Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/examples/extended/field/field03/src/F03DetectorConstruction.cc

Version: [ ReleaseNotes ] [ 1.0 ] [ 1.1 ] [ 2.0 ] [ 3.0 ] [ 3.1 ] [ 3.2 ] [ 4.0 ] [ 4.0.p1 ] [ 4.0.p2 ] [ 4.1 ] [ 4.1.p1 ] [ 5.0 ] [ 5.0.p1 ] [ 5.1 ] [ 5.1.p1 ] [ 5.2 ] [ 5.2.p1 ] [ 5.2.p2 ] [ 6.0 ] [ 6.0.p1 ] [ 6.1 ] [ 6.2 ] [ 6.2.p1 ] [ 6.2.p2 ] [ 7.0 ] [ 7.0.p1 ] [ 7.1 ] [ 7.1.p1 ] [ 8.0 ] [ 8.0.p1 ] [ 8.1 ] [ 8.1.p1 ] [ 8.1.p2 ] [ 8.2 ] [ 8.2.p1 ] [ 8.3 ] [ 8.3.p1 ] [ 8.3.p2 ] [ 9.0 ] [ 9.0.p1 ] [ 9.0.p2 ] [ 9.1 ] [ 9.1.p1 ] [ 9.1.p2 ] [ 9.1.p3 ] [ 9.2 ] [ 9.2.p1 ] [ 9.2.p2 ] [ 9.2.p3 ] [ 9.2.p4 ] [ 9.3 ] [ 9.3.p1 ] [ 9.3.p2 ] [ 9.4 ] [ 9.4.p1 ] [ 9.4.p2 ] [ 9.4.p3 ] [ 9.4.p4 ] [ 9.5 ] [ 9.5.p1 ] [ 9.5.p2 ] [ 9.6 ] [ 9.6.p1 ] [ 9.6.p2 ] [ 9.6.p3 ] [ 9.6.p4 ] [ 10.0 ] [ 10.0.p1 ] [ 10.0.p2 ] [ 10.0.p3 ] [ 10.0.p4 ] [ 10.1 ] [ 10.1.p1 ] [ 10.1.p2 ] [ 10.1.p3 ] [ 10.2 ] [ 10.2.p1 ] [ 10.2.p2 ] [ 10.2.p3 ] [ 10.3 ] [ 10.3.p1 ] [ 10.3.p2 ] [ 10.3.p3 ] [ 10.4 ] [ 10.4.p1 ] [ 10.4.p2 ] [ 10.4.p3 ] [ 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /examples/extended/field/field03/src/F03DetectorConstruction.cc (Version 11.3.0) and /examples/extended/field/field03/src/F03DetectorConstruction.cc (Version 10.4.p2)


  1 //                                                  1 //
  2 // *******************************************      2 // ********************************************************************
  3 // * License and Disclaimer                         3 // * License and Disclaimer                                           *
  4 // *                                                4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of th      5 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
  6 // * the Geant4 Collaboration.  It is provided      6 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
  7 // * conditions of the Geant4 Software License      7 // * conditions of the Geant4 Software License,  included in the file *
  8 // * LICENSE and available at  http://cern.ch/      8 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
  9 // * include a list of copyright holders.           9 // * include a list of copyright holders.                             *
 10 // *                                               10 // *                                                                  *
 11 // * Neither the authors of this software syst     11 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing fin     12 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warran     13 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assum     14 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file      15 // * use.  Please see the license in the file  LICENSE  and URL above *
 16 // * for the full disclaimer and the limitatio     16 // * for the full disclaimer and the limitation of liability.         *
 17 // *                                               17 // *                                                                  *
 18 // * This  code  implementation is the result      18 // * This  code  implementation is the result of  the  scientific and *
 19 // * technical work of the GEANT4 collaboratio     19 // * technical work of the GEANT4 collaboration.                      *
 20 // * By using,  copying,  modifying or  distri     20 // * By using,  copying,  modifying or  distributing the software (or *
 21 // * any work based  on the software)  you  ag     21 // * any work based  on the software)  you  agree  to acknowledge its *
 22 // * use  in  resulting  scientific  publicati     22 // * use  in  resulting  scientific  publications,  and indicate your *
 23 // * acceptance of all terms of the Geant4 Sof     23 // * acceptance of all terms of the Geant4 Software license.          *
 24 // *******************************************     24 // ********************************************************************
 25 //                                                 25 //
 26 /// \file field/field03/src/F03DetectorConstru     26 /// \file field/field03/src/F03DetectorConstruction.cc
 27 /// \brief Implementation of the F03DetectorCo     27 /// \brief Implementation of the F03DetectorConstruction class
 28 //                                                 28 //
 29 //                                                 29 //
                                                   >>  30 // $Id: F03DetectorConstruction.cc 101666 2016-11-21 09:12:08Z gcosmo $
 30 //                                                 31 //
 31 //                                                 32 //
 32 //....oooOO0OOooo........oooOO0OOooo........oo     33 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 33 //....oooOO0OOooo........oooOO0OOooo........oo     34 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 34                                                    35 
 35 #include "F03DetectorConstruction.hh"              36 #include "F03DetectorConstruction.hh"
                                                   >>  37 #include "F03DetectorMessenger.hh"
 36                                                    38 
 37 #include "F03CalorimeterSD.hh"                     39 #include "F03CalorimeterSD.hh"
 38 #include "F03DetectorMessenger.hh"             <<  40 #include "F03FieldSetup.hh"
 39                                                    41 
 40 #include "G4AutoDelete.hh"                     << 
 41 #include "G4GeometryManager.hh"                    42 #include "G4GeometryManager.hh"
 42 #include "G4FieldBuilder.hh"                   <<  43 #include "G4PhysicalVolumeStore.hh"
 43 #include "G4LogicalVolume.hh"                  << 
 44 #include "G4LogicalVolumeStore.hh"                 44 #include "G4LogicalVolumeStore.hh"
                                                   >>  45 #include "G4SolidStore.hh"
                                                   >>  46 
 45 #include "G4Material.hh"                           47 #include "G4Material.hh"
                                                   >>  48 #include "G4Tubs.hh"
                                                   >>  49 #include "G4LogicalVolume.hh"
 46 #include "G4PVPlacement.hh"                        50 #include "G4PVPlacement.hh"
 47 #include "G4PhysicalConstants.hh"              << 
 48 #include "G4PhysicalVolumeStore.hh"            << 
 49 #include "G4RunManager.hh"                         51 #include "G4RunManager.hh"
                                                   >>  52 #include "G4AutoDelete.hh"
 50 #include "G4SDManager.hh"                          53 #include "G4SDManager.hh"
 51 #include "G4SolidStore.hh"                     <<  54 
                                                   >>  55 #include "G4PhysicalConstants.hh"
 52 #include "G4SystemOfUnits.hh"                      56 #include "G4SystemOfUnits.hh"
 53 #include "G4Tubs.hh"                           << 
 54 #include "G4UniformMagField.hh"                << 
 55                                                    57 
 56 //....oooOO0OOooo........oooOO0OOooo........oo     58 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 57                                                    59 
 58 F03DetectorConstruction::F03DetectorConstructi     60 F03DetectorConstruction::F03DetectorConstruction()
                                                   >>  61  : G4VUserDetectorConstruction(),
                                                   >>  62    fDetectorMessenger(0),
                                                   >>  63    fSolidWorld(0), fLogicWorld(0), fPhysiWorld(0),
                                                   >>  64    fSolidAbsorber(0), fLogicAbsorber(0), fPhysiAbsorber(0),
                                                   >>  65    fSolidRadSlice(0), fLogicRadSlice(0), fPhysiRadSlice(0),
                                                   >>  66    fSolidRadiator(0), fLogicRadiator(0), fPhysiRadiator(0),
                                                   >>  67    fWorldMaterial(0), fAbsorberMaterial(0), fRadiatorMat(0),
                                                   >>  68    // default parameter values of the calorimeter
                                                   >>  69    fWorldSizeR(       22000.*mm),
                                                   >>  70    fWorldSizeZ(       44000.*mm),
                                                   >>  71    fAbsorberThickness(    1.*mm),
                                                   >>  72    fAbsorberRadius(   20000.*mm),
                                                   >>  73    fZAbsorber(        21990.*mm),
                                                   >>  74    fZStartAbs(            0.),
                                                   >>  75    fZEndAbs(              0.),
                                                   >>  76    fRadThickness(       100.*mm),
                                                   >>  77    fGasGap(             100.*mm),
                                                   >>  78    fDetGap(               1.*mm),
                                                   >>  79    fFoilNumber(1)
 59 {                                                  80 {
 60   fDetectorMessenger = new F03DetectorMessenge     81   fDetectorMessenger = new F03DetectorMessenger(this);
 61                                                    82 
 62   // create field builder                      << 
 63   // this will create commands for field param << 
 64   G4FieldBuilder* fieldBuilder = G4FieldBuilde << 
 65   // fieldBuilder->SetVerboseLevel(2);         << 
 66                                                << 
 67   auto globalFieldParameters = fieldBuilder->G << 
 68   auto localFieldParameters = fieldBuilder->Cr << 
 69                                                << 
 70   // set default min step 0.25 mm              << 
 71   globalFieldParameters->SetMinimumStep(0.25 * << 
 72   localFieldParameters->SetMinimumStep(0.25 *  << 
 73                                                << 
 74   // create materials                              83   // create materials
                                                   >>  84 
 75   DefineMaterials();                               85   DefineMaterials();
                                                   >>  86 
 76 }                                                  87 }
 77                                                    88 
 78 //....oooOO0OOooo........oooOO0OOooo........oo     89 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 79                                                    90 
 80 F03DetectorConstruction::~F03DetectorConstruct     91 F03DetectorConstruction::~F03DetectorConstruction()
 81 {                                                  92 {
 82   delete fDetectorMessenger;                       93   delete fDetectorMessenger;
 83 }                                                  94 }
 84                                                    95 
 85 //....oooOO0OOooo........oooOO0OOooo........oo     96 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 86                                                    97 
 87 G4VPhysicalVolume* F03DetectorConstruction::Co     98 G4VPhysicalVolume* F03DetectorConstruction::Construct()
 88 {                                                  99 {
 89   return ConstructCalorimeter();                  100   return ConstructCalorimeter();
 90 }                                                 101 }
 91                                                   102 
 92 //....oooOO0OOooo........oooOO0OOooo........oo    103 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 93                                                   104 
 94 void F03DetectorConstruction::DefineMaterials(    105 void F03DetectorConstruction::DefineMaterials()
 95 {                                                 106 {
 96   // This function illustrates the possible wa << 107   //This function illustrates the possible ways to define materials
 97                                                << 108  
 98   G4String name, symbol;  // a=mass of a mole; << 109   G4String name, symbol;             // a=mass of a mole;
 99   G4double a, z, density;  // z=mean number of << 110   G4double a, z, density;            // z=mean number of protons;
100   G4int nel;                                      111   G4int nel;
101   G4int ncomponents;                              112   G4int ncomponents;
102   G4double fractionmass, pressure, temperature    113   G4double fractionmass, pressure, temperature;
103                                                   114 
104   //                                              115   //
105   // define Elements                              116   // define Elements
106   //                                              117   //
107                                                   118 
108   a = 1.01 * g / mole;                         << 119   a = 1.01*g/mole;
109   auto elH = new G4Element(name = "Hydrogen",  << 120   G4Element* elH  = new G4Element(name="Hydrogen",symbol="H" , z= 1., a);
110                                                   121 
111   a = 12.01 * g / mole;                        << 122   a = 12.01*g/mole;
112   auto elC = new G4Element(name = "Carbon", sy << 123   G4Element* elC = new G4Element(name="Carbon", symbol="C", z=6., a);
113                                                   124 
114   a = 14.01 * g / mole;                        << 125   a = 14.01*g/mole;
115   auto elN = new G4Element(name = "Nitrogen",  << 126   G4Element* elN  = new G4Element(name="Nitrogen",symbol="N" , z= 7., a);
116                                                   127 
117   a = 16.00 * g / mole;                        << 128   a = 16.00*g/mole;
118   auto elO = new G4Element(name = "Oxygen", sy << 129   G4Element* elO  = new G4Element(name="Oxygen"  ,symbol="O" , z= 8., a);
119                                                   130 
120   a = 39.948 * g / mole;                       << 131   a = 39.948*g/mole;
121   auto elAr = new G4Element(name = "Argon", sy << 132   G4Element* elAr = new G4Element(name="Argon", symbol="Ar", z=18., a);
122                                                   133 
123   //                                              134   //
124   // define simple materials                      135   // define simple materials
125   //                                              136   //
126                                                   137 
127   // Mylar                                        138   // Mylar
128                                                   139 
129   density = 1.39 * g / cm3;                    << 140   density = 1.39*g/cm3;
130   auto mylar = new G4Material(name = "Mylar",  << 141   G4Material* mylar = new G4Material(name="Mylar", density, nel=3);
131   mylar->AddElement(elO, 2);                   << 142   mylar->AddElement(elO,2);
132   mylar->AddElement(elC, 5);                   << 143   mylar->AddElement(elC,5);
133   mylar->AddElement(elH, 4);                   << 144   mylar->AddElement(elH,4);
134                                                   145 
135   // Polypropelene                                146   // Polypropelene
136                                                   147 
137   auto CH2 = new G4Material("Polypropelene", 0 << 148   G4Material* CH2 = new G4Material ("Polypropelene" , 0.91*g/cm3, 2);
138   CH2->AddElement(elH, 2);                     << 149   CH2->AddElement(elH,2);
139   CH2->AddElement(elC, 1);                     << 150   CH2->AddElement(elC,1);
140                                                   151 
141   // Krypton as detector gas, STP                 152   // Krypton as detector gas, STP
142                                                   153 
143   density = 3.700 * mg / cm3;                  << 154   density = 3.700*mg/cm3;
144   a = 83.80 * g / mole;                        << 155   a = 83.80*g/mole;
145   auto Kr = new G4Material(name = "Kr", z = 36 << 156   G4Material* Kr  = new G4Material(name="Kr",z=36., a, density );
146                                                   157 
147   // Dry air (average composition)                158   // Dry air (average composition)
148                                                   159 
149   density = 1.7836 * mg / cm3;  // STP         << 160   density = 1.7836*mg/cm3;        // STP
150   auto argon = new G4Material(name = "Argon",  << 161   G4Material* argon = new G4Material(name="Argon"  , density, ncomponents=1);
151   argon->AddElement(elAr, 1);                     162   argon->AddElement(elAr, 1);
152                                                   163 
153   density = 1.25053 * mg / cm3;  // STP        << 164   density = 1.25053*mg/cm3;       // STP
154   auto nitrogen = new G4Material(name = "N2",  << 165   G4Material* nitrogen = new G4Material(name="N2"  , density, ncomponents=1);
155   nitrogen->AddElement(elN, 2);                   166   nitrogen->AddElement(elN, 2);
156                                                   167 
157   density = 1.4289 * mg / cm3;  // STP         << 168   density = 1.4289*mg/cm3;        // STP
158   auto oxygen = new G4Material(name = "O2", de << 169   G4Material* oxygen = new G4Material(name="O2"  , density, ncomponents=1);
159   oxygen->AddElement(elO, 2);                     170   oxygen->AddElement(elO, 2);
160                                                   171 
161   density = 1.2928 * mg / cm3;  // STP         << 172   density  = 1.2928*mg/cm3;       // STP
162   density *= 1.0e-8;  // pumped vacuum         << 173   density *= 1.0e-8;              // pumped vacuum
163   temperature = STP_Temperature;                  174   temperature = STP_Temperature;
164   pressure = 1.0e-8 * STP_Pressure;            << 175   pressure = 1.0e-8*STP_Pressure;
165                                                   176 
166   auto air =                                   << 177   G4Material* air = new G4Material(name="Air"  , density, ncomponents=3,
167     new G4Material(name = "Air", density, ncom << 178                                    kStateGas,temperature,pressure);
168   air->AddMaterial(nitrogen, fractionmass = 0. << 179   air->AddMaterial( nitrogen, fractionmass = 0.7557 );
169   air->AddMaterial(oxygen, fractionmass = 0.23 << 180   air->AddMaterial( oxygen,   fractionmass = 0.2315 );
170   air->AddMaterial(argon, fractionmass = 0.012 << 181   air->AddMaterial( argon,    fractionmass = 0.0128 );
171                                                   182 
172   // Xenon as detector gas, STP                   183   // Xenon as detector gas, STP
173                                                   184 
174   density = 5.858 * mg / cm3;                  << 185   density = 5.858*mg/cm3;
175   a = 131.29 * g / mole;                       << 186   a = 131.29*g/mole;
176   auto Xe = new G4Material(name = "Xenon", z = << 187   G4Material* Xe  = new G4Material(name="Xenon",z=54., a, density );
177                                                   188 
178   // Carbon dioxide, STP                          189   // Carbon dioxide, STP
179                                                   190 
180   density = 1.842 * mg / cm3;                  << 191   density = 1.842*mg/cm3;
181   auto CarbonDioxide = new G4Material(name = " << 192   G4Material* CarbonDioxide = new G4Material(name="CO2", density, nel=2);
182   CarbonDioxide->AddElement(elC, 1);           << 193   CarbonDioxide->AddElement(elC,1);
183   CarbonDioxide->AddElement(elO, 2);           << 194   CarbonDioxide->AddElement(elO,2);
184                                                   195 
185   // 80% Xe + 20% CO2, STP                        196   // 80% Xe + 20% CO2, STP
186                                                   197 
187   density = 5.0818 * mg / cm3;                 << 198   density = 5.0818*mg/cm3;
188   auto Xe20CO2 = new G4Material(name = "Xe20CO << 199   G4Material* Xe20CO2 = new G4Material(name="Xe20CO2", density, ncomponents=2);
189   Xe20CO2->AddMaterial(Xe, fractionmass = 0.92 << 200   Xe20CO2->AddMaterial( Xe,              fractionmass = 0.922 );
190   Xe20CO2->AddMaterial(CarbonDioxide, fraction << 201   Xe20CO2->AddMaterial( CarbonDioxide,   fractionmass = 0.078 );
191                                                   202 
192   // 80% Kr + 20% CO2, STP                        203   // 80% Kr + 20% CO2, STP
193                                                   204 
194   density = 3.601 * mg / cm3;                  << 205   density = 3.601*mg/cm3;
195   auto Kr20CO2 = new G4Material(name = "Kr20CO << 206   G4Material* Kr20CO2 = new G4Material(name="Kr20CO2", density, ncomponents=2);
196   Kr20CO2->AddMaterial(Kr, fractionmass = 0.89 << 207   Kr20CO2->AddMaterial( Kr,              fractionmass = 0.89 );
197   Kr20CO2->AddMaterial(CarbonDioxide, fraction << 208   Kr20CO2->AddMaterial( CarbonDioxide,   fractionmass = 0.11 );
198                                                   209 
199   G4cout << *(G4Material::GetMaterialTable())     210   G4cout << *(G4Material::GetMaterialTable()) << G4endl;
200                                                   211 
201   // default materials of the calorimeter and  << 212   //default materials of the calorimeter and TR radiator
202                                                   213 
203   fRadiatorMat = air;  // CH2 ;   // mylar;    << 214   fRadiatorMat =  air;  // CH2 ;   // mylar;
                                                   >> 215   
                                                   >> 216   fAbsorberMaterial = air; //  Kr20CO2;   // XeCO2CF4;
204                                                   217 
205   fAbsorberMaterial = air;  //  Kr20CO2;   //  << 218   fWorldMaterial    = air;
206                                                << 
207   fWorldMaterial = air;                        << 
208 }                                                 219 }
209                                                   220 
210 //....oooOO0OOooo........oooOO0OOooo........oo    221 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
211                                                << 222   
212 G4VPhysicalVolume* F03DetectorConstruction::Co    223 G4VPhysicalVolume* F03DetectorConstruction::ConstructCalorimeter()
213 {                                                 224 {
214   // Cleanup old geometry                         225   // Cleanup old geometry
215                                                   226 
216   if (fPhysiWorld) {                           << 227   if (fPhysiWorld)
                                                   >> 228   {
217     G4GeometryManager::GetInstance()->OpenGeom    229     G4GeometryManager::GetInstance()->OpenGeometry();
218     G4PhysicalVolumeStore::GetInstance()->Clea    230     G4PhysicalVolumeStore::GetInstance()->Clean();
219     G4LogicalVolumeStore::GetInstance()->Clean    231     G4LogicalVolumeStore::GetInstance()->Clean();
220     G4SolidStore::GetInstance()->Clean();         232     G4SolidStore::GetInstance()->Clean();
221   }                                               233   }
222                                                   234 
223   // complete the Calor parameters definition     235   // complete the Calor parameters definition and Print
224                                                   236 
225   ComputeCalorParameters();                       237   ComputeCalorParameters();
226   PrintCalorParameters();                         238   PrintCalorParameters();
227                                                   239 
228   G4bool checkOverlaps = true;                 << 240   fSolidWorld = new G4Tubs("World",                        // its name
                                                   >> 241                    0.,fWorldSizeR,fWorldSizeZ/2.,0.,twopi);// its size
229                                                   242 
230   fSolidWorld = new G4Tubs("World",  // its na << 243   fLogicWorld = new G4LogicalVolume(fSolidWorld,           // its solid
231                            0., fWorldSizeR, fW << 244                                    fWorldMaterial,         // its material
232                                                << 245                                    "World");               // its name
233   fLogicWorld = new G4LogicalVolume(fSolidWorl << 246 
234                                     fWorldMate << 247   fPhysiWorld = new G4PVPlacement(0,                       // no rotation
235                                     "World");  << 248                                   G4ThreeVector(),         // at (0,0,0)
236                                                << 249                                   "World",                 // its name
237   fPhysiWorld = new G4PVPlacement(nullptr,  // << 250                                   fLogicWorld,             // its logical volume
238                                   G4ThreeVecto << 251                                   0,                       // its mother  volume
239                                   "World",  // << 252                                   false,                   // no boolean op.
240                                   fLogicWorld, << 253                                   0);                      // copy number
241                                   nullptr,  // << 
242                                   false,  // n << 
243                                   0,  // copy  << 
244                                   checkOverlap << 
245                                                   254 
246   // TR radiator envelope                         255   // TR radiator envelope
247   G4double radThick = fFoilNumber * (fRadThick << 
248   G4double zRad = fZAbsorber - 0.5 * (radThick << 
249                                                   256 
250   G4cout << "zRad = " << zRad / mm << " mm" << << 257   G4double radThick = fFoilNumber*(fRadThickness + fGasGap) + fDetGap;
251   G4cout << "radThick = " << radThick / mm <<  << 258 
                                                   >> 259   G4double zRad = fZAbsorber - 20*cm - 0.5*radThick;
                                                   >> 260   G4cout << "zRad = " << zRad/mm << " mm" << G4endl;
                                                   >> 261 
                                                   >> 262   radThick *= 1.02;
                                                   >> 263   G4cout << "radThick = " << radThick/mm << " mm" << G4endl;
252   G4cout << "fFoilNumber = " << fFoilNumber <<    264   G4cout << "fFoilNumber = " << fFoilNumber << G4endl;
253   G4cout << "fRadiatorMat = " << fRadiatorMat-    265   G4cout << "fRadiatorMat = " << fRadiatorMat->GetName() << G4endl;
254   G4cout << "WorldMaterial = " << fWorldMateri    266   G4cout << "WorldMaterial = " << fWorldMaterial->GetName() << G4endl;
255                                                << 267  
256   fSolidRadiator = new G4Tubs("Radiator", 0.0, << 268   fSolidRadiator = new G4Tubs("Radiator",0.0,
257                                                << 269                              1.01*fAbsorberRadius,
258   fLogicRadiator = new G4LogicalVolume(fSolidR << 270                              0.5*radThick,0.0, twopi);
259                                                << 271 
260   fPhysiRadiator = new G4PVPlacement(nullptr,  << 272   fLogicRadiator = new G4LogicalVolume(fSolidRadiator,
261                                      fPhysiWor << 273                                       fWorldMaterial,
262                                                << 274                                       "Radiator");
263   fSolidRadSlice = new G4Tubs("RadSlice", 0.0, << 275 
264                                                << 276   fPhysiRadiator = new G4PVPlacement(0,
265   fLogicRadSlice = new G4LogicalVolume(fSolidR << 277                                     G4ThreeVector(0,0,zRad),
266                                                << 278                                     "Radiator", fLogicRadiator,
267   // Radiator slice                            << 279                                     fPhysiWorld, false, 0);
268   G4double radSliceThick = fRadThickness + fGa << 280 
269   G4double zStart = 0.5 * (-radThick + radSlic << 281   fSolidRadSlice = new G4Tubs("RadSlice",0.0,
270   // start on the board of radiator enevelope  << 282                                 fAbsorberRadius,0.5*fRadThickness,0.0,twopi);
271                                                << 283 
272   for (G4int j = 0; j < fFoilNumber; j++) {    << 284   fLogicRadSlice = new G4LogicalVolume(fSolidRadSlice,fRadiatorMat,
273     G4double zSlice = zStart + j * radSliceThi << 285                                        "RadSlice",0,0,0);
274     G4cout << zSlice / mm << " mm"             << 286 
275            << "\t";                            << 287   G4double zModule, zRadiator;
276                                                << 288   zModule = zRad + 0.5*radThick/1.02;
277     fPhysiRadSlice = new G4PVPlacement(nullptr << 289   G4cout << "zModule = " << zModule/mm << " mm" << G4endl;
278                                        fLogicR << 290 
279   }                                            << 291   for (G4int j=0;j<fFoilNumber;j++)
                                                   >> 292     {
                                                   >> 293       zRadiator = zModule - j*(fRadThickness + fGasGap);
                                                   >> 294       G4cout << zRadiator/mm << " mm" << "\t";
                                                   >> 295       //   G4cout << "j = " << j << "\t";
                                                   >> 296 
                                                   >> 297       fPhysiRadSlice = new G4PVPlacement(0,G4ThreeVector(0.,0.,zRadiator-zRad),
                                                   >> 298                                          "RadSlice",fLogicRadSlice,
                                                   >> 299                                           fPhysiRadiator,false,j);
                                                   >> 300     }
280   G4cout << G4endl;                               301   G4cout << G4endl;
281                                                   302 
282   // Absorber                                     303   // Absorber
283                                                   304 
284   fSolidAbsorber =                             << 305   fSolidAbsorber = new G4Tubs("Absorber", 1.0*mm,
285     new G4Tubs("Absorber", 1.0 * mm, fAbsorber << 306                                fAbsorberRadius,
286                                                << 307                                fAbsorberThickness/2.,
287   fLogicAbsorber = new G4LogicalVolume(fSolidA << 308                                0.0,twopi);
288                                                << 309 
289   fPhysiAbsorber = new G4PVPlacement(nullptr,  << 310   fLogicAbsorber = new G4LogicalVolume(fSolidAbsorber,
290                                      fLogicAbs << 311                                        fAbsorberMaterial,
                                                   >> 312                                        "Absorber");
                                                   >> 313  
                                                   >> 314   fPhysiAbsorber = new G4PVPlacement(0,
                                                   >> 315                                      G4ThreeVector(0.,0.,fZAbsorber),
                                                   >> 316                                      "Absorber",
                                                   >> 317                                      fLogicAbsorber,
                                                   >> 318                                      fPhysiWorld,
                                                   >> 319                                      false,
                                                   >> 320                                      0);
291                                                   321 
292   return fPhysiWorld;                             322   return fPhysiWorld;
293 }                                                 323 }
294                                                   324 
295 //....oooOO0OOooo........oooOO0OOooo........oo    325 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
296                                                   326 
297 void F03DetectorConstruction::PrintCalorParame    327 void F03DetectorConstruction::PrintCalorParameters()
298 {                                                 328 {
299   G4cout << "\n The  WORLD   is made of " << f << 329   G4cout << "\n The  WORLD   is made of "
300          << fWorldMaterial->GetName();         << 330          << fWorldSizeZ/mm << "mm of " << fWorldMaterial->GetName();
301   G4cout << ", the transverse size (R) of the  << 331   G4cout << ", the transverse size (R) of the world is "
302   G4cout << " The ABSORBER is made of " << fAb << 332          << fWorldSizeR/mm << " mm. " << G4endl;
303          << fAbsorberMaterial->GetName();      << 333   G4cout << " The ABSORBER is made of "
304   G4cout << ", the transverse size (R) is " << << 334          << fAbsorberThickness/mm << "mm of " << fAbsorberMaterial->GetName();
305   G4cout << " Z position of the (middle of the << 335   G4cout << ", the transverse size (R) is " << fAbsorberRadius/mm
                                                   >> 336          << " mm. " << G4endl;
                                                   >> 337   G4cout << " Z position of the (middle of the) absorber "
                                                   >> 338          << fZAbsorber/mm << "  mm." << G4endl;
306   G4cout << G4endl;                               339   G4cout << G4endl;
307 }                                                 340 }
308                                                   341 
309 //....oooOO0OOooo........oooOO0OOooo........oo    342 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
310                                                   343 
311 void F03DetectorConstruction::SetAbsorberMater    344 void F03DetectorConstruction::SetAbsorberMaterial(G4String materialChoice)
312 {                                                 345 {
313   // get the pointer to the material table        346   // get the pointer to the material table
314   const G4MaterialTable* theMaterialTable = G4    347   const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable();
315                                                   348 
316   // search the material by its name              349   // search the material by its name
317   G4Material* material;                           350   G4Material* material;
318   for (size_t j = 0; j < theMaterialTable->siz << 351   for (size_t j=0 ; j<theMaterialTable->size() ; j++)
319     material = (*theMaterialTable)[j];         << 352    { material = (*theMaterialTable)[j];
320     if (material->GetName() == materialChoice) << 353      if (material->GetName() == materialChoice)
321       fAbsorberMaterial = material;            << 354         {
322       fLogicAbsorber->SetMaterial(material);   << 355           fAbsorberMaterial = material;
323       G4RunManager::GetRunManager()->PhysicsHa << 356           fLogicAbsorber->SetMaterial(material);
324     }                                          << 357           G4RunManager::GetRunManager()->PhysicsHasBeenModified();
325   }                                            << 358         }
                                                   >> 359    }
326 }                                                 360 }
327                                                   361 
328 //....oooOO0OOooo........oooOO0OOooo........oo    362 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
329                                                   363 
330 void F03DetectorConstruction::SetWorldMaterial    364 void F03DetectorConstruction::SetWorldMaterial(G4String materialChoice)
331 {                                                 365 {
332   // get the pointer to the material table        366   // get the pointer to the material table
333   const G4MaterialTable* theMaterialTable = G4    367   const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable();
334                                                   368 
335   // search the material by its name              369   // search the material by its name
336   G4Material* material;                           370   G4Material* material;
337   for (size_t j = 0; j < theMaterialTable->siz << 371   for (size_t j=0 ; j<theMaterialTable->size() ; j++)
338     material = (*theMaterialTable)[j];         << 372    { material = (*theMaterialTable)[j];
339     if (material->GetName() == materialChoice) << 373      if(material->GetName() == materialChoice)
340       fWorldMaterial = material;               << 374         {
341       fLogicWorld->SetMaterial(material);      << 375           fWorldMaterial = material;
342       G4RunManager::GetRunManager()->PhysicsHa << 376           fLogicWorld->SetMaterial(material);
343     }                                          << 377           G4RunManager::GetRunManager()->PhysicsHasBeenModified();
344   }                                            << 378         }
                                                   >> 379    }
345 }                                                 380 }
346                                                   381 
347 //....oooOO0OOooo........oooOO0OOooo........oo    382 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
348                                                   383 
349 void F03DetectorConstruction::SetAbsorberThick    384 void F03DetectorConstruction::SetAbsorberThickness(G4double val)
350 {                                                 385 {
351   // change Absorber thickness and recompute t    386   // change Absorber thickness and recompute the calorimeter parameters
352   fAbsorberThickness = val;                       387   fAbsorberThickness = val;
353   ComputeCalorParameters();                       388   ComputeCalorParameters();
354   G4RunManager::GetRunManager()->GeometryHasBe << 389   G4RunManager::GetRunManager()->ReinitializeGeometry();
355 }                                                 390 }
356                                                   391 
357 //....oooOO0OOooo........oooOO0OOooo........oo    392 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
358                                                   393 
359 void F03DetectorConstruction::SetAbsorberRadiu    394 void F03DetectorConstruction::SetAbsorberRadius(G4double val)
360 {                                                 395 {
361   // change the transverse size and recompute     396   // change the transverse size and recompute the calorimeter parameters
362   fAbsorberRadius = val;                          397   fAbsorberRadius = val;
363   ComputeCalorParameters();                       398   ComputeCalorParameters();
364   G4RunManager::GetRunManager()->GeometryHasBe << 399   G4RunManager::GetRunManager()->ReinitializeGeometry();
365 }                                                 400 }
366                                                   401 
367 //....oooOO0OOooo........oooOO0OOooo........oo    402 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
368                                                   403 
369 void F03DetectorConstruction::SetWorldSizeZ(G4    404 void F03DetectorConstruction::SetWorldSizeZ(G4double val)
370 {                                                 405 {
371   fWorldSizeZ = val;                              406   fWorldSizeZ = val;
372   ComputeCalorParameters();                       407   ComputeCalorParameters();
373   G4RunManager::GetRunManager()->GeometryHasBe << 408   G4RunManager::GetRunManager()->ReinitializeGeometry();
374 }                                                 409 }
375                                                   410 
376 //....oooOO0OOooo........oooOO0OOooo........oo    411 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
377                                                   412 
378 void F03DetectorConstruction::SetWorldSizeR(G4    413 void F03DetectorConstruction::SetWorldSizeR(G4double val)
379 {                                                 414 {
380   fWorldSizeR = val;                              415   fWorldSizeR = val;
381   ComputeCalorParameters();                       416   ComputeCalorParameters();
382   G4RunManager::GetRunManager()->GeometryHasBe << 417   G4RunManager::GetRunManager()->ReinitializeGeometry();
383 }                                                 418 }
384                                                   419 
385 //....oooOO0OOooo........oooOO0OOooo........oo    420 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
386                                                   421 
387 void F03DetectorConstruction::SetAbsorberZpos(    422 void F03DetectorConstruction::SetAbsorberZpos(G4double val)
388 {                                                 423 {
389   fZAbsorber = val;                               424   fZAbsorber = val;
390   ComputeCalorParameters();                       425   ComputeCalorParameters();
391   G4RunManager::GetRunManager()->GeometryHasBe << 426   G4RunManager::GetRunManager()->ReinitializeGeometry();
392 }                                              << 
393                                                << 
394 //....oooOO0OOooo........oooOO0OOooo........oo << 
395                                                << 
396 void F03DetectorConstruction::SetFieldValue(G4 << 
397 {                                              << 
398   fFieldVector = value;                        << 
399                                                << 
400   G4UniformMagField* magField = nullptr;       << 
401   if (fFieldVector != G4ThreeVector(0.,0.,0.)) << 
402     magField = new G4UniformMagField(fFieldVec << 
403   }                                            << 
404                                                << 
405   // Set field to the field builder            << 
406   auto fieldBuilder = G4FieldBuilder::Instance << 
407   fieldBuilder->SetGlobalField(magField);      << 
408 }                                              << 
409                                                << 
410 //....oooOO0OOooo........oooOO0OOooo........oo << 
411                                                << 
412                                                << 
413 void F03DetectorConstruction::SetLocalFieldVal << 
414 {                                              << 
415   fLocalFieldVector = value;                   << 
416                                                << 
417   G4UniformMagField* magField = nullptr;       << 
418   if (fLocalFieldVector != G4ThreeVector(0.,0. << 
419     magField = new G4UniformMagField(fLocalFie << 
420   }                                            << 
421                                                << 
422   // Set field to the field builder            << 
423   auto fieldBuilder = G4FieldBuilder::Instance << 
424   fieldBuilder->SetLocalField(magField, fLogic << 
425 }                                                 427 }
426                                                   428 
427 //....oooOO0OOooo........oooOO0OOooo........oo    429 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
428                                                   430 
429 void F03DetectorConstruction::ConstructSDandFi    431 void F03DetectorConstruction::ConstructSDandField()
430 {                                              << 432 {   
431   // Sensitive Detectors: Absorber                433   // Sensitive Detectors: Absorber
432                                                   434 
433   if (!fCalorimeterSD.Get()) {                    435   if (!fCalorimeterSD.Get()) {
434     auto calorimeterSD = new F03CalorimeterSD( << 436     F03CalorimeterSD* calorimeterSD = new F03CalorimeterSD("CalorSD",this);
435     fCalorimeterSD.Put(calorimeterSD);            437     fCalorimeterSD.Put(calorimeterSD);
436   }                                            << 438   }  
437   G4SDManager::GetSDMpointer()->AddNewDetector    439   G4SDManager::GetSDMpointer()->AddNewDetector(fCalorimeterSD.Get());
438   SetSensitiveDetector(fLogicAbsorber, fCalori    440   SetSensitiveDetector(fLogicAbsorber, fCalorimeterSD.Get());
439                                                   441 
440   // Create detector fields                    << 442   // Construct the field creator - this will register the field it creates
441   SetFieldValue(fFieldVector);                 << 443 
442   SetLocalFieldValue(fLocalFieldVector);       << 444   if (!fEmFieldSetup.Get()) { 
443                                                << 445     F03FieldSetup* emFieldSetup = new F03FieldSetup();
444   // Construct all Geant4 field objects        << 446 
445   auto fieldBuilder = G4FieldBuilder::Instance << 447     fEmFieldSetup.Put(emFieldSetup);
446   fieldBuilder->ConstructFieldSetup();         << 448     G4AutoDelete::Register(emFieldSetup); //Kernel will delete the messenger
                                                   >> 449   }  
                                                   >> 450   // Set local field manager and local field in radiator and its daughters:
                                                   >> 451   G4bool allLocal = true;
                                                   >> 452   fLogicRadiator->SetFieldManager(fEmFieldSetup.Get()->GetLocalFieldManager(),
                                                   >> 453                                   allLocal );
447 }                                                 454 }
448                                                   455 
449 //....oooOO0OOooo........oooOO0OOooo........oo    456 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
450                                                   457