34 #include "DetectorConstruction.hh"
35 #include "DetectorMessenger.hh"
67 fAbsorSizeX = fAbsorSizeYZ = 20*
cm;
68 fWorldSizeX = fWorldSizeYZ = 1.2*fAbsorSizeX;
87 delete fDetectorMessenger;
92 void DetectorConstruction::DefineMaterials()
106 G4double density, temperature, pressure;
107 G4int ncomponents, natoms;
118 BuildMaterialWithNewDensity(
"Water_1.05",
"G4_WATER",1.05*
g/
cm3);
125 density = 1.e-5*
g/
cm3;
126 pressure = 2.e-2*
bar;
134 temperature = 2.73*
kelvin;
140 fAbsorMaterial = H2O;
141 fWorldMaterial = vacuum;
151 sWorld =
new G4Box(
"World",
152 fWorldSizeX/2,fWorldSizeYZ/2,fWorldSizeYZ/2);
170 sAbsor =
new G4Box(
"Absorber",
171 fAbsorSizeX/2,fAbsorSizeYZ/2,fAbsorSizeYZ/2);
188 if (fTallyNumber > 0) {
189 for (
G4int j=0; j<fTallyNumber; ++j) {
192 fTallySize[j].
x()/2,fTallySize[j].y()/2,fTallySize[j].
z()/2);
204 fTallyMass[j] = fTallySize[j].
x()*fTallySize[j].
y()*fTallySize[j].
z()
222 G4cout <<
"\n---------------------------------------------------------\n";
223 G4cout <<
"---> The Absorber is " <<
G4BestUnit(fAbsorSizeX,
"Length")
225 G4cout <<
"\n---------------------------------------------------------\n";
227 if (fTallyNumber > 0) {
228 G4cout <<
"---> There are " << fTallyNumber <<
" tallies : " <<
G4endl;
229 for (
G4int j=0; j<fTallyNumber; ++j) {
230 G4cout <<
"fTally " << j <<
": "
232 <<
", mass = " <<
G4BestUnit(fTallyMass[j],
"Mass")
233 <<
" size = " <<
G4BestUnit(fTallySize[j],
"Length")
234 <<
" position = " <<
G4BestUnit(fTallyPosition[j],
"Length")
237 G4cout <<
"\n---------------------------------------------------------\n";
246 fWorldSizeX = 1.2*fAbsorSizeX;
253 fAbsorSizeYZ =
value;
254 fWorldSizeYZ = 1.2*fAbsorSizeYZ;
264 if (pttoMaterial && pttoMaterial != fAbsorMaterial) {
266 fAbsorMaterial = pttoMaterial;
267 for (
G4int j=0; j<fTallyNumber; ++j) {
270 fTallyMass[j] = fTallySize[j].
x()*fTallySize[j].
y()*fTallySize[j].
z()
288 if (pttoMaterial && pttoMaterial != fWorldMaterial) {
289 fWorldMaterial = pttoMaterial;
305 if (fMagField)
delete fMagField;
324 fTallyNumber =
value;
326 G4cout <<
"### DetectorConstruction::SetTallyNumber WARNING: wrong tally "
327 <<
"number " << value <<
" is ignored" <<
G4endl;
336 fTallySize[j] =
value;
338 G4cout <<
"### DetectorConstruction::SetTallyNumber WARNING: wrong tally "
339 <<
"number " << j <<
" is ignored" <<
G4endl;
348 fTallyPosition[j] =
value;
350 G4cout <<
"### DetectorConstruction::SetTallyPosition WARNING: wrong tally "
351 <<
"number " << j <<
" is ignored" <<
G4endl;
358 return fTallyMass[j];
360 G4cout <<
"### DetectorConstruction::GetTallyMass WARNING: wrong tally "
361 <<
"number " << j <<
" is ignored" <<
G4endl;
371 G4cout <<
"### DetectorConstruction::GetLOgicalTally WARNING: wrong tally "
372 <<
"number " << j <<
" is ignored" <<
G4endl;
G4IonisParamMat * GetIonisation() const
G4Material * FindOrBuildMaterial(const G4String &name, G4bool isotopes=true, G4bool warning=false)
static constexpr double mg
CLHEP::Hep3Vector G4ThreeVector
G4bool SetDetectorField(G4Field *detectorField)
void AddMaterial(G4Material *material, G4double fraction)
std::vector< ExP01TrackerHit * > a
int universe_mean_density
void SetMeanExcitationEnergy(G4double value)
const G4String & GetName() const
G4VPhysicalVolume * Construct()
static G4MaterialTable * GetMaterialTable()
G4double GetDensity() const
void SetWorldMaterial(const G4String &)
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
static G4NistManager * Instance()
G4GLOB_DLL std::ostream G4cout
const XML_Char int const XML_Char * value
void PhysicsHasBeenModified()
static constexpr double cm
static constexpr double eV
static constexpr double kelvin
static constexpr double cm3
static G4TransportationManager * GetTransportationManager()
G4FieldManager * GetFieldManager() const
void SetTallyPosition(G4int, const G4ThreeVector &)
static G4RunManager * GetRunManager()
void SetMagField(G4double)
void SetTallySize(G4int, const G4ThreeVector &)
const G4LogicalVolume * GetLogicalTally(G4int n) const
void AddElement(G4Element *element, G4int nAtoms)
static constexpr double bar
void CreateChordFinder(G4MagneticField *detectorMagField)
void SetMaterial(G4Material *pMaterial)
void SetTallyNumber(G4int)
static constexpr double mole
G4double GetTallyMass(G4int n) const
void SetMaterial(G4String)