Geant4  10.02.p03
GB03DetectorConstruction Class Reference

#include <GB03DetectorConstruction.hh>

Inheritance diagram for GB03DetectorConstruction:
Collaboration diagram for GB03DetectorConstruction:

Public Member Functions

 GB03DetectorConstruction ()
 
virtual ~GB03DetectorConstruction ()
 
virtual G4VPhysicalVolumeConstruct ()
 
virtual void ConstructSDandField ()
 
void PrintCalorParameters () const
 
void SetAbsorberMaterial (G4String materialChoice)
 
G4String GetAbsorberMaterial () const
 
void SetGapMaterial (G4String materialChoice)
 
G4String GetGapMaterial () const
 
void SetNumberOfLayers (G4int nl)
 
G4int GetVerboseLevel () const
 
void SetVerboseLevel (G4int val)
 
- Public Member Functions inherited from G4VUserDetectorConstruction
 G4VUserDetectorConstruction ()
 
virtual ~G4VUserDetectorConstruction ()
 
virtual void CloneSD ()
 
virtual void CloneF ()
 
void RegisterParallelWorld (G4VUserParallelWorld *)
 
G4int ConstructParallelGeometries ()
 
void ConstructParallelSD ()
 
G4int GetNumberOfParallelWorld () const
 
G4VUserParallelWorldGetParallelWorld (G4int i) const
 

Static Public Member Functions

static G4int GetNumberOfLayers ()
 

Private Member Functions

void DefineMaterials ()
 
void SetupGeometry ()
 
void SetupDetectors ()
 
void SetupBiasing ()
 

Private Attributes

G4double fTotalThickness
 
G4double fLayerThickness
 total thinkness of one calorimeter More...
 
G4bool fConstructed
 = fTotalThickness / fNumberOfLayers More...
 
G4String fCalName
 
G4MaterialfWorldMaterial
 
G4MaterialfAbsorberMaterial
 
G4MaterialfGapMaterial
 
G4BoxfLayerSolid
 
G4BoxfGapSolid
 
G4LogicalVolumefWorldLogical
 
G4LogicalVolumefCalorLogical
 
G4LogicalVolumefLayerLogical
 
G4LogicalVolumefGapLogical
 
G4VPhysicalVolumefWorldPhysical
 
G4VPhysicalVolumefCalorPhysical
 
G4PVReplicafLayerPhysical
 
G4VPhysicalVolumefGapPhysical
 
GB03DetectorMessengerfDetectorMessenger
 
G4int fVerboseLevel
 

Static Private Attributes

static G4int fNumberOfLayers = 40
 
static G4ThreadLocal G4bool fConstructedSDandField = false
 

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

Definition at line 44 of file GB03DetectorConstruction.hh.

Constructor & Destructor Documentation

◆ GB03DetectorConstruction()

GB03DetectorConstruction::GB03DetectorConstruction ( )

Definition at line 65 of file GB03DetectorConstruction.cc.

68  fConstructed(false),
70  fLayerSolid(0), fGapSolid(0),
74 {
76  fCalName = "Calor";
78 }
G4double fLayerThickness
total thinkness of one calorimeter
GB03DetectorMessenger * fDetectorMessenger
G4bool fConstructed
= fTotalThickness / fNumberOfLayers
static const double m
Definition: G4SIunits.hh:128

◆ ~GB03DetectorConstruction()

GB03DetectorConstruction::~GB03DetectorConstruction ( )
virtual

Definition at line 82 of file GB03DetectorConstruction.cc.

83 { delete fDetectorMessenger;}
GB03DetectorMessenger * fDetectorMessenger

Member Function Documentation

◆ Construct()

G4VPhysicalVolume * GB03DetectorConstruction::Construct ( void  )
virtual

Implements G4VUserDetectorConstruction.

Definition at line 87 of file GB03DetectorConstruction.cc.

88 {
89  if(!fConstructed)
90  {
91  fConstructed = true;
93  SetupGeometry();
94  }
95  if (GetVerboseLevel()>0)
97 
98  return fWorldPhysical;
99 }
G4bool fConstructed
= fTotalThickness / fNumberOfLayers
Here is the call graph for this function:

◆ ConstructSDandField()

void GB03DetectorConstruction::ConstructSDandField ( )
virtual

Reimplemented from G4VUserDetectorConstruction.

Definition at line 103 of file GB03DetectorConstruction.cc.

104 {
106  {
107  fConstructedSDandField = true;
108  SetupDetectors();
109  SetupBiasing();
110  }
111 }
static G4ThreadLocal G4bool fConstructedSDandField
Here is the call graph for this function:

◆ DefineMaterials()

void GB03DetectorConstruction::DefineMaterials ( )
private

Definition at line 115 of file GB03DetectorConstruction.cc.

116 {
117  G4String name, symbol; //a=mass of a mole;
118  G4double a, z, density; //z=mean number of protons;
119  G4int iz; //iz=number of protons in an isotope;
120  G4int n; // n=number of nucleons in an isotope;
121 
122  G4int ncomponents, natoms;
123  G4double abundance, fractionmass;
124  G4double temperature, pressure;
125 
126  //
127  // define Elements
128  //
129 
130  a = 1.01*g/mole;
131  G4Element* H = new G4Element(name="Hydrogen",symbol="H" , z= 1., a);
132 
133  a = 12.01*g/mole;
134  G4Element* C = new G4Element(name="Carbon" ,symbol="C" , z= 6., a);
135 
136  a = 14.01*g/mole;
137  G4Element* N = new G4Element(name="Nitrogen",symbol="N" , z= 7., a);
138 
139  a = 16.00*g/mole;
140  G4Element* O = new G4Element(name="Oxygen" ,symbol="O" , z= 8., a);
141 
142  //
143  // define an Element from isotopes, by relative abundance
144  //
145 
146  G4Isotope* U5 = new G4Isotope(name="U235", iz=92, n=235, a=235.01*g/mole);
147  G4Isotope* U8 = new G4Isotope(name="U238", iz=92, n=238, a=238.03*g/mole);
148 
149  G4Element* U = new G4Element(name="enriched Uranium",symbol="U",ncomponents=2);
150  U->AddIsotope(U5, abundance= 90.*perCent);
151  U->AddIsotope(U8, abundance= 10.*perCent);
152 
153  //
154  // define simple materials
155  //
156 
157  new G4Material(name="Aluminium", z=13., a=26.98*g/mole, density=2.700*g/cm3);
158  new G4Material(name="Silicon", z=14., a= 28.09*g/mole, density= 2.33*g/cm3);
159  new G4Material(name="Iron", z=26., a=55.85*g/mole, density=7.87*g/cm3);
160  new G4Material(name="ArgonGas",z=18., a= 39.95*g/mole, density=1.782*mg/cm3);
161  new G4Material(name="He", z=2., a=4.0*g/mole, density=0.1786e-03*g/cm3);
162 
163  density = 1.390*g/cm3;
164  a = 39.95*g/mole;
165  new G4Material(name="liquidArgon", z=18., a, density);
166 
167  density = 11.35*g/cm3;
168  a = 207.19*g/mole;
169  G4Material* Pb = new G4Material(name="Lead" , z=82., a, density);
170 
171  //
172  // define a material from elements. case 1: chemical molecule
173  //
174 
175  density = 1.000*g/cm3;
176  G4Material* H2O = new G4Material(name="Water", density, ncomponents=2);
177  H2O->AddElement(H, natoms=2);
178  H2O->AddElement(O, natoms=1);
179 
180  density = 1.032*g/cm3;
181  G4Material* Sci = new G4Material(name="Scintillator", density, ncomponents=2);
182  Sci->AddElement(C, natoms=9);
183  Sci->AddElement(H, natoms=10);
184 
185  //
186  // define a material from elements. case 2: mixture by fractional mass
187  //
188 
189  density = 1.290*mg/cm3;
190  G4Material* Air = new G4Material(name="Air" , density, ncomponents=2);
191  Air->AddElement(N, fractionmass=0.7);
192  Air->AddElement(O, fractionmass=0.3);
193 
194  //
195  // examples of vacuum
196  //
197 
198  density = universe_mean_density;
199  pressure = 3.e-18*pascal;
200  temperature = 2.73*kelvin;
201  G4Material* Vacuum = new G4Material(name="Galactic", z=1., a=1.01*g/mole,
202  density,kStateGas,temperature,pressure);
203 
204  if (GetVerboseLevel()>1) {
206  }
207 
208  //default materials of the calorimeter
209  fWorldMaterial = Vacuum;
210  fAbsorberMaterial = Pb;
211  fGapMaterial = Sci;
212 }
G4String symbol
Definition: TRTMaterials.hh:40
G4Material * Air
Definition: TRTMaterials.hh:57
int universe_mean_density
Definition: hepunit.py:307
G4String name
Definition: TRTMaterials.hh:40
static G4MaterialTable * GetMaterialTable()
Definition: G4Material.cc:589
double C(double temp)
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
Char_t n[5]
G4GLOB_DLL std::ostream G4cout
G4double iz
Definition: TRTMaterials.hh:39
void AddIsotope(G4Isotope *isotope, G4double RelativeAbundance)
Definition: G4Element.cc:151
#define pascal
static const double cm3
Definition: G4SIunits.hh:120
static const double perCent
Definition: G4SIunits.hh:329
static const double kelvin
Definition: G4SIunits.hh:278
static const double mole
Definition: G4SIunits.hh:283
#define G4endl
Definition: G4ios.hh:61
**D E S C R I P T I O N
void AddElement(G4Element *element, G4int nAtoms)
Definition: G4Material.cc:364
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetAbsorberMaterial()

G4String GB03DetectorConstruction::GetAbsorberMaterial ( ) const

Definition at line 361 of file GB03DetectorConstruction.cc.

362 { return fAbsorberMaterial->GetName(); }
const G4String & GetName() const
Definition: G4Material.hh:178
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetGapMaterial()

G4String GB03DetectorConstruction::GetGapMaterial ( ) const

Definition at line 389 of file GB03DetectorConstruction.cc.

390 { return fGapMaterial->GetName(); }
const G4String & GetName() const
Definition: G4Material.hh:178
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetNumberOfLayers()

static G4int GB03DetectorConstruction::GetNumberOfLayers ( )
inlinestatic

Definition at line 59 of file GB03DetectorConstruction.hh.

59 { return fNumberOfLayers; }
Here is the caller graph for this function:

◆ GetVerboseLevel()

G4int GB03DetectorConstruction::GetVerboseLevel ( ) const
inline

Definition at line 61 of file GB03DetectorConstruction.hh.

Here is the caller graph for this function:

◆ PrintCalorParameters()

void GB03DetectorConstruction::PrintCalorParameters ( ) const

Definition at line 323 of file GB03DetectorConstruction.cc.

324 {
325  G4cout
326  << "--------------------------------------------------------" << G4endl;
327  G4cout
328  << " Absorber is made of " << fAbsorberMaterial->GetName() << G4endl
329  << " Gap is made of " << fGapMaterial->GetName() << G4endl
330  << "--------------------------------------------------------" << G4endl;
331 }
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
const G4String & GetName() const
Definition: G4Material.hh:178
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetAbsorberMaterial()

void GB03DetectorConstruction::SetAbsorberMaterial ( G4String  materialChoice)

Definition at line 335 of file GB03DetectorConstruction.cc.

336 {
337  // search the material by its name
338  G4Material* pttoMaterial = G4Material::GetMaterial(materialChoice);
339  if(pttoMaterial)
340  {
341  fAbsorberMaterial = pttoMaterial;
342  if(fConstructed)
343  {
346  }
348  if (GetVerboseLevel()>1) {
350  }
351  }
352  else
353  {
354  G4cerr
355  << materialChoice << " is not defined. - Command is ignored." << G4endl;
356  }
357 }
void GeometryHasBeenModified(G4bool prop=true)
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
Definition: G4Material.cc:604
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:79
G4bool fConstructed
= fTotalThickness / fNumberOfLayers
#define G4endl
Definition: G4ios.hh:61
void SetMaterial(G4Material *pMaterial)
G4GLOB_DLL std::ostream G4cerr
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetGapMaterial()

void GB03DetectorConstruction::SetGapMaterial ( G4String  materialChoice)

Definition at line 366 of file GB03DetectorConstruction.cc.

367 {
368  // search the material by its name
369  G4Material* pttoMaterial = G4Material::GetMaterial(materialChoice);
370  if(pttoMaterial)
371  {
372  fGapMaterial = pttoMaterial;
373  if(fConstructed)
376  if (GetVerboseLevel()>1) {
378  }
379  }
380  else
381  {
382  G4cerr
383  << materialChoice << " is not defined. - Command is ignored." << G4endl;
384  }
385 }
void GeometryHasBeenModified(G4bool prop=true)
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
Definition: G4Material.cc:604
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:79
G4bool fConstructed
= fTotalThickness / fNumberOfLayers
#define G4endl
Definition: G4ios.hh:61
void SetMaterial(G4Material *pMaterial)
G4GLOB_DLL std::ostream G4cerr
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetNumberOfLayers()

void GB03DetectorConstruction::SetNumberOfLayers ( G4int  nl)

Definition at line 394 of file GB03DetectorConstruction.cc.

395 {
396  fNumberOfLayers = nl;
398  if(!fConstructed) return;
399 
402 
404  delete fLayerPhysical;
409 
411 }
void GeometryHasBeenModified(G4bool prop=true)
void SetZHalfLength(G4double dz)
Definition: G4Box.cc:171
CLHEP::Hep3Vector G4ThreeVector
G4double fLayerThickness
total thinkness of one calorimeter
void SetTranslation(const G4ThreeVector &v)
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:79
G4bool fConstructed
= fTotalThickness / fNumberOfLayers
void RemoveDaughter(const G4VPhysicalVolume *p)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetupBiasing()

void GB03DetectorConstruction::SetupBiasing ( )
private

Definition at line 315 of file GB03DetectorConstruction.cc.

316 {
318  biasingOperator->AttachTo(fLayerLogical);
319 }
void AttachTo(const G4LogicalVolume *)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetupDetectors()

void GB03DetectorConstruction::SetupDetectors ( )
private

Definition at line 266 of file GB03DetectorConstruction.cc.

267 {
269  G4String filterName;
270 
271  G4SDNeutralFilter* neutralFilter
272  = new G4SDNeutralFilter(filterName="neutralFilter");
273  G4SDChargedFilter* chargedFilter
274  = new G4SDChargedFilter(filterName="chargedFilter");
275 
276  for(G4int j=0;j<2;j++)
277  {
278  // Loop counter j = 0 : absorber
279  // = 1 : gap
280  G4String detName = fCalName;
281  if(j==0)
282  { detName += "_abs"; }
283  else
284  { detName += "_gap"; }
286 
287  // The second argument in each primitive means the "level" of geometrical
288  // hierarchy, the copy number of that level is used as the key of the
289  // G4THitsMap.
290  // For absorber (j = 0), the copy number of its own physical volume is used.
291  // For gap (j = 1), the copy number of its mother physical volume is used,
292  // since there is only one physical volume of gap is placed with respect
293  // to its mother.
294  G4VPrimitiveScorer* primitive;
295  primitive = new G4PSEnergyDeposit("eDep",j);
296  det->RegisterPrimitive(primitive);
297  primitive = new G4PSFlatSurfaceFlux("nNeutral",1,j);
298  primitive->SetFilter(neutralFilter);
299  det->RegisterPrimitive(primitive);
300  primitive = new G4PSFlatSurfaceFlux("nCharged",1,j);
301  primitive->SetFilter(chargedFilter);
302  det->RegisterPrimitive(primitive);
303 
304  if(j==0)
306  else
308 
309  }
311 }
G4bool RegisterPrimitive(G4VPrimitiveScorer *)
void SetVerboseLevel(G4int vl)
Definition: G4SDManager.hh:90
void SetFilter(G4VSDFilter *f)
int G4int
Definition: G4Types.hh:78
void SetSensitiveDetector(const G4String &logVolName, G4VSensitiveDetector *aSD, G4bool multi=false)
static G4SDManager * GetSDMpointer()
Definition: G4SDManager.cc:40
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetupGeometry()

void GB03DetectorConstruction::SetupGeometry ( )
private

Definition at line 216 of file GB03DetectorConstruction.cc.

217 {
218  //
219  // World
220  //
221  G4VSolid* worldSolid = new G4Box("World",2.*m,2.*m,fTotalThickness*2.);
222  fWorldLogical = new G4LogicalVolume(worldSolid,fWorldMaterial,"World");
224  0,false,0);
225 
226  //
227  // Calorimeter
228  //
229  G4VSolid* calorSolid = new G4Box("Calor",0.5*m,0.5*m,fTotalThickness/2.);
231  fCalorPhysical = new G4PVPlacement(0, G4ThreeVector(0.,0.,0.),
233 
234  //
235  // Layers --- as absorbers
236  //
237  fLayerSolid = new G4Box("Layer",0.5*m,0.5*m,fLayerThickness/2.);
243 
244  //
245  // Gap
246  //
247  fGapSolid = new G4Box("Gap",0.5*m,0.5*m,fLayerThickness/4.);
250  fGapLogical,fCalName+"_gap",fLayerLogical,false,0);
251 
252  //
253  // Visualization attributes
254  //
256  G4VisAttributes* simpleBoxVisAtt= new G4VisAttributes(G4Colour(1.0,1.0,1.0));
257  simpleBoxVisAtt->SetVisibility(true);
258  fCalorLogical->SetVisAttributes(simpleBoxVisAtt);
259  fLayerLogical->SetVisAttributes(simpleBoxVisAtt);
260  fGapLogical->SetVisAttributes(simpleBoxVisAtt);
261 
262 }
CLHEP::Hep3Vector G4ThreeVector
Definition: G4Box.hh:64
void SetVisibility(G4bool)
G4double fLayerThickness
total thinkness of one calorimeter
static const G4VisAttributes Invisible
static const double m
Definition: G4SIunits.hh:128
void SetVisAttributes(const G4VisAttributes *pVA)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetVerboseLevel()

void GB03DetectorConstruction::SetVerboseLevel ( G4int  val)
inline

Definition at line 62 of file GB03DetectorConstruction.hh.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ fAbsorberMaterial

G4Material* GB03DetectorConstruction::fAbsorberMaterial
private

Definition at line 82 of file GB03DetectorConstruction.hh.

◆ fCalName

G4String GB03DetectorConstruction::fCalName
private

Definition at line 79 of file GB03DetectorConstruction.hh.

◆ fCalorLogical

G4LogicalVolume* GB03DetectorConstruction::fCalorLogical
private

Definition at line 89 of file GB03DetectorConstruction.hh.

◆ fCalorPhysical

G4VPhysicalVolume* GB03DetectorConstruction::fCalorPhysical
private

Definition at line 94 of file GB03DetectorConstruction.hh.

◆ fConstructed

G4bool GB03DetectorConstruction::fConstructed
private

= fTotalThickness / fNumberOfLayers

Definition at line 76 of file GB03DetectorConstruction.hh.

◆ fConstructedSDandField

G4ThreadLocal G4bool GB03DetectorConstruction::fConstructedSDandField = false
staticprivate

Definition at line 77 of file GB03DetectorConstruction.hh.

◆ fDetectorMessenger

GB03DetectorMessenger* GB03DetectorConstruction::fDetectorMessenger
private

Definition at line 98 of file GB03DetectorConstruction.hh.

◆ fGapLogical

G4LogicalVolume* GB03DetectorConstruction::fGapLogical
private

Definition at line 91 of file GB03DetectorConstruction.hh.

◆ fGapMaterial

G4Material* GB03DetectorConstruction::fGapMaterial
private

Definition at line 83 of file GB03DetectorConstruction.hh.

◆ fGapPhysical

G4VPhysicalVolume* GB03DetectorConstruction::fGapPhysical
private

Definition at line 96 of file GB03DetectorConstruction.hh.

◆ fGapSolid

G4Box* GB03DetectorConstruction::fGapSolid
private

Definition at line 86 of file GB03DetectorConstruction.hh.

◆ fLayerLogical

G4LogicalVolume* GB03DetectorConstruction::fLayerLogical
private

Definition at line 90 of file GB03DetectorConstruction.hh.

◆ fLayerPhysical

G4PVReplica* GB03DetectorConstruction::fLayerPhysical
private

Definition at line 95 of file GB03DetectorConstruction.hh.

◆ fLayerSolid

G4Box* GB03DetectorConstruction::fLayerSolid
private

Definition at line 85 of file GB03DetectorConstruction.hh.

◆ fLayerThickness

G4double GB03DetectorConstruction::fLayerThickness
private

total thinkness of one calorimeter

Definition at line 74 of file GB03DetectorConstruction.hh.

◆ fNumberOfLayers

G4int GB03DetectorConstruction::fNumberOfLayers = 40
staticprivate

Definition at line 71 of file GB03DetectorConstruction.hh.

◆ fTotalThickness

G4double GB03DetectorConstruction::fTotalThickness
private

Definition at line 73 of file GB03DetectorConstruction.hh.

◆ fVerboseLevel

G4int GB03DetectorConstruction::fVerboseLevel
private

Definition at line 100 of file GB03DetectorConstruction.hh.

◆ fWorldLogical

G4LogicalVolume* GB03DetectorConstruction::fWorldLogical
private

Definition at line 88 of file GB03DetectorConstruction.hh.

◆ fWorldMaterial

G4Material* GB03DetectorConstruction::fWorldMaterial
private

Definition at line 81 of file GB03DetectorConstruction.hh.

◆ fWorldPhysical

G4VPhysicalVolume* GB03DetectorConstruction::fWorldPhysical
private

Definition at line 93 of file GB03DetectorConstruction.hh.


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