Geant4  10.03.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ExP02DetectorConstruction Class Reference

Detector construction. More...

#include <ExP02DetectorConstruction.hh>

Inheritance diagram for ExP02DetectorConstruction:
Collaboration diagram for ExP02DetectorConstruction:

Public Member Functions

 ExP02DetectorConstruction ()
 
 ~ExP02DetectorConstruction ()
 
virtual G4VPhysicalVolumeConstruct ()
 
- Public Member Functions inherited from G4VUserDetectorConstruction
 G4VUserDetectorConstruction ()
 
virtual ~G4VUserDetectorConstruction ()
 
virtual void ConstructSDandField ()
 
virtual void CloneSD ()
 
virtual void CloneF ()
 
void RegisterParallelWorld (G4VUserParallelWorld *)
 
G4int ConstructParallelGeometries ()
 
void ConstructParallelSD ()
 
G4int GetNumberOfParallelWorld () const
 
G4VUserParallelWorldGetParallelWorld (G4int i) const
 

Additional Inherited Members

- Protected Member Functions inherited from G4VUserDetectorConstruction
void SetSensitiveDetector (const G4String &logVolName, G4VSensitiveDetector *aSD, G4bool multi=false)
 
void SetSensitiveDetector (G4LogicalVolume *logVol, G4VSensitiveDetector *aSD)
 

Detailed Description

Detector construction.

Definition at line 42 of file ExP02DetectorConstruction.hh.

Constructor & Destructor Documentation

ExP02DetectorConstruction::ExP02DetectorConstruction ( )

Definition at line 52 of file ExP02DetectorConstruction.cc.

54  fExperimentalHall_log(0), fTracker_log(0),
55  fCalorimeterBlock_log(0), fCalorimeterLayer_log(0),
56  fExperimentalHall_phys(0), fCalorimeterLayer_phys(0),
57  fCalorimeterBlock_phys(0), fTracker_phys(0)
58 {;}
ExP02DetectorConstruction::~ExP02DetectorConstruction ( )

Definition at line 62 of file ExP02DetectorConstruction.cc.

63 {
64 }

Member Function Documentation

G4VPhysicalVolume * ExP02DetectorConstruction::Construct ( void  )
virtual

Implements G4VUserDetectorConstruction.

Definition at line 68 of file ExP02DetectorConstruction.cc.

69 {
70 
71  //------------------------------------------------------ materials
72 
73  G4double a; // atomic mass
74  G4double z; // atomic number
75  G4double density;
76 
77  G4Material* Ar =
78  new G4Material("ArgonGas", z= 18., a= 39.95*g/mole, density= 1.782*mg/cm3);
79 
80  G4Material* Al =
81  new G4Material("Aluminum", z= 13., a= 26.98*g/mole, density= 2.7*g/cm3);
82 
83  G4Material* Pb =
84  new G4Material("Lead", z= 82., a= 207.19*g/mole, density= 11.35*g/cm3);
85 
86  //------------------------------------------------------ volumes
87 
88  //------------------------------ experimental hall (world volume)
89  //------------------------------ beam line along x axis
90 
91  G4double expHall_x = 3.0*m;
92  G4double expHall_y = 1.0*m;
93  G4double expHall_z = 1.0*m;
94  G4Box* experimentalHall_box
95  = new G4Box("expHall_box",expHall_x,expHall_y,expHall_z);
96  fExperimentalHall_log = new G4LogicalVolume(experimentalHall_box,
97  Ar,"expHall_log",0,0,0);
98  fExperimentalHall_phys = new G4PVPlacement(0,G4ThreeVector(),
99  fExperimentalHall_log,"expHall",0,false,0);
100 
101  //------------------------------ a tracker tube
102 
103  G4double innerRadiusOfTheTube = 0.*cm;
104  G4double outerRadiusOfTheTube = 60.*cm;
105  G4double hightOfTheTube = 50.*cm;
106  G4double startAngleOfTheTube = 0.*deg;
107  G4double spanningAngleOfTheTube = 360.*deg;
108  G4Tubs* tracker_tube = new G4Tubs("tracker_tube",innerRadiusOfTheTube,
109  outerRadiusOfTheTube,hightOfTheTube,
110  startAngleOfTheTube,spanningAngleOfTheTube);
111  fTracker_log = new G4LogicalVolume(tracker_tube,Al,"tracker_log",0,0,0);
112  G4double trackerPos_x = -1.0*m;
113  G4double trackerPos_y = 0.*m;
114  G4double trackerPos_z = 0.*m;
115  fTracker_phys = new G4PVPlacement(0,
116  G4ThreeVector(trackerPos_x,trackerPos_y,trackerPos_z),
117  fTracker_log,"tracker",fExperimentalHall_log,false,0);
118 
119  //------------------------------ a calorimeter block
120 
121  G4double block_x = 1.0*m;
122  G4double block_y = 50.0*cm;
123  G4double block_z = 50.0*cm;
124  G4Box* calorimeterBlock_box = new G4Box("calBlock_box",block_x,
125  block_y,block_z);
126  fCalorimeterBlock_log = new G4LogicalVolume(calorimeterBlock_box,
127  Pb,"caloBlock_log",0,0,0);
128  G4double blockPos_x = 1.0*m;
129  G4double blockPos_y = 0.0*m;
130  G4double blockPos_z = 0.0*m;
131  fCalorimeterBlock_phys = new G4PVPlacement(0,
132  G4ThreeVector(blockPos_x,blockPos_y,blockPos_z),
133  fCalorimeterBlock_log,"caloBlock",fExperimentalHall_log,false,0);
134 
135  //------------------------------ calorimeter layers
136 
137  G4double calo_x = 1.*cm;
138  G4double calo_y = 40.*cm;
139  G4double calo_z = 40.*cm;
140  G4Box* calorimeterLayer_box = new G4Box("caloLayer_box",
141  calo_x,calo_y,calo_z);
142  fCalorimeterLayer_log = new G4LogicalVolume(calorimeterLayer_box,
143  Al,"caloLayer_log",0,0,0);
144  for(G4int i=0;i<19;i++) // loop for 19 layers
145  {
146  G4double caloPos_x = (i-9)*10.*cm;
147  G4double caloPos_y = 0.0*m;
148  G4double caloPos_z = 0.0*m;
149  fCalorimeterLayer_phys = new G4PVPlacement(0,
150  G4ThreeVector(caloPos_x,caloPos_y,caloPos_z),
151  fCalorimeterLayer_log,"caloLayer",fCalorimeterBlock_log,false,i);
152  }
153 
154  //------------------------------------------------------------------
155 
156  // writing the geometry to a ROOT file
157 
158  // initialize ROOT
159  TSystem ts;
160 
161  gSystem->Load("libExP02ClassesDict");
162 
163  // gDebug = 1;
164 
167 
168  ExP02GeoTree* geotree = new ExP02GeoTree(fExperimentalHall_phys, eltab, mattab);
169 
170  TFile fo("geo.root","RECREATE");
171 
172  fo.WriteObject(geotree, "my_geo");
173 
174  return fExperimentalHall_phys;
175 }
static constexpr double mg
Definition: G4SIunits.hh:184
CLHEP::Hep3Vector G4ThreeVector
std::vector< ExP01TrackerHit * > a
Definition: ExP01Classes.hh:33
Definition: G4Box.hh:64
Definition: G4Tubs.hh:85
static G4MaterialTable * GetMaterialTable()
Definition: G4Material.cc:587
std::vector< G4Material * > G4MaterialTable
G4double expHall_x
int G4int
Definition: G4Types.hh:78
function g(Y1, Y2, PT2)
Definition: hijing1.383.f:5205
G4double expHall_y
static constexpr double m
Definition: G4SIunits.hh:129
static constexpr double cm
Definition: G4SIunits.hh:119
static constexpr double cm3
Definition: G4SIunits.hh:121
tuple z
Definition: test.py:28
std::vector< G4Element * > G4ElementTable
double G4double
Definition: G4Types.hh:76
static constexpr double deg
Definition: G4SIunits.hh:152
static G4ElementTable * GetElementTable()
Definition: G4Element.cc:398
static constexpr double mole
Definition: G4SIunits.hh:286
G4double expHall_z

Here is the call graph for this function:


The documentation for this class was generated from the following files: