Import Geant4 0.0.0 source tree
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
# $Id: GNUmakefile,v 1.1 1998/10/14 15:18:56 allison Exp $
|
||||
# --------------------------------------------------------------
|
||||
# GNUmakefile for tests module. Gabriele Cosmo, 27/06/98.
|
||||
# --------------------------------------------------------------
|
||||
|
||||
name := exampleE01
|
||||
G4TARGET := $(name)
|
||||
G4EXLIB := true
|
||||
|
||||
ifndef G4INSTALL
|
||||
G4INSTALL = ../../..
|
||||
endif
|
||||
|
||||
.PHONY: all
|
||||
all: lib bin
|
||||
|
||||
include $(G4INSTALL)/config/architecture.gmk
|
||||
|
||||
# Override some variables for binmake.gmk.
|
||||
#
|
||||
# INCFLAGS :=
|
||||
# LDLIBS :=
|
||||
|
||||
CPPFLAGS += \
|
||||
-I$(OBJY_DIR)/include \
|
||||
-I$(HEP_ODBMS_DIR)/include \
|
||||
-I$(HISTOODIR)/code
|
||||
LDFLAGS += \
|
||||
-L$(OBJY_DIR)/lib \
|
||||
-L$(HEP_ODBMS_DIR)/lib \
|
||||
-L$(HISTOODIR)/lib
|
||||
LOADLIBS += -lHistoxx -lHepODBMS -loo -lm
|
||||
|
||||
include $(G4INSTALL)/config/binmake.gmk
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
$Id: History,v 1.1 1998/10/14 15:18:57 allison Exp $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
|
||||
=========================================================
|
||||
|
||||
Novice Example 07 History file
|
||||
------------------------------
|
||||
This file should be used by the test developer to briefly
|
||||
summarize all major modifications introduced in the code and keep
|
||||
track of all tags.
|
||||
|
||||
----------------------------------------------------------
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
14th October 1998 John Allison
|
||||
- Moved from N07.
|
||||
|
||||
25th August 1998 Evgueni.Tcherniaev@cern.ch
|
||||
- CPPFLAGS += ... -I$(HISTOODIR)/code
|
||||
LDFLAGS += ... -L$(HISTOODIR)/lib
|
||||
|
||||
- Changed p.Print(); to p.print();
|
||||
|
||||
21st August 1998 John Allison
|
||||
- Changed file names from N07* to ExN07*.
|
||||
|
||||
August 7th,1998 John Allison
|
||||
- Moved from test03 to exampleN07.
|
||||
|
||||
July 10, 1998, Evgueni.Tcherniaev@cern.ch
|
||||
- in test03.cc added:
|
||||
runManager->initialize();
|
||||
|
||||
- GNUmakefile now points to $(HISTOODIR)/../dev/code
|
||||
should be changed to $(HISTOODIR) for official release
|
||||
|
||||
June 27, 98 G. Cosmo
|
||||
- Created.
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
$Id: README,v 1.1 1998/10/14 15:18:57 allison Exp $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
|
||||
=========================================================
|
||||
|
||||
ExampleN07
|
||||
---------
|
||||
|
||||
This directory contains a GEANT4 example on how to create, fill,
|
||||
print and save histograms in a OODBMS.
|
||||
|
||||
The main program "exampleN07.cc" is a standard G4 main (no initialization
|
||||
of OODBMS or histos).
|
||||
|
||||
The run actions are overloaded:
|
||||
|
||||
- in BeginOfRunAction the federated data base and the data bases sessions
|
||||
are initialized and a transaction is opened;
|
||||
1d and 2d histograms are constructed;
|
||||
The name of the base name is "ExN07DB".
|
||||
|
||||
- in EndOfRunAction contents of the histograms are printed and
|
||||
the transaction is closed;
|
||||
|
||||
The stepping action is overloaded:
|
||||
|
||||
- in SteppingAction two histograms are accessed and filled.
|
||||
|
||||
The followings are the instruction to execute it for the case of HP-AFS.
|
||||
|
||||
0) Setting up the environment
|
||||
|
||||
http://wwwinfo.cern.ch/asdoc/lhcpp/SetUpUserEnvironment.html
|
||||
|
||||
1) Compilation/linking
|
||||
|
||||
% gmake
|
||||
|
||||
2) Execution
|
||||
|
||||
% ../../../bin/HP-AFS/exampleN07 > exampleN07.newout
|
||||
% diff exampleN07.out exampleN07.newout
|
||||
|
||||
Evgueni.Tcherniaev@cern.ch, 25.08.98
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
// $Id: exampleE01.cc,v 1.2 1998/12/08 16:37:23 allison Exp $
|
||||
|
||||
#include "ExE01DetectorConstruction.hh"
|
||||
#include "ExE01RunAction.hh"
|
||||
#include "ExE01PrimaryGeneratorAction.hh"
|
||||
#include "ExE01PhysicsList.hh"
|
||||
#include "ExE01SteppingAction.hh"
|
||||
|
||||
#include "G4RunManager.hh"
|
||||
|
||||
int main(int ,char** ) {
|
||||
// Run manager
|
||||
G4RunManager * runManager = new G4RunManager;
|
||||
|
||||
// UserInitialization classes
|
||||
runManager->SetUserInitialization(new ExE01DetectorConstruction);
|
||||
runManager->SetUserInitialization(new ExE01PhysicsList);
|
||||
|
||||
// UserAction classes.
|
||||
runManager->SetUserAction(new ExE01RunAction);
|
||||
runManager->SetUserAction(new ExE01PrimaryGeneratorAction);
|
||||
runManager->SetUserAction(new ExE01SteppingAction);
|
||||
|
||||
// Event loop
|
||||
G4int n_event = 1000;
|
||||
runManager->Initialize();
|
||||
runManager->BeamOn(n_event);
|
||||
|
||||
delete runManager;
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,175 @@
|
||||
ExE01PhysicsList::setCuts:CutLength : 1 (mm)
|
||||
TYPE : Histo1D
|
||||
TITLE : HepJamesRandom1
|
||||
BIN NUMBER : 100
|
||||
BIN WIDTH : 0.01
|
||||
|
||||
0.00e+00 3.88e+00 Y
|
||||
X POSITION BIN VALUE|--------------------------------------------------->
|
||||
0.000e+00 0 6.000e-02|
|
||||
1.000e-02 1 4.000e-02|
|
||||
2.000e-02 2 1.800e-01|XX
|
||||
3.000e-02 3 9.000e-02|X
|
||||
4.000e-02 4 1.500e-01|X
|
||||
5.000e-02 5 2.600e-01|XXX
|
||||
6.000e-02 6 2.500e-01|XXX
|
||||
7.000e-02 7 3.600e-01|XXXX
|
||||
8.000e-02 8 3.000e-01|XXX
|
||||
9.000e-02 9 4.900e-01|XXXXXX
|
||||
1.000e-01 10 6.000e-01|XXXXXXX
|
||||
1.100e-01 11 5.600e-01|XXXXXXX
|
||||
1.200e-01 12 6.400e-01|XXXXXXXX
|
||||
1.300e-01 13 1.110e+00|XXXXXXXXXXXXXX
|
||||
1.400e-01 14 1.140e+00|XXXXXXXXXXXXXX
|
||||
1.500e-01 15 1.500e+00|XXXXXXXXXXXXXXXXXXX
|
||||
1.600e-01 16 1.520e+00|XXXXXXXXXXXXXXXXXXX
|
||||
1.700e-01 17 1.750e+00|XXXXXXXXXXXXXXXXXXXXXXX
|
||||
1.800e-01 18 1.700e+00|XXXXXXXXXXXXXXXXXXXXXX
|
||||
1.900e-01 19 1.860e+00|XXXXXXXXXXXXXXXXXXXXXXXX
|
||||
2.000e-01 20 2.360e+00|XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
||||
2.100e-01 21 2.530e+00|XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
||||
2.200e-01 22 2.580e+00|XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
||||
2.300e-01 23 2.670e+00|XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
||||
2.400e-01 24 2.900e+00|XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
||||
2.500e-01 25 3.100e+00|XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
||||
2.600e-01 26 3.250e+00|XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
||||
2.700e-01 27 3.230e+00|XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
||||
2.800e-01 28 3.530e+00|XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
||||
2.900e-01 29 3.540e+00|XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
||||
3.000e-01 30 3.470e+00|XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
||||
3.100e-01 31 3.880e+00|XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
||||
3.200e-01 32 3.340e+00|XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
||||
3.300e-01 33 3.430e+00|XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
||||
3.400e-01 34 3.070e+00|XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
||||
3.500e-01 35 3.490e+00|XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
||||
3.600e-01 36 2.950e+00|XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
||||
3.700e-01 37 2.560e+00|XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
||||
3.800e-01 38 2.740e+00|XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
||||
3.900e-01 39 2.250e+00|XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
||||
4.000e-01 40 2.110e+00|XXXXXXXXXXXXXXXXXXXXXXXXXXX
|
||||
4.100e-01 41 1.900e+00|XXXXXXXXXXXXXXXXXXXXXXXX
|
||||
4.200e-01 42 1.740e+00|XXXXXXXXXXXXXXXXXXXXXX
|
||||
4.300e-01 43 1.420e+00|XXXXXXXXXXXXXXXXXX
|
||||
4.400e-01 44 1.160e+00|XXXXXXXXXXXXXXX
|
||||
4.500e-01 45 1.040e+00|XXXXXXXXXXXXX
|
||||
4.600e-01 46 9.200e-01|XXXXXXXXXXXX
|
||||
4.700e-01 47 7.900e-01|XXXXXXXXXX
|
||||
4.800e-01 48 7.500e-01|XXXXXXXXX
|
||||
4.900e-01 49 6.200e-01|XXXXXXXX
|
||||
5.000e-01 50 5.400e-01|XXXXXXX
|
||||
5.100e-01 51 3.800e-01|XXXX
|
||||
5.200e-01 52 2.900e-01|XXX
|
||||
5.300e-01 53 2.000e-01|XX
|
||||
5.400e-01 54 2.000e-01|XX
|
||||
5.500e-01 55 1.200e-01|X
|
||||
5.600e-01 56 6.000e-02|
|
||||
5.700e-01 57 5.000e-02|
|
||||
5.800e-01 58 4.000e-02|
|
||||
5.900e-01 59 8.000e-02|X
|
||||
6.000e-01 60 2.000e-02|
|
||||
6.100e-01 61 0.000e+00|
|
||||
6.200e-01 62 1.000e-02|
|
||||
6.300e-01 63 1.000e-02|
|
||||
6.400e-01 64 0.000e+00|
|
||||
6.500e-01 65 0.000e+00|
|
||||
6.600e-01 66 0.000e+00|
|
||||
6.700e-01 67 0.000e+00|
|
||||
6.800e-01 68 0.000e+00|
|
||||
6.900e-01 69 0.000e+00|
|
||||
7.000e-01 70 0.000e+00|
|
||||
7.100e-01 71 0.000e+00|
|
||||
7.200e-01 72 0.000e+00|
|
||||
7.300e-01 73 0.000e+00|
|
||||
7.400e-01 74 0.000e+00|
|
||||
7.500e-01 75 0.000e+00|
|
||||
7.600e-01 76 0.000e+00|
|
||||
7.700e-01 77 0.000e+00|
|
||||
7.800e-01 78 0.000e+00|
|
||||
7.900e-01 79 0.000e+00|
|
||||
8.000e-01 80 0.000e+00|
|
||||
8.100e-01 81 0.000e+00|
|
||||
8.200e-01 82 0.000e+00|
|
||||
8.300e-01 83 0.000e+00|
|
||||
8.400e-01 84 0.000e+00|
|
||||
8.500e-01 85 0.000e+00|
|
||||
8.600e-01 86 0.000e+00|
|
||||
8.700e-01 87 0.000e+00|
|
||||
8.800e-01 88 0.000e+00|
|
||||
8.900e-01 89 0.000e+00|
|
||||
9.000e-01 90 0.000e+00|
|
||||
9.100e-01 91 0.000e+00|
|
||||
9.200e-01 92 0.000e+00|
|
||||
9.300e-01 93 0.000e+00|
|
||||
9.400e-01 94 0.000e+00|
|
||||
9.500e-01 95 0.000e+00|
|
||||
9.600e-01 96 0.000e+00|
|
||||
9.700e-01 97 0.000e+00|
|
||||
9.800e-01 98 0.000e+00|
|
||||
9.900e-01 99 0.000e+00|
|
||||
X |
|
||||
V
|
||||
ENTRIES : 9000 TOTAL C. : 8.988e+01 NEQUIVAL : 8.988e+03
|
||||
MEAN F.T.: 3.003e-01 MEAN B.C.: 3.003e-01 UNDERFLOW: 1.200e-01
|
||||
RMS F.T. : 1.003e-01 RMS B.C. : 1.003e-01 OVERFLOW : 0.000e+00
|
||||
TYPE : Histo2D
|
||||
TITLE : HepJamesVsDRand48
|
||||
X: BINS : 40 WIDTH : 2.500e-02 MIN : 0.000e+00 MAX : 1.000e+00
|
||||
Y: BINS : 40 WIDTH : 2.500e-02 MIN : 0.000e+00 MAX : 1.000e+00
|
||||
|
||||
|
||||
0 1 2 3
|
||||
0123456789012345678901234567890123456789
|
||||
******************************************
|
||||
* *
|
||||
0 * ........................................ *
|
||||
1 * ........................................ *
|
||||
2 * ........................................ *
|
||||
3 * ........................................ *
|
||||
4 * ........................................ *
|
||||
5 * ........................................ *
|
||||
6 * ........................................ *
|
||||
7 * ........................................ *
|
||||
8 * ........................................ *
|
||||
9 * ........................................ *
|
||||
10 * ........................................ *
|
||||
11 * ........................................ *
|
||||
12 * ........................................ *
|
||||
13 * ........................................ *
|
||||
14 * ........................................ *
|
||||
15 * ........................................ *
|
||||
16 * ........................................ *
|
||||
17 * ........................................ *
|
||||
18 * ............++.......................... *
|
||||
19 * ..........++++.++....................... *
|
||||
20 * .......+22++22++++...................... *
|
||||
21 * ...++.2+2+233323+2...................... *
|
||||
22 * .....+224334444222..+................... *
|
||||
23 * ..+.+223447786642322.................... *
|
||||
24 * .....+3466997984633..................... *
|
||||
25 * ..++22457A9ACAA85332+................... *
|
||||
26 * ..+++45779DBFA778523+................... *
|
||||
27 * ....+37688DCBCA96422+................... *
|
||||
28 * ...+2467AAADE9DA6443++.................. *
|
||||
29 * ...+2454999ACB985332+................... *
|
||||
30 * ...++2445AAB9B9863+2+................... *
|
||||
31 * ...++2245568878553+++................... *
|
||||
32 * .....2235556765332+2.................... *
|
||||
33 * .....++23345343422+..................... *
|
||||
34 * .....++.+23322232++..................... *
|
||||
35 * .......+.2+2+2+++....................... *
|
||||
36 * .........++++.+..+...................... *
|
||||
37 * ...........++++......................... *
|
||||
38 * ........................................ *
|
||||
39 * ........................................ *
|
||||
* *
|
||||
******************************************
|
||||
|
||||
ENTRIES : 9000 Z MIN : 0
|
||||
TOTAL C. : 89.8 Z STEP : 0.068
|
||||
NEQUIVAL : 8.98e+03 Z SCALE : .+23456789ABCDE
|
||||
|
||||
0 | 0.05 | 0
|
||||
-----------|------------|-----------
|
||||
0.12 | 89.7 | 0
|
||||
-----------|------------|-----------
|
||||
0 | 0 | 0
|
||||
@@ -0,0 +1,34 @@
|
||||
|
||||
#ifndef ExE01DetectorConstruction_h
|
||||
#define ExE01DetectorConstruction_h 1
|
||||
|
||||
#include "G4VUserDetectorConstruction.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class ExE01DetectorConstruction : public G4VUserDetectorConstruction
|
||||
{
|
||||
public:
|
||||
ExE01DetectorConstruction();
|
||||
~ExE01DetectorConstruction();
|
||||
|
||||
public:
|
||||
G4VPhysicalVolume* Construct();
|
||||
|
||||
private:
|
||||
G4double expHall_x;
|
||||
G4double expHall_y;
|
||||
G4double expHall_z;
|
||||
|
||||
G4double calBox_x;
|
||||
G4double calBox_y;
|
||||
G4double calBox_z;
|
||||
G4double rotAngle;
|
||||
G4double calPos;
|
||||
|
||||
G4double trackerRadius;
|
||||
G4double trackerHight;
|
||||
G4double trackerPos;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
// $Id: ExE01PhysicsList.hh,v 1.1 1998/10/14 15:19:38 allison Exp $
|
||||
// ------------------------------------------------------------
|
||||
#ifndef ExE01PhysicsList_h
|
||||
#define ExE01PhysicsList_h 1
|
||||
|
||||
#include "G4VUserPhysicsList.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class ExE01PhysicsList: public G4VUserPhysicsList
|
||||
{
|
||||
public:
|
||||
ExE01PhysicsList();
|
||||
virtual ~ExE01PhysicsList();
|
||||
|
||||
protected:
|
||||
// Construct particle and physics
|
||||
virtual void ConstructParticle();
|
||||
virtual void ConstructProcess();
|
||||
|
||||
//
|
||||
virtual void SetCuts(G4double cut);
|
||||
|
||||
protected:
|
||||
// these methods Construct particles
|
||||
virtual void ConstructBosons();
|
||||
virtual void ConstructLeptons();
|
||||
|
||||
protected:
|
||||
// these methods Construct physics processes and register them
|
||||
virtual void ConstructEM();
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
|
||||
#ifndef ExE01PrimaryGeneratorAction_h
|
||||
#define ExE01PrimaryGeneratorAction_h 1
|
||||
|
||||
#include "G4VUserPrimaryGeneratorAction.hh"
|
||||
|
||||
class G4ParticleGun;
|
||||
class G4Event;
|
||||
|
||||
class ExE01PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
|
||||
{
|
||||
public:
|
||||
ExE01PrimaryGeneratorAction();
|
||||
~ExE01PrimaryGeneratorAction();
|
||||
|
||||
public:
|
||||
void GeneratePrimaries(G4Event* anEvent);
|
||||
|
||||
private:
|
||||
G4ParticleGun* particleGun;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
// $Id: ExE01RunAction.hh,v 1.1 1998/10/14 15:19:39 allison Exp $
|
||||
|
||||
#ifndef ExE01RunAction_h
|
||||
#define ExE01RunAction_h 1
|
||||
|
||||
#include "G4UserRunAction.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
#include "HepODBMS/clustering/HepDbApplication.h"
|
||||
#include "histograms.h"
|
||||
class G4Run;
|
||||
|
||||
class ExE01RunAction : public G4UserRunAction
|
||||
{
|
||||
public:
|
||||
ExE01RunAction() { runIDcounter = 0; }
|
||||
~ExE01RunAction() {}
|
||||
|
||||
void BeginOfRunAction(G4Run* aRun);
|
||||
void EndOfRunAction(G4Run* aRun);
|
||||
|
||||
static HepRef(Histo1D) get_1d() { return myHisto1D; }
|
||||
static HepRef(Histo2D) Get2d() { return myHisto2D; }
|
||||
|
||||
private:
|
||||
G4int runIDcounter;
|
||||
|
||||
static HepRef(Histo1D) myHisto1D;
|
||||
static HepRef(Histo2D) myHisto2D;
|
||||
|
||||
HepDbApplication dbApp;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
// $Id: ExE01SteppingAction.hh,v 1.1 1998/10/14 15:19:40 allison Exp $
|
||||
|
||||
#ifndef ExE01SteppingAction_h
|
||||
#define ExE01SteppingAction_h 1
|
||||
|
||||
#include "G4UserSteppingAction.hh"
|
||||
#include "globals.hh"
|
||||
#include "Randomize.hh"
|
||||
|
||||
#include "histograms.h"
|
||||
|
||||
class ExE01SteppingAction : public G4UserSteppingAction {
|
||||
private:
|
||||
HepJamesRandom theJamesEngine;
|
||||
DRand48Engine theDRand48Engine;
|
||||
|
||||
public:
|
||||
ExE01SteppingAction(){};
|
||||
~ExE01SteppingAction(){};
|
||||
|
||||
void UserSteppingAction();
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,102 @@
|
||||
|
||||
#include "ExE01DetectorConstruction.hh"
|
||||
|
||||
#include "G4Material.hh"
|
||||
#include "G4MaterialTable.hh"
|
||||
#include "G4Element.hh"
|
||||
#include "G4ElementTable.hh"
|
||||
#include "G4Box.hh"
|
||||
#include "G4Tubs.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4RotationMatrix.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
#include "G4Transform3D.hh"
|
||||
#include "G4PVPlacement.hh"
|
||||
|
||||
ExE01DetectorConstruction::ExE01DetectorConstruction()
|
||||
{
|
||||
expHall_x = 600.*cm;
|
||||
expHall_y = 600.*cm;
|
||||
expHall_z = 600.*cm;
|
||||
|
||||
calBox_x = 50.*cm;
|
||||
calBox_y = 50.*cm;
|
||||
calBox_z = 50.*cm;
|
||||
rotAngle = 30.*deg;
|
||||
calPos = 200.*cm;
|
||||
|
||||
trackerRadius = 50.*cm;
|
||||
trackerHight = 100.*cm;
|
||||
trackerPos = -200.*cm;
|
||||
}
|
||||
|
||||
ExE01DetectorConstruction::~ExE01DetectorConstruction()
|
||||
{;}
|
||||
|
||||
G4VPhysicalVolume* ExE01DetectorConstruction::Construct()
|
||||
{
|
||||
|
||||
//------------------------------------------------------ materials
|
||||
|
||||
G4double a, iz, z, density;
|
||||
G4String name, symbol;
|
||||
G4int nel;
|
||||
|
||||
a = 14.01*g/mole;
|
||||
G4Element* elN = new G4Element(name="Nitrogen", symbol="N", iz=7., a);
|
||||
a = 16.00*g/mole;
|
||||
G4Element* elO = new G4Element(name="Oxygen", symbol="O", iz=8., a);
|
||||
|
||||
density = 1.29e-03*g/cm3;
|
||||
G4Material* Air = new G4Material(name="Air", density, nel=2);
|
||||
Air->AddElement(elN, .7);
|
||||
Air->AddElement(elO, .3);
|
||||
|
||||
a = 207.19*g/mole;
|
||||
density = 11.35*g/cm3;
|
||||
G4Material* Lead = new G4Material(name="Lead", z=82., a, density);
|
||||
|
||||
a = 39.95*g/mole;
|
||||
density = 1.782e-03*g/cm3;
|
||||
G4Material* Ar = new G4Material(name="ArgonGas", z=18., a, density);
|
||||
|
||||
//------------------------------------------------------ volumes
|
||||
|
||||
//------------------------------ experimental hall
|
||||
G4Box * experimantalHall_box
|
||||
= new G4Box("expHall_b",expHall_x,expHall_y,expHall_z);
|
||||
G4LogicalVolume * experimantalHall_log
|
||||
= new G4LogicalVolume(experimantalHall_box,Air,"expHall_L",0,0,0);
|
||||
G4VPhysicalVolume * experimantalHall_phys
|
||||
= new G4PVPlacement(0,G4ThreeVector(),"expHall_P",
|
||||
experimantalHall_log,0,false,0);
|
||||
|
||||
//------------------------------ calorimeter boxes
|
||||
G4Box * calorimeter_box
|
||||
= new G4Box("calorimeter_b",calBox_x,calBox_y,calBox_z);
|
||||
G4LogicalVolume * calorimeter_log
|
||||
= new G4LogicalVolume(calorimeter_box,Lead,"calo_L",0,0,0);
|
||||
for(G4int i=0;i<3;i++)
|
||||
{
|
||||
G4RotationMatrix rm;
|
||||
rm.rotateZ(i*rotAngle);
|
||||
new G4PVPlacement(G4Transform3D(rm,G4ThreeVector(0.*cm,i*calPos,0.*cm)),
|
||||
"calo_phys",calorimeter_log,experimantalHall_phys,
|
||||
false,i);
|
||||
}
|
||||
|
||||
//------------------------------ tracker tube
|
||||
G4Tubs * tracker_tube
|
||||
= new G4Tubs("tracker_tube",0.*cm,trackerRadius,trackerHight,
|
||||
0.*deg,360.*deg);
|
||||
G4LogicalVolume * tracker_log
|
||||
= new G4LogicalVolume(tracker_tube,Ar,"tracker_L",0,0,0);
|
||||
new G4PVPlacement(0,G4ThreeVector(0.*cm,trackerPos,0.*cm),
|
||||
"tracker_phys",tracker_log,experimantalHall_phys,
|
||||
false,0);
|
||||
|
||||
//------------------------------------------------------------------
|
||||
|
||||
return experimantalHall_phys;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,129 @@
|
||||
// $Id: ExE01PhysicsList.cc,v 1.1 1998/10/14 15:20:10 allison Exp $
|
||||
|
||||
#include "globals.hh"
|
||||
#include "ExE01PhysicsList.hh"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "G4ParticleWithCuts.hh"
|
||||
#include "G4ProcessManager.hh"
|
||||
#include "G4ProcessVector.hh"
|
||||
#include "G4ParticleTypes.hh"
|
||||
#include "G4ParticleTable.hh"
|
||||
#include "G4Material.hh"
|
||||
#include "G4MaterialTable.hh"
|
||||
#include "G4ios.hh"
|
||||
#include <iomanip.h>
|
||||
|
||||
|
||||
ExE01PhysicsList::ExE01PhysicsList(): G4VUserPhysicsList()
|
||||
{
|
||||
SetVerboseLevel(1);
|
||||
}
|
||||
|
||||
ExE01PhysicsList::~ExE01PhysicsList()
|
||||
{
|
||||
}
|
||||
|
||||
void ExE01PhysicsList::ConstructParticle()
|
||||
{
|
||||
// In this method, static member functions should be called
|
||||
// for all particles which you want to use.
|
||||
// This ensures that objects of these particle types will be
|
||||
// created in the program.
|
||||
|
||||
ConstructBosons();
|
||||
ConstructLeptons();
|
||||
|
||||
}
|
||||
|
||||
void ExE01PhysicsList::ConstructBosons()
|
||||
{
|
||||
// pseudo-particles
|
||||
G4Geantino::GeantinoDefinition();
|
||||
G4ChargedGeantino::ChargedGeantinoDefinition();
|
||||
|
||||
// gamma
|
||||
G4Gamma::GammaDefinition();
|
||||
|
||||
// optical photon
|
||||
G4OpticalPhoton::OpticalPhotonDefinition();
|
||||
}
|
||||
|
||||
void ExE01PhysicsList::ConstructLeptons()
|
||||
{
|
||||
// leptons
|
||||
G4Electron::ElectronDefinition();
|
||||
G4Positron::PositronDefinition();
|
||||
G4NeutrinoE::NeutrinoEDefinition();
|
||||
G4AntiNeutrinoE::AntiNeutrinoEDefinition();
|
||||
}
|
||||
|
||||
void ExE01PhysicsList::ConstructProcess()
|
||||
{
|
||||
AddTransportation();
|
||||
ConstructEM();
|
||||
}
|
||||
|
||||
#include "G4ComptonScattering.hh"
|
||||
#include "G4GammaConversion.hh"
|
||||
#include "G4PhotoElectricEffect.hh"
|
||||
|
||||
#include "G4MultipleScattering.hh"
|
||||
|
||||
#include "G4eIonisation.hh"
|
||||
#include "G4eBremsstrahlung.hh"
|
||||
#include "G4eplusAnnihilation.hh"
|
||||
|
||||
void ExE01PhysicsList::ConstructEM()
|
||||
{
|
||||
theParticleIterator->reset();
|
||||
while( (*theParticleIterator)() ){
|
||||
G4ParticleDefinition* particle = theParticleIterator->value();
|
||||
G4ProcessManager* pmanager = particle->GetProcessManager();
|
||||
G4String particleName = particle->GetParticleName();
|
||||
|
||||
if (particleName == "gamma") {
|
||||
// gamma
|
||||
// Construct processes for gamma
|
||||
pmanager->AddDiscreteProcess(new G4GammaConversion());
|
||||
pmanager->AddDiscreteProcess(new G4ComptonScattering());
|
||||
pmanager->AddDiscreteProcess(new G4PhotoElectricEffect());
|
||||
|
||||
} else if (particleName == "e-") {
|
||||
//electron
|
||||
// Construct processes for electron
|
||||
pmanager->AddProcess(new G4MultipleScattering(),-1,1,1);
|
||||
pmanager->AddProcess(new G4eIonisation(),-1,2,2);
|
||||
pmanager->AddProcess(new G4eBremsstrahlung(),-1,-1,3);
|
||||
|
||||
} else if (particleName == "e+") {
|
||||
//positron
|
||||
// Construct processes for positron
|
||||
pmanager->AddProcess(new G4MultipleScattering(),-1,1,1);
|
||||
|
||||
pmanager->AddProcess(new G4eIonisation(),-1,2,2);
|
||||
pmanager->AddProcess(new G4eBremsstrahlung(),-1,-1,3);
|
||||
pmanager->AddProcess(new G4eplusAnnihilation(),0,-1,4);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ExE01PhysicsList::SetCuts(G4double cut)
|
||||
{
|
||||
if (verboseLevel >0){
|
||||
G4cout << "ExE01PhysicsList::SetCuts:";
|
||||
G4cout << "CutLength : " << cut/mm << " (mm)" << endl;
|
||||
}
|
||||
|
||||
// set cut values for gamma at first and for e- second and next for e+,
|
||||
// because some processes for e+/e- need cut values for gamma
|
||||
SetCutValue(cut, "gamma");
|
||||
SetCutValue(cut, "e-");
|
||||
SetCutValue(cut, "e+");
|
||||
|
||||
SetCutValueForOthers(cut);
|
||||
|
||||
if (verboseLevel>1) {
|
||||
DumpCutValuesTable();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
|
||||
#include "ExE01PrimaryGeneratorAction.hh"
|
||||
|
||||
#include "G4Event.hh"
|
||||
#include "G4ParticleGun.hh"
|
||||
#include "G4ParticleTable.hh"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
ExE01PrimaryGeneratorAction::ExE01PrimaryGeneratorAction()
|
||||
{
|
||||
G4int n_particle = 1;
|
||||
particleGun = new G4ParticleGun(n_particle);
|
||||
}
|
||||
|
||||
ExE01PrimaryGeneratorAction::~ExE01PrimaryGeneratorAction()
|
||||
{
|
||||
delete particleGun;
|
||||
}
|
||||
|
||||
void ExE01PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
|
||||
{
|
||||
G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable();
|
||||
G4String particleName;
|
||||
G4ParticleDefinition* particle
|
||||
= particleTable->FindParticle(particleName="geantino");
|
||||
particleGun->SetParticleDefinition(particle);
|
||||
|
||||
particleGun->SetParticleMomentumDirection(G4ThreeVector(0.,1.,0.));
|
||||
particleGun->SetParticleEnergy(100.*GeV);
|
||||
particleGun->SetParticlePosition(G4ThreeVector(0.*cm,-300.*cm,0.*cm));
|
||||
|
||||
particleGun->GeneratePrimaryVertex(anEvent);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
// $Id: ExE01RunAction.cc,v 1.1 1998/10/14 15:20:12 allison Exp $
|
||||
|
||||
#include "ExE01RunAction.hh"
|
||||
#include "G4Run.hh"
|
||||
#include "G4UImanager.hh"
|
||||
#include "G4ios.hh"
|
||||
|
||||
HepRef(Histo1D) ExE01RunAction::myHisto1D;
|
||||
HepRef(Histo2D) ExE01RunAction::myHisto2D;
|
||||
|
||||
void ExE01RunAction::BeginOfRunAction(G4Run* aRun)
|
||||
{
|
||||
aRun->SetRunID(runIDcounter++);
|
||||
|
||||
G4UImanager* UI = G4UImanager::GetUIpointer();
|
||||
UI->ApplyCommand("/event/Verbose 0");
|
||||
UI->ApplyCommand("/tracking/Verbose 0");
|
||||
|
||||
dbApp.Init();
|
||||
dbApp.startUpdate();
|
||||
|
||||
HepDatabaseRef dbH = dbApp.db("ExE01DB");
|
||||
|
||||
// Number of histogram bins
|
||||
int nBins1d = 100;
|
||||
int nBins2d = 40;
|
||||
|
||||
// Limits for values
|
||||
double low = 0, high = 1;
|
||||
double xlow = 0, xhigh = 1, ylow = 0, yhigh = 1;
|
||||
|
||||
myHisto1D = new(dbH)
|
||||
Histo1D("HepJamesRandom1", nBins1d, low, high);
|
||||
|
||||
myHisto2D = new(dbH)
|
||||
Histo2D("HepJamesVsDRand48", nBins2d, xlow, xhigh, nBins2d, ylow, yhigh);
|
||||
}
|
||||
|
||||
void ExE01RunAction::EndOfRunAction(G4Run* aRun)
|
||||
{
|
||||
// Print histograms
|
||||
HistPrintout p(G4cout);
|
||||
|
||||
p.print(*myHisto1D);
|
||||
p.print(*myHisto2D);
|
||||
|
||||
// commit changes to Objectivty database
|
||||
dbApp.commit();
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
// $Id: ExE01SteppingAction.cc,v 1.1 1998/10/14 15:20:14 allison Exp $
|
||||
|
||||
#include "ExE01SteppingAction.hh"
|
||||
#include "ExE01RunAction.hh"
|
||||
|
||||
void ExE01SteppingAction::UserSteppingAction(){
|
||||
|
||||
HepRef(Histo1D) h1 = ExE01RunAction::get_1d();
|
||||
HepRef(Histo2D) h2 = ExE01RunAction::Get2d();
|
||||
|
||||
HepRandom::setTheEngine(&theJamesEngine);
|
||||
|
||||
double james = RandGauss::shoot(0.3,0.1);
|
||||
h1->fill(james,0.01);
|
||||
|
||||
HepRandom::setTheEngine(&theDRand48Engine);
|
||||
|
||||
double d48 = RandGauss::shoot(0.7,0.1);
|
||||
h2->fill(james,d48,0.01);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user