Geant4  10.02.p03
ExN04DetectorConstruction Class Reference

#include <ExN04DetectorConstruction.hh>

Inheritance diagram for ExN04DetectorConstruction:
Collaboration diagram for ExN04DetectorConstruction:

Public Member Functions

 ExN04DetectorConstruction ()
 
 ~ExN04DetectorConstruction ()
 
virtual G4VPhysicalVolumeConstruct ()
 
 ExN04DetectorConstruction ()
 
 ~ExN04DetectorConstruction ()
 
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
 

Private Member Functions

void DefineMaterials ()
 
void DefineMaterials ()
 

Private Attributes

G4double fexpHall_x
 
G4double fexpHall_y
 
G4double fexpHall_z
 
G4double ftrkTubs_rmax
 
G4double ftrkTubs_rmin
 
G4double ftrkTubs_dz
 
G4double ftrkTubs_sphi
 
G4double ftrkTubs_dphi
 
G4int fnotrkLayers
 
G4double ftracker_radius [5]
 
G4double ftracker_thick
 
G4double ftracker_length [5]
 
G4double fcaloTubs_rmax
 
G4double fcaloTubs_rmin
 
G4double fcaloTubs_dz
 
G4double fcaloTubs_sphi
 
G4double fcaloTubs_dphi
 
G4int fnocaloLayers
 
G4double fabsorber_thick
 
G4double fscinti_thick
 
G4int fsegmentsinZ
 
G4double fcaloRing_rmax
 
G4double fcaloRing_rmin
 
G4double fcaloRing_dz
 
G4double fcaloRing_sphi
 
G4double fcaloRing_dphi
 
G4int fsegmentsinPhi
 
G4double fcaloCell_rmax
 
G4double fcaloCell_rmin
 
G4double fcaloCell_dz
 
G4double fcaloCell_sphi
 
G4double fcaloCell_dphi
 
G4int fnomucounter
 
G4double fmuBox_radius
 
G4double fmuBox_width
 
G4double fmuBox_thick
 
G4double fmuBox_length
 
G4MaterialfAir
 
G4MaterialfAr
 
G4MaterialfSilicon
 
G4MaterialfScinti
 
G4MaterialfLead
 
G4double expHall_x
 
G4double expHall_y
 
G4double expHall_z
 
G4double trkTubs_rmax
 
G4double trkTubs_rmin
 
G4double trkTubs_dz
 
G4double trkTubs_sphi
 
G4double trkTubs_dphi
 
G4int notrkLayers
 
G4double tracker_radius [5]
 
G4double tracker_thick
 
G4double tracker_length [5]
 
G4double caloTubs_rmax
 
G4double caloTubs_rmin
 
G4double caloTubs_dz
 
G4double caloTubs_sphi
 
G4double caloTubs_dphi
 
G4int nocaloLayers
 
G4double absorber_thick
 
G4double scinti_thick
 
G4int segmentsinZ
 
G4double caloRing_rmax
 
G4double caloRing_rmin
 
G4double caloRing_dz
 
G4double caloRing_sphi
 
G4double caloRing_dphi
 
G4int segmentsinPhi
 
G4double caloCell_rmax
 
G4double caloCell_rmin
 
G4double caloCell_dz
 
G4double caloCell_sphi
 
G4double caloCell_dphi
 
G4int nomucounter
 
G4double muBox_radius
 
G4double muBox_width
 
G4double muBox_thick
 
G4double muBox_length
 
G4MaterialAir
 
G4MaterialAr
 
G4MaterialSilicon
 
G4MaterialScinti
 
G4MaterialLead
 
G4ElementH
 
G4ElementC
 
G4ElementN
 
G4ElementO
 

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

Constructor & Destructor Documentation

◆ ExN04DetectorConstruction() [1/2]

ExN04DetectorConstruction::ExN04DetectorConstruction ( )

◆ ~ExN04DetectorConstruction() [1/2]

ExN04DetectorConstruction::~ExN04DetectorConstruction ( )

◆ ExN04DetectorConstruction() [2/2]

ExN04DetectorConstruction::ExN04DetectorConstruction ( )

◆ ~ExN04DetectorConstruction() [2/2]

ExN04DetectorConstruction::~ExN04DetectorConstruction ( )

Member Function Documentation

◆ Construct() [1/2]

G4VPhysicalVolume * ExN04DetectorConstruction::Construct ( void  )
virtual

Implements G4VUserDetectorConstruction.

Definition at line 104 of file eventgenerator/HepMC/HepMCEx01/src/ExN04DetectorConstruction.cc.

105 {
106  //-------------------------------------------------------------------------
107  // Magnetic field
108  //-------------------------------------------------------------------------
109 
110  static G4bool fieldIsInitialized = false;
111  if ( !fieldIsInitialized ) {
112  ExN04Field* myField = new ExN04Field;
113  G4FieldManager* fieldMgr
115  GetFieldManager();
116  fieldMgr-> SetDetectorField(myField);
117  fieldMgr-> CreateChordFinder(myField);
118  fieldIsInitialized = true;
119  }
120 
121  //-------------------------------------------------------------------------
122  // Detector geometry
123  //-------------------------------------------------------------------------
124 
125  //------------------------------ experimental hall
126  G4Box* experimentalHall_box =
127  new G4Box("expHall_b", fexpHall_x, fexpHall_y, fexpHall_z);
128  G4LogicalVolume* experimentalHall_log =
129  new G4LogicalVolume(experimentalHall_box, fAir,"expHall_L", 0,0,0);
130  G4VPhysicalVolume * experimentalHall_phys =
131  new G4PVPlacement(0, G4ThreeVector(), experimentalHall_log,
132  "expHall_P", 0, false,0);
133  G4VisAttributes* experimentalHallVisAtt =
134  new G4VisAttributes(G4Colour(1.,1.,1.));
135  experimentalHallVisAtt-> SetForceWireframe(true);
136  experimentalHall_log-> SetVisAttributes(experimentalHallVisAtt);
137 
138  //------------------------------ tracker
139  G4VSolid* tracker_tubs
140  = new G4Tubs("trkTubs_tubs", ftrkTubs_rmin, ftrkTubs_rmax, ftrkTubs_dz,
142  G4LogicalVolume* tracker_log
143  = new G4LogicalVolume(tracker_tubs, fAr,"trackerT_L",0,0,0);
144  // G4VPhysicalVolume * tracker_phys =
145  new G4PVPlacement(0,G4ThreeVector(), tracker_log, "tracker_phys",
146  experimentalHall_log, false, 0);
147  G4VisAttributes* tracker_logVisAtt
148  = new G4VisAttributes(G4Colour(1.0,0.0,1.0));
149  tracker_logVisAtt->SetForceWireframe(true);
150  tracker_log->SetVisAttributes(tracker_logVisAtt);
151 
152  //------------------------------ tracker layers
153  // As an example for Parameterised volume
154  // dummy values for G4Tubs -- modified by parameterised volume
155  G4VSolid* trackerLayer_tubs
156  = new G4Tubs("trackerLayer_tubs", ftrkTubs_rmin, ftrkTubs_rmax, ftrkTubs_dz,
158  G4LogicalVolume* trackerLayer_log
159  = new G4LogicalVolume(trackerLayer_tubs, fSilicon,"trackerB_L",0,0,0);
160  G4VPVParameterisation* trackerParam
162  // dummy value : kXAxis -- modified by parameterised volume
163  // G4VPhysicalVolume *trackerLayer_phys =
164  new G4PVParameterised("trackerLayer_phys", trackerLayer_log, tracker_log,
165  kXAxis, fnotrkLayers, trackerParam);
166  G4VisAttributes* trackerLayer_logVisAtt
167  = new G4VisAttributes(G4Colour(0.5,0.0,1.0));
168  trackerLayer_logVisAtt->SetForceWireframe(true);
169  trackerLayer_log->SetVisAttributes(trackerLayer_logVisAtt);
170 
171  //------------------------------ calorimeter
172  G4VSolid* calorimeter_tubs
173  = new G4Tubs("calorimeter_tubs", fcaloTubs_rmin, fcaloTubs_rmax,
175  G4LogicalVolume* calorimeter_log
176  = new G4LogicalVolume(calorimeter_tubs, fScinti, "caloT_L",0,0,0);
177  // G4VPhysicalVolume * calorimeter_phys =
178  new G4PVPlacement(0,G4ThreeVector(), calorimeter_log, "caloM_P",
179  experimentalHall_log, false,0);
180  G4VisAttributes* calorimeter_logVisATT
181  = new G4VisAttributes(G4Colour(1.0,1.0,0.0));
182  calorimeter_logVisATT->SetForceWireframe(true);
183  calorimeter_log->SetVisAttributes(calorimeter_logVisATT);
184 
185  //------------------------------- Lead layers
186  // As an example for Parameterised volume
187  // dummy values for G4Tubs -- modified by parameterised volume
188  G4VSolid* caloLayer_tubs
189  = new G4Tubs("caloLayer_tubs", fcaloRing_rmin, fcaloRing_rmax,
191  G4LogicalVolume* caloLayer_log
192  = new G4LogicalVolume(caloLayer_tubs, fLead, "caloR_L",0,0,0);
193  G4VPVParameterisation* calorimeterParam
195  // dummy value : kXAxis -- modified by parameterised volume
196  // G4VPhysicalVolume * caloLayer_phys =
197  new G4PVParameterised("caloLayer_phys",caloLayer_log,calorimeter_log,
198  kXAxis, fnocaloLayers, calorimeterParam);
199  G4VisAttributes* caloLayer_logVisAtt
200  = new G4VisAttributes(G4Colour(0.7,1.0,0.0));
201  caloLayer_logVisAtt->SetForceWireframe(true);
202  caloLayer_log->SetVisAttributes(caloLayer_logVisAtt);
203 
204  //------------------------------ muon counters
205  // As an example of CSG volumes with rotation
206  G4VSolid* muoncounter_box
207  = new G4Box("muoncounter_box", fmuBox_width, fmuBox_thick, fmuBox_length);
208  G4LogicalVolume* muoncounter_log
209  = new G4LogicalVolume(muoncounter_box, fScinti, "mucounter_L",0,0,0);
210  G4VPhysicalVolume* muoncounter_phys;
211  for( G4int i = 0; i < fnomucounter; i++ ) {
212  G4double phi, x, y, z;
213  phi = 360.*deg/fnomucounter*i;
214  x = fmuBox_radius*std::sin(phi);
215  y = fmuBox_radius*std::cos(phi);
216  z = 0.*cm;
217  G4RotationMatrix rm;
218  rm.rotateZ(phi);
219  muoncounter_phys
220  = new G4PVPlacement(G4Transform3D(rm,G4ThreeVector(x,y,z)),
221  muoncounter_log, "muoncounter_P",
222  experimentalHall_log,false,i);
223  }
224  G4VisAttributes* muoncounter_logVisAtt
225  = new G4VisAttributes(G4Colour(0.0,1.0,1.0));
226  muoncounter_logVisAtt->SetForceWireframe(true);
227  muoncounter_log->SetVisAttributes(muoncounter_logVisAtt);
228 
229  //------------------------------------------------------------------
230  // Sensitive Detector
231  //------------------------------------------------------------------
232 
234 
235  G4String trackerSDname = "/mydet/tracker";
236  ExN04TrackerSD * trackerSD = new ExN04TrackerSD(trackerSDname);
237  SDman->AddNewDetector(trackerSD);
238  trackerLayer_log->SetSensitiveDetector(trackerSD);
239 
240  G4String calorimeterSDname = "/mydet/calorimeter";
241  ExN04CalorimeterSD* calorimeterSD = new ExN04CalorimeterSD(calorimeterSDname);
242  G4String ROgeometryName = "CalorimeterROGeom";
243  G4VReadOutGeometry* calRO = new ExN04CalorimeterROGeometry(ROgeometryName);
244  calRO->BuildROGeometry();
245  calorimeterSD->SetROgeometry(calRO);
246  SDman->AddNewDetector(calorimeterSD);
247  calorimeter_log->SetSensitiveDetector(calorimeterSD);
248 
249  G4String muonSDname = "/mydet/muon";
250  ExN04MuonSD* muonSD = new ExN04MuonSD(muonSDname);
251  SDman->AddNewDetector(muonSD);
252  muoncounter_log->SetSensitiveDetector(muonSD);
253 
254  //------------------------------------------------------------------
255  // Digitizer modules
256  //------------------------------------------------------------------
257 
258  return experimentalHall_phys;
259 }
static const double cm
Definition: G4SIunits.hh:118
void SetForceWireframe(G4bool)
CLHEP::Hep3Vector G4ThreeVector
Definition: G4Box.hh:64
Definition: G4Tubs.hh:85
int G4int
Definition: G4Types.hh:78
Double_t y
static const double deg
Definition: G4SIunits.hh:151
bool G4bool
Definition: G4Types.hh:79
void SetROgeometry(G4VReadOutGeometry *value)
HepGeom::Transform3D G4Transform3D
static G4TransportationManager * GetTransportationManager()
void AddNewDetector(G4VSensitiveDetector *aSD)
Definition: G4SDManager.cc:71
static G4SDManager * GetSDMpointer()
Definition: G4SDManager.cc:40
HepRotation & rotateZ(double delta)
Definition: Rotation.cc:92
double G4double
Definition: G4Types.hh:76
void SetVisAttributes(const G4VisAttributes *pVA)
void SetSensitiveDetector(G4VSensitiveDetector *pSDetector)
Here is the call graph for this function:

◆ Construct() [2/2]

G4VPhysicalVolume* ExN04DetectorConstruction::Construct ( )
virtual

◆ DefineMaterials() [1/2]

void ExN04DetectorConstruction::DefineMaterials ( )
private

Definition at line 73 of file eventgenerator/HepMC/HepMCEx01/src/ExN04DetectorConstruction.cc.

74 {
75  //-------------------------------------------------------------------------
76  // Materials
77  //-------------------------------------------------------------------------
78 
79  G4double a, z, density;
80  G4int nel;
81 
82  G4Element* H = new G4Element("Hydrogen", "H", z=1., a= 1.01*g/mole);
83  G4Element* C = new G4Element("Carbon", "C", z=6., a= 12.01*g/mole);
84  G4Element* N = new G4Element("Nitrogen", "N", z=7., a= 14.01*g/mole);
85  G4Element* O = new G4Element("Oxygen", "O", z=8., a= 16.00*g/mole);
86 
87  fAir = new G4Material("Air", density= 1.29*mg/cm3, nel=2);
88  fAir-> AddElement(N, 70.*perCent);
89  fAir-> AddElement(O, 30.*perCent);
90 
91  fLead = new G4Material("Lead", z=82., a= 207.19*g/mole, density= 11.35*g/cm3);
92 
93  fAr = new G4Material("ArgonGas",z=18., a= 39.95*g/mole, density=1.782*mg/cm3);
94 
95  fSilicon = new G4Material("Silicon", z=14., a= 28.09*g/mole,
96  density= 2.33*g/cm3);
97 
98  fScinti = new G4Material("Scintillator", density= 1.032*g/cm3, nel=2);
99  fScinti-> AddElement(C, 9);
100  fScinti-> AddElement(H, 10);
101 }
static const double mg
Definition: G4SIunits.hh:181
int G4int
Definition: G4Types.hh:78
G4double density
Definition: TRTMaterials.hh:39
function g(Y1, Y2, PT2)
Definition: hijing1.383.f:5206
static const double cm3
Definition: G4SIunits.hh:120
static const double perCent
Definition: G4SIunits.hh:329
static const double mole
Definition: G4SIunits.hh:283
double G4double
Definition: G4Types.hh:76
Air AddElement(elN,.7)
G4int nel
Definition: TRTMaterials.hh:41
Here is the call graph for this function:

◆ DefineMaterials() [2/2]

void ExN04DetectorConstruction::DefineMaterials ( )
private

Member Data Documentation

◆ absorber_thick

G4double ExN04DetectorConstruction::absorber_thick
private

◆ Air

G4Material* ExN04DetectorConstruction::Air
private

◆ Ar

G4Material* ExN04DetectorConstruction::Ar
private

◆ C

G4Element* ExN04DetectorConstruction::C
private

◆ caloCell_dphi

G4double ExN04DetectorConstruction::caloCell_dphi
private

◆ caloCell_dz

G4double ExN04DetectorConstruction::caloCell_dz
private

◆ caloCell_rmax

G4double ExN04DetectorConstruction::caloCell_rmax
private

◆ caloCell_rmin

G4double ExN04DetectorConstruction::caloCell_rmin
private

◆ caloCell_sphi

G4double ExN04DetectorConstruction::caloCell_sphi
private

◆ caloRing_dphi

G4double ExN04DetectorConstruction::caloRing_dphi
private

◆ caloRing_dz

G4double ExN04DetectorConstruction::caloRing_dz
private

◆ caloRing_rmax

G4double ExN04DetectorConstruction::caloRing_rmax
private

◆ caloRing_rmin

G4double ExN04DetectorConstruction::caloRing_rmin
private

◆ caloRing_sphi

G4double ExN04DetectorConstruction::caloRing_sphi
private

◆ caloTubs_dphi

G4double ExN04DetectorConstruction::caloTubs_dphi
private

◆ caloTubs_dz

G4double ExN04DetectorConstruction::caloTubs_dz
private

◆ caloTubs_rmax

G4double ExN04DetectorConstruction::caloTubs_rmax
private

◆ caloTubs_rmin

G4double ExN04DetectorConstruction::caloTubs_rmin
private

◆ caloTubs_sphi

G4double ExN04DetectorConstruction::caloTubs_sphi
private

◆ expHall_x

G4double ExN04DetectorConstruction::expHall_x
private

◆ expHall_y

G4double ExN04DetectorConstruction::expHall_y
private

◆ expHall_z

G4double ExN04DetectorConstruction::expHall_z
private

◆ fabsorber_thick

G4double ExN04DetectorConstruction::fabsorber_thick
private

◆ fAir

G4Material* ExN04DetectorConstruction::fAir
private

◆ fAr

G4Material* ExN04DetectorConstruction::fAr
private

◆ fcaloCell_dphi

G4double ExN04DetectorConstruction::fcaloCell_dphi
private

◆ fcaloCell_dz

G4double ExN04DetectorConstruction::fcaloCell_dz
private

◆ fcaloCell_rmax

G4double ExN04DetectorConstruction::fcaloCell_rmax
private

◆ fcaloCell_rmin

G4double ExN04DetectorConstruction::fcaloCell_rmin
private

◆ fcaloCell_sphi

G4double ExN04DetectorConstruction::fcaloCell_sphi
private

◆ fcaloRing_dphi

G4double ExN04DetectorConstruction::fcaloRing_dphi
private

◆ fcaloRing_dz

G4double ExN04DetectorConstruction::fcaloRing_dz
private

◆ fcaloRing_rmax

G4double ExN04DetectorConstruction::fcaloRing_rmax
private

◆ fcaloRing_rmin

G4double ExN04DetectorConstruction::fcaloRing_rmin
private

◆ fcaloRing_sphi

G4double ExN04DetectorConstruction::fcaloRing_sphi
private

◆ fcaloTubs_dphi

G4double ExN04DetectorConstruction::fcaloTubs_dphi
private

◆ fcaloTubs_dz

G4double ExN04DetectorConstruction::fcaloTubs_dz
private

◆ fcaloTubs_rmax

G4double ExN04DetectorConstruction::fcaloTubs_rmax
private

◆ fcaloTubs_rmin

G4double ExN04DetectorConstruction::fcaloTubs_rmin
private

◆ fcaloTubs_sphi

G4double ExN04DetectorConstruction::fcaloTubs_sphi
private

◆ fexpHall_x

G4double ExN04DetectorConstruction::fexpHall_x
private

◆ fexpHall_y

G4double ExN04DetectorConstruction::fexpHall_y
private

◆ fexpHall_z

G4double ExN04DetectorConstruction::fexpHall_z
private

◆ fLead

G4Material* ExN04DetectorConstruction::fLead
private

◆ fmuBox_length

G4double ExN04DetectorConstruction::fmuBox_length
private

◆ fmuBox_radius

G4double ExN04DetectorConstruction::fmuBox_radius
private

◆ fmuBox_thick

G4double ExN04DetectorConstruction::fmuBox_thick
private

◆ fmuBox_width

G4double ExN04DetectorConstruction::fmuBox_width
private

◆ fnocaloLayers

G4int ExN04DetectorConstruction::fnocaloLayers
private

◆ fnomucounter

G4int ExN04DetectorConstruction::fnomucounter
private

◆ fnotrkLayers

G4int ExN04DetectorConstruction::fnotrkLayers
private

◆ fScinti

G4Material* ExN04DetectorConstruction::fScinti
private

◆ fscinti_thick

G4double ExN04DetectorConstruction::fscinti_thick
private

◆ fsegmentsinPhi

G4int ExN04DetectorConstruction::fsegmentsinPhi
private

◆ fsegmentsinZ

G4int ExN04DetectorConstruction::fsegmentsinZ
private

◆ fSilicon

G4Material* ExN04DetectorConstruction::fSilicon
private

◆ ftracker_length

G4double ExN04DetectorConstruction::ftracker_length[5]
private

◆ ftracker_radius

G4double ExN04DetectorConstruction::ftracker_radius[5]
private

◆ ftracker_thick

G4double ExN04DetectorConstruction::ftracker_thick
private

◆ ftrkTubs_dphi

G4double ExN04DetectorConstruction::ftrkTubs_dphi
private

◆ ftrkTubs_dz

G4double ExN04DetectorConstruction::ftrkTubs_dz
private

◆ ftrkTubs_rmax

G4double ExN04DetectorConstruction::ftrkTubs_rmax
private

◆ ftrkTubs_rmin

G4double ExN04DetectorConstruction::ftrkTubs_rmin
private

◆ ftrkTubs_sphi

G4double ExN04DetectorConstruction::ftrkTubs_sphi
private

◆ H

G4Element* ExN04DetectorConstruction::H
private

◆ Lead

G4Material* ExN04DetectorConstruction::Lead
private

◆ muBox_length

G4double ExN04DetectorConstruction::muBox_length
private

◆ muBox_radius

G4double ExN04DetectorConstruction::muBox_radius
private

◆ muBox_thick

G4double ExN04DetectorConstruction::muBox_thick
private

◆ muBox_width

G4double ExN04DetectorConstruction::muBox_width
private

◆ N

G4Element* ExN04DetectorConstruction::N
private

◆ nocaloLayers

G4int ExN04DetectorConstruction::nocaloLayers
private

◆ nomucounter

G4int ExN04DetectorConstruction::nomucounter
private

◆ notrkLayers

G4int ExN04DetectorConstruction::notrkLayers
private

◆ O

G4Element* ExN04DetectorConstruction::O
private

◆ Scinti

G4Material* ExN04DetectorConstruction::Scinti
private

◆ scinti_thick

G4double ExN04DetectorConstruction::scinti_thick
private

◆ segmentsinPhi

G4int ExN04DetectorConstruction::segmentsinPhi
private

◆ segmentsinZ

G4int ExN04DetectorConstruction::segmentsinZ
private

◆ Silicon

G4Material* ExN04DetectorConstruction::Silicon
private

◆ tracker_length

G4double ExN04DetectorConstruction::tracker_length[5]
private

◆ tracker_radius

G4double ExN04DetectorConstruction::tracker_radius[5]
private

◆ tracker_thick

G4double ExN04DetectorConstruction::tracker_thick
private

◆ trkTubs_dphi

G4double ExN04DetectorConstruction::trkTubs_dphi
private

◆ trkTubs_dz

G4double ExN04DetectorConstruction::trkTubs_dz
private

◆ trkTubs_rmax

G4double ExN04DetectorConstruction::trkTubs_rmax
private

◆ trkTubs_rmin

G4double ExN04DetectorConstruction::trkTubs_rmin
private

◆ trkTubs_sphi

G4double ExN04DetectorConstruction::trkTubs_sphi
private

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