34 #include "DetectorConstruction.hh"
35 #include "DetectorMessenger.hh"
60 fDefaultMaterial(0),fSolidWorld(0),fLogicWorld(0),fPhysiWorld(0),
61 fSolidCalor(0),fLogicCalor(0),fPhysiCalor(0),
62 fSolidLayer(0),fLogicLayer(0),fPhysiLayer(0),
67 fAbsorThickness[1] = 2.3*
mm;
68 fAbsorThickness[2] = 5.7*
mm;
70 fCalorSizeYZ = 40.*
cm;
71 ComputeCalorParameters();
87 delete fDetectorMessenger;
94 return ConstructCalorimeter();
99 void DetectorConstruction::DefineMaterials()
164 new G4Material(
"Polystyrene", density= 1.032*
g/
cm3, ncomponents=2);
169 new G4Material(
"Scintillator", density= 1.032*
g/
cm3, ncomponents=2);
212 SiNx-> AddElement(Si, 300);
213 SiNx-> AddElement(N, 310);
214 SiNx-> AddElement(H, 6);
271 temperature = 2.73*
kelvin;
275 density = 1.e-5*
g/
cm3;
276 pressure = 2.e-2*
bar;
279 new G4Material(
"Beam", density, ncomponents=1,
288 void DetectorConstruction::ComputeCalorParameters()
291 fLayerThickness = 0.;
292 for (
G4int iAbs=1; iAbs<=fNbOfAbsor; iAbs++) {
293 fLayerThickness += fAbsorThickness[iAbs];
295 fCalorThickness = fNbOfLayers*fLayerThickness;
296 fWorldSizeX = 1.2*fCalorThickness;
297 fWorldSizeYZ = 1.2*fCalorSizeYZ;
305 ComputeCalorParameters();
317 fSolidWorld =
new G4Box(
"World",
318 fWorldSizeX/2,fWorldSizeYZ/2,fWorldSizeYZ/2);
335 fSolidCalor =
new G4Box(
"Calorimeter",
336 fCalorThickness/2,fCalorSizeYZ/2,fCalorSizeYZ/2);
354 fSolidLayer =
new G4Box(
"Layer",
355 fLayerThickness/2,fCalorSizeYZ/2,fCalorSizeYZ/2);
380 G4double xfront = -0.5*fLayerThickness;
381 for (
G4int k=1; k<=fNbOfAbsor; k++) {
382 fSolidAbsor[k] =
new G4Box(
"Absorber",
383 fAbsorThickness[k]/2,fCalorSizeYZ/2,fCalorSizeYZ/2);
387 fAbsorMaterial[k]->GetName());
389 G4double xcenter = xfront+0.5*fAbsorThickness[k];
390 xfront += fAbsorThickness[k];
394 fAbsorMaterial[k]->GetName(),
412 G4cout <<
"\n-------------------------------------------------------------"
413 <<
"\n ---> The calorimeter is " << fNbOfLayers <<
" layers of:";
414 for (
G4int i=1; i<=fNbOfAbsor; i++)
416 G4cout <<
"\n \t" << std::setw(12) << fAbsorMaterial[i]->
GetName() <<
": "
417 << std::setw(6) <<
G4BestUnit(fAbsorThickness[i],
"Length");
419 G4cout <<
"\n-------------------------------------------------------------\n";
422 for (
G4int j=1; j<=fNbOfAbsor; j++)
423 G4cout <<
"\n" << fAbsorMaterial[j] << G4endl;
425 G4cout <<
"\n-------------------------------------------------------------\n";
435 if (pttoMaterial) fDefaultMaterial = pttoMaterial;
446 {
G4cout <<
"\n --->warning from SetfNbOfLayers: "
447 << ival <<
" must be at least 1. Command refused" <<
G4endl;
461 {
G4cout <<
"\n ---> warning from SetfNbOfAbsor: "
462 << ival <<
" must be at least 1 and and most " <<
kMaxAbsor-1
463 <<
". Command refused" <<
G4endl;
477 if (ival > fNbOfAbsor || ival <= 0)
478 {
G4cout <<
"\n --->warning from SetAbsorMaterial: absor number "
479 << ival <<
" out of range. Command refused" <<
G4endl;
485 if (pttoMaterial) fAbsorMaterial[ival] = pttoMaterial;
495 if (ival > fNbOfAbsor || ival <= 0)
496 {
G4cout <<
"\n --->warning from SetAbsorThickness: absor number "
497 << ival <<
" out of range. Command refused" <<
G4endl;
501 {
G4cout <<
"\n --->warning from SetAbsorThickness: thickness "
502 << val <<
" out of range. Command refused" <<
G4endl;
505 fAbsorThickness[ival] = val;
516 {
G4cout <<
"\n --->warning from SetfCalorSizeYZ: thickness "
517 << val <<
" out of range. Command refused" <<
G4endl;
531 if ( fFieldMessenger.
Get() == 0 ) {
540 fFieldMessenger.
Put( msg );
G4IonisParamMat * GetIonisation() const
G4Material * FindOrBuildMaterial(const G4String &name, G4bool isotopes=true, G4bool warning=false)
void SetChemicalFormula(const G4String &chF)
static constexpr double mm
static constexpr double mg
CLHEP::Hep3Vector G4ThreeVector
void AddMaterial(G4Material *material, G4double fraction)
std::vector< ExP01TrackerHit * > a
int universe_mean_density
void SetMeanExcitationEnergy(G4double value)
static constexpr double perCent
const G4String & GetName() const
G4VPhysicalVolume * Construct()
void SetBirksConstant(G4double value)
void SetWorldMaterial(const G4String &)
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
static G4NistManager * Instance()
void SetNbOfLayers(G4int)
static G4PhysicalVolumeStore * GetInstance()
virtual void ConstructSDandField()
G4GLOB_DLL std::ostream G4cout
void PhysicsHasBeenModified()
void SetAbsorMaterial(G4int, const G4String &)
static constexpr double cm
void AddIsotope(G4Isotope *isotope, G4double RelativeAbundance)
static G4LogicalVolumeStore * GetInstance()
static G4SolidStore * GetInstance()
static constexpr double eV
static G4GeometryManager * GetInstance()
static constexpr double kelvin
static constexpr double cm3
void ReinitializeGeometry(G4bool destroyFirst=false, G4bool prop=true)
static G4RunManager * GetRunManager()
void SetCalorSizeYZ(G4double)
void SetAbsorThickness(G4int, G4double)
static constexpr double MeV
void OpenGeometry(G4VPhysicalVolume *vol=0)
void AddElement(G4Element *element, G4int nAtoms)
G4Material * ConstructNewGasMaterial(const G4String &name, const G4String &nameNist, G4double temp, G4double pres, G4bool isotopes=true)
static constexpr double bar
void PrintCalorParameters()
G4Element * FindOrBuildElement(G4int Z, G4bool isotopes=true)
void Put(const value_type &val) const
static constexpr double atmosphere
static constexpr double mole