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 9.6.p4)


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