Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-23 09:22:36

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 // g
0026 /// \file persistency/gdml/G02/src/G02DetectorConstruction.cc
0027 /// \brief Implementation of the G02DetectorConstruction class
0028 //
0029 //
0030 //
0031 // Class G02DetectorConstruction implementation
0032 //
0033 // ----------------------------------------------------------------------------
0034 
0035 #include "G02DetectorConstruction.hh"
0036 
0037 // Geant4 includes
0038 //
0039 #include "G4GeometryManager.hh"
0040 #include "G4VisAttributes.hh"
0041 #include "globals.hh"
0042 
0043 // Materials
0044 //
0045 #include "G4Material.hh"
0046 
0047 // Geometry includes
0048 //
0049 #include "G4Box.hh"
0050 #include "G4LogicalVolume.hh"
0051 #include "G4PVParameterised.hh"
0052 #include "G4PVPlacement.hh"
0053 #include "G4Tubs.hh"
0054 #include "G4VPhysicalVolume.hh"
0055 
0056 // Reflected solids
0057 //
0058 #include "G4AffineTransform.hh"
0059 #include "G4DisplacedSolid.hh"
0060 #include "G4ReflectedSolid.hh"
0061 #include "G4ReflectionFactory.hh"
0062 #include "G4RotationMatrix.hh"
0063 #include "G4Transform3D.hh"
0064 
0065 // Assembly volumes
0066 //
0067 #include "G4AssemblyVolume.hh"
0068 
0069 // Volume parameterisations
0070 //
0071 #include "G02ChamberParameterisation.hh"
0072 
0073 // Messenger
0074 //
0075 #include "G02DetectorMessenger.hh"
0076 
0077 // GDML parser include
0078 //
0079 #include "G4GDMLParser.hh"
0080 #include "G4PhysicalConstants.hh"
0081 #include "G4SystemOfUnits.hh"
0082 
0083 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0084 //
0085 // Constructor
0086 //
0087 G02DetectorConstruction::G02DetectorConstruction()
0088   : G4VUserDetectorConstruction(), fAir(0), fAluminum(0), fPb(0), fXenon(0), fDetectorMessenger(0)
0089 {
0090   fExpHall_x = 5. * m;
0091 
0092   fReadFile = "test.gdml";
0093   fWriteFile = "wtest.gdml";
0094   fStepFile = "mbb";
0095   fWritingChoice = 1;
0096 
0097   fDetectorMessenger = new G02DetectorMessenger(this);
0098 }
0099 
0100 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0101 //
0102 // Destructor
0103 //
0104 G02DetectorConstruction::~G02DetectorConstruction()
0105 {
0106   if (fDetectorMessenger) delete fDetectorMessenger;
0107 }
0108 
0109 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0110 //
0111 // Constructs geometries and materials
0112 //
0113 G4VPhysicalVolume* G02DetectorConstruction::Construct()
0114 {
0115   // Writing or Reading of Geometry using G4GDML
0116 
0117   G4VPhysicalVolume* fWorldPhysVol;
0118 
0119   if (fWritingChoice == 0) {
0120     // **** LOOK HERE*** FOR READING GDML FILES
0121     //
0122 
0123     // ACTIVATING OVERLAP CHECK when read volumes are placed.
0124     // Can take long time in case of complex geometries
0125     //
0126     // fParser.SetOverlapCheck(true);
0127 
0128     fParser.Read(fReadFile);
0129 
0130     // READING GDML FILES OPTION: 2nd Boolean argument "Validate".
0131     // Flag to "false" disables check with the Schema when reading GDML file.
0132     // See the GDML Documentation for more information.
0133     //
0134     // fParser.Read(fReadFile,false);
0135 
0136     // Prints the material information
0137     //
0138     G4cout << *(G4Material::GetMaterialTable()) << G4endl;
0139 
0140     // Giving World Physical Volume from GDML Parser
0141     //
0142     fWorldPhysVol = fParser.GetWorldVolume();
0143   }
0144   else if (fWritingChoice == 1) {
0145     // **** LOOK HERE*** FOR WRITING GDML FILES
0146     // Detector Construction and WRITING to GDML
0147     //
0148     ListOfMaterials();
0149     fWorldPhysVol = ConstructDetector();
0150 
0151     // OPTION: TO ADD MODULE AT DEPTH LEVEL ...
0152     //
0153     // Can be a integer or a pointer to the top Physical Volume:
0154     //
0155     // G4int depth=1;
0156     // fParser.AddModule(depth);
0157 
0158     // OPTION: SETTING ADDITION OF POINTER TO NAME TO FALSE
0159     //
0160     // By default, written names in GDML consist of the given name with
0161     // appended the pointer reference to it, in order to make it unique.
0162     // Naming policy can be changed by using the following method, or
0163     // calling Write with additional Boolean argument to "false".
0164     // NOTE: you have to be sure not to have duplication of names in your
0165     //       Geometry Setup.
0166     //
0167     // fParser.SetAddPointerToName(false);
0168     //
0169     // or
0170     //
0171     // fParser.Write(fWriteFile, fWorldPhysVol, false);
0172 
0173     // OPTION: SET MAXIMUM LEVEL TO EXPORT (REDUCED TREE)...
0174     //
0175     // Can be a integer greater than zero:
0176     //
0177     // G4int maxlevel=3;
0178     // fParser.SetMaxExportLevel(maxlevel);
0179 
0180     // Writing Geometry to GDML File
0181     //
0182     fParser.Write(fWriteFile, fWorldPhysVol);
0183 
0184     // OPTION: SPECIFYING THE SCHEMA LOCATION
0185     //
0186     // When writing GDML file the default the Schema Location from the
0187     // GDML web site will be used:
0188     // "http://cern.ch/service-spi/app/releases/GDML/schema/gdml.xsd"
0189     //
0190     // NOTE: GDML Schema is distributed in Geant4 in the directory:
0191     //    $G4INSTALL/source/persistency/gdml/schema
0192     //
0193     // You can change the Schema path by adding a parameter to the Write
0194     // command, as follows:
0195     //
0196     // fParser.Write(fWriteFile, fWorldPhysVol, "your-path-to-schema/gdml.xsd");
0197   }
0198   else  // Demonstration how to Read STEP files using GDML
0199   {
0200     // Some printout...
0201     //
0202     ListOfMaterials();
0203 
0204     // Arbitrary values that should enclose any reasonable geometry
0205     //
0206     const G4double expHall_y = fExpHall_x / 50.;
0207     const G4double expHall_z = fExpHall_x / 50.;
0208 
0209     // Create the hall
0210     //
0211     G4Box* experimentalHallBox = new G4Box("ExpHallBox", fExpHall_x / 50., expHall_y, expHall_z);
0212     G4LogicalVolume* experimentalHallLV =
0213       new G4LogicalVolume(experimentalHallBox, fAir, "ExpHallLV");
0214     fWorldPhysVol = new G4PVPlacement(0, G4ThreeVector(0.0, 0.0, 0.0), experimentalHallLV,
0215                                       "ExpHallPhys", 0, false, 0);
0216 
0217     // G02DetectorConstruction via reading STEP File
0218     //
0219     G4LogicalVolume* LogicalVolST = fParser.ParseST(fStepFile, fAir, fAluminum);
0220 
0221     // Placement inside of the hall
0222     //
0223     new G4PVPlacement(0, G4ThreeVector(10.0, 0.0, 0.0), LogicalVolST, "StepPhys",
0224                       experimentalHallLV, false, 0);
0225   }
0226 
0227   // Set Visualization attributes to world
0228   //
0229   G4VisAttributes* BoxVisAtt = new G4VisAttributes(G4Colour(1.0, 1.0, 1.0));
0230   fWorldPhysVol->GetLogicalVolume()->SetVisAttributes(BoxVisAtt);
0231 
0232   return fWorldPhysVol;
0233 }
0234 
0235 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0236 //
0237 // Utility to build and list necessary materials
0238 //
0239 void G02DetectorConstruction::ListOfMaterials()
0240 {
0241   G4double a;  // atomic mass
0242   G4double z;  // atomic number
0243   G4double density, temperature, pressure;
0244   G4double fractionmass;
0245   G4String name, symbol;
0246   G4int ncomponents;
0247 
0248   // Elements needed for the materials
0249 
0250   a = 14.01 * g / mole;
0251   G4Element* elN = new G4Element(name = "Nitrogen", symbol = "N", z = 7., a);
0252 
0253   a = 16.00 * g / mole;
0254   G4Element* elO = new G4Element(name = "Oxygen", symbol = "O", z = 8., a);
0255 
0256   a = 26.98 * g / mole;
0257   G4Element* elAl = new G4Element(name = "Aluminum", symbol = "Al", z = 13., a);
0258 
0259   // Print the Element information
0260   //
0261   G4cout << *(G4Element::GetElementTable()) << G4endl;
0262 
0263   // Air
0264   //
0265   density = 1.29 * mg / cm3;
0266   fAir = new G4Material(name = "Air", density, ncomponents = 2);
0267   fAir->AddElement(elN, fractionmass = 0.7);
0268   fAir->AddElement(elO, fractionmass = 0.3);
0269 
0270   // Aluminum
0271   //
0272   density = 2.70 * g / cm3;
0273   fAluminum = new G4Material(name = "Aluminum", density, ncomponents = 1);
0274   fAluminum->AddElement(elAl, fractionmass = 1.0);
0275 
0276   // Lead
0277   //
0278   fPb = new G4Material("Lead", z = 82., a = 207.19 * g / mole, density = 11.35 * g / cm3);
0279 
0280   // Xenon gas
0281   //
0282   fXenon = new G4Material("XenonGas", z = 54., a = 131.29 * g / mole, density = 5.458 * mg / cm3,
0283                           kStateGas, temperature = 293.15 * kelvin, pressure = 1 * atmosphere);
0284 
0285   // Prints the material information
0286   //
0287   G4cout << *(G4Material::GetMaterialTable()) << G4endl;
0288 }
0289 
0290 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0291 //
0292 // Detector Construction
0293 //
0294 // Detector consist from DetectorBox, Conrol Room and 4 SubDetectors
0295 // SubDetectors1 and 2 show how to use Reflection Factory and Assembly
0296 // SubDetectors 3 and 4 show how to use Parameterisation
0297 //
0298 G4VPhysicalVolume* G02DetectorConstruction::ConstructDetector()
0299 {
0300   // Arbitary values that should enclose any reasonable geometry
0301   //
0302   const G4double expHall_y = fExpHall_x;
0303   const G4double expHall_z = fExpHall_x;
0304 
0305   // Create the hall
0306   //
0307   G4Box* experimentalHallBox = new G4Box("ExpHallBox", fExpHall_x, expHall_y, expHall_z);
0308   G4LogicalVolume* experimentalHallLV = new G4LogicalVolume(experimentalHallBox, fAir, "ExpHallLV");
0309   G4PVPlacement* experimentalHallPhys = new G4PVPlacement(
0310     0, G4ThreeVector(0.0, 0.0, 0.0), experimentalHallLV, "ExpHallPhys", 0, false, 0);
0311 
0312   // G02DetectorConstruction
0313 
0314   const G4double det_x = fExpHall_x * 0.8;
0315   const G4double det_y = fExpHall_x * 0.7;
0316   const G4double det_z = det_y;
0317 
0318   // Create the detector box
0319   //
0320   G4Box* detectorBox = new G4Box("detectorBox", det_x, det_y, det_z);
0321   G4LogicalVolume* detectorLV = new G4LogicalVolume(detectorBox, fAir, "detLV");
0322   // G4PVPlacement * detectorPhys =
0323   new G4PVPlacement(0, G4ThreeVector(0.0, 0.0, 0.0), detectorLV, "detPhys", experimentalHallLV,
0324                     false, 0);
0325 
0326   // Create the Control room box
0327   //
0328   const G4double room_x = fExpHall_x / 20.;
0329   const G4double room_y = room_x;
0330   const G4double room_z = room_x;
0331 
0332   G4Box* roomBox = new G4Box("roomBox", room_x, room_y, room_z);
0333   G4LogicalVolume* roomLV = new G4LogicalVolume(roomBox, fAir, "roomLV");
0334   // G4PVPlacement * roomPhys =
0335   new G4PVPlacement(0, G4ThreeVector(fExpHall_x - room_x - 10., 0.0, 0.0), roomLV, "roomPhys",
0336                     experimentalHallLV, false, 0);
0337 
0338   // SubDetector1
0339   //
0340   const G4double bigL = fExpHall_x / 5. + 50.;
0341   G4LogicalVolume* subDetectorLV1 = ConstructSubDetector1();
0342   // G4PVPlacement * detPhys1 =
0343   new G4PVPlacement(0, G4ThreeVector(bigL, 0.0, 0.0), subDetectorLV1, "PhysSubDetector1",
0344                     detectorLV, false, 0);
0345 
0346   //
0347   // LOOK HERE FOR REFLECTIONS
0348   //
0349 
0350   // SubDetector2
0351   //
0352   G4Translate3D translation(-bigL, 0., 0.);
0353   G4RotationMatrix* rotD3 = new G4RotationMatrix();
0354   G4Transform3D rotation = G4Rotate3D(*rotD3);
0355   G4ReflectX3D reflection;
0356   G4Transform3D transform = translation * rotation * reflection;
0357 
0358   // Place the reflected part using G4ReflectionFactory
0359   //
0360   G4ReflectionFactory::Instance()->Place(transform, "reflSubDetector", subDetectorLV1, detectorLV,
0361                                          false, 0);
0362 
0363   // SubDetector3
0364   //
0365   G4LogicalVolume* subDetectorLV3 = ConstructSubDetector2();
0366   // G4PVPlacement * detPhys3 =
0367   new G4PVPlacement(0, G4ThreeVector(0.0, bigL, 0.0), subDetectorLV3, "PhysSubDetectorFirst3",
0368                     detectorLV, false, 0);
0369 
0370   // SubDetector4, placement of parameterised chambers
0371   //
0372   G4LogicalVolume* subDetectorLV4 = ConstructSubDetector2();
0373   G4LogicalVolume* subChamberLV = ConstructParametrisationChamber();
0374   // G4PVPlacement * detChamb =
0375   new G4PVPlacement(0, G4ThreeVector(0, 0.0, 0.0), subChamberLV, "AssemblyPhys", subDetectorLV4,
0376                     false, 0);
0377   // G4PVPlacement * detPhys4 =
0378   new G4PVPlacement(0, G4ThreeVector(0.0, -bigL, 0.0), subDetectorLV4, "PhysSubDetectorSecond3",
0379                     detectorLV, false, 0);
0380 
0381   return experimentalHallPhys;
0382 }
0383 
0384 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0385 //
0386 // SubDetector1
0387 //
0388 G4LogicalVolume* G02DetectorConstruction::ConstructSubDetector1()
0389 {
0390   const G4double sub_x = fExpHall_x / 5.;
0391   const G4double sub_y = sub_x;
0392 
0393   // Create the hall
0394   //
0395   G4Tubs* subTub = new G4Tubs("subTub", 0., sub_x, sub_y, -90. * deg, 180 * deg);
0396   G4LogicalVolume* subTubLV = new G4LogicalVolume(subTub, fPb, "tubLV");
0397   G4LogicalVolume* AssemblyLV = ConstructAssembly();
0398   // G4PVPlacement * detAss =
0399   new G4PVPlacement(0, G4ThreeVector(sub_x / 3, 0.0, 0.0), AssemblyLV, "AssemblyPhys", subTubLV,
0400                     false, 0);
0401   return subTubLV;
0402 }
0403 
0404 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0405 //
0406 // SubDetector2
0407 //
0408 G4LogicalVolume* G02DetectorConstruction::ConstructSubDetector2()
0409 {
0410   const G4double sub_x = fExpHall_x / 10.;
0411   const G4double sub_y = sub_x * 2.;
0412   const G4double sub_z = sub_x;
0413 
0414   // Create the hall
0415   //
0416   G4Box* detHallBox = new G4Box("detHallBox", sub_x, sub_y, sub_z);
0417   G4LogicalVolume* detHallLV = new G4LogicalVolume(detHallBox, fAluminum, "detHallLV");
0418 
0419   return detHallLV;
0420 }
0421 
0422 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0423 //
0424 // Assembly
0425 //
0426 G4LogicalVolume* G02DetectorConstruction::ConstructAssembly()
0427 {
0428   const G4double big_x = fExpHall_x / 17;
0429   const G4double big_y = big_x;
0430   const G4double big_z = big_x;
0431 
0432   // Create the Box
0433   //
0434   G4Box* OuterBox = new G4Box("OuterBox", big_x, big_y, big_z);
0435   G4LogicalVolume* OuterBoxLV = new G4LogicalVolume(OuterBox, fAir, "OuterBoxLV");
0436   // G4PVPlacement * OuterBoxPhys =
0437   new G4PVPlacement(0, G4ThreeVector(0.0, 0.0, 0.0), OuterBoxLV, "OuterBoxPhys", 0, false, 0);
0438 
0439   // The aluminum object's logical volume
0440   //
0441   const G4double bigL = big_x / 2.5;
0442   const G4double medL = big_x / 8;
0443   const G4double smalL = big_x / 12;
0444 
0445   G4Box* BigBox = new G4Box("BBox", bigL, bigL, bigL);
0446   G4LogicalVolume* BigBoxLV = new G4LogicalVolume(BigBox, fAluminum, "AlBigBoxLV");
0447   G4Box* MedBox = new G4Box("MBox", medL, medL, medL);
0448   G4LogicalVolume* MedBoxLV1 = new G4LogicalVolume(MedBox, fAluminum, "AlMedBoxLV1");
0449   G4Box* SmallBox = new G4Box("SBox", smalL, smalL, smalL);
0450   G4LogicalVolume* SmallBoxLV = new G4LogicalVolume(SmallBox, fAluminum, "AlSmaBoxLV");
0451 
0452   const G4double bigPlace = bigL + 10.;
0453   const G4double medPlace = medL + 10.;
0454   // G4PVPlacement * BigBoxPhys =
0455   new G4PVPlacement(0, G4ThreeVector(bigPlace, 0.0, 0.0), BigBoxLV, "AlPhysBig", OuterBoxLV, false,
0456                     0);
0457 
0458   // Construction of Tub
0459   //
0460   G4Tubs* BigTube = new G4Tubs("BTube", 0, smalL, smalL, -pi / 2., pi);
0461 
0462   // Construction of Reflection of Tub
0463   //
0464   G4ReflectX3D Xreflection;
0465   G4Translate3D translation(-bigPlace, 0., 0.);
0466   G4Transform3D transform = Xreflection;
0467 
0468   G4ReflectedSolid* ReflBig = new G4ReflectedSolid("Refll_Big", BigTube, transform);
0469   G4LogicalVolume* ReflBigLV = new G4LogicalVolume(ReflBig, fXenon, "ReflBigAl");
0470   new G4PVPlacement(0, G4ThreeVector(0., 0.0, 0.0), ReflBigLV, "AlPhysBigTube", SmallBoxLV, false,
0471                     0);
0472   //
0473   // LOOK HERE FOR ASSEMBLY
0474   //
0475 
0476   // create Assembly of Boxes and Tubs
0477   //
0478   G4AssemblyVolume* assembly = new G4AssemblyVolume();
0479   G4RotationMatrix* rot = new G4RotationMatrix();
0480   G4ThreeVector posBig(-bigPlace, 0, 0);
0481   G4ThreeVector posBig0(bigPlace / 4, 0, 0);
0482   G4ThreeVector posMed(-medPlace, 0, 0);
0483   G4ThreeVector posMed0(medPlace, 0, 0);
0484   G4ThreeVector position(0., 0., 0.);
0485 
0486   // Add to Assembly the MediumBox1
0487   //
0488   assembly->AddPlacedVolume(MedBoxLV1, posMed0, rot);
0489 
0490   // Add to Assembly the Small Box
0491   //
0492   assembly->AddPlacedVolume(SmallBoxLV, posMed, rot);
0493 
0494   // Place the Assembly
0495   //
0496   assembly->MakeImprint(BigBoxLV, posBig0, rot, 0);
0497 
0498   //
0499   // LOOK HERE FOR ASSEMBLY with REFLECTION
0500   //
0501 
0502   G4Translate3D translation1(-bigPlace, 0., 0.);
0503   G4RotationMatrix* rotD3 = new G4RotationMatrix();
0504   G4Transform3D rotation = G4Rotate3D(*rotD3);
0505   G4ReflectX3D reflection;
0506   G4Transform3D transform1 = translation1 * rotation * reflection;
0507 
0508   assembly->MakeImprint(OuterBoxLV, transform1, 0, 0);
0509 
0510   return OuterBoxLV;
0511 }
0512 
0513 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0514 //
0515 // Parameterised Chamber
0516 //
0517 G4LogicalVolume* G02DetectorConstruction::ConstructParametrisationChamber()
0518 {
0519   const G4double chamber_x = fExpHall_x / 12.;
0520   const G4double chamber_y = chamber_x;
0521   const G4double chamber_z = chamber_x;
0522 
0523   // Create the hall
0524   //
0525   G4Box* paramChamberBox = new G4Box("ChamberBox", chamber_x, chamber_y, chamber_z);
0526   G4LogicalVolume* paramChamberLV = new G4LogicalVolume(paramChamberBox, fAir, "ChamberLV");
0527 
0528   // Parametrisation Chamber (taken from N02 novice example)
0529   //
0530   G4int NbOfChambers = 5;
0531   G4double ChamberWidth = 2 * cm;
0532   G4double ChamberSpacing = 8 * cm;
0533   G4double fTrackerLength = (NbOfChambers + 1) * ChamberSpacing;  // Full length
0534   G4double trackerSize = 0.5 * fTrackerLength;
0535 
0536   // An example of parameterised volume
0537   // dummy values for G4Box -- modified by parameterised volume
0538   //
0539   G4Box* solidChamber = new G4Box("chamber", 10 * cm, 10 * cm, 1 * cm);
0540   G4LogicalVolume* logicChamber = new G4LogicalVolume(solidChamber, fAluminum, "Chamber", 0, 0, 0);
0541 
0542   G4double firstPosition = -trackerSize + 0.5 * ChamberWidth;
0543   G4double firstLength = fTrackerLength / 10;
0544   G4double lastLength = fTrackerLength;
0545 
0546   G4VPVParameterisation* chamberParam =
0547     new G02ChamberParameterisation(NbOfChambers,  // NoChambers
0548                                    firstPosition,  // Z of center of first
0549                                    ChamberSpacing,  // Z spacing of centers
0550                                    ChamberWidth,  // Width Chamber
0551                                    firstLength,  // lengthInitial
0552                                    lastLength);  // lengthFinal
0553   // G4VPhysicalVolume* physiChamber =
0554   new G4PVParameterised("Chamber",  // their name
0555                         logicChamber,  // their logical volume
0556                         paramChamberLV,  // mother logical volume
0557                         kZAxis,  // Are placed along this axis
0558                         NbOfChambers,  // Number of chambers
0559                         chamberParam);  // The parametrisation
0560   return paramChamberLV;
0561 }
0562 
0563 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0564 //
0565 // SetReadFile
0566 //
0567 void G02DetectorConstruction::SetReadFile(const G4String& File)
0568 {
0569   fReadFile = File;
0570   fWritingChoice = 0;
0571 }
0572 
0573 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0574 //
0575 // SetWriteFile
0576 //
0577 void G02DetectorConstruction::SetWriteFile(const G4String& File)
0578 {
0579   fWriteFile = File;
0580   fWritingChoice = 1;
0581 }
0582 
0583 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0584 //
0585 // SetStepFile
0586 //
0587 void G02DetectorConstruction::SetStepFile(const G4String& File)
0588 {
0589   fStepFile = File;
0590   fWritingChoice = 3;
0591 }