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.3)


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