Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
RE06DetectorConstruction Class Reference

#include <RE06DetectorConstruction.hh>

Inheritance diagram for RE06DetectorConstruction:
G4VUserDetectorConstruction

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 66 of file RE06DetectorConstruction.cc.

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

Definition at line 105 of file RE06DetectorConstruction.cc.

106 { delete fDetectorMessenger;}

Member Function Documentation

void RE06DetectorConstruction::AddMaterial ( )

Definition at line 515 of file RE06DetectorConstruction.cc.

References test::a, G4Material::AddElement(), python.hepunit::atmosphere, python.hepunit::cm3, CO2, density, g(), G4Element::GetElement(), python.hepunit::kelvin, kStateGas, python.hepunit::mg, python.hepunit::mole, symbol, and z.

Referenced by RE06DetectorMessenger::SetNewValue().

516 {
517  static G4bool isAdded = false;
518 
519  if( isAdded ) return;
520 
521  G4String name, symbol; //a=mass of a mole;
522  G4double a, z, density; //z=mean number of protons;
523 
524  G4int ncomponents, natoms;
525 
526  //
527  // define simple materials
528  //
529 
530  new G4Material(name="Copper", z=29., a=63.546*g/mole, density=8.96*g/cm3);
531  new G4Material(name="Tungsten", z=74., a=183.84*g/mole, density=19.3*g/cm3);
532 
533  G4Element* C = G4Element::GetElement("Carbon");
534  G4Element* O = G4Element::GetElement("Oxygen");
535 
536 
537  G4Material* CO2 =
538  new G4Material("CarbonicGas", density= 27.*mg/cm3, ncomponents=2,
539  kStateGas, 325.*kelvin, 50.*atmosphere);
540  CO2->AddElement(C, natoms=1);
541  CO2->AddElement(O, natoms=2);
542 
543  isAdded = true;
544 
545 }
G4String symbol
Definition: TRTMaterials.hh:40
static G4Element * GetElement(G4String name, G4bool warning=true)
Definition: G4Element.cc:409
G4double z
Definition: TRTMaterials.hh:39
int atmosphere
Definition: hepunit.py:151
const XML_Char * name
int G4int
Definition: G4Types.hh:78
G4double density
Definition: TRTMaterials.hh:39
function g(Y1, Y2, PT2)
Definition: hijing1.383.f:5205
bool G4bool
Definition: G4Types.hh:79
void AddElement(G4Element *element, G4int nAtoms)
Definition: G4Material.cc:345
double G4double
Definition: G4Types.hh:76
G4Material * CO2
Definition: TRTMaterials.hh:81
G4VPhysicalVolume * RE06DetectorConstruction::Construct ( void  )
virtual

Implements G4VUserDetectorConstruction.

Definition at line 108 of file RE06DetectorConstruction.cc.

References GetVerboseLevel(), and PrintCalorParameters().

109 {
110 // if(!fConstructed)
111  {
112  fConstructed = true;
113  DefineMaterials();
114  SetupGeometry();
115  SetupDetectors();
116  }
117  if (GetVerboseLevel()>0) {
119  }
120  return fWorldPhysical;
121 }
void RE06DetectorConstruction::ConstructSDandField ( )
virtual

Reimplemented from G4VUserDetectorConstruction.

Definition at line 123 of file RE06DetectorConstruction.cc.

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

Definition at line 435 of file RE06DetectorConstruction.cc.

References G4Material::GetName().

Referenced by RE06DetectorMessenger::GetCurrentValue().

436 { return fAbsorberMaterial->GetName(); }
const G4String & GetName() const
Definition: G4Material.hh:176
G4String RE06DetectorConstruction::GetGapMaterial ( ) const

Definition at line 461 of file RE06DetectorConstruction.cc.

References G4Material::GetName().

Referenced by RE06DetectorMessenger::GetCurrentValue().

462 { return fGapMaterial->GetName(); }
const G4String & GetName() const
Definition: G4Material.hh:176
G4int RE06DetectorConstruction::GetNumberOfLayers ( ) const
inline

Definition at line 62 of file RE06DetectorConstruction.hh.

Referenced by RE06DetectorMessenger::GetCurrentValue().

62 { return fNumberOfLayers; }
G4int RE06DetectorConstruction::GetVerboseLevel ( ) const
inline

Definition at line 67 of file RE06DetectorConstruction.hh.

Referenced by Construct(), RE06DetectorMessenger::GetCurrentValue(), SetAbsorberMaterial(), and SetGapMaterial().

67 { return fVerboseLevel; }
G4bool RE06DetectorConstruction::IsSerial ( ) const
inline

Definition at line 63 of file RE06DetectorConstruction.hh.

Referenced by RE06DetectorMessenger::GetCurrentValue().

63 { return fSerial; }
void RE06DetectorConstruction::PrintCalorParameters ( ) const

Definition at line 393 of file RE06DetectorConstruction.cc.

References G4cout, G4endl, and G4Material::GetName().

Referenced by Construct(), SetAbsorberMaterial(), and SetGapMaterial().

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

Definition at line 409 of file RE06DetectorConstruction.cc.

References G4cerr, G4endl, G4RunManager::GeometryHasBeenModified(), G4Material::GetMaterial(), G4RunManager::GetRunManager(), GetVerboseLevel(), PrintCalorParameters(), and G4LogicalVolume::SetMaterial().

Referenced by RE06DetectorMessenger::SetNewValue().

410 {
411  // search the material by its name
412  G4Material* pttoMaterial = G4Material::GetMaterial(materialChoice);
413  if(pttoMaterial)
414  {
415  fAbsorberMaterial = pttoMaterial;
416  if(fConstructed) for(size_t i=0;i<3;i++)
417  {
418  fCalorLogical[i]->SetMaterial(fAbsorberMaterial);
419  fLayerLogical[i]->SetMaterial(fAbsorberMaterial);
420  }
422  if (GetVerboseLevel()>1) {
424  }
425  }
426  else
427  {
428  G4cerr
429  << materialChoice << " is not defined. - Command is ignored." << G4endl;
430  }
431 }
void GeometryHasBeenModified(G4bool prop=true)
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
Definition: G4Material.cc:578
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:74
#define G4endl
Definition: G4ios.hh:61
void SetMaterial(G4Material *pMaterial)
G4GLOB_DLL std::ostream G4cerr
void RE06DetectorConstruction::SetGapMaterial ( G4String  materialChoice)

Definition at line 440 of file RE06DetectorConstruction.cc.

References G4cerr, G4endl, G4RunManager::GeometryHasBeenModified(), G4Material::GetMaterial(), G4RunManager::GetRunManager(), GetVerboseLevel(), PrintCalorParameters(), and G4LogicalVolume::SetMaterial().

Referenced by RE06DetectorMessenger::SetNewValue().

441 {
442  // search the material by its name
443  G4Material* pttoMaterial = G4Material::GetMaterial(materialChoice);
444  if(pttoMaterial)
445  {
446  fGapMaterial = pttoMaterial;
447  if(fConstructed) for(size_t i=0;i<3;i++)
448  { fGapLogical[i]->SetMaterial(fGapMaterial); }
450  if (GetVerboseLevel()>1) {
452  }
453  }
454  else
455  {
456  G4cerr
457  << materialChoice << " is not defined. - Command is ignored." << G4endl;
458  }
459 }
void GeometryHasBeenModified(G4bool prop=true)
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
Definition: G4Material.cc:578
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:74
#define G4endl
Definition: G4ios.hh:61
void SetMaterial(G4Material *pMaterial)
G4GLOB_DLL std::ostream G4cerr
void RE06DetectorConstruction::SetNumberOfLayers ( G4int  nl)

Definition at line 493 of file RE06DetectorConstruction.cc.

References G4RunManager::GeometryHasBeenModified(), G4RunManager::GetRunManager(), kZAxis, G4LogicalVolume::RemoveDaughter(), G4VPhysicalVolume::SetTranslation(), and G4Box::SetZHalfLength().

Referenced by RE06DetectorMessenger::SetNewValue().

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

Definition at line 466 of file RE06DetectorConstruction.cc.

References G4RunManager::GeometryHasBeenModified(), G4VUserDetectorConstruction::GetParallelWorld(), G4RunManager::GetRunManager(), G4RunManager::GetUserPrimaryGeneratorAction(), python.hepunit::m, RE06PrimaryGeneratorAction::SetSerial(), and G4VPhysicalVolume::SetTranslation().

Referenced by RE06DetectorMessenger::SetNewValue().

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

Definition at line 68 of file RE06DetectorConstruction.hh.

Referenced by RE06DetectorMessenger::SetNewValue().

68 { fVerboseLevel = val; }

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