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

#include <RE06DetectorConstruction.hh>

Inheritance diagram for RE06DetectorConstruction:
Collaboration diagram for RE06DetectorConstruction:

Public Member Functions

 RE06DetectorConstruction ()
 
virtual ~RE06DetectorConstruction ()
 
virtual G4VPhysicalVolumeConstruct ()
 
void ConstructSDandField ()
 
void PrintCalorParameters () const
 
void SetAbsorberMaterial (G4String materialChoice)
 
G4String GetAbsorberMaterial () const
 
void SetGapMaterial (G4String materialChoice)
 
G4String GetGapMaterial () const
 
void SetSerialGeometry (G4bool ser)
 
void SetNumberOfLayers (G4int nl)
 
G4int GetNumberOfLayers () const
 
G4bool IsSerial () const
 
void AddMaterial ()
 
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
 

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 45 of file RE06DetectorConstruction.hh.

Constructor & Destructor Documentation

RE06DetectorConstruction::RE06DetectorConstruction ( )

Definition at line 68 of file RE06DetectorConstruction.cc.

70  fNumberOfLayers(40),
71  fTotalThickness (2.0*m),
72  fLayerThickness(0.),
73  fConstructed(false),
74  fWorldMaterial(0),
75  fAbsorberMaterial(0),
76  fGapMaterial(0),
77  fLayerSolid(0),
78  fGapSolid(0),
79  fWorldLogical(0),
80  fWorldPhysical(0),
81  fSerial(false),
82  fDetectorMessenger(0),
83  fVerboseLevel(1)
84 {
85  fLayerThickness = fTotalThickness / fNumberOfLayers;
86 
87  for(size_t i=0;i<3;i++)
88  {
89  fCalorLogical[i] = 0;
90  fLayerLogical[i] = 0;
91  fGapLogical[i] = 0;
92  fCalorPhysical[i] = 0;
93  fLayerPhysical[i] = 0;
94  fGapPhysical[i] = 0;
95  }
96 
97  fCalName[0] = "Calor-A";
98  fCalName[1] = "Calor-B";
99  fCalName[2] = "Calor-C";
100 
101  fDetectorMessenger = new RE06DetectorMessenger(this);
102 }
static constexpr double m
Definition: G4SIunits.hh:129
RE06DetectorConstruction::~RE06DetectorConstruction ( )
virtual

Definition at line 106 of file RE06DetectorConstruction.cc.

107 { delete fDetectorMessenger;}

Member Function Documentation

void RE06DetectorConstruction::AddMaterial ( )

Definition at line 516 of file RE06DetectorConstruction.cc.

517 {
518  static G4bool isAdded = false;
519 
520  if( isAdded ) return;
521 
522  G4String name, symbol; //a=mass of a mole;
523  G4double a, z, density; //z=mean number of protons;
524 
525  G4int ncomponents, natoms;
526 
527  //
528  // define simple materials
529  //
530 
531  new G4Material(name="Copper", z=29., a=63.546*g/mole, density=8.96*g/cm3);
532  new G4Material(name="Tungsten", z=74., a=183.84*g/mole, density=19.3*g/cm3);
533 
534  G4Element* C = G4Element::GetElement("Carbon");
535  G4Element* O = G4Element::GetElement("Oxygen");
536 
537 
538  G4Material* CO2 =
539  new G4Material("CarbonicGas", density= 27.*mg/cm3, ncomponents=2,
540  kStateGas, 325.*kelvin, 50.*atmosphere);
541  CO2->AddElement(C, natoms=1);
542  CO2->AddElement(O, natoms=2);
543 
544  isAdded = true;
545 
546 }
const XML_Char * name
Definition: expat.h:151
static constexpr double mg
Definition: G4SIunits.hh:184
static G4Element * GetElement(G4String name, G4bool warning=true)
Definition: G4Element.cc:412
std::vector< ExP01TrackerHit * > a
Definition: ExP01Classes.hh:33
double C(double temp)
int G4int
Definition: G4Types.hh:78
function g(Y1, Y2, PT2)
Definition: hijing1.383.f:5205
bool G4bool
Definition: G4Types.hh:79
static constexpr double kelvin
Definition: G4SIunits.hh:281
static constexpr double cm3
Definition: G4SIunits.hh:121
tuple z
Definition: test.py:28
void AddElement(G4Element *element, G4int nAtoms)
Definition: G4Material.cc:362
double G4double
Definition: G4Types.hh:76
static constexpr double atmosphere
Definition: G4SIunits.hh:237
static constexpr double mole
Definition: G4SIunits.hh:286

Here is the call graph for this function:

Here is the caller graph for this function:

G4VPhysicalVolume * RE06DetectorConstruction::Construct ( void  )
virtual

Implements G4VUserDetectorConstruction.

Definition at line 109 of file RE06DetectorConstruction.cc.

110 {
111  if(!fConstructed)
112  {
113  fConstructed = true;
114  DefineMaterials();
115  SetupGeometry();
116  }
117  if (GetVerboseLevel()>0) {
119  }
120  return fWorldPhysical;
121 }

Here is the call graph for this function:

void RE06DetectorConstruction::ConstructSDandField ( )
virtual

Reimplemented from G4VUserDetectorConstruction.

Definition at line 123 of file RE06DetectorConstruction.cc.

124 {
125  if(!fConstructedSDandField)
126  {
127  fConstructedSDandField = true;
128  SetupDetectors();
129  }
130 }
G4String RE06DetectorConstruction::GetAbsorberMaterial ( ) const

Definition at line 436 of file RE06DetectorConstruction.cc.

437 { 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:

G4String RE06DetectorConstruction::GetGapMaterial ( ) const

Definition at line 462 of file RE06DetectorConstruction.cc.

463 { 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:

G4int RE06DetectorConstruction::GetNumberOfLayers ( ) const
inline

Definition at line 62 of file RE06DetectorConstruction.hh.

62 { return fNumberOfLayers; }

Here is the caller graph for this function:

G4int RE06DetectorConstruction::GetVerboseLevel ( ) const
inline

Definition at line 67 of file RE06DetectorConstruction.hh.

67 { return fVerboseLevel; }

Here is the caller graph for this function:

G4bool RE06DetectorConstruction::IsSerial ( ) const
inline

Definition at line 63 of file RE06DetectorConstruction.hh.

63 { return fSerial; }

Here is the caller graph for this function:

void RE06DetectorConstruction::PrintCalorParameters ( ) const

Definition at line 394 of file RE06DetectorConstruction.cc.

395 {
396  G4cout
397  << "--------------------------------------------------------" << G4endl;
398  if(fSerial)
399  { G4cout << " Calorimeters are placed in serial." << G4endl; }
400  else
401  { G4cout << " Calorimeters are placed in parallel." << G4endl; }
402  G4cout
403  << " Absorber is made of " << fAbsorberMaterial->GetName() << G4endl
404  << " Gap is made of " << fGapMaterial->GetName() << G4endl
405  << "--------------------------------------------------------" << G4endl;
406 }
const G4String & GetName() const
Definition: G4Material.hh:178
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

Here is the caller graph for this function:

void RE06DetectorConstruction::SetAbsorberMaterial ( G4String  materialChoice)

Definition at line 410 of file RE06DetectorConstruction.cc.

411 {
412  // search the material by its name
413  G4Material* pttoMaterial = G4Material::GetMaterial(materialChoice);
414  if(pttoMaterial)
415  {
416  fAbsorberMaterial = pttoMaterial;
417  if(fConstructed) for(size_t i=0;i<3;i++)
418  {
419  fCalorLogical[i]->SetMaterial(fAbsorberMaterial);
420  fLayerLogical[i]->SetMaterial(fAbsorberMaterial);
421  }
423  if (GetVerboseLevel()>1) {
425  }
426  }
427  else
428  {
429  G4cerr
430  << materialChoice << " is not defined. - Command is ignored." << G4endl;
431  }
432 }
void GeometryHasBeenModified(G4bool prop=true)
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
Definition: G4Material.cc:602
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:79
#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:

void RE06DetectorConstruction::SetGapMaterial ( G4String  materialChoice)

Definition at line 441 of file RE06DetectorConstruction.cc.

442 {
443  // search the material by its name
444  G4Material* pttoMaterial = G4Material::GetMaterial(materialChoice);
445  if(pttoMaterial)
446  {
447  fGapMaterial = pttoMaterial;
448  if(fConstructed) for(size_t i=0;i<3;i++)
449  { fGapLogical[i]->SetMaterial(fGapMaterial); }
451  if (GetVerboseLevel()>1) {
453  }
454  }
455  else
456  {
457  G4cerr
458  << materialChoice << " is not defined. - Command is ignored." << G4endl;
459  }
460 }
void GeometryHasBeenModified(G4bool prop=true)
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
Definition: G4Material.cc:602
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:79
#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:

void RE06DetectorConstruction::SetNumberOfLayers ( G4int  nl)

Definition at line 494 of file RE06DetectorConstruction.cc.

495 {
496  fNumberOfLayers = nl;
497  fLayerThickness = fTotalThickness/fNumberOfLayers;
498  if(!fConstructed) return;
499 
500  fLayerSolid->SetZHalfLength(fLayerThickness/2.);
501  fGapSolid->SetZHalfLength(fLayerThickness/4.);
502  for(size_t i=0;i<3;i++)
503  {
504  fCalorLogical[i]->RemoveDaughter(fLayerPhysical[i]);
505  delete fLayerPhysical[i];
506  fLayerPhysical[i]
507  = new G4PVReplica(fCalName[i]+"_Layer",fLayerLogical[i],fCalorLogical[i],
508  kZAxis,fNumberOfLayers,fLayerThickness);
509  fGapPhysical[i]->SetTranslation(G4ThreeVector(0.,0.,fLayerThickness/4.));
510  }
512 }
void GeometryHasBeenModified(G4bool prop=true)
void SetZHalfLength(G4double dz)
Definition: G4Box.cc:174
CLHEP::Hep3Vector G4ThreeVector
void SetTranslation(const G4ThreeVector &v)
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:79
void RemoveDaughter(const G4VPhysicalVolume *p)

Here is the call graph for this function:

Here is the caller graph for this function:

void RE06DetectorConstruction::SetSerialGeometry ( G4bool  ser)

Definition at line 467 of file RE06DetectorConstruction.cc.

468 {
469  if(fSerial==serial) return;
470  fSerial=serial;
473  if(gen) gen->SetSerial(fSerial);
474  if(!fConstructed) return;
475  for(G4int i=0;i<3;i++)
476  {
477  if(fSerial)
478  {
479  fCalorPhysical[i]
480  ->SetTranslation(G4ThreeVector(0.,0.,G4double(i-1)*2.*m));
481  }
482  else
483  {
484  fCalorPhysical[i]
485  ->SetTranslation(G4ThreeVector(0.,G4double(i-1)*m,0.));
486  }
487  }
490 }
void GeometryHasBeenModified(G4bool prop=true)
const G4VUserPrimaryGeneratorAction * GetUserPrimaryGeneratorAction() const
CLHEP::Hep3Vector G4ThreeVector
int G4int
Definition: G4Types.hh:78
static constexpr double m
Definition: G4SIunits.hh:129
void SetTranslation(const G4ThreeVector &v)
G4VUserParallelWorld * GetParallelWorld(G4int i) const
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:79
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

Here is the caller graph for this function:

void RE06DetectorConstruction::SetVerboseLevel ( G4int  val)
inline

Definition at line 68 of file RE06DetectorConstruction.hh.

68 { fVerboseLevel = val; }

Here is the caller graph for this function:


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