91 fAir(0), fAluminum(0), fPb(0), fXenon(0),
96 fReadFile =
"test.gdml";
97 fWriteFile=
"wtest.gdml";
110 if(fDetectorMessenger)
delete fDetectorMessenger;
123 if(fWritingChoice==0)
133 fParser.
Read(fReadFile);
149 else if(fWritingChoice==1)
181 fParser.
Write(fWriteFile, fWorldPhysVol);
210 G4Box * experimentalHallBox
211 =
new G4Box(
"ExpHallBox",fExpHall_x/50.,expHall_y,expHall_z);
216 experimentalHallLV,
"ExpHallPhys", 0,
false, 0);
221 = fParser.
ParseST(fStepFile,fAir,fAluminum);
226 "StepPhys", experimentalHallLV,
false, 0);
234 return fWorldPhysVol;
245 G4double density,temperature,pressure;
267 density = 1.29*
mg/
cm3;
268 fAir =
new G4Material(name=
"Air", density, ncomponents=2);
274 density = 2.70*
g/
cm3;
275 fAluminum =
new G4Material(name=
"Aluminum", density, ncomponents=1);
276 fAluminum->
AddElement(elAl, fractionmass=1.0);
310 G4Box * experimentalHallBox =
311 new G4Box(
"ExpHallBox", fExpHall_x, expHall_y, expHall_z);
316 "ExpHallPhys", 0,
false, 0);
320 const G4double det_x = fExpHall_x*0.8;
321 const G4double det_y = fExpHall_x*0.7;
326 G4Box * detectorBox =
327 new G4Box(
"detectorBox", det_x, det_y, det_z);
332 "detPhys", experimentalHallLV,
false, 0);
336 const G4double room_x = fExpHall_x/20.;
341 new G4Box(
"roomBox", room_x, room_y, room_z);
346 "roomPhys", experimentalHallLV,
false, 0);
350 const G4double bigL=fExpHall_x/5.+50.;
354 "PhysSubDetector1", detectorLV,
false, 0);
371 subDetectorLV1, detectorLV,
false, 0);
378 "PhysSubDetectorFirst3", detectorLV,
false, 0);
386 "AssemblyPhys", subDetectorLV4,
false, 0);
389 "PhysSubDetectorSecond3", detectorLV,
false, 0);
391 return experimentalHallPhys;
400 const G4double sub_x = fExpHall_x/5.;
406 new G4Tubs(
"subTub", 0., sub_x, sub_y, -90.*
deg, 180*
deg);
412 "AssemblyPhys", subTubLV,
false, 0);
422 const G4double sub_x = fExpHall_x/10.;
429 new G4Box(
"detHallBox", sub_x, sub_y, sub_z);
442 const G4double big_x = fExpHall_x/17;
449 new G4Box(
"OuterBox", big_x, big_y, big_z);
454 "OuterBoxPhys", 0,
false, 0);
463 new G4Box(
"BBox", bigL, bigL, bigL);
467 new G4Box(
"MBox", medL, medL, medL);
471 new G4Box(
"SBox", smalL, smalL, smalL);
479 "AlPhysBig", OuterBoxLV,
false, 0);
497 "AlPhysBigTube", SmallBoxLV,
false, 0);
534 assembly->
MakeImprint(OuterBoxLV, transform1, 0, 0);
545 const G4double chamber_x = fExpHall_x/12.;
546 const G4double chamber_y = chamber_x;
547 const G4double chamber_z = chamber_x;
551 G4Box * paramChamberBox =
552 new G4Box(
"ChamberBox", chamber_x, chamber_y, chamber_z);
558 G4int NbOfChambers = 5;
561 G4double fTrackerLength = (NbOfChambers+1)*ChamberSpacing;
562 G4double trackerSize = 0.5*fTrackerLength;
567 G4Box *solidChamber =
572 G4double firstPosition = -trackerSize + 0.5*ChamberWidth;
573 G4double firstLength = fTrackerLength/10;
574 G4double lastLength = fTrackerLength;
590 return paramChamberLV;
Definition of the G02DetectorMessenger class.
void MakeImprint(G4LogicalVolume *pMotherLV, G4ThreeVector &translationInMother, G4RotationMatrix *pRotationInMother, G4int copyNumBase=0, G4bool surfCheck=false)
static constexpr double mg
CLHEP::Hep3Vector G4ThreeVector
CLHEP::HepRotation G4RotationMatrix
Definition of the G02DetectorConstruction class.
void SetWriteFile(const G4String &File)
std::vector< ExP01TrackerHit * > a
G4VPhysicalVolume * ConstructDetector()
G4VPhysicalVolume * GetWorldVolume(const G4String &setupName="Default") const
static G4MaterialTable * GetMaterialTable()
G4LogicalVolume * ConstructParametrisationChamber()
static G4ReflectionFactory * Instance()
G4LogicalVolume * ConstructSubDetector1()
void SetReadFile(const G4String &File)
G4GLOB_DLL std::ostream G4cout
static constexpr double m
G4PhysicalVolumesPair Place(const G4Transform3D &transform3D, const G4String &name, G4LogicalVolume *LV, G4LogicalVolume *motherLV, G4bool isMany, G4int copyNo, G4bool surfCheck=false)
virtual G4VPhysicalVolume * Construct()
static constexpr double cm
Detector messenger class used in GDML read/write example.
void Write(const G4String &filename, const G4VPhysicalVolume *pvol=0, G4bool storeReferences=true, const G4String &SchemaLocation=G4GDML_DEFAULT_SCHEMALOCATION)
void SetStepFile(const G4String &File)
G02DetectorConstruction()
static constexpr double kelvin
G4LogicalVolume * ParseST(const G4String &name, G4Material *medium, G4Material *solid)
static constexpr double cm3
Chamber parametrisation used in the GDML read/write example.
G4LogicalVolume * GetLogicalVolume() const
void AddPlacedVolume(G4LogicalVolume *pPlacedVolume, G4ThreeVector &translation, G4RotationMatrix *rotation)
G4LogicalVolume * ConstructAssembly()
void Read(const G4String &filename, G4bool Validate=true)
G4LogicalVolume * ConstructSubDetector2()
void AddElement(G4Element *element, G4int nAtoms)
static constexpr double pi
~G02DetectorConstruction()
static constexpr double deg
static G4ElementTable * GetElementTable()
static constexpr double atmosphere
static constexpr double mole
void SetVisAttributes(const G4VisAttributes *pVA)
Definition of the G02ChamberParameterisation class.