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 7.1.p1)


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