Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/examples/advanced/microbeam/src/DetectorConstruction.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/advanced/microbeam/src/DetectorConstruction.cc (Version 11.3.0) and /examples/advanced/microbeam/src/DetectorConstruction.cc (Version 10.1.p2)


  1 //                                                  1 //
  2 // *******************************************      2 // ********************************************************************
  3 // * License and Disclaimer                         3 // * License and Disclaimer                                           *
  4 // *                                                4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of th      5 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
  6 // * the Geant4 Collaboration.  It is provided      6 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
  7 // * conditions of the Geant4 Software License      7 // * conditions of the Geant4 Software License,  included in the file *
  8 // * LICENSE and available at  http://cern.ch/      8 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
  9 // * include a list of copyright holders.           9 // * include a list of copyright holders.                             *
 10 // *                                               10 // *                                                                  *
 11 // * Neither the authors of this software syst     11 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing fin     12 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warran     13 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assum     14 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file      15 // * use.  Please see the license in the file  LICENSE  and URL above *
 16 // * for the full disclaimer and the limitatio     16 // * for the full disclaimer and the limitation of liability.         *
 17 // *                                               17 // *                                                                  *
 18 // * This  code  implementation is the result      18 // * This  code  implementation is the result of  the  scientific and *
 19 // * technical work of the GEANT4 collaboratio     19 // * technical work of the GEANT4 collaboration.                      *
 20 // * By using,  copying,  modifying or  distri     20 // * By using,  copying,  modifying or  distributing the software (or *
 21 // * any work based  on the software)  you  ag     21 // * any work based  on the software)  you  agree  to acknowledge its *
 22 // * use  in  resulting  scientific  publicati     22 // * use  in  resulting  scientific  publications,  and indicate your *
 23 // * acceptance of all terms of the Geant4 Sof     23 // * acceptance of all terms of the Geant4 Software license.          *
 24 // *******************************************     24 // ********************************************************************
 25 //                                                 25 //
 26 // This example is provided by the Geant4-DNA      26 // This example is provided by the Geant4-DNA collaboration
 27 // Any report or published results obtained us     27 // Any report or published results obtained using the Geant4-DNA software 
 28 // shall cite the following Geant4-DNA collabo     28 // shall cite the following Geant4-DNA collaboration publication:
 29 // Med. Phys. 37 (2010) 4692-4708                  29 // Med. Phys. 37 (2010) 4692-4708
 30 // The Geant4-DNA web site is available at htt     30 // The Geant4-DNA web site is available at http://geant4-dna.org
 31 //                                                 31 // 
 32 // If you use this example, please cite the fo     32 // If you use this example, please cite the following publication:
 33 // Rad. Prot. Dos. 133 (2009) 2-11                 33 // Rad. Prot. Dos. 133 (2009) 2-11
 34                                                    34 
 35 #include "DetectorConstruction.hh"                 35 #include "DetectorConstruction.hh"
 36 #include "G4PhysicalConstants.hh"                  36 #include "G4PhysicalConstants.hh"
 37 #include "G4SystemOfUnits.hh"                      37 #include "G4SystemOfUnits.hh"
 38 #include "G4MagIntegratorDriver.hh"            <<  38 
 39 #include "G4AutoDelete.hh"                     <<  39 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
                                                   >>  40 
                                                   >>  41 G4ThreadLocal EMField* DetectorConstruction::fField = 0;
                                                   >>  42 
                                                   >>  43 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
 40                                                    44 
 41 DetectorConstruction::DetectorConstruction()       45 DetectorConstruction::DetectorConstruction()
 42                                                    46   
 43   :fDefaultMaterial(nullptr),fCollimatorMateri <<  47   :fDefaultMaterial(NULL),fCollimatorMaterial(NULL),fBoiteMaterial(NULL),
 44    fCathodeMaterial(nullptr),fVerreMaterial(nu <<  48    fCathodeMaterial(NULL),fVerreMaterial(NULL),fVerre2Material(NULL),   
 45    fKgmMaterial(nullptr),fBoite2Material(nullp <<  49    fKgmMaterial(NULL),fBoite2Material(NULL),fBoite3Material(NULL),
 46    fNucleusMaterial1(nullptr),fCytoplasmMateri <<  50    fNucleusMaterial1(NULL),fCytoplasmMaterial1(NULL),
 47    fNucleusMaterial2(nullptr),fCytoplasmMateri <<  51    fNucleusMaterial2(NULL),fCytoplasmMaterial2(NULL),
 48    fNucleusMaterial3(nullptr),fCytoplasmMateri <<  52    fNucleusMaterial3(NULL),fCytoplasmMaterial3(NULL),
 49    fPhysiWorld(nullptr),fLogicWorld(nullptr),f <<  53    fPhysiWorld(NULL),fLogicWorld(NULL),fSolidWorld(NULL),
 50    fPhysiVol(nullptr),fLogicVol(nullptr),fSoli <<  54    fPhysiVol(NULL),fLogicVol(NULL),fSolidVol(NULL),
 51    fPhysiBoite(nullptr),fLogicBoite(nullptr),f <<  55    fPhysiBoite(NULL),fLogicBoite(NULL),fSolidBoite(NULL),
 52    fPhysiYoke1(nullptr),fLogicYoke1(nullptr),f <<  56    fPhysiYoke1(NULL),fLogicYoke1(NULL),fSolidYoke1(NULL),
 53    fPhysi1Gap(nullptr),fLogic1Gap(nullptr),fSo <<  57    fPhysi1Gap(NULL),fLogic1Gap(NULL),fSolid1Gap(NULL),
 54    fPhysi2Gap(nullptr),fLogic2Gap(nullptr),fSo <<  58    fPhysi2Gap(NULL),fLogic2Gap(NULL),fSolid2Gap(NULL), 
 55    fPhysi3Gap(nullptr),fLogic3Gap(nullptr),fSo <<  59    fPhysi3Gap(NULL),fLogic3Gap(NULL),fSolid3Gap(NULL),
 56    fPhysiYoke2(nullptr),fLogicYoke2(nullptr),f <<  60    fPhysiYoke2(NULL),fLogicYoke2(NULL),fSolidYoke2(NULL),
 57    fPhysi4Gap(nullptr),fLogic4Gap(nullptr),fSo <<  61    fPhysi4Gap(NULL),fLogic4Gap(NULL),fSolid4Gap(NULL),
 58    fPhysi5Gap(nullptr),fLogic5Gap(nullptr),fSo <<  62    fPhysi5Gap(NULL),fLogic5Gap(NULL),fSolid5Gap(NULL), 
 59    fPhysiBoiteIso(nullptr),fLogicBoiteIso(null <<  63    fPhysiBoiteIso(NULL),fLogicBoiteIso(NULL),fSolidBoiteIso(NULL),
 60    fPhysiCathode(nullptr),fLogicCathode(nullpt <<  64    fPhysiCathode(NULL),fLogicCathode(NULL),fSolidCathode(NULL), 
 61    fPhysiIso(nullptr),fLogicIso(nullptr),fSoli <<  65    fPhysiIso(NULL),fLogicIso(NULL),fSolidIso(NULL),
 62    fPhysiVerre(nullptr),fLogicVerre(nullptr),f <<  66    fPhysiVerre(NULL),fLogicVerre(NULL),fSolidVerre(NULL),
 63    fPhysiBoite2(nullptr),fLogicBoite2(nullptr) <<  67    fPhysiBoite2(NULL),fLogicBoite2(NULL),fSolidBoite2(NULL),
 64    fPhysiBoite3(nullptr),fLogicBoite3(nullptr) <<  68    fPhysiBoite3(NULL),fLogicBoite3(NULL),fSolidBoite3(NULL),
 65    fPhysiKgm(nullptr),fLogicKgm(nullptr),fSoli <<  69    fPhysiKgm(NULL),fLogicKgm(NULL),fSolidKgm(NULL),
 66    fPhysiVerre2(nullptr),fLogicVerre2(nullptr) <<  70    fPhysiVerre2(NULL),fLogicVerre2(NULL),fSolidVerre2(NULL),
 67    fPhysiPhantom(nullptr),fLogicPhantom(nullpt <<  71    fPhysiPhantom(NULL),fLogicPhantom(NULL),fSolidPhantom(NULL)
 68                                                    72   
 69 {                                                  73 {
 70   DefineMaterials();                           <<  74   fWorldSizeXY=fWorldSizeZ=0;
 71                                                << 
 72   // Initialisation of variables which         << 
 73   // will then be appropriately fixed in metho << 
 74   // to implement the simulation geometry set- << 
 75   fDensityPhantom = 0.; // in g/cm3            << 
 76   fDensityNucleus = 0.; // in g/cm3            << 
 77   fDensityCytoplasm = 0.; // in g/cm3          << 
 78   fWorldSizeXY=fWorldSizeZ=0.;                 << 
 79   fCollObjSizeXY = 0.;                         << 
 80   fCollObjSizeZ = 0.;                          << 
 81                                                << 
 82   // TARGET POSITION                           << 
 83   fCiblePositionX = 0.;                        << 
 84   fCiblePositionY = 0.;                        << 
 85   fCiblePositionZ = 0.;                        << 
 86                                                << 
 87    // MICROBEAM LINE ANGLE                     << 
 88   fLineAngle = 0.;                             << 
 89                                                << 
 90   fNbOfPixelsInPhantom=0;                      << 
 91 }                                                  75 }  
 92                                                    76 
                                                   >>  77 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
                                                   >>  78 
 93 DetectorConstruction::~DetectorConstruction()      79 DetectorConstruction::~DetectorConstruction()
 94 {}                                             <<  80 {
                                                   >>  81   delete fDefaultMaterial;
                                                   >>  82   delete fCollimatorMaterial;
                                                   >>  83   delete fBoiteMaterial;
                                                   >>  84   delete fCathodeMaterial;
                                                   >>  85   delete fVerreMaterial;
                                                   >>  86   delete fVerre2Material;
                                                   >>  87   delete fKgmMaterial;
                                                   >>  88   delete fBoite2Material;
                                                   >>  89   delete fBoite3Material;
                                                   >>  90   delete fNucleusMaterial1;
                                                   >>  91   delete fCytoplasmMaterial1;
                                                   >>  92   delete fNucleusMaterial2;
                                                   >>  93   delete fCytoplasmMaterial2;
                                                   >>  94   delete fNucleusMaterial3;
                                                   >>  95   delete fCytoplasmMaterial3;
                                                   >>  96 }
                                                   >>  97 
                                                   >>  98 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
 95                                                    99 
 96 G4VPhysicalVolume* DetectorConstruction::Const    100 G4VPhysicalVolume* DetectorConstruction::Construct()
                                                   >> 101   
 97 {                                                 102 {
 98   if(fPhysiWorld) { return fPhysiWorld; }      << 103   DefineMaterials();
 99   return ConstructLine();                         104   return ConstructLine();
100 }                                                 105 }
101                                                   106 
                                                   >> 107 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
                                                   >> 108 
102 void DetectorConstruction::DefineMaterials()      109 void DetectorConstruction::DefineMaterials()
103 {                                                 110 { 
                                                   >> 111 
104   G4String name, symbol;                          112   G4String name, symbol;             
105   G4double density;                               113   G4double density;            
106                                                   114   
107   G4int ncomponents, natoms,nel;                  115   G4int ncomponents, natoms,nel;
108   G4double z, a;                                  116   G4double z, a;
109   G4double fractionmass;                          117   G4double fractionmass;
110   G4double temperature, pressure;                 118   G4double temperature, pressure;
111                                                   119   
112   // Define Elements                              120   // Define Elements 
113                                                   121   
114   G4Element*   H  = new G4Element ("Hydrogen",    122   G4Element*   H  = new G4Element ("Hydrogen", "H", 1. ,  1.01*g/mole);
115   G4Element*   N  = new G4Element ("Nitrogen",    123   G4Element*   N  = new G4Element ("Nitrogen", "N", 7., 14.01*g/mole);
116   G4Element*   O  = new G4Element ("Oxygen"  ,    124   G4Element*   O  = new G4Element ("Oxygen"  , "O", 8. , 16.00*g/mole);
117   G4Element*   Ar = new G4Element ("Argon" , "    125   G4Element*   Ar = new G4Element ("Argon" , "Ar", 18., 39.948*g/mole );
118   G4Element*    C = new G4Element ("Carbon","C    126   G4Element*    C = new G4Element ("Carbon","C", 6., 12.011*g/mole);
119   G4Element *  Si = new G4Element ("Silicon","    127   G4Element *  Si = new G4Element ("Silicon","Si",14., 28.0855*g/mole);
120   G4Element *  Cu = new G4Element ("Cuivre","C    128   G4Element *  Cu = new G4Element ("Cuivre","Cu",29., 63.546*g/mole);
121   G4Element *  Zn = new G4Element ("Zinc","Zn"    129   G4Element *  Zn = new G4Element ("Zinc","Zn",30.,65.409*g/mole);
122   G4Element *  P  = new G4Element ("Phosphorus    130   G4Element *  P  = new G4Element ("Phosphorus","P",15.,30.973761*g/mole);
123                                                   131  
124   // Vacuum standard definition...                132   // Vacuum standard definition...
125                                                   133   
126   density = universe_mean_density;                134   density = universe_mean_density;
127   G4Material* vacuum = new G4Material(name="Va    135   G4Material* vacuum = new G4Material(name="Vacuum", z=1., a=1.01*g/mole,
128               density);                           136               density);  
129   // Water                                        137   // Water 
130                                                   138   
131   density = 1.000*g/cm3;                          139   density = 1.000*g/cm3;
132   G4Material* H2O = new G4Material(name="H2O"     140   G4Material* H2O = new G4Material(name="H2O"  , density, ncomponents=2);
133   H2O->AddElement(H, natoms=2);                   141   H2O->AddElement(H, natoms=2);
134   H2O->AddElement(O, natoms=1);                   142   H2O->AddElement(O, natoms=1);
135                                                   143  
136   // Air                                          144   // Air
137                                                   145   
138   density = 1.290*mg/cm3;                         146   density = 1.290*mg/cm3;
139   pressure = 1*atmosphere;                        147   pressure = 1*atmosphere;
140   temperature = 293.16*kelvin;                    148   temperature = 293.16*kelvin;
141   G4Material* Air = new G4Material(name="Air"     149   G4Material* Air = new G4Material(name="Air"  , density, ncomponents=2, kStateGas, temperature, pressure);
142   Air->AddElement(N, fractionmass=0.7);           150   Air->AddElement(N, fractionmass=0.7);
143   Air->AddElement(O, fractionmass=0.3);           151   Air->AddElement(O, fractionmass=0.3);
144                                                   152   
145   // Low Pressure air                             153   // Low Pressure air
146                                                   154   
147   density = (5e-6/1013.)*1.290*mg/cm3; // 5e-6    155   density = (5e-6/1013.)*1.290*mg/cm3; // 5e-6 mbar is the usual beam pipe air pressure
148   pressure = 1*atmosphere;                        156   pressure = 1*atmosphere;
149   temperature = 293.16*kelvin;                    157   temperature = 293.16*kelvin;
150   G4Material* LPAir = new G4Material(name="LPA    158   G4Material* LPAir = new G4Material(name="LPAir"  , density, ncomponents=3, kStateGas, temperature, pressure);
151   LPAir->AddElement(N, fractionmass=0.715);       159   LPAir->AddElement(N, fractionmass=0.715);
152   LPAir->AddElement(O, fractionmass=0.25);        160   LPAir->AddElement(O, fractionmass=0.25);
153   LPAir->AddElement(Ar, fractionmass=0.035);      161   LPAir->AddElement(Ar, fractionmass=0.035);
154                                                   162   
155   // Platinum                                     163   // Platinum
156                                                   164   
157   a = 195.09*g/mole;                              165   a = 195.09*g/mole;
158   density = 21.4*g/cm3;                           166   density = 21.4*g/cm3;
159   G4Material* Pt = new G4Material(name="Pl", z    167   G4Material* Pt = new G4Material(name="Pl", z=78., a, density);
160                                                   168  
161   // Butane @ 10 mbar                             169   // Butane @ 10 mbar
162                                                   170   
163   density = 2.552e-2*mg/cm3;                      171   density = 2.552e-2*mg/cm3;
164   pressure = 0.01*bar;                            172   pressure = 0.01*bar;
165   temperature = 293.16*kelvin;                    173   temperature = 293.16*kelvin;
166   G4Material* Butane = new G4Material(name = "    174   G4Material* Butane = new G4Material(name = "Butane", density, nel = 2, kStateGas, temperature, pressure);
167   Butane->AddElement (C, natoms=4);               175   Butane->AddElement (C, natoms=4);
168   Butane->AddElement (H, natoms=10);              176   Butane->AddElement (H, natoms=10);
169                                                   177   
170   // Polypropylene                                178   // Polypropylene
171                                                   179   
172   density = 0.9*g/cm3;                            180   density = 0.9*g/cm3;
173   G4Material* Polyprop = new G4Material(name =    181   G4Material* Polyprop = new G4Material(name = "Polyprop", density, nel = 2);
174   Polyprop->AddElement (C,3);                     182   Polyprop->AddElement (C,3);
175   Polyprop->AddElement (H,6);                     183   Polyprop->AddElement (H,6);
176                                                   184 
177   // Si3N4                                        185   // Si3N4
178                                                   186   
179   density = 3.44*g/cm3;                           187   density = 3.44*g/cm3;
180   G4Material* Si3N4 = new G4Material(name = "S    188   G4Material* Si3N4 = new G4Material(name = "Si3N4", density, nel = 2);
181   Si3N4->AddElement (Si, natoms=3);               189   Si3N4->AddElement (Si, natoms=3);
182   Si3N4->AddElement (N, natoms=4);                190   Si3N4->AddElement (N, natoms=4);
183                                                   191   
184   // SiO2                                         192   // SiO2
185                                                   193   
186   density = 2.5*g/cm3;                            194   density = 2.5*g/cm3;
187   G4Material* SiO2 = new G4Material(name = "Si    195   G4Material* SiO2 = new G4Material(name = "SiO2", density, nel = 2);
188   SiO2->AddElement (Si, natoms=1);                196   SiO2->AddElement (Si, natoms=1);
189   SiO2->AddElement (O, natoms=2);                 197   SiO2->AddElement (O, natoms=2);
190                                                   198     
191   // Brass                                        199   // Brass
192                                                   200   
193   density = 8.5*g/cm3;                            201   density = 8.5*g/cm3;
194   G4Material* Laiton = new G4Material(name = "    202   G4Material* Laiton = new G4Material(name = "Laiton", density, nel = 2);
195   Laiton->AddElement (Cu,1);                      203   Laiton->AddElement (Cu,1);
196   Laiton->AddElement (Zn,1);                      204   Laiton->AddElement (Zn,1);
197                                                   205 
198   // Phantom                                      206   // Phantom
199                                                   207   
200   fDensityPhantom = 1.; // in g/cm3               208   fDensityPhantom = 1.; // in g/cm3
201                                                   209 
202   // Nucleus composition from Alard et al., Ra    210   // Nucleus composition from Alard et al., Rad. Res. 158, 650 (2002) and
203   // Comp. Math. Meth. Med. 147252 (2012)         211   // Comp. Math. Meth. Med. 147252 (2012) 
204   //                                              212   //
205   // Cytoplasm composition is assumed to be wa    213   // Cytoplasm composition is assumed to be water
206                                                   214   
207   // Cytoplasm                                    215   // Cytoplasm
208                                                   216   
209   fDensityCytoplasm = 1.; // in g/cm3             217   fDensityCytoplasm = 1.; // in g/cm3
210   density = fDensityCytoplasm*g/cm3;              218   density = fDensityCytoplasm*g/cm3;
211   G4Material* Cytoplasm1 = new G4Material(name    219   G4Material* Cytoplasm1 = new G4Material(name="Cytoplasm1"  , density, ncomponents=2);
212   Cytoplasm1->AddElement(H, fractionmass=0.112    220   Cytoplasm1->AddElement(H, fractionmass=0.112);
213   Cytoplasm1->AddElement(O, fractionmass=0.888    221   Cytoplasm1->AddElement(O, fractionmass=0.888);
214                                                   222  
215   // Nucleoli                                     223   // Nucleoli
216                                                   224   
217   fDensityCytoplasm = 1.;                         225   fDensityCytoplasm = 1.;  
218   // in g/cm3 (nucleoli are assumed to have th    226   // in g/cm3 (nucleoli are assumed to have the same chemical comp. as nucleus)
219   density = fDensityCytoplasm*g/cm3;              227   density = fDensityCytoplasm*g/cm3;
220   G4Material* Cytoplasm2 = new G4Material(name    228   G4Material* Cytoplasm2 = new G4Material(name="Cytoplasm2"  , density, ncomponents=5);
221   Cytoplasm2->AddElement(H, fractionmass=0.106    229   Cytoplasm2->AddElement(H, fractionmass=0.1064);
222   Cytoplasm2->AddElement(O, fractionmass=0.745    230   Cytoplasm2->AddElement(O, fractionmass=0.745);
223   Cytoplasm2->AddElement(C, fractionmass=0.090    231   Cytoplasm2->AddElement(C, fractionmass=0.0904);
224   Cytoplasm2->AddElement(N, fractionmass=0.032    232   Cytoplasm2->AddElement(N, fractionmass=0.0321);
225   Cytoplasm2->AddElement(P, fractionmass=0.026    233   Cytoplasm2->AddElement(P, fractionmass=0.0261);
226                                                   234  
227   // default is water                             235   // default is water
228                                                   236   
229   fDensityCytoplasm = 1.; // in g/cm3             237   fDensityCytoplasm = 1.; // in g/cm3
230   density = fDensityCytoplasm*g/cm3;              238   density = fDensityCytoplasm*g/cm3;
231   G4Material* Cytoplasm3 = new G4Material(name    239   G4Material* Cytoplasm3 = new G4Material(name="Cytoplasm3"  , density, ncomponents=2);
232   Cytoplasm3->AddElement(H, fractionmass=0.112    240   Cytoplasm3->AddElement(H, fractionmass=0.112);
233   Cytoplasm3->AddElement(O, fractionmass=0.888    241   Cytoplasm3->AddElement(O, fractionmass=0.888);
234                                                   242  
235   // Nucleus chemical composition                 243   // Nucleus chemical composition
236                                                   244 
237   fDensityNucleus = 1.; // in g/cm3               245   fDensityNucleus = 1.; // in g/cm3
238   density = fDensityNucleus*g/cm3;                246   density = fDensityNucleus*g/cm3;
239   G4Material* Nucleus1 = new G4Material(name="    247   G4Material* Nucleus1 = new G4Material(name="Nucleus1"  , density, ncomponents=5);
240   Nucleus1->AddElement(H, fractionmass=0.1064)    248   Nucleus1->AddElement(H, fractionmass=0.1064);
241   Nucleus1->AddElement(O, fractionmass=0.745);    249   Nucleus1->AddElement(O, fractionmass=0.745);
242   Nucleus1->AddElement(C, fractionmass=0.0904)    250   Nucleus1->AddElement(C, fractionmass=0.0904);
243   Nucleus1->AddElement(N, fractionmass=0.0321)    251   Nucleus1->AddElement(N, fractionmass=0.0321);
244   Nucleus1->AddElement(P, fractionmass=0.0261)    252   Nucleus1->AddElement(P, fractionmass=0.0261);
245                                                   253  
246   fDensityNucleus = 1.; // in g/cm3               254   fDensityNucleus = 1.; // in g/cm3
247   density = fDensityNucleus*g/cm3;                255   density = fDensityNucleus*g/cm3;
248   G4Material* Nucleus2 = new G4Material(name="    256   G4Material* Nucleus2 = new G4Material(name="Nucleus2"  , density, ncomponents=5);
249   Nucleus2->AddElement(H, fractionmass=0.1064)    257   Nucleus2->AddElement(H, fractionmass=0.1064);
250   Nucleus2->AddElement(O, fractionmass=0.745);    258   Nucleus2->AddElement(O, fractionmass=0.745);
251   Nucleus2->AddElement(C, fractionmass=0.0904)    259   Nucleus2->AddElement(C, fractionmass=0.0904);
252   Nucleus2->AddElement(N, fractionmass=0.0321)    260   Nucleus2->AddElement(N, fractionmass=0.0321);
253   Nucleus2->AddElement(P, fractionmass=0.0261)    261   Nucleus2->AddElement(P, fractionmass=0.0261);
254                                                   262  
255   // default                                      263   // default
256                                                   264   
257   fDensityNucleus = 1.; // in g/cm3               265   fDensityNucleus = 1.; // in g/cm3
258   density = fDensityNucleus*g/cm3;                266   density = fDensityNucleus*g/cm3;
259   G4Material* Nucleus3 = new G4Material(name="    267   G4Material* Nucleus3 = new G4Material(name="Nucleus3"  , density, ncomponents=5);
260   Nucleus3->AddElement(H, fractionmass=0.1064)    268   Nucleus3->AddElement(H, fractionmass=0.1064);
261   Nucleus3->AddElement(O, fractionmass=0.745);    269   Nucleus3->AddElement(O, fractionmass=0.745);
262   Nucleus3->AddElement(C, fractionmass=0.0904)    270   Nucleus3->AddElement(C, fractionmass=0.0904);
263   Nucleus3->AddElement(N, fractionmass=0.0321)    271   Nucleus3->AddElement(N, fractionmass=0.0321);
264   Nucleus3->AddElement(P, fractionmass=0.0261)    272   Nucleus3->AddElement(P, fractionmass=0.0261);
265                                                   273  
266   // Materials in setup                           274   // Materials in setup
267                                                   275   
268   fDefaultMaterial  = vacuum;                     276   fDefaultMaterial  = vacuum;
269   fCollimatorMaterial   = Pt;                     277   fCollimatorMaterial   = Pt;
270   fBoiteMaterial    = Butane;                     278   fBoiteMaterial    = Butane;
271   fCathodeMaterial      = Laiton;                 279   fCathodeMaterial      = Laiton;
272   fVerreMaterial        = Si3N4;                  280   fVerreMaterial        = Si3N4;
273   fVerre2Material   = SiO2;                       281   fVerre2Material   = SiO2;
274   fKgmMaterial    = H2O;                          282   fKgmMaterial    = H2O;
275   fBoite2Material       = Air;                    283   fBoite2Material       = Air;
276   fBoite3Material       = Polyprop;               284   fBoite3Material       = Polyprop;
277                                                   285   
278   fNucleusMaterial1   = Nucleus1;                 286   fNucleusMaterial1   = Nucleus1;
279   fCytoplasmMaterial1   = Cytoplasm1;             287   fCytoplasmMaterial1   = Cytoplasm1;
280   fNucleusMaterial2   = Nucleus2;                 288   fNucleusMaterial2   = Nucleus2;
281   fCytoplasmMaterial2   = Cytoplasm2;             289   fCytoplasmMaterial2   = Cytoplasm2;
282   fNucleusMaterial3   = Nucleus3;                 290   fNucleusMaterial3   = Nucleus3;
283   fCytoplasmMaterial3   = Cytoplasm3;             291   fCytoplasmMaterial3   = Cytoplasm3;
284                                                   292   
285   // DISPLAY MATERIALS                            293   // DISPLAY MATERIALS
286   G4cout << G4endl << *(G4Material::GetMateria    294   G4cout << G4endl << *(G4Material::GetMaterialTable()) << G4endl;
287                                                   295 
288 }                                                 296 }
289                                                   297 
                                                   >> 298 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
                                                   >> 299 
290 G4VPhysicalVolume* DetectorConstruction::Const    300 G4VPhysicalVolume* DetectorConstruction::ConstructLine()
291 {                                                 301 {
292   // WORLD                                        302   // WORLD
293   fWorldSizeXY  = 20*m;                           303   fWorldSizeXY  = 20*m;
294   fWorldSizeZ   = 40*m;                           304   fWorldSizeZ   = 40*m;
295                                                   305    
296   // MICROBEAM LINE ANGLE                         306   // MICROBEAM LINE ANGLE
297   fLineAngle = 10*deg;                            307   fLineAngle = 10*deg;
298                                                   308   
299   // TARGET POSITION                              309   // TARGET POSITION
300   fCiblePositionX = -1461.42*mm;                  310   fCiblePositionX = -1461.42*mm;
301   fCiblePositionY = 0*mm;                         311   fCiblePositionY = 0*mm;
302   fCiblePositionZ = -1327 + (955*std::cos(fLin    312   fCiblePositionZ = -1327 + (955*std::cos(fLineAngle))*mm;
303                                                   313   
304   //*************                                 314   //*************
305   // WORLD VOLUME                                 315   // WORLD VOLUME
306   //*************                                 316   //*************
307                                                   317   
308   fSolidWorld = new G4Box("World",                318   fSolidWorld = new G4Box("World",                 //its name
309         fWorldSizeXY/2,fWorldSizeXY/2,fWorldSi    319         fWorldSizeXY/2,fWorldSizeXY/2,fWorldSizeZ/2);  //its size
310                                                   320   
311                                                   321   
312   fLogicWorld = new G4LogicalVolume(fSolidWorl    322   fLogicWorld = new G4LogicalVolume(fSolidWorld,  //its solid
313             fDefaultMaterial, //its material      323             fDefaultMaterial, //its material
314             "World");   //its name                324             "World");   //its name
315                                                   325   
316   fPhysiWorld = new G4PVPlacement(0,      //no    326   fPhysiWorld = new G4PVPlacement(0,      //no rotation
317            G4ThreeVector(), //at (0,0,0)          327            G4ThreeVector(), //at (0,0,0)
318                                  "World",   //    328                                  "World",   //its name
319                                  fLogicWorld,     329                                  fLogicWorld,   //its logical volume
320                                  nullptr,   // << 330                                  NULL,      //its mother  volume
321                                  false,     //    331                                  false,     //no boolean operation
322                                  0);      //co    332                                  0);      //copy number
323                                                   333 
324   //*****************                             334   //*****************
325   // FULL LINE VOLUME                             335   // FULL LINE VOLUME
326   //*****************                             336   //*****************
327                                                   337   
328   fSolidVol = new G4Box("Vol",                    338   fSolidVol = new G4Box("Vol",              
329             10.*m/2,10.*m/2,(14025)*mm/2);        339             10.*m/2,10.*m/2,(14025)*mm/2);  
330                                                   340            
331   fLogicVol = new G4LogicalVolume(fSolidVol,      341   fLogicVol = new G4LogicalVolume(fSolidVol,         
332           fDefaultMaterial,                       342           fDefaultMaterial,     
333           "Vol");                                 343           "Vol");   
334                                                   344   
335   fPhysiVol = new G4PVPlacement(0,                345   fPhysiVol = new G4PVPlacement(0,      
336              G4ThreeVector(0,0,-2012.5*mm),       346              G4ThreeVector(0,0,-2012.5*mm), 
337              "Vol",                               347              "Vol",     
338              fLogicVol,                           348              fLogicVol,     
339              fPhysiWorld,                         349              fPhysiWorld,      
340              false,                               350              false,         
341              0);                                  351              0);
342                                                   352              
343   // *****************************************    353   // *************************************************                    
344   // Whole microbeam line at 10 deg contained     354   // Whole microbeam line at 10 deg contained in a box 
345   // *****************************************    355   // *************************************************
346                                                   356 
347   G4double PosX = fCiblePositionX*mm +( (6958.    357   G4double PosX = fCiblePositionX*mm +( (6958.3/2-3.3)*std::sin(fLineAngle))*mm;
348   G4double PosZ = (fCiblePositionZ+2012.5)*mm     358   G4double PosZ = (fCiblePositionZ+2012.5)*mm - ((6958.3/2-3.3)*std::cos(fLineAngle))*mm;
349                                                   359 
350   // Adjust box absolute position                 360   // Adjust box absolute position
351                                                   361   
352   PosX = PosX + 1.3 * micrometer * std::cos(fL    362   PosX = PosX + 1.3 * micrometer * std::cos(fLineAngle);
353   PosZ = PosZ + 1.3 * micrometer * std::sin(fL    363   PosZ = PosZ + 1.3 * micrometer * std::sin(fLineAngle);
354                                                   364       
355   G4RotationMatrix *rot = new G4RotationMatrix    365   G4RotationMatrix *rot = new G4RotationMatrix();
356   //  rot->rotateX(0*deg);                     << 366   rot->rotateX(0*deg);
357   rot->rotateY(10*deg);                           367   rot->rotateY(10*deg);
358   //  rot->rotateZ(0*deg);                     << 368   rot->rotateZ(0*deg);
359                                                   369  
360   fSolidBoite = new G4Box("Boite", 4*cm, 4*cm,    370   fSolidBoite = new G4Box("Boite", 4*cm, 4*cm, 6958.3*mm/2);
361                                                   371   
362   fLogicBoite = new G4LogicalVolume(fSolidBoit    372   fLogicBoite = new G4LogicalVolume(fSolidBoite, fDefaultMaterial, "Boite");
363                                                   373   
364   fPhysiBoite = new G4PVPlacement(rot,            374   fPhysiBoite = new G4PVPlacement(rot,
365          G4ThreeVector(PosX,0,PosZ),              375          G4ThreeVector(PosX,0,PosZ),
366          "Boite",                                 376          "Boite", 
367          fLogicBoite,                             377          fLogicBoite,
368          fPhysiVol,                               378          fPhysiVol,
369          false,                                   379          false, 
370          0);                                      380          0);
371                                                   381   
372   //******************************************    382   //*********************************************************************
373   // OBJECT COLLIMATOR (after switching magnet    383   // OBJECT COLLIMATOR (after switching magnet, 5 micrometer in diameter)
374   //******************************************    384   //*********************************************************************
375                                                   385   
376   fCollObjSizeXY = 8*cm;                          386   fCollObjSizeXY = 8*cm;
377   fCollObjSizeZ = 0.07*mm;                        387   fCollObjSizeZ = 0.07*mm;
378                                                   388   
379   fSolidYoke1 = new G4Box("_CollObj_yoke1_", f    389   fSolidYoke1 = new G4Box("_CollObj_yoke1_", fCollObjSizeXY/2,fCollObjSizeXY/2,fCollObjSizeZ/2);
380                                                   390   
381   fLogicYoke1 = new G4LogicalVolume(fSolidYoke    391   fLogicYoke1 = new G4LogicalVolume(fSolidYoke1, fCollimatorMaterial, "_CollObj_yoke1_");
382                                                   392   
383   fPhysiYoke1 = new G4PVPlacement( 0, G4ThreeV    393   fPhysiYoke1 = new G4PVPlacement( 0, G4ThreeVector(0,0,6958.3*mm/2-3.3*mm-6955*mm+0.07*mm/2), fLogicYoke1, 
384                                    "_CollObj_y    394                                    "_CollObj_yoke1_",fLogicBoite, false, 0);
385                                                   395    
386   // --> FIRST PART                               396   // --> FIRST PART
387                                                   397   
388   fSolid1Gap = new G4Cons("_CollObj_gap1_", 0.    398   fSolid1Gap = new G4Cons("_CollObj_gap1_", 0.*micrometer, 6*micrometer,
389        0.*micrometer,2.5*micrometer,              399        0.*micrometer,2.5*micrometer,
390        3.5*micrometer,                            400        3.5*micrometer, 
391        0, twopi);                              << 401        0, ((360*CLHEP::pi)/180));
392                                                   402   
393   fLogic1Gap = new G4LogicalVolume(fSolid1Gap,    403   fLogic1Gap = new G4LogicalVolume(fSolid1Gap, fDefaultMaterial, "_CollObj_gap1_");
394                                                   404   
395   fPhysi1Gap = new G4PVPlacement(0, G4ThreeVec    405   fPhysi1Gap = new G4PVPlacement(0, G4ThreeVector(0,0,0.0315*mm), fLogic1Gap, "_CollObj_gap1_", 
396                                  fLogicYoke1,     406                                  fLogicYoke1, false, 0);
397                                                   407   
398                                                   408   
399   // --> SECOND PART                              409   // --> SECOND PART
400                                                   410   
401   fSolid2Gap = new G4Cons("_CollObj_gap2_", 0.    411   fSolid2Gap = new G4Cons("_CollObj_gap2_", 0.*micrometer, 15*micrometer,
402        0.*micrometer,6*micrometer,                412        0.*micrometer,6*micrometer,
403        6.5*micrometer,                            413        6.5*micrometer, 
404        0, twopi);                              << 414        0, ((360*CLHEP::pi)/180));
405                                                   415   
406   fLogic2Gap = new G4LogicalVolume(fSolid2Gap,    416   fLogic2Gap = new G4LogicalVolume(fSolid2Gap, fDefaultMaterial, "_CollObj_gap2_");
407                                                   417   
408   fPhysi2Gap = new G4PVPlacement(0, G4ThreeVec    418   fPhysi2Gap = new G4PVPlacement(0, G4ThreeVector(0,0,0.0215*mm), fLogic2Gap, "_CollObj_gap2_", 
409                                  fLogicYoke1,     419                                  fLogicYoke1, false, 0);
410                                                   420   
411                                                   421   
412   // --> THIRD PART                               422   // --> THIRD PART
413                                                   423   
414   fSolid3Gap = new G4Cons("_CollObj_gap3_", 0.    424   fSolid3Gap = new G4Cons("_CollObj_gap3_", 0.*micrometer, 105*micrometer, 
415        0.*micrometer,15*micrometer,               425        0.*micrometer,15*micrometer,
416        25*micrometer,                             426        25*micrometer, 
417        0, twopi);                              << 427        0, ((360*CLHEP::pi)/180));
418                                                   428   
419   fLogic3Gap = new G4LogicalVolume(fSolid3Gap,    429   fLogic3Gap = new G4LogicalVolume(fSolid3Gap, fDefaultMaterial, "_CollObj_gap3_");
420                                                   430   
421   fPhysi3Gap = new G4PVPlacement(0, G4ThreeVec    431   fPhysi3Gap = new G4PVPlacement(0, G4ThreeVector(0,0,-0.010*mm), fLogic3Gap, "_CollObj_gap3_", fLogicYoke1, 
422                                  false, 0);       432                                  false, 0);
423                                                   433 
424                                                   434 
425   //************************                      435   //************************
426   // GAS DETECTOR COLLIMATOR                      436   // GAS DETECTOR COLLIMATOR
427   //************************                      437   //************************
428                                                   438   
429   fSolidYoke2 = new G4Box("_CollDet_yoke_", 2.    439   fSolidYoke2 = new G4Box("_CollDet_yoke_", 2.5*cm, 2.5*cm, 0.035*mm);
430                                                   440  
431   fLogicYoke2 = new G4LogicalVolume(fSolidYoke    441   fLogicYoke2 = new G4LogicalVolume(fSolidYoke2, fCollimatorMaterial, "_CollDet_yoke_");
432                                                   442   
433   fPhysiYoke2 = new G4PVPlacement(0,              443   fPhysiYoke2 = new G4PVPlacement(0,
434                                   G4ThreeVecto    444                                   G4ThreeVector(0,0,6958.3*mm/2-0.3*mm-3*mm-0.004*mm-0.1*mm-1*mm-2.5*mm-0.070*mm/2), 
435                                   fLogicYoke2,    445                                   fLogicYoke2, "_CollDet_yoke_", fLogicBoite, false, 0);
436                                                   446 
437   // --> FIRST PART                               447   // --> FIRST PART
438                                                   448   
439   fSolid4Gap = new G4Cons("_CollDet_gap4_", 0.    449   fSolid4Gap = new G4Cons("_CollDet_gap4_", 0.*micrometer, 8*micrometer,
440        0.*micrometer,5*micrometer,                450        0.*micrometer,5*micrometer,
441        7.5*micrometer,                            451        7.5*micrometer, 
442        0, twopi);                              << 452        0, ((360*CLHEP::pi)/180));
443                                                   453 
444   fLogic4Gap = new G4LogicalVolume(fSolid4Gap,    454   fLogic4Gap = new G4LogicalVolume(fSolid4Gap, fDefaultMaterial, "_CollDet_gap4_");
445                                                   455   
446   fPhysi4Gap = new G4PVPlacement(0, G4ThreeVec    456   fPhysi4Gap = new G4PVPlacement(0, G4ThreeVector(0,0,0.0275*mm), fLogic4Gap, "_CollDet_gap4_", 
447                                  fLogicYoke2,     457                                  fLogicYoke2, false, 0);
448                                                   458   
449   // --> SECOND PART                              459   // --> SECOND PART
450                                                   460   
451   fSolid5Gap = new G4Cons("_CollDet_gap5_", 0.    461   fSolid5Gap = new G4Cons("_CollDet_gap5_", 0.*micrometer, 105*micrometer,
452        0.*micrometer,8*micrometer,                462        0.*micrometer,8*micrometer,
453        27.5*micrometer,                           463        27.5*micrometer, 
454        0, twopi);                              << 464        0, ((360*CLHEP::pi)/180));
455                                                   465 
456   fLogic5Gap = new G4LogicalVolume(fSolid5Gap,    466   fLogic5Gap = new G4LogicalVolume(fSolid5Gap, fDefaultMaterial, "_CollDet_gap5_");
457                                                   467   
458   fPhysi5Gap = new G4PVPlacement(0,               468   fPhysi5Gap = new G4PVPlacement(0,
459         G4ThreeVector(0,0,-0.0075*mm),            469         G4ThreeVector(0,0,-0.0075*mm),
460         fLogic5Gap,                               470         fLogic5Gap,
461         "_CollDet_gap5_",                         471         "_CollDet_gap5_", 
462         fLogicYoke2,                              472         fLogicYoke2,
463         false,                                    473         false,
464         0);                                       474         0);
465   // ************                                 475   // ************
466   // GAS DETECTOR                                 476   // GAS DETECTOR
467   // ************                                 477   // ************
468                                                   478  
469   fSolidBoiteIso = new G4Box("Isobutane", 2.5*    479   fSolidBoiteIso = new G4Box("Isobutane", 2.5*cm, 2.5*cm, 1.75*mm);
470                                                   480   
471   fLogicBoiteIso = new G4LogicalVolume(fSolidB    481   fLogicBoiteIso = new G4LogicalVolume(fSolidBoiteIso, fBoiteMaterial, "Isobutane");
472                                                   482   
473   fPhysiBoiteIso = new G4PVPlacement(0,           483   fPhysiBoiteIso = new G4PVPlacement(0,
474          G4ThreeVector(0,0,6958.3*mm/2-0.3*mm-    484          G4ThreeVector(0,0,6958.3*mm/2-0.3*mm-3*mm-0.004*mm-0.1*mm-3.5*mm/2),
475          "Isobutane",                             485          "Isobutane", 
476          fLogicBoiteIso,                          486          fLogicBoiteIso,
477          fPhysiBoite,                             487          fPhysiBoite,
478          false,                                   488          false, 
479          0);                                      489          0);
480                                                   490   
481   // --> GAS DETECTOR END CAP                     491   // --> GAS DETECTOR END CAP
482                                                   492   
483   fSolidCathode = new G4Box("_Laiton_", 2.5*cm    493   fSolidCathode = new G4Box("_Laiton_", 2.5*cm, 2.5*cm, 0.5*mm);
484                                                   494   
485   fLogicCathode = new G4LogicalVolume(fSolidCa    495   fLogicCathode = new G4LogicalVolume(fSolidCathode, fCathodeMaterial, "_Laiton_");
486                                                   496   
487   fPhysiCathode = new G4PVPlacement(0,            497   fPhysiCathode = new G4PVPlacement(0,
488            G4ThreeVector(0,0,1.25*mm),            498            G4ThreeVector(0,0,1.25*mm),
489            "_Laiton_",                            499            "_Laiton_", 
490            fLogicCathode,                         500            fLogicCathode,
491            fPhysiBoiteIso,                        501            fPhysiBoiteIso,
492            false, 0);                             502            false, 0);
493                                                   503 
494   // --> ISOBUTANE GAS                            504   // --> ISOBUTANE GAS  
495                                                   505   
496   fSolidIso = new G4Box("_Iso_", 1.*mm, 1.*mm,    506   fSolidIso = new G4Box("_Iso_", 1.*mm, 1.*mm, 0.499925*mm);
497                                                   507   
498   fLogicIso = new G4LogicalVolume(fSolidIso, f    508   fLogicIso = new G4LogicalVolume(fSolidIso, fBoiteMaterial, "_Iso_");
499                                                   509   
500   fPhysiIso = new G4PVPlacement(0,                510   fPhysiIso = new G4PVPlacement(0, 
501              G4ThreeVector(0,0,-0.000075*mm),     511              G4ThreeVector(0,0,-0.000075*mm),
502              "_Iso_",                             512              "_Iso_", 
503              fLogicIso,                           513              fLogicIso,
504              fPhysiCathode,                       514              fPhysiCathode,
505              false,                               515              false, 
506              0);                                  516              0);
507                                                   517 
508   // --> Si3N4 WINDOW                             518   // --> Si3N4 WINDOW
509                                                   519   
510   fSolidVerre = new G4Box("_Si3N4_", 0.5*mm, 0    520   fSolidVerre = new G4Box("_Si3N4_", 0.5*mm, 0.5*mm, 0.075*micrometer);
511                                                   521   
512   fLogicVerre = new G4LogicalVolume(fSolidVerr    522   fLogicVerre = new G4LogicalVolume(fSolidVerre, fVerreMaterial, "_Si3N4_");
513                                                   523   
514                                                   524   
515   fPhysiVerre = new G4PVPlacement(0,              525   fPhysiVerre = new G4PVPlacement(0,
516          G4ThreeVector(0,0,0.499925*mm),          526          G4ThreeVector(0,0,0.499925*mm),
517          "_Si3N4_",                               527          "_Si3N4_", 
518          fLogicVerre,                             528          fLogicVerre,
519          fPhysiCathode,                           529          fPhysiCathode,
520          false,                                   530          false,
521          0);                                      531          0);
522   // *******                                      532   // *******
523   // AIR GAP                                      533   // AIR GAP
524   // *******                                      534   // *******
525                                                   535    
526   fSolidBoite2 = new G4Box("_Air_", 2.5*cm, 2.    536   fSolidBoite2 = new G4Box("_Air_", 2.5*cm, 2.5*cm, 0.1*mm/2);
527                                                   537   
528   fLogicBoite2 = new G4LogicalVolume(fSolidBoi    538   fLogicBoite2 = new G4LogicalVolume(fSolidBoite2, fBoite2Material, "_Air_");
529                                                   539   
530   fPhysiBoite2 = new G4PVPlacement(0,             540   fPhysiBoite2 = new G4PVPlacement(0,
531          G4ThreeVector(0,0,6958.3*mm/2-0.3*mm-    541          G4ThreeVector(0,0,6958.3*mm/2-0.3*mm-3*mm-0.004*mm-0.1*mm/2),
532          "_Air_",                                 542          "_Air_", 
533          fLogicBoite2,                            543          fLogicBoite2,
534          fPhysiBoite,                             544          fPhysiBoite,
535          false,                                   545          false, 
536          0);                                      546          0);
537                                                   547 
538   //*************                                 548   //*************           
539   // CELL SUPPORT                                 549   // CELL SUPPORT
540   //*************                                 550   //*************  
541                                                   551   
542   fSolidBoite3 = new G4Box("Polyprop", 2.5*cm,    552   fSolidBoite3 = new G4Box("Polyprop", 2.5*cm, 2.5*cm, 0.004*mm/2);
543                                                   553   
544   fLogicBoite3 = new G4LogicalVolume(fSolidBoi    554   fLogicBoite3 = new G4LogicalVolume(fSolidBoite3, fBoite3Material, "Polyprop");
545                                                   555   
546   fPhysiBoite3 = new G4PVPlacement(0,             556   fPhysiBoite3 = new G4PVPlacement(0, 
547           G4ThreeVector(0,0,6958.3*mm/2-0.3*mm    557           G4ThreeVector(0,0,6958.3*mm/2-0.3*mm-3*mm-0.004*mm/2),
548           "Polyprop",                             558           "Polyprop", 
549           fLogicBoite3,                           559           fLogicBoite3, 
550           fPhysiBoite,                            560           fPhysiBoite, 
551           false,                                  561           false, 
552           0);                                     562           0);
553   //****                                          563   //****
554   // KGM                                          564   // KGM   
555   //****                                          565   //****
556                                                   566     
557   fSolidKgm = new G4Box("KGM", 2.5*cm, 2.5*cm,    567   fSolidKgm = new G4Box("KGM", 2.5*cm, 2.5*cm, 3*mm/2);
558                                                   568 
559   fLogicKgm = new G4LogicalVolume(fSolidKgm, f    569   fLogicKgm = new G4LogicalVolume(fSolidKgm, fKgmMaterial, "KGM");
560                                                   570   
561   fPhysiKgm = new G4PVPlacement(0,                571   fPhysiKgm = new G4PVPlacement(0,
562              G4ThreeVector(0,0,6958.3*mm/2-0.3    572              G4ThreeVector(0,0,6958.3*mm/2-0.3*mm-3*mm/2),
563              "KGM",                               573              "KGM",
564              fLogicKgm,                           574              fLogicKgm,
565              fPhysiBoite,                         575              fPhysiBoite, 
566              false,                               576              false,
567              0);                                  577              0);
568                                                   578 
569   //*****************                             579   //*****************
570   // MICROSCOPE PLATE                             580   // MICROSCOPE PLATE
571   //*****************                             581   //*****************
572                                                   582   
573   fSolidVerre2 = new G4Box("_Lame_", 2.5*cm, 2    583   fSolidVerre2 = new G4Box("_Lame_", 2.5*cm, 2.5*cm, 0.150*mm);
574                                                   584   
575   fLogicVerre2 = new G4LogicalVolume(fSolidVer    585   fLogicVerre2 = new G4LogicalVolume(fSolidVerre2, fVerre2Material, "_Lame_");
576                                                   586   
577   fPhysiVerre2 = new G4PVPlacement(0,             587   fPhysiVerre2 = new G4PVPlacement(0,
578           G4ThreeVector(0,0,6958.3*mm/2-0.3*mm    588           G4ThreeVector(0,0,6958.3*mm/2-0.3*mm/2),
579           "_Lame_",                               589           "_Lame_", 
580           fLogicVerre2,                           590           fLogicVerre2,
581           fPhysiBoite,                            591           fPhysiBoite, 
582           false,                                  592           false,
583           0);                                     593           0);
584                                                   594 
585   // **************                               595   // **************
586   // CELL CYTOPLASM                               596   // CELL CYTOPLASM
587   // **************                               597   // **************
588                                                   598   
589   // WITHIN KGM                                   599   // WITHIN KGM
590 /*                                                600 /*  
591   fSolidCyto=new G4Ellipsoid("CYTO",25*microme    601   fSolidCyto=new G4Ellipsoid("CYTO",25*micrometer, 25*micrometer, 11*micrometer);
592                                                   602  
593   fLogicCyto=new G4LogicalVolume (fSolidCyto,     603   fLogicCyto=new G4LogicalVolume (fSolidCyto, fDefaultMaterial, "CYTO");
594                                                   604 
595   fPhysiCyto=new G4PVPlacement(0, G4ThreeVecto    605   fPhysiCyto=new G4PVPlacement(0, G4ThreeVector(0,0,-1.5*mm+11*micrometer),"CYTO",fLogicCyto, fPhysiKgm, false, 0);
596 */                                                606 */
597                                                   607 
598   // ************                                 608   // ************
599   // CELL PHANTOM                                 609   // CELL PHANTOM
600   // ************                                 610   // ************
601                                                   611 
602   fMyCellParameterisation = new CellParameteri    612   fMyCellParameterisation = new CellParameterisation
603         (fNucleusMaterial1,fCytoplasmMaterial1    613         (fNucleusMaterial1,fCytoplasmMaterial1,
604    fNucleusMaterial2,fCytoplasmMaterial2,         614    fNucleusMaterial2,fCytoplasmMaterial2,
605    fNucleusMaterial3,fCytoplasmMaterial3);        615    fNucleusMaterial3,fCytoplasmMaterial3);
606                                                   616 
607   fSolidPhantom = new G4Box("Phantom",            617   fSolidPhantom = new G4Box("Phantom", 
608     fMyCellParameterisation->GetPixelSizeX()/2    618     fMyCellParameterisation->GetPixelSizeX()/2, 
609   fMyCellParameterisation->GetPixelSizeY()/2,     619   fMyCellParameterisation->GetPixelSizeY()/2, 
610   fMyCellParameterisation->GetPixelSizeZ()/2);    620   fMyCellParameterisation->GetPixelSizeZ()/2); 
611                                                   621   
612   fLogicPhantom = new G4LogicalVolume(fSolidPh    622   fLogicPhantom = new G4LogicalVolume(fSolidPhantom,fDefaultMaterial,"Phantom",0,0,0);
613                                                   623     
614   SetNbOfPixelsInPhantom (fMyCellParameterisat    624   SetNbOfPixelsInPhantom (fMyCellParameterisation->GetPhantomTotalPixels());
615                                                   625 
616   SetMassNucleus(fMyCellParameterisation->GetN    626   SetMassNucleus(fMyCellParameterisation->GetNucleusMass());
617                                                   627 
618   SetMassCytoplasm(fMyCellParameterisation->Ge    628   SetMassCytoplasm(fMyCellParameterisation->GetCytoplasmMass());
619                                                   629 
620   fPhysiPhantom = new G4PVParameterised(          630   fPhysiPhantom = new G4PVParameterised(
621                             "Phantom",            631                             "Phantom",        // their name
622                             fLogicPhantom,        632                             fLogicPhantom,    // their logical volumr
623                             //logicCyto,          633                             //logicCyto,      // Mother logical volume is Cyto
624                             fLogicKgm,            634                             fLogicKgm,        // Mother logical volume is Kgm
625           kUndefined,       // Are placed alon    635           kUndefined,       // Are placed along this axis 
626                             fMyCellParameteris    636                             fMyCellParameterisation->GetPhantomTotalPixels(),    // Number of boxes
627                             fMyCellParameteris    637                             fMyCellParameterisation,false);   // The parametrisation
628                                                   638 
629   G4cout << " ==========> The phantom contains    639   G4cout << " ==========> The phantom contains " << fMyCellParameterisation->GetPhantomTotalPixels() << " voxels " << G4endl;       
630   G4cout << " ==========> Nucleus mass (kg)="     640   G4cout << " ==========> Nucleus mass (kg)=" << fMyCellParameterisation->GetNucleusMass() / kg << G4endl;
631   G4cout << " ==========> Cytoplasm mass (kg)=    641   G4cout << " ==========> Cytoplasm mass (kg)=" << fMyCellParameterisation->GetCytoplasmMass()/ kg << G4endl;
632   G4cout << " ==========> Voxel size X (um)="     642   G4cout << " ==========> Voxel size X (um)=" << fMyCellParameterisation->GetPixelSizeX()/um << G4endl;
633   G4cout << " ==========> Voxel size Y (um)="     643   G4cout << " ==========> Voxel size Y (um)=" << fMyCellParameterisation->GetPixelSizeY()/um << G4endl;
634   G4cout << " ==========> Voxel size Z (um)="     644   G4cout << " ==========> Voxel size Z (um)=" << fMyCellParameterisation->GetPixelSizeZ()/um << G4endl; 
635   G4cout << G4endl;                               645   G4cout << G4endl; 
                                                   >> 646                     
                                                   >> 647   // USER LIMITS ON STEP LENGTH
                                                   >> 648   
                                                   >> 649   fLogicWorld->SetUserLimits(new G4UserLimits(100*mm));
                                                   >> 650   fLogicVol->SetUserLimits(new G4UserLimits(100*mm));
                                                   >> 651   fLogicBoite->SetUserLimits(new G4UserLimits(10*mm));
                                                   >> 652 
                                                   >> 653 /*
                                                   >> 654   logicPhantom->SetUserLimits (new G4UserLimits(0.5*micrometer));
                                                   >> 655   logic1Gap->SetUserLimits (new G4UserLimits(5*micrometer));
                                                   >> 656   logic2Gap->SetUserLimits (new G4UserLimits(5*micrometer));
                                                   >> 657   logic3Gap->SetUserLimits (new G4UserLimits(5*micrometer));
                                                   >> 658   logic4Gap->SetUserLimits (new G4UserLimits(5*micrometer));
                                                   >> 659   logic5Gap->SetUserLimits (new G4UserLimits(5*micrometer));
                                                   >> 660   logicBoiteIso->SetUserLimits (new G4UserLimits(200.*micrometer));
                                                   >> 661   logicCathode->SetUserLimits (new G4UserLimits(100.*micrometer));
                                                   >> 662   logicIso->SetUserLimits (new G4UserLimits(100.*micrometer));
                                                   >> 663   logicVerre->SetUserLimits (new G4UserLimits(0.02*micrometer));
                                                   >> 664   logicBoite2->SetUserLimits (new G4UserLimits(10*micrometer));
                                                   >> 665   logicBoite3->SetUserLimits (new G4UserLimits(0.2*micrometer));
                                                   >> 666   logicKgm->SetUserLimits (new G4UserLimits(1*micrometer));
                                                   >> 667   logicVerre2->SetUserLimits (new G4UserLimits(10*micrometer));
                                                   >> 668 */
636                                                   669 
637   // VISUALISATION ATTRIBUTES (for phantom, se    670   // VISUALISATION ATTRIBUTES (for phantom, see in Parameterisation class)
638                                                   671   
639   G4VisAttributes* simpleWorldVisAtt= new G4Vi    672   G4VisAttributes* simpleWorldVisAtt= new G4VisAttributes(G4Colour(1.0,1.0,1.0)); //White
640   simpleWorldVisAtt->SetVisibility(true);         673   simpleWorldVisAtt->SetVisibility(true);
641                                                   674   
642   G4VisAttributes* simplePlain= new G4VisAttri    675   G4VisAttributes* simplePlain= new G4VisAttributes(G4Colour(1.0,1.0,1.0)); //White
643   simplePlain->SetVisibility(true);               676   simplePlain->SetVisibility(true);
644   simplePlain->SetForceSolid(true);               677   simplePlain->SetForceSolid(true);
645                                                   678     
646   G4VisAttributes* simpleBoxAttLine= new G4Vis    679   G4VisAttributes* simpleBoxAttLine= new G4VisAttributes(G4Colour(1.0,0.0,0.0));
647   simpleBoxAttLine->SetVisibility(true);          680   simpleBoxAttLine->SetVisibility(true);
648                                                   681    
649   G4VisAttributes* simpleBoxAtt= new G4VisAttr    682   G4VisAttributes* simpleBoxAtt= new G4VisAttributes(G4Colour(1.0,1.0,0.0));
650   simpleBoxAtt->SetDaughtersInvisible(false);     683   simpleBoxAtt->SetDaughtersInvisible(false);
651   simpleBoxAtt->SetForceSolid(false);             684   simpleBoxAtt->SetForceSolid(false);
652                                                   685  
653   G4VisAttributes* simpleBoxAtt2= new G4VisAtt    686   G4VisAttributes* simpleBoxAtt2= new G4VisAttributes(G4Colour(0.0,1.0,0.0));
654   simpleBoxAtt2->SetDaughtersInvisible(false);    687   simpleBoxAtt2->SetDaughtersInvisible(false);
655   simpleBoxAtt2->SetForceSolid(false);            688   simpleBoxAtt2->SetForceSolid(false);
656                                                   689   
657   G4VisAttributes* simpleBoxAttKGM= new G4VisA    690   G4VisAttributes* simpleBoxAttKGM= new G4VisAttributes(G4Colour(0.0,0.0,1.0));
658   simpleBoxAttKGM->SetDaughtersInvisible(false    691   simpleBoxAttKGM->SetDaughtersInvisible(false);
659   simpleBoxAttKGM->SetForceSolid(false);          692   simpleBoxAttKGM->SetForceSolid(false);
660                                                   693   
661   G4VisAttributes* simpleBoxAttPropyl= new G4V    694   G4VisAttributes* simpleBoxAttPropyl= new G4VisAttributes(G4Colour(1.0,1.0,1.0));
662   simpleBoxAttPropyl->SetDaughtersInvisible(tr    695   simpleBoxAttPropyl->SetDaughtersInvisible(true);
663   simpleBoxAttPropyl->SetForceSolid(false);       696   simpleBoxAttPropyl->SetForceSolid(false);
664                                                   697   
665   G4VisAttributes* simpleBoxAttAir= new G4VisA    698   G4VisAttributes* simpleBoxAttAir= new G4VisAttributes(G4Colour(0.0,1.0,0.0));
666   simpleBoxAttAir->SetDaughtersInvisible(true)    699   simpleBoxAttAir->SetDaughtersInvisible(true);
667   simpleBoxAttAir->SetForceSolid(false);          700   simpleBoxAttAir->SetForceSolid(false);
668                                                   701   
669   G4VisAttributes* simpleBoxAtt3= new G4VisAtt    702   G4VisAttributes* simpleBoxAtt3= new G4VisAttributes(G4Colour(0.0,0.0,1.0));
670   simpleBoxAtt3->SetDaughtersInvisible(false);    703   simpleBoxAtt3->SetDaughtersInvisible(false);
671   simpleBoxAtt3->SetForceSolid(false);            704   simpleBoxAtt3->SetForceSolid(false);
672                                                   705   
673   fLogicYoke1->SetVisAttributes(simpleBoxAtt);    706   fLogicYoke1->SetVisAttributes(simpleBoxAtt);
674   fLogic1Gap->SetVisAttributes(simpleBoxAtt);     707   fLogic1Gap->SetVisAttributes(simpleBoxAtt);
675   fLogic2Gap->SetVisAttributes(simpleBoxAtt);     708   fLogic2Gap->SetVisAttributes(simpleBoxAtt);
676   fLogic3Gap->SetVisAttributes(simpleBoxAtt);     709   fLogic3Gap->SetVisAttributes(simpleBoxAtt);
677   fLogicYoke2->SetVisAttributes(simpleBoxAtt);    710   fLogicYoke2->SetVisAttributes(simpleBoxAtt);  
678   fLogic4Gap->SetVisAttributes(simpleBoxAtt);     711   fLogic4Gap->SetVisAttributes(simpleBoxAtt);
679   fLogic5Gap->SetVisAttributes(simpleBoxAtt);     712   fLogic5Gap->SetVisAttributes(simpleBoxAtt);
680   fLogicBoite->SetVisAttributes(simpleBoxAttLi    713   fLogicBoite->SetVisAttributes(simpleBoxAttLine);
681   fLogicCathode->SetVisAttributes(simpleBoxAtt    714   fLogicCathode->SetVisAttributes(simpleBoxAttPropyl);
682   fLogicIso->SetVisAttributes(simpleBoxAttProp    715   fLogicIso->SetVisAttributes(simpleBoxAttPropyl);
683   fLogicBoiteIso->SetVisAttributes(simpleBoxAt    716   fLogicBoiteIso->SetVisAttributes(simpleBoxAttPropyl);
684   fLogicVerre->SetVisAttributes(simpleBoxAtt);    717   fLogicVerre->SetVisAttributes(simpleBoxAtt);
685   fLogicBoite2->SetVisAttributes(simpleBoxAttA    718   fLogicBoite2->SetVisAttributes(simpleBoxAttAir);
686   fLogicBoite3->SetVisAttributes(simpleBoxAtt)    719   fLogicBoite3->SetVisAttributes(simpleBoxAtt);
687   fLogicKgm->SetVisAttributes(simpleBoxAttKGM)    720   fLogicKgm->SetVisAttributes(simpleBoxAttKGM);
688   fLogicVerre2->SetVisAttributes(simpleBoxAtt)    721   fLogicVerre2->SetVisAttributes(simpleBoxAtt);
689                                                   722   
690   return fPhysiWorld;                             723   return fPhysiWorld;
691 }                                                 724 }
692                                                   725 
                                                   >> 726 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
                                                   >> 727 
693 void DetectorConstruction::ConstructSDandField    728 void DetectorConstruction::ConstructSDandField()
694 {                                                 729 {
695   EMField* field = new EMField();              << 730   if(!fField) fField = new EMField(); 
696   G4AutoDelete::Register(field);               << 
697                                                   731   
698   G4EqMagElectricField* fEquation = new G4EqMa << 732   fEquation = new G4EqMagElectricField(fField);
699   G4MagIntegratorStepper* fStepper = new G4Cla << 733   fStepper = new G4ClassicalRK4 (fEquation,8);
700   G4FieldManager* fFieldMgr =                  << 734   fFieldMgr = G4TransportationManager::GetTransportationManager()->GetFieldManager();
701     G4TransportationManager::GetTransportation << 735   fIntgrDriver = new G4MagInt_Driver(0.000001*mm,fStepper,fStepper->GetNumberOfVariables() );
702                                                << 736   fChordFinder = new G4ChordFinder(fIntgrDriver);
703   // Relaxed                                   << 
704   G4MagInt_Driver* fIntgrDriver =              << 
705     new G4MagInt_Driver(1*mm,fStepper,fStepper << 
706                                                << 
707   G4ChordFinder* fChordFinder = new G4ChordFin << 
708   fFieldMgr->SetChordFinder(fChordFinder);        737   fFieldMgr->SetChordFinder(fChordFinder);
709   fFieldMgr->SetDetectorField(field);          << 738   fFieldMgr->SetDetectorField(fField);
710                                                   739 
711   // FOLLOWING PARAMETERS TUNED FROM RAY-TRACI    740   // FOLLOWING PARAMETERS TUNED FROM RAY-TRACING SIMULATIONS OF THE AIFIRA NANOBEAM LINE
712   /*                                           << 741   
713   fFieldMgr->GetChordFinder()->SetDeltaChord(1    742   fFieldMgr->GetChordFinder()->SetDeltaChord(1e-9*m);
714   fFieldMgr->SetDeltaIntersection(1e-9*m);        743   fFieldMgr->SetDeltaIntersection(1e-9*m);
715   fFieldMgr->SetDeltaOneStep(1e-9*m);             744   fFieldMgr->SetDeltaOneStep(1e-9*m);     
716                                                   745       
717   fPropInField =                                  746   fPropInField =
718     G4TransportationManager::GetTransportation    747     G4TransportationManager::GetTransportationManager()->GetPropagatorInField();
719   fPropInField->SetMinimumEpsilonStep(1e-16);  << 748   fPropInField->SetMinimumEpsilonStep(1e-11);
720   fPropInField->SetMaximumEpsilonStep(1e-15);  << 749   fPropInField->SetMaximumEpsilonStep(1e-10);
721   */                                           << 750 
722 }                                                 751 }
723                                                   752