35 #include "DetectorConstruction.hh"
36 #include "DetectorMessenger.hh"
59 fTargetMater(0), fLogicTarget(0),
60 fDetectorMater(0), fLogicDetector(0),
61 fWorldMater(0), fPhysiWorld(0),
65 fTargetRadius = 0.5*
cm;
66 fDetectorLength = 5*
cm;
67 fDetectorThickness = 2*
cm;
69 fWorldLength =
std::max(fTargetLength,fDetectorLength);
70 fWorldRadius = fTargetRadius + fDetectorThickness;
80 {
delete fDetectorMessenger;}
86 return ConstructVolumes();
91 void DetectorConstruction::DefineMaterials()
131 fWorldLength =
std::max(fTargetLength,fDetectorLength);
132 fWorldRadius = fTargetRadius + fDetectorThickness;
135 sWorld =
new G4Tubs(
"World",
136 0.,fWorldRadius, 0.5*fWorldLength, 0.,
twopi);
154 sTarget =
new G4Tubs(
"Target",
155 0., fTargetRadius, 0.5*fTargetLength, 0.,
twopi);
173 sDetector =
new G4Tubs(
"Detector",
174 fTargetRadius, fWorldRadius, 0.5*fDetectorLength, 0.,
twopi);
202 <<
" Radius = " <<
G4BestUnit(fTargetRadius,
"Length")
203 <<
" Material = " << fTargetMater->
GetName();
205 <<
" Tickness = " <<
G4BestUnit(fDetectorThickness,
"Length")
207 G4cout <<
"\n" << fTargetMater <<
"\n" << fDetectorMater <<
G4endl;
219 fTargetMater = pttoMaterial;
220 if(fLogicTarget) { fLogicTarget->
SetMaterial(fTargetMater); }
223 G4cout <<
"\n--> warning from DetectorConstruction::SetTargetMaterial : "
224 << materialChoice <<
" not found" <<
G4endl;
237 fDetectorMater = pttoMaterial;
238 if(fLogicDetector) { fLogicDetector->
SetMaterial(fDetectorMater); }
241 G4cout <<
"\n--> warning from DetectorConstruction::SetDetectorMaterial : "
242 << materialChoice <<
" not found" <<
G4endl;
250 fTargetRadius =
value;
258 fTargetLength =
value;
266 fDetectorThickness =
value;
274 fDetectorLength =
value;
282 return fTargetLength;
289 return fTargetRadius;
310 return fDetectorLength;
317 return fDetectorThickness;
324 return fDetectorMater;
331 return fLogicDetector;
void SetDetectorMaterial(G4String)
void SetTargetLength(G4double val)
G4Material * FindOrBuildMaterial(const G4String &name, G4bool isotopes=true, G4bool warning=false)
G4LogicalVolume * GetLogicTarget()
void SetDetectorThickness(G4double value)
static constexpr double mg
CLHEP::Hep3Vector G4ThreeVector
const G4String & GetName() const
G4VPhysicalVolume * Construct()
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
G4double GetTargetRadius()
static G4NistManager * Instance()
static constexpr double twopi
static G4PhysicalVolumeStore * GetInstance()
G4GLOB_DLL std::ostream G4cout
const XML_Char int const XML_Char * value
G4Material * GetDetectorMaterial()
void PhysicsHasBeenModified()
static constexpr double cm
void SetDetectorLength(G4double value)
static G4LogicalVolumeStore * GetInstance()
static G4SolidStore * GetInstance()
static G4GeometryManager * GetInstance()
G4double GetDetectorLength()
static constexpr double kelvin
void SetTargetMaterial(const G4String &)
static constexpr double cm3
void ReinitializeGeometry(G4bool destroyFirst=false, G4bool prop=true)
static G4RunManager * GetRunManager()
T max(const T t1, const T t2)
brief Return the largest of the two arguments
void SetTargetRadius(G4double val)
void OpenGeometry(G4VPhysicalVolume *vol=0)
void AddElement(G4Element *element, G4int nAtoms)
G4double GetTargetLength()
void SetMaterial(G4Material *pMaterial)
static constexpr double atmosphere
static constexpr double mole
G4LogicalVolume * GetLogicDetector()
const G4Material * GetTargetMaterial() const
G4double GetDetectorThickness()