Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/examples/extended/field/field02/src/F02DetectorConstruction.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/field02/src/F02DetectorConstruction.cc (Version 11.3.0) and /examples/extended/field/field02/src/F02DetectorConstruction.cc (Version 8.0)


  1 //                                                  1 //
  2 // *******************************************      2 // ********************************************************************
  3 // * License and Disclaimer                    <<   3 // * DISCLAIMER                                                       *
  4 // *                                                4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of th <<   5 // * The following disclaimer summarizes all the specific disclaimers *
  6 // * the Geant4 Collaboration.  It is provided <<   6 // * of contributors to this software. The specific disclaimers,which *
  7 // * conditions of the Geant4 Software License <<   7 // * govern, are listed with their locations in:                      *
  8 // * LICENSE and available at  http://cern.ch/ <<   8 // *   http://cern.ch/geant4/license                                  *
  9 // * include a list of copyright holders.      << 
 10 // *                                                9 // *                                                                  *
 11 // * Neither the authors of this software syst     10 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing fin     11 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warran     12 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assum     13 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file  <<  14 // * use.                                                             *
 16 // * for the full disclaimer and the limitatio << 
 17 // *                                               15 // *                                                                  *
 18 // * This  code  implementation is the result  <<  16 // * This  code  implementation is the  intellectual property  of the *
 19 // * technical work of the GEANT4 collaboratio <<  17 // * GEANT4 collaboration.                                            *
 20 // * By using,  copying,  modifying or  distri <<  18 // * By copying,  distributing  or modifying the Program (or any work *
 21 // * any work based  on the software)  you  ag <<  19 // * based  on  the Program)  you indicate  your  acceptance of  this *
 22 // * use  in  resulting  scientific  publicati <<  20 // * statement, and all its terms.                                    *
 23 // * acceptance of all terms of the Geant4 Sof << 
 24 // *******************************************     21 // ********************************************************************
 25 //                                                 22 //
 26 /// \file field/field02/src/F02DetectorConstru << 
 27 /// \brief Implementation of the F02DetectorCo << 
 28 //                                                 23 //
                                                   >>  24 // $Id: F02DetectorConstruction.cc,v 1.11 2005/10/13 15:00:13 grichine Exp $
                                                   >>  25 // GEANT4 tag $Name: geant4-08-00 $
 29 //                                                 26 //
 30 //                                             <<  27 // 
 31 //                                             << 
 32 //....oooOO0OOooo........oooOO0OOooo........oo << 
 33 //....oooOO0OOooo........oooOO0OOooo........oo << 
 34                                                    28 
 35 #include "F02DetectorConstruction.hh"              29 #include "F02DetectorConstruction.hh"
                                                   >>  30 #include "F02DetectorMessenger.hh"
 36                                                    31 
 37 #include "F02CalorimeterSD.hh"                     32 #include "F02CalorimeterSD.hh"
 38 #include "F02DetectorMessenger.hh"             <<  33 #include "F02ElectricFieldSetup.hh"
                                                   >>  34 
 39                                                    35 
 40 #include "G4AutoDelete.hh"                     << 
 41 #include "G4GeometryManager.hh"                << 
 42 #include "G4FieldBuilder.hh"                   << 
 43 #include "G4LogicalVolume.hh"                  << 
 44 #include "G4LogicalVolumeStore.hh"             << 
 45 #include "G4Material.hh"                           36 #include "G4Material.hh"
                                                   >>  37 #include "G4Tubs.hh"
                                                   >>  38 #include "G4LogicalVolume.hh"
 46 #include "G4PVPlacement.hh"                        39 #include "G4PVPlacement.hh"
 47 #include "G4PhysicalConstants.hh"              <<  40 #include "G4UniformMagField.hh"
 48 #include "G4PhysicalVolumeStore.hh"            <<  41 #include "G4FieldManager.hh"
 49 #include "G4RunManager.hh"                     <<  42 #include "G4TransportationManager.hh"
 50 #include "G4SDManager.hh"                          43 #include "G4SDManager.hh"
                                                   >>  44 #include "G4RunManager.hh"
                                                   >>  45 
                                                   >>  46 #include "G4GeometryManager.hh"
                                                   >>  47 #include "G4PhysicalVolumeStore.hh"
                                                   >>  48 #include "G4LogicalVolumeStore.hh"
 51 #include "G4SolidStore.hh"                         49 #include "G4SolidStore.hh"
 52 #include "G4SystemOfUnits.hh"                  << 
 53 #include "G4Tubs.hh"                           << 
 54 #include "G4UniformElectricField.hh"           << 
 55                                                    50 
 56 //....oooOO0OOooo........oooOO0OOooo........oo <<  51 #include "G4ios.hh"
                                                   >>  52 
                                                   >>  53 /////////////////////////////////////////////////////////////////////////////
                                                   >>  54 //
                                                   >>  55 //
 57                                                    56 
 58 F02DetectorConstruction::F02DetectorConstructi     57 F02DetectorConstruction::F02DetectorConstruction()
                                                   >>  58  : solidWorld(0), logicWorld(0), physiWorld(0),
                                                   >>  59    solidAbsorber(0),logicAbsorber(0), physiAbsorber(0),
                                                   >>  60    fEmFieldSetup(0), calorimeterSD(0),
                                                   >>  61    AbsorberMaterial(0), worldchanged(false), WorldMaterial(0)
 59 {                                                  62 {
 60   // create commands for interactive definitio <<  63   // default parameter values of the calorimeter
 61                                                    64 
 62   fDetectorMessenger = new F02DetectorMessenge <<  65   WorldSizeZ = 80.*cm;
                                                   >>  66   WorldSizeR = 20.*cm;
 63                                                    67 
 64   // create field builder                      <<  68   AbsorberThickness = 40.0*mm;
 65   // this will create commands for field confi <<  69 
 66   G4FieldBuilder::Instance();                  <<  70   AbsorberRadius   = 10.*cm;
 67   // G4FieldBuilder::Instance()->SetVerboseLev <<  71   zAbsorber = 36.*cm ;
 68                                                <<  72 
 69   // create materials                          <<  73   // create commands for interactive definition of the calorimeter  
                                                   >>  74 
                                                   >>  75   detectorMessenger = new F02DetectorMessenger(this);
                                                   >>  76   
 70   DefineMaterials();                               77   DefineMaterials();
                                                   >>  78 
                                                   >>  79   fEmFieldSetup = new F02ElectricFieldSetup() ;
 71 }                                                  80 }
 72                                                    81 
 73 //....oooOO0OOooo........oooOO0OOooo........oo <<  82 //////////////////////////////////////////////////////////////////////////
                                                   >>  83 //
                                                   >>  84 //
 74                                                    85 
 75 F02DetectorConstruction::~F02DetectorConstruct     86 F02DetectorConstruction::~F02DetectorConstruction()
 76 {                                              <<  87 { 
 77   delete fDetectorMessenger;                   <<  88   delete detectorMessenger;
                                                   >>  89   delete fEmFieldSetup ;
 78 }                                                  90 }
 79                                                    91 
 80 //....oooOO0OOooo........oooOO0OOooo........oo <<  92 //////////////////////////////////////////////////////////////////////////
                                                   >>  93 //
                                                   >>  94 //
 81                                                    95 
 82 G4VPhysicalVolume* F02DetectorConstruction::Co     96 G4VPhysicalVolume* F02DetectorConstruction::Construct()
 83 {                                                  97 {
 84   return ConstructCalorimeter();                   98   return ConstructCalorimeter();
 85 }                                                  99 }
 86                                                   100 
 87 //....oooOO0OOooo........oooOO0OOooo........oo << 101 //////////////////////////////////////////////////////////////////////////////
                                                   >> 102 //
                                                   >> 103 //
 88                                                   104 
 89 void F02DetectorConstruction::DefineMaterials(    105 void F02DetectorConstruction::DefineMaterials()
 90 {                                              << 106 { 
 91   // This function illustrates the possible wa << 107  //This function illustrates the possible ways to define materials
 92                                                << 108  
 93   G4String name, symbol;  // a=mass of a mole; << 109   G4String name, symbol ;             // a=mass of a mole;
 94   G4double a, z, density;  // z=mean number of << 110   G4double a, z, density ;            // z=mean number of protons;  
 95   G4int nel;                                      111   G4int nel;
 96   G4int ncomponents;                              112   G4int ncomponents;
 97   G4double fractionmass, pressure, temperature    113   G4double fractionmass, pressure, temperature;
 98                                                   114 
 99   //                                           << 115 //
100   // define Elements                           << 116 // define Elements
101   //                                           << 117 //
102                                                   118 
103   a = 1.01 * g / mole;                         << 119   a = 1.01*g/mole;
104   auto elH = new G4Element(name = "Hydrogen",  << 120   G4Element* elH  = new G4Element(name="Hydrogen",symbol="H" , z= 1., a);
105                                                   121 
106   a = 12.01 * g / mole;                        << 122   a = 12.01*g/mole;
107   auto elC = new G4Element(name = "Carbon", sy << 123   G4Element* elC = new G4Element(name="Carbon", symbol="C", z=6., a);
108                                                   124 
109   a = 14.01 * g / mole;                        << 125   a = 14.01*g/mole;
110   auto elN = new G4Element(name = "Nitrogen",  << 126   G4Element* elN  = new G4Element(name="Nitrogen",symbol="N" , z= 7., a);
111                                                   127 
112   a = 16.00 * g / mole;                        << 128   a = 16.00*g/mole;
113   auto elO = new G4Element(name = "Oxygen", sy << 129   G4Element* elO  = new G4Element(name="Oxygen"  ,symbol="O" , z= 8., a);
114                                                   130 
115   a = 39.948 * g / mole;                       << 131   a = 39.948*g/mole;
116   auto elAr = new G4Element(name = "Argon", sy << 132   G4Element* elAr = new G4Element(name="Argon", symbol="Ar", z=18., a);
117                                                   133 
118   //                                           << 134 //
119   // define simple materials                   << 135 // define simple materials
120   //                                           << 136 //
121                                                   137 
122   // Mylar                                        138   // Mylar
123                                                   139 
124   density = 1.39 * g / cm3;                    << 140   density = 1.39*g/cm3;
125   auto mylar = new G4Material(name = "Mylar",  << 141   G4Material* Mylar = new G4Material(name="Mylar", density, nel=3);
126   mylar->AddElement(elO, 2);                   << 142   Mylar->AddElement(elO,2);
127   mylar->AddElement(elC, 5);                   << 143   Mylar->AddElement(elC,5);
128   mylar->AddElement(elH, 4);                   << 144   Mylar->AddElement(elH,4);
129                                                   145 
130   // Polypropelene                                146   // Polypropelene
131                                                   147 
132   auto CH2 = new G4Material("Polypropelene", 0 << 148   G4Material* CH2 = new G4Material ("Polypropelene" , 0.91*g/cm3, 2);
133   CH2->AddElement(elH, 2);                     << 149   CH2->AddElement(elH,2);
134   CH2->AddElement(elC, 1);                     << 150   CH2->AddElement(elC,1);
135                                                   151 
136   // Krypton as detector gas, STP                 152   // Krypton as detector gas, STP
137                                                   153 
138   density = 3.700 * mg / cm3;                  << 154   density = 3.700*mg/cm3 ;
139   a = 83.80 * g / mole;                        << 155   a = 83.80*g/mole ;
140   auto Kr = new G4Material(name = "Kr", z = 36 << 156   G4Material* Kr  = new G4Material(name="Kr",z=36., a, density );
141                                                   157 
142   // Dry air (average composition)                158   // Dry air (average composition)
143                                                   159 
144   density = 1.7836 * mg / cm3;  // STP         << 160   density = 1.7836*mg/cm3 ;       // STP
145   auto argon = new G4Material(name = "Argon",  << 161   G4Material* Argon = new G4Material(name="Argon"  , density, ncomponents=1);
146   argon->AddElement(elAr, 1);                  << 162   Argon->AddElement(elAr, 1);
147                                                << 163 
148   density = 1.25053 * mg / cm3;  // STP        << 164   density = 1.25053*mg/cm3 ;       // STP
149   auto nitrogen = new G4Material(name = "N2",  << 165   G4Material* Nitrogen = new G4Material(name="N2"  , density, ncomponents=1);
150   nitrogen->AddElement(elN, 2);                << 166   Nitrogen->AddElement(elN, 2);
151                                                << 167 
152   density = 1.4289 * mg / cm3;  // STP         << 168   density = 1.4289*mg/cm3 ;       // STP
153   auto oxygen = new G4Material(name = "O2", de << 169   G4Material* Oxygen = new G4Material(name="O2"  , density, ncomponents=1);
154   oxygen->AddElement(elO, 2);                  << 170   Oxygen->AddElement(elO, 2);
                                                   >> 171 
155                                                   172 
156   density = 1.2928 * mg / cm3;  // STP         << 173   density = 1.2928*mg/cm3 ;       // STP
157                                                   174 
158   temperature = STP_Temperature;                  175   temperature = STP_Temperature;
159   pressure = 1.0e-0 * STP_Pressure;            << 176   pressure = 1.0e-0*STP_Pressure;
160                                                   177 
161   auto air =                                   << 178   G4Material* Air = new G4Material(name="Air"  , density, ncomponents=3,
162     new G4Material(name = "Air", density, ncom << 179                                    kStateGas,temperature,pressure);
163   air->AddMaterial(nitrogen, fractionmass = 0. << 180   Air->AddMaterial( Nitrogen, fractionmass = 0.7557 ) ;
164   air->AddMaterial(oxygen, fractionmass = 0.23 << 181   Air->AddMaterial( Oxygen,   fractionmass = 0.2315 ) ;
165   air->AddMaterial(argon, fractionmass = 0.012 << 182   Air->AddMaterial( Argon,    fractionmass = 0.0128 ) ;
166                                                   183 
167   // Xenon as detector gas, STP                   184   // Xenon as detector gas, STP
168                                                   185 
169   density = 5.858 * mg / cm3;                  << 186   density = 5.858*mg/cm3 ;
170   a = 131.29 * g / mole;                       << 187   a = 131.29*g/mole ;
171   auto Xe = new G4Material(name = "Xenon", z = << 188   G4Material* Xe  = new G4Material(name="Xenon",z=54., a, density );
172                                                   189 
173   // Carbon dioxide, STP                          190   // Carbon dioxide, STP
174                                                   191 
175   density = 1.842 * mg / cm3;                  << 192   density = 1.977*mg/cm3;
176   auto CarbonDioxide = new G4Material(name = " << 193   G4Material* CarbonDioxide = new G4Material(name="CO2", density, nel=2);
177   CarbonDioxide->AddElement(elC, 1);           << 194   CarbonDioxide->AddElement(elC,1);
178   CarbonDioxide->AddElement(elO, 2);           << 195   CarbonDioxide->AddElement(elO,2);
179                                                   196 
180   // 80% Xe + 20% CO2, STP                        197   // 80% Xe + 20% CO2, STP
181                                                   198 
182   density = 5.0818 * mg / cm3;                 << 199   density = 5.0818*mg/cm3 ;      
183   auto Xe20CO2 = new G4Material(name = "Xe20CO << 200   G4Material* Xe20CO2 = new G4Material(name="Xe20CO2"  , density, ncomponents=2);
184   Xe20CO2->AddMaterial(Xe, fractionmass = 0.92 << 201   Xe20CO2->AddMaterial( Xe,              fractionmass = 0.922 ) ;
185   Xe20CO2->AddMaterial(CarbonDioxide, fraction << 202   Xe20CO2->AddMaterial( CarbonDioxide,   fractionmass = 0.078 ) ;
186                                                   203 
187   // 80% Kr + 20% CO2, STP                        204   // 80% Kr + 20% CO2, STP
188                                                   205 
189   density = 3.601 * mg / cm3;                  << 206   density = 3.601*mg/cm3 ;      
190   auto Kr20CO2 = new G4Material(name = "Kr20CO << 207   G4Material* Kr20CO2 = new G4Material(name="Kr20CO2"  , density, 
191   Kr20CO2->AddMaterial(Kr, fractionmass = 0.89 << 208                                                              ncomponents=2);
192   Kr20CO2->AddMaterial(CarbonDioxide, fraction << 209   Kr20CO2->AddMaterial( Kr,              fractionmass = 0.89 ) ;
                                                   >> 210   Kr20CO2->AddMaterial( CarbonDioxide,   fractionmass = 0.11 ) ;
193                                                   211 
194   G4cout << *(G4Material::GetMaterialTable())  << 
195                                                   212 
196   // default materials of the calorimeter      << 213   G4cout << *(G4Material::GetMaterialTable()) << G4endl;
197                                                   214 
198   fAbsorberMaterial = Kr20CO2;  // XeCO2CF4;   << 215   AbsorberMaterial = Kr20CO2 ;   // XeCO2CF4  ; 
199                                                   216 
200   fWorldMaterial = air;                        << 217   WorldMaterial    = Air ;
201 }                                                 218 }
202                                                   219 
203 //....oooOO0OOooo........oooOO0OOooo........oo << 220 /////////////////////////////////////////////////////////////////////////
204                                                << 221 //
                                                   >> 222 //
                                                   >> 223   
205 G4VPhysicalVolume* F02DetectorConstruction::Co    224 G4VPhysicalVolume* F02DetectorConstruction::ConstructCalorimeter()
206 {                                                 225 {
                                                   >> 226   // complete the Calor parameters definition and Print 
                                                   >> 227 
                                                   >> 228   ComputeCalorParameters();
                                                   >> 229   PrintCalorParameters();
                                                   >> 230       
207   // Cleanup old geometry                         231   // Cleanup old geometry
208                                                   232 
209   if (fPhysiWorld) {                           << 233   if (physiWorld)
                                                   >> 234   {
210     G4GeometryManager::GetInstance()->OpenGeom    235     G4GeometryManager::GetInstance()->OpenGeometry();
211     G4PhysicalVolumeStore::GetInstance()->Clea    236     G4PhysicalVolumeStore::GetInstance()->Clean();
212     G4LogicalVolumeStore::GetInstance()->Clean    237     G4LogicalVolumeStore::GetInstance()->Clean();
213     G4SolidStore::GetInstance()->Clean();         238     G4SolidStore::GetInstance()->Clean();
214   }                                               239   }
215                                                   240 
216   // complete the Calor parameters definition  << 
217                                                << 
218   ComputeCalorParameters();                    << 
219   PrintCalorParameters();                      << 
220                                                << 
221   // World                                        241   // World
222                                                << 242   
223   fSolidWorld = new G4Tubs("World",  // its na << 243   solidWorld = new G4Tubs("World",        //its name
224                            0., fWorldSizeR, fW << 244                    0.,WorldSizeR,WorldSizeZ/2.,0.,twopi);       //its size
225                                                << 245                          
226   fLogicWorld = new G4LogicalVolume(fSolidWorl << 246   logicWorld = new G4LogicalVolume(solidWorld,    //its solid
227                                     fWorldMate << 247                                    WorldMaterial, //its material
228                                     "World");  << 248                                    "World");    //its name
229                                                << 249                                    
230   fPhysiWorld = new G4PVPlacement(nullptr,  // << 250   physiWorld = new G4PVPlacement(0,     //no rotation
231                                   G4ThreeVecto << 251            G4ThreeVector(), //at (0,0,0)
232                                   "World",  // << 252                                  "World",   //its name
233                                   fLogicWorld, << 253                                  logicWorld,    //its logical volume
234                                   nullptr,  // << 254                                  0,     //its mother  volume
235                                   false,  // n << 255                                  false,     //no boolean operation
236                                   0);  // copy << 256                                  0);      //copy number                             
237   // Absorber                                     257   // Absorber
238                                                   258 
239   fSolidAbsorber = new G4Tubs("Absorber", 0.,  << 259   if (AbsorberThickness > 0.) 
240                                                << 260   { 
241   fLogicAbsorber = new G4LogicalVolume(fSolidA << 261       solidAbsorber = new G4Tubs("Absorber",    
242                                                << 262                           0.,AbsorberRadius,AbsorberThickness/2.,0.,twopi); 
243   fPhysiAbsorber = new G4PVPlacement(nullptr,  << 263                           
244                                      fLogicAbs << 264       logicAbsorber = new G4LogicalVolume(solidAbsorber,    
                                                   >> 265                               AbsorberMaterial, 
                                                   >> 266                               "Absorber");     
                                                   >> 267                               
                                                   >> 268       physiAbsorber = new G4PVPlacement(0,       
                                                   >> 269               G4ThreeVector(0.,0.,zAbsorber),        
                                                   >> 270                                         "Absorber",        
                                                   >> 271                                         logicAbsorber,     
                                                   >> 272                                         physiWorld,       
                                                   >> 273                                         false,             
                                                   >> 274                                         0);                
                                                   >> 275   }
                                                   >> 276                                  
                                                   >> 277   // Sensitive Detectors: Absorber 
                                                   >> 278   
                                                   >> 279   G4SDManager* SDman = G4SDManager::GetSDMpointer();
                                                   >> 280 
                                                   >> 281   if(!calorimeterSD)
                                                   >> 282   {
                                                   >> 283     calorimeterSD = new F02CalorimeterSD("CalorSD",this);
                                                   >> 284     SDman->AddNewDetector( calorimeterSD );
                                                   >> 285   }
                                                   >> 286   if (logicAbsorber)  logicAbsorber->SetSensitiveDetector(calorimeterSD);
245                                                   287 
246   return fPhysiWorld;                          << 288   return physiWorld;
247 }                                                 289 }
248                                                   290 
249 //....oooOO0OOooo........oooOO0OOooo........oo << 291 ////////////////////////////////////////////////////////////////////////////
                                                   >> 292 //
                                                   >> 293 //
250                                                   294 
251 void F02DetectorConstruction::PrintCalorParame    295 void F02DetectorConstruction::PrintCalorParameters()
252 {                                                 296 {
253   G4cout << "\n The  WORLD   is made of " << f << 297   G4cout << "\n The  WORLD   is made of " 
254          << fWorldMaterial->GetName();         << 298        << WorldSizeZ/mm << "mm of " << WorldMaterial->GetName() ;
255   G4cout << ", the transverse size (R) of the  << 299   G4cout << ", the transverse size (R) of the world is " << WorldSizeR/mm << " mm. " << G4endl;
256   G4cout << " The ABSORBER is made of " << fAb << 300   G4cout << " The ABSORBER is made of " 
257          << fAbsorberMaterial->GetName();      << 301        << AbsorberThickness/mm << "mm of " << AbsorberMaterial->GetName() ;
258   G4cout << ", the transverse size (R) is " << << 302   G4cout << ", the transverse size (R) is " << AbsorberRadius/mm << " mm. " << G4endl;
259   G4cout << " Z position of the (middle of the << 303   G4cout << " Z position of the (middle of the) absorber " << zAbsorber/mm << "  mm." << G4endl;
260   G4cout << G4endl;                               304   G4cout << G4endl;
261 }                                                 305 }
262                                                   306 
263 //....oooOO0OOooo........oooOO0OOooo........oo << 307 ///////////////////////////////////////////////////////////////////////////
                                                   >> 308 //
                                                   >> 309 //
264                                                   310 
265 void F02DetectorConstruction::SetAbsorberMater    311 void F02DetectorConstruction::SetAbsorberMaterial(G4String materialChoice)
266 {                                                 312 {
267   // get the pointer to the material table        313   // get the pointer to the material table
268   const G4MaterialTable* theMaterialTable = G4    314   const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable();
269                                                   315 
270   // search the material by its name           << 316   // search the material by its name   
271   G4Material* material;                        << 317   G4Material* pttoMaterial;
272   for (size_t j = 0; j < theMaterialTable->siz << 318   for (size_t J=0 ; J<theMaterialTable->size() ; J++)
273     material = (*theMaterialTable)[j];         << 319    { pttoMaterial = (*theMaterialTable)[J];     
274     if (material->GetName() == materialChoice) << 320      if(pttoMaterial->GetName() == materialChoice)
275       fAbsorberMaterial = material;            << 321         {
276       fLogicAbsorber->SetMaterial(material);   << 322     AbsorberMaterial = pttoMaterial;
277       G4RunManager::GetRunManager()->PhysicsHa << 323           logicAbsorber->SetMaterial(pttoMaterial); 
278     }                                          << 324         }             
279   }                                            << 325    }
280 }                                                 326 }
281                                                   327 
282 //....oooOO0OOooo........oooOO0OOooo........oo << 328 ////////////////////////////////////////////////////////////////////////////
                                                   >> 329 //
                                                   >> 330 //
283                                                   331 
284 void F02DetectorConstruction::SetWorldMaterial    332 void F02DetectorConstruction::SetWorldMaterial(G4String materialChoice)
285 {                                                 333 {
286   // get the pointer to the material table        334   // get the pointer to the material table
287   const G4MaterialTable* theMaterialTable = G4    335   const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable();
288                                                   336 
289   // search the material by its name           << 337   // search the material by its name   
290   G4Material* material;                        << 338   G4Material* pttoMaterial;
291   for (size_t j = 0; j < theMaterialTable->siz << 339   for (size_t J=0 ; J<theMaterialTable->size() ; J++)
292     material = (*theMaterialTable)[j];         << 340    { pttoMaterial = (*theMaterialTable)[J];     
293     if (material->GetName() == materialChoice) << 341      if(pttoMaterial->GetName() == materialChoice)
294       fWorldMaterial = material;               << 342         {
295       fLogicWorld->SetMaterial(material);      << 343     WorldMaterial = pttoMaterial;
296       G4RunManager::GetRunManager()->PhysicsHa << 344           logicWorld->SetMaterial(pttoMaterial); 
297     }                                          << 345         }             
298   }                                            << 346    }
299 }                                                 347 }
300                                                   348 
301 //....oooOO0OOooo........oooOO0OOooo........oo << 349 ///////////////////////////////////////////////////////////////////////////
                                                   >> 350 //
                                                   >> 351 //
302                                                   352 
303 void F02DetectorConstruction::SetAbsorberThick    353 void F02DetectorConstruction::SetAbsorberThickness(G4double val)
304 {                                                 354 {
305   // change Absorber thickness and recompute t    355   // change Absorber thickness and recompute the calorimeter parameters
306   fAbsorberThickness = val;                    << 356   AbsorberThickness = val;
307   ComputeCalorParameters();                       357   ComputeCalorParameters();
308   G4RunManager::GetRunManager()->GeometryHasBe << 358 }  
309 }                                              << 
310                                                   359 
311 //....oooOO0OOooo........oooOO0OOooo........oo << 360 /////////////////////////////////////////////////////////////////////////////
                                                   >> 361 //
                                                   >> 362 //
312                                                   363 
313 void F02DetectorConstruction::SetAbsorberRadiu    364 void F02DetectorConstruction::SetAbsorberRadius(G4double val)
314 {                                                 365 {
315   // change the transverse size and recompute     366   // change the transverse size and recompute the calorimeter parameters
316   fAbsorberRadius = val;                       << 367   AbsorberRadius = val;
317   ComputeCalorParameters();                       368   ComputeCalorParameters();
318   G4RunManager::GetRunManager()->GeometryHasBe << 369 }  
319 }                                              << 
320                                                   370 
321 //....oooOO0OOooo........oooOO0OOooo........oo << 371 ////////////////////////////////////////////////////////////////////////////
                                                   >> 372 //
                                                   >> 373 //
322                                                   374 
323 void F02DetectorConstruction::SetWorldSizeZ(G4    375 void F02DetectorConstruction::SetWorldSizeZ(G4double val)
324 {                                                 376 {
325   fWorldChanged = true;                        << 377   worldchanged=true;
326   fWorldSizeZ = val;                           << 378   WorldSizeZ = val;
327   ComputeCalorParameters();                       379   ComputeCalorParameters();
328   G4RunManager::GetRunManager()->GeometryHasBe << 380 }  
329 }                                              << 
330                                                   381 
331 //....oooOO0OOooo........oooOO0OOooo........oo << 382 ///////////////////////////////////////////////////////////////////////////
                                                   >> 383 //
                                                   >> 384 //
332                                                   385 
333 void F02DetectorConstruction::SetWorldSizeR(G4    386 void F02DetectorConstruction::SetWorldSizeR(G4double val)
334 {                                                 387 {
335   fWorldChanged = true;                        << 388   worldchanged=true;
336   fWorldSizeR = val;                           << 389   WorldSizeR = val;
337   ComputeCalorParameters();                       390   ComputeCalorParameters();
338   G4RunManager::GetRunManager()->GeometryHasBe << 391 }  
339 }                                              << 
340                                                   392 
341 //....oooOO0OOooo........oooOO0OOooo........oo << 393 //////////////////////////////////////////////////////////////////////////////
                                                   >> 394 //
                                                   >> 395 //
342                                                   396 
343 void F02DetectorConstruction::SetAbsorberZpos(    397 void F02DetectorConstruction::SetAbsorberZpos(G4double val)
344 {                                                 398 {
345   fZAbsorber = val;                            << 399   zAbsorber  = val;
346   ComputeCalorParameters();                       400   ComputeCalorParameters();
347   G4RunManager::GetRunManager()->GeometryHasBe << 401 }  
348 }                                              << 
349                                                << 
350 //....oooOO0OOooo........oooOO0OOooo........oo << 
351                                                   402 
352 void F02DetectorConstruction::SetFieldValue(G4 << 
353 {                                              << 
354   fFieldVector = value;                        << 
355                                                << 
356   G4UniformElectricField* elField = nullptr;   << 
357   if (fFieldVector != G4ThreeVector(0.,0.,0.)) << 
358     elField = new G4UniformElectricField(fFiel << 
359   }                                            << 
360                                                << 
361   // Set field to the field builder            << 
362   auto fieldBuilder = G4FieldBuilder::Instance << 
363   fieldBuilder->SetGlobalField(elField);       << 
364 }                                              << 
365                                                   403 
366 //....oooOO0OOooo........oooOO0OOooo........oo << 404 ////////////////////////////////////////////////////////////////////////////
367                                                << 405 //
368 void F02DetectorConstruction::ConstructSDandFi << 406 //
                                                   >> 407   
                                                   >> 408 void F02DetectorConstruction::UpdateGeometry()
369 {                                                 409 {
370   // Sensitive Detectors: Absorber             << 410   G4RunManager::GetRunManager()->DefineWorldVolume(ConstructCalorimeter());
371                                                << 
372   if (!fCalorimeterSD.Get()) {                 << 
373     auto calorimeterSD = new F02CalorimeterSD( << 
374     fCalorimeterSD.Put(calorimeterSD);         << 
375   }                                            << 
376   G4SDManager::GetSDMpointer()->AddNewDetector << 
377   SetSensitiveDetector(fLogicAbsorber, fCalori << 
378                                                << 
379   // Create detector field                     << 
380   SetFieldValue(fFieldVector);                 << 
381                                                << 
382   // Construct all Geant4 field objects        << 
383   auto fieldBuilder = G4FieldBuilder::Instance << 
384   fieldBuilder->SetFieldType(kElectroMagnetic) << 
385   fieldBuilder->ConstructFieldSetup();         << 
386 }                                                 411 }
387                                                   412 
388 //....oooOO0OOooo........oooOO0OOooo........oo << 413 //
                                                   >> 414 //
                                                   >> 415 ////////////////////////////////////////////////////////////////////////////
389                                                   416