Geant4  10.02.p03
ExErrorDetectorConstruction Class Reference

#include <ExErrorDetectorConstruction.hh>

Inheritance diagram for ExErrorDetectorConstruction:
Collaboration diagram for ExErrorDetectorConstruction:

Public Member Functions

 ExErrorDetectorConstruction ()
 
 ~ExErrorDetectorConstruction ()
 
virtual G4VPhysicalVolumeConstruct ()
 
void SetMagField (G4double)
 
- 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 Attributes

G4double fXBEAM
 
G4double fXCDET
 
G4double fXECAL
 
G4double fXSOLN
 
G4double fXHCAL
 
G4double fXMUON
 
G4double fNdivECAL
 
G4double fNdivHCAL
 
G4double fYZLength
 
G4double fXHalfWorldLength
 
G4UserLimitsfUserLimits
 
ExErrorMagneticFieldfMagField
 
ExErrorDetectorMessengerfDetectorMessenger
 

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 class

Creates a simplified typical HEP detector: An air beamline ( BEAM ) An air central detector ( CDET ) A copper calorimeter, divided in four ( ECAL ) An aluminium calorimeter, divided in ten ( HCAL ) An air muon detector ( MUON )

History: Created: May 2007

Author
P. Arce

Definition at line 60 of file ExErrorDetectorConstruction.hh.

Constructor & Destructor Documentation

◆ ExErrorDetectorConstruction()

ExErrorDetectorConstruction::ExErrorDetectorConstruction ( )

Definition at line 51 of file ExErrorDetectorConstruction.cc.

53  fXBEAM(5.*cm), fXCDET(20.*cm), fXECAL(40.*cm), fXSOLN(10.*cm), fXHCAL(100.*cm),
54  fXMUON(50.*cm), fNdivECAL(40./10.), fNdivHCAL(100./10.), fYZLength(50.*cm),
57 {
58 
59  // create UserLimits
60  fUserLimits = new G4UserLimits();
61 
65 
66 }
static const double cm
Definition: G4SIunits.hh:118
CLHEP::Hep3Vector G4ThreeVector
ExErrorDetectorMessenger * fDetectorMessenger
static const double kilogauss
Definition: G4SIunits.hh:268

◆ ~ExErrorDetectorConstruction()

ExErrorDetectorConstruction::~ExErrorDetectorConstruction ( )

Definition at line 69 of file ExErrorDetectorConstruction.cc.

70 {
71  delete fMagField;
72  delete fDetectorMessenger;
73 }
ExErrorDetectorMessenger * fDetectorMessenger

Member Function Documentation

◆ Construct()

G4VPhysicalVolume * ExErrorDetectorConstruction::Construct ( void  )
virtual

Implements G4VUserDetectorConstruction.

Definition at line 76 of file ExErrorDetectorConstruction.cc.

77 {
78 //--------- Material definition ---------
79 
80  //Vacuum
81  /* a = 1.*g/mole;
82  density = 1.E-9*g/cm3;
83  G4Material* Vacuum = new G4Material(name="Vacuum", z=1., a, density);
84  */
85 
87  G4Material* air = nistMgr->FindOrBuildMaterial("G4_AIR");
88  //Al
89  G4Material* al = nistMgr->FindOrBuildMaterial("G4_Al");
90  //Fe
91  G4Material* fe = nistMgr->FindOrBuildMaterial("G4_Fe");
92  //Cu
93  G4Material* cu = nistMgr->FindOrBuildMaterial("G4_Cu");
94 
95  // Print all the materials defined.
96  //
97  G4cout << G4endl << "The materials defined are : " << G4endl << G4endl;
98  G4cout << *(G4Material::GetMaterialTable()) << G4endl;
99 
100  //--- Sizes of the principal geometrical components (solids) --- (half lengths)
101  //double fXBEAM = 5.*2.*cm;
102  //double fXCDET = 90.*cm;
103  //double fXECAL = 40.*cm;
104  //double fXSOLN = 10.*cm;
105  //double fXHCAL = 100.*cm;
106  //double fXMUON = 50.*cm;
107  //double fNdivECAL = 10;
108  //double fNdivHCAL = 10;
109  //double fYZLength = 100.*cm;
110 
111  // double fXWorldLength= fXBEAM + fXCDET + fXECAL + fXSOLN + fXHCAL + fXMUON;
112 
113 
114 //--------- Definitions of Solids, Logical Volumes, Physical Volumes ---------
115 
116  //------------------------------
117  // World
118  //------------------------------
119  //- G4double HalfWorldLength = fXWorldLength;
120  G4cout << " HalfWorldLength " << fXHalfWorldLength << G4endl;
121 
122  G4Box* solidWorld= new G4Box("world",fXHalfWorldLength,fYZLength,fYZLength);
123  G4LogicalVolume* logicWorld= new G4LogicalVolume( solidWorld, air, "World", 0, 0, 0);
124  // Must place the World Physical volume unrotated at (0,0,0).
125  //
126  G4VPhysicalVolume* physiWorld
127  = new G4PVPlacement(0, // no rotation
128  G4ThreeVector(), // at (0,0,0)
129  "World", // its name
130  logicWorld, // its logical volume
131  0, // its mother volume
132  false, // no boolean operations
133  0); // no field specific to volum
134 
135  //------------------------------
136  // BEAM
137  //------------------------------
138  G4Box* solidBEAM = new G4Box("BEAM",fXBEAM,fYZLength,fYZLength);
139  G4LogicalVolume* logicBEAM = new G4LogicalVolume(solidBEAM,air,"BEAM",0,0,0);
140  G4ThreeVector positionBEAM = G4ThreeVector(0.,0.,0.);
141  //G4VPhysicalVolume* physiBEAM =
142  new G4PVPlacement(0, // no rotation
143  positionBEAM, // at (x,y,z)
144  "BEAM", // its name
145  logicBEAM, // its logical volume
146  physiWorld, // its mother volume
147  false, // no boolean operations
148  0); // no particular field
149 
150  //------------------------------
151  // CDET (Central DETector)
152  //------------------------------
153  G4ThreeVector positionCdet = G4ThreeVector(fXBEAM + fXCDET/2.,0.,0.);
154  G4Box* solidCDET = new G4Box("CDET",fXCDET/2.,fYZLength,fYZLength);
155  G4LogicalVolume* logicCDET = new G4LogicalVolume(solidCDET,air,"Cdet",0,0,0);
156  // G4VPhysicalVolume* physiCDET =
157  new G4PVPlacement(0, // no rotation
158  positionCdet, // at (x,y,z)
159  "CDET", // its name
160  logicCDET, // its logical volume
161  physiWorld, // its mother volume
162  false, // no boolean operations
163  0); // no particular field
164 
165  //------------------------------
166  // ECAL
167  //------------------------------
168  G4ThreeVector positionECAL = G4ThreeVector(fXBEAM + fXCDET + fXECAL/2., 0., 0.);
169  G4Box* solidECAL = new G4Box("ECAL",fXECAL/2.,fYZLength,fYZLength);
170  G4LogicalVolume* logicECAL = new G4LogicalVolume(solidECAL,cu,"ECAL",0,0,0);
171  G4VPhysicalVolume* physiECAL
172  = new G4PVPlacement(0, // no rotation
173  positionECAL, // at (x,y,z)
174  "ECAL", // its name
175  logicECAL, // its logical volume
176  physiWorld, // its mother volume
177  false, // no boolean operations
178  0); // no particular field
179  //--------- Divide it
180  G4Box* solidECALdiv = new G4Box("ECAL",fXECAL/2./fNdivECAL,fYZLength,fYZLength);
181  G4LogicalVolume* logicECALdiv = new G4LogicalVolume(solidECALdiv,cu,"ECALdiv",0,0,0);
182  new G4PVReplica("DVEC", logicECALdiv, physiECAL,
184 
185 
186  //------------------------------
187  // SOLN
188  //------------------------------
189  G4ThreeVector positionSOLN
190  = G4ThreeVector(fXBEAM + fXCDET + fXECAL + fXSOLN/2., 0., 0.);
191  G4Box* solidSOLN = new G4Box("SOLN",fXSOLN/2.,fYZLength,fYZLength);
192  G4LogicalVolume* logicSOLN = new G4LogicalVolume(solidSOLN,al,"SOLN",0,0,0);
193  new G4PVPlacement(0, // no rotation
194  positionSOLN, // at (x,y,z)
195  "SOLN", // its name
196  logicSOLN, // its logical volume
197  physiWorld, // its mother volume
198  false, // no boolean operations
199  0); // no particular field
200 
201  //------------------------------
202  // HCAL
203  //------------------------------
204  G4ThreeVector positionHCAL = G4ThreeVector(fXBEAM + fXCDET + fXECAL + fXSOLN + fXHCAL/2., 0., 0.);
205  G4Box* solidHCAL = new G4Box("HCAL",fXHCAL/2.,fYZLength,fYZLength);
206  G4LogicalVolume* logicHCAL = new G4LogicalVolume(solidHCAL,fe,"HCAL",0,0,0);
207  G4VPhysicalVolume* physiHCAL
208  = new G4PVPlacement(0, // no rotation
209  positionHCAL, // at (x,y,z)
210  "HCAL", // its name
211  logicHCAL, // its logical volume
212  physiWorld, // its mother volume
213  false, // no boolean operations
214  0); // no particular field
215  //--------- Divide it
216  G4Box* solidHCALdiv = new G4Box("HCAL",fXHCAL/2./fNdivHCAL,fYZLength,fYZLength);
217  G4LogicalVolume* logicHCALdiv = new G4LogicalVolume(solidHCALdiv,fe,"HCALdiv",0,0,0);
218  new G4PVReplica("DVEH", logicHCALdiv, physiHCAL,
220 
221  //------------------------------
222  // MUON
223  //------------------------------
224  G4ThreeVector positionMUON
225  = G4ThreeVector(fXBEAM + fXCDET + fXECAL + fXSOLN + fXHCAL + fXMUON/2., 0., 0.);
226  G4Box* solidMUON = new G4Box("MUON",fXMUON/2.,fYZLength,fYZLength);
227  G4LogicalVolume* logicMUON = new G4LogicalVolume(solidMUON,air,"MUON",0,0,0);
228  new G4PVPlacement(0, // no rotation
229  positionMUON, // at (x,y,z)
230  "MUON", // its name
231  logicMUON, // its logical volume
232  physiWorld, // its mother volume
233  false, // no boolean operations
234  0); // no particular field
235 
236 
237  G4VisAttributes* worldVisAtt = new G4VisAttributes(0);
238  logicWorld->SetVisAttributes( worldVisAtt);
239  return physiWorld;
240 }
G4Material * FindOrBuildMaterial(const G4String &name, G4bool isotopes=true, G4bool warning=false)
CLHEP::Hep3Vector G4ThreeVector
Definition: G4Box.hh:64
static G4MaterialTable * GetMaterialTable()
Definition: G4Material.cc:589
int G4int
Definition: G4Types.hh:78
static G4NistManager * Instance()
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
void SetVisAttributes(const G4VisAttributes *pVA)
G4fissionEvent * fe
Here is the call graph for this function:

◆ SetMagField()

void ExErrorDetectorConstruction::SetMagField ( G4double  fieldValue)

Definition at line 243 of file ExErrorDetectorConstruction.cc.

244 {
245  fMagField->SetFieldValue(fieldValue);
246 }
void SetFieldValue(G4double fieldValue)
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ fDetectorMessenger

ExErrorDetectorMessenger* ExErrorDetectorConstruction::fDetectorMessenger
private

Definition at line 88 of file ExErrorDetectorConstruction.hh.

◆ fMagField

ExErrorMagneticField* ExErrorDetectorConstruction::fMagField
private

Definition at line 86 of file ExErrorDetectorConstruction.hh.

◆ fNdivECAL

G4double ExErrorDetectorConstruction::fNdivECAL
private

Definition at line 78 of file ExErrorDetectorConstruction.hh.

◆ fNdivHCAL

G4double ExErrorDetectorConstruction::fNdivHCAL
private

Definition at line 79 of file ExErrorDetectorConstruction.hh.

◆ fUserLimits

G4UserLimits* ExErrorDetectorConstruction::fUserLimits
private

Definition at line 84 of file ExErrorDetectorConstruction.hh.

◆ fXBEAM

G4double ExErrorDetectorConstruction::fXBEAM
private

Definition at line 72 of file ExErrorDetectorConstruction.hh.

◆ fXCDET

G4double ExErrorDetectorConstruction::fXCDET
private

Definition at line 73 of file ExErrorDetectorConstruction.hh.

◆ fXECAL

G4double ExErrorDetectorConstruction::fXECAL
private

Definition at line 74 of file ExErrorDetectorConstruction.hh.

◆ fXHalfWorldLength

G4double ExErrorDetectorConstruction::fXHalfWorldLength
private

Definition at line 81 of file ExErrorDetectorConstruction.hh.

◆ fXHCAL

G4double ExErrorDetectorConstruction::fXHCAL
private

Definition at line 76 of file ExErrorDetectorConstruction.hh.

◆ fXMUON

G4double ExErrorDetectorConstruction::fXMUON
private

Definition at line 77 of file ExErrorDetectorConstruction.hh.

◆ fXSOLN

G4double ExErrorDetectorConstruction::fXSOLN
private

Definition at line 75 of file ExErrorDetectorConstruction.hh.

◆ fYZLength

G4double ExErrorDetectorConstruction::fYZLength
private

Definition at line 80 of file ExErrorDetectorConstruction.hh.


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