56 fSolidWorld(0), fLogicWorld(0), fPhysiWorld(0),
57 fSolidTarget(0), fLogicTarget(0), fPhysiTarget(0),
58 fSolidDetector(0),fLogicDetector(0),fPhysiDetector(0),
59 fDetectorMessenger(0),
61 fDefaultMater(0),fTargetMater(0),fDetectorMater(0),
62 fTargetLength (1.*
cm), fTargetRadius(0.5*
cm),
63 fDetectorLength(5.0 *
cm), fDetectorThickness(2.0 *
cm),
64 fWorldLength (std::
max(fTargetLength,fDetectorLength)),
65 fWorldRadius (fTargetRadius + fDetectorThickness),
66 fTargetRegion(0), fDetectorRegion(0)
76 delete fDetectorMessenger;
81 void exrdmDetectorConstruction::DefineMaterials()
96 fDefaultMater = fMaterialsManager->
GetMaterial(
"Air");
97 fTargetMater = fMaterialsManager->
GetMaterial(
"CsI");
98 fDetectorMater = fMaterialsManager->
GetMaterial(
"Germanium");
108 fWorldLength =
std::max(fTargetLength,fDetectorLength);
109 fWorldRadius = fTargetRadius + fDetectorThickness;
115 fSolidWorld=
new G4Tubs(
"world",0.,fWorldRadius,fWorldLength/2.,0.,
twopi);
116 fLogicWorld=
new G4LogicalVolume( fSolidWorld, fDefaultMater,
"World", 0, 0, 0);
134 fSolidTarget =
new G4Tubs(
"target",0.,fTargetRadius,fTargetLength/2.,0.,
twopi);
135 fLogicTarget =
new G4LogicalVolume(fSolidTarget,fTargetMater,
"Target",0,0,0);
153 fSolidDetector =
new G4Tubs(
"detector",fTargetRadius,fWorldRadius,
154 fDetectorLength/2.,0.,
twopi);
182 fTargetRegion =
new G4Region(
"Target");
183 fDetectorRegion =
new G4Region(
"Detector");
205 G4String command =
"/gps/pos/centre ";
206 std::ostringstream os;
211 command =
"/gps/position ";
228 {fTargetMater = pttoMaterial;
229 if (fLogicTarget) fLogicTarget->
SetMaterial(pttoMaterial);
230 G4cout <<
"\n----> The target has been changed to " << fTargetLength/
cm
232 << materialName <<
G4endl;
243 {fDetectorMater = pttoMaterial;
244 if (fLogicDetector) fLogicDetector->
SetMaterial(pttoMaterial);
245 G4cout <<
"\n----> The Deetctor has been changed to" << fDetectorLength/
cm
247 << materialName <<
G4endl;
G4Material * GetMaterial(G4int i)
Definition of the exrdmDetectorConstruction class.
virtual ~exrdmDetectorConstruction()
CLHEP::Hep3Vector G4ThreeVector
void AddRootLogicalVolume(G4LogicalVolume *lv)
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
exrdmDetectorConstruction()
void AddMaterial(G4String, G4String, G4double, G4String, G4double tem=CLHEP::STP_Temperature, G4double pres=CLHEP::STP_Pressure)
static G4UImanager * GetUIpointer()
Definition of the exrdmMaterial class.
G4GLOB_DLL std::ostream G4cout
void SetDetectorMaterial(G4String)
T max(const T t1, const T t2)
brief Return the largest of the two arguments
Definition of the exrdmDetectorMessenger class.
static const G4VisAttributes Invisible
void SetTargetMaterial(G4String)
void SetMaterial(G4Material *pMaterial)
void SetVisAttributes(const G4VisAttributes *pVA)
virtual G4VPhysicalVolume * Construct()
G4int ApplyCommand(const char *aCommand)