Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-31 09:22:33

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 // This example is provided by the Geant4-DNA collaboration
0027 // Any report or published results obtained using the Geant4-DNA software 
0028 // shall cite the following Geant4-DNA collaboration publication:
0029 // Med. Phys. 37 (2010) 4692-4708
0030 // The Geant4-DNA web site is available at http://geant4-dna.org
0031 // 
0032 // If you use this example, please cite the following publication:
0033 // Rad. Prot. Dos. 133 (2009) 2-11
0034 
0035 #include "DetectorConstruction.hh"
0036 #include "G4PhysicalConstants.hh"
0037 #include "G4SystemOfUnits.hh"
0038 #include "G4MagIntegratorDriver.hh"
0039 #include "G4AutoDelete.hh"
0040 
0041 DetectorConstruction::DetectorConstruction()
0042   
0043   :fDefaultMaterial(nullptr),fCollimatorMaterial(nullptr),fBoiteMaterial(nullptr),
0044    fCathodeMaterial(nullptr),fVerreMaterial(nullptr),fVerre2Material(nullptr),   
0045    fKgmMaterial(nullptr),fBoite2Material(nullptr),fBoite3Material(nullptr),
0046    fNucleusMaterial1(nullptr),fCytoplasmMaterial1(nullptr),
0047    fNucleusMaterial2(nullptr),fCytoplasmMaterial2(nullptr),
0048    fNucleusMaterial3(nullptr),fCytoplasmMaterial3(nullptr),
0049    fPhysiWorld(nullptr),fLogicWorld(nullptr),fSolidWorld(nullptr),
0050    fPhysiVol(nullptr),fLogicVol(nullptr),fSolidVol(nullptr),
0051    fPhysiBoite(nullptr),fLogicBoite(nullptr),fSolidBoite(nullptr),
0052    fPhysiYoke1(nullptr),fLogicYoke1(nullptr),fSolidYoke1(nullptr),
0053    fPhysi1Gap(nullptr),fLogic1Gap(nullptr),fSolid1Gap(nullptr),
0054    fPhysi2Gap(nullptr),fLogic2Gap(nullptr),fSolid2Gap(nullptr), 
0055    fPhysi3Gap(nullptr),fLogic3Gap(nullptr),fSolid3Gap(nullptr),
0056    fPhysiYoke2(nullptr),fLogicYoke2(nullptr),fSolidYoke2(nullptr),
0057    fPhysi4Gap(nullptr),fLogic4Gap(nullptr),fSolid4Gap(nullptr),
0058    fPhysi5Gap(nullptr),fLogic5Gap(nullptr),fSolid5Gap(nullptr), 
0059    fPhysiBoiteIso(nullptr),fLogicBoiteIso(nullptr),fSolidBoiteIso(nullptr),
0060    fPhysiCathode(nullptr),fLogicCathode(nullptr),fSolidCathode(nullptr), 
0061    fPhysiIso(nullptr),fLogicIso(nullptr),fSolidIso(nullptr),
0062    fPhysiVerre(nullptr),fLogicVerre(nullptr),fSolidVerre(nullptr),
0063    fPhysiBoite2(nullptr),fLogicBoite2(nullptr),fSolidBoite2(nullptr),
0064    fPhysiBoite3(nullptr),fLogicBoite3(nullptr),fSolidBoite3(nullptr),
0065    fPhysiKgm(nullptr),fLogicKgm(nullptr),fSolidKgm(nullptr),
0066    fPhysiVerre2(nullptr),fLogicVerre2(nullptr),fSolidVerre2(nullptr),
0067    fPhysiPhantom(nullptr),fLogicPhantom(nullptr),fSolidPhantom(nullptr)
0068   
0069 {
0070   DefineMaterials();
0071   
0072   // Initialisation of variables which 
0073   // will then be appropriately fixed in methods of this class
0074   // to implement the simulation geometry set-up
0075   fDensityPhantom = 0.; // in g/cm3
0076   fDensityNucleus = 0.; // in g/cm3
0077   fDensityCytoplasm = 0.; // in g/cm3
0078   fWorldSizeXY=fWorldSizeZ=0.; 
0079   fCollObjSizeXY = 0.;
0080   fCollObjSizeZ = 0.;
0081    
0082   // TARGET POSITION
0083   fCiblePositionX = 0.;
0084   fCiblePositionY = 0.;
0085   fCiblePositionZ = 0.;
0086 
0087    // MICROBEAM LINE ANGLE
0088   fLineAngle = 0.;
0089   
0090   fNbOfPixelsInPhantom=0;
0091 }  
0092 
0093 DetectorConstruction::~DetectorConstruction()
0094 {}
0095 
0096 G4VPhysicalVolume* DetectorConstruction::Construct()
0097 {
0098   if(fPhysiWorld) { return fPhysiWorld; }
0099   return ConstructLine();
0100 }
0101 
0102 void DetectorConstruction::DefineMaterials()
0103 { 
0104   G4String name, symbol;             
0105   G4double density;            
0106   
0107   G4int ncomponents, natoms,nel;
0108   G4double z, a;
0109   G4double fractionmass;
0110   G4double temperature, pressure;
0111   
0112   // Define Elements 
0113   
0114   G4Element*   H  = new G4Element ("Hydrogen", "H", 1. ,  1.01*g/mole);
0115   G4Element*   N  = new G4Element ("Nitrogen", "N", 7., 14.01*g/mole);
0116   G4Element*   O  = new G4Element ("Oxygen"  , "O", 8. , 16.00*g/mole);
0117   G4Element*   Ar = new G4Element ("Argon" , "Ar", 18., 39.948*g/mole );
0118   G4Element*    C = new G4Element ("Carbon","C", 6., 12.011*g/mole);
0119   G4Element *  Si = new G4Element ("Silicon","Si",14., 28.0855*g/mole);
0120   G4Element *  Cu = new G4Element ("Cuivre","Cu",29., 63.546*g/mole);
0121   G4Element *  Zn = new G4Element ("Zinc","Zn",30.,65.409*g/mole);
0122   G4Element *  P  = new G4Element ("Phosphorus","P",15.,30.973761*g/mole);
0123  
0124   // Vacuum standard definition...
0125   
0126   density = universe_mean_density;
0127   G4Material* vacuum = new G4Material(name="Vacuum", z=1., a=1.01*g/mole,
0128                       density);  
0129   // Water 
0130   
0131   density = 1.000*g/cm3;
0132   G4Material* H2O = new G4Material(name="H2O"  , density, ncomponents=2);
0133   H2O->AddElement(H, natoms=2);
0134   H2O->AddElement(O, natoms=1);
0135  
0136   // Air
0137   
0138   density = 1.290*mg/cm3;
0139   pressure = 1*atmosphere;
0140   temperature = 293.16*kelvin;
0141   G4Material* Air = new G4Material(name="Air"  , density, ncomponents=2, kStateGas, temperature, pressure);
0142   Air->AddElement(N, fractionmass=0.7);
0143   Air->AddElement(O, fractionmass=0.3);
0144   
0145   // Low Pressure air
0146   
0147   density = (5e-6/1013.)*1.290*mg/cm3; // 5e-6 mbar is the usual beam pipe air pressure
0148   pressure = 1*atmosphere;
0149   temperature = 293.16*kelvin;
0150   G4Material* LPAir = new G4Material(name="LPAir"  , density, ncomponents=3, kStateGas, temperature, pressure);
0151   LPAir->AddElement(N, fractionmass=0.715);
0152   LPAir->AddElement(O, fractionmass=0.25);
0153   LPAir->AddElement(Ar, fractionmass=0.035);
0154   
0155   // Platinum
0156   
0157   a = 195.09*g/mole;
0158   density = 21.4*g/cm3;
0159   G4Material* Pt = new G4Material(name="Pl", z=78., a, density);
0160  
0161   // Butane @ 10 mbar
0162   
0163   density = 2.552e-2*mg/cm3;
0164   pressure = 0.01*bar;
0165   temperature = 293.16*kelvin;
0166   G4Material* Butane = new G4Material(name = "Butane", density, nel = 2, kStateGas, temperature, pressure);
0167   Butane->AddElement (C, natoms=4);
0168   Butane->AddElement (H, natoms=10);
0169   
0170   // Polypropylene
0171   
0172   density = 0.9*g/cm3;
0173   G4Material* Polyprop = new G4Material(name = "Polyprop", density, nel = 2);
0174   Polyprop->AddElement (C,3);
0175   Polyprop->AddElement (H,6);
0176 
0177   // Si3N4
0178   
0179   density = 3.44*g/cm3;
0180   G4Material* Si3N4 = new G4Material(name = "Si3N4", density, nel = 2);
0181   Si3N4->AddElement (Si, natoms=3);
0182   Si3N4->AddElement (N, natoms=4);
0183   
0184   // SiO2
0185   
0186   density = 2.5*g/cm3;
0187   G4Material* SiO2 = new G4Material(name = "SiO2", density, nel = 2);
0188   SiO2->AddElement (Si, natoms=1);
0189   SiO2->AddElement (O, natoms=2);
0190     
0191   // Brass
0192   
0193   density = 8.5*g/cm3;
0194   G4Material* Laiton = new G4Material(name = "Laiton", density, nel = 2);
0195   Laiton->AddElement (Cu,1);
0196   Laiton->AddElement (Zn,1);
0197 
0198   // Phantom
0199   
0200   fDensityPhantom = 1.; // in g/cm3
0201 
0202   // Nucleus composition from Alard et al., Rad. Res. 158, 650 (2002) and
0203   // Comp. Math. Meth. Med. 147252 (2012) 
0204   //
0205   // Cytoplasm composition is assumed to be water
0206   
0207   // Cytoplasm
0208   
0209   fDensityCytoplasm = 1.; // in g/cm3
0210   density = fDensityCytoplasm*g/cm3;
0211   G4Material* Cytoplasm1 = new G4Material(name="Cytoplasm1"  , density, ncomponents=2);
0212   Cytoplasm1->AddElement(H, fractionmass=0.112);
0213   Cytoplasm1->AddElement(O, fractionmass=0.888);
0214  
0215   // Nucleoli
0216   
0217   fDensityCytoplasm = 1.;  
0218   // in g/cm3 (nucleoli are assumed to have the same chemical comp. as nucleus)
0219   density = fDensityCytoplasm*g/cm3;
0220   G4Material* Cytoplasm2 = new G4Material(name="Cytoplasm2"  , density, ncomponents=5);
0221   Cytoplasm2->AddElement(H, fractionmass=0.1064);
0222   Cytoplasm2->AddElement(O, fractionmass=0.745);
0223   Cytoplasm2->AddElement(C, fractionmass=0.0904);
0224   Cytoplasm2->AddElement(N, fractionmass=0.0321);
0225   Cytoplasm2->AddElement(P, fractionmass=0.0261);
0226  
0227   // default is water
0228   
0229   fDensityCytoplasm = 1.; // in g/cm3
0230   density = fDensityCytoplasm*g/cm3;
0231   G4Material* Cytoplasm3 = new G4Material(name="Cytoplasm3"  , density, ncomponents=2);
0232   Cytoplasm3->AddElement(H, fractionmass=0.112);
0233   Cytoplasm3->AddElement(O, fractionmass=0.888);
0234  
0235   // Nucleus chemical composition
0236 
0237   fDensityNucleus = 1.; // in g/cm3
0238   density = fDensityNucleus*g/cm3;
0239   G4Material* Nucleus1 = new G4Material(name="Nucleus1"  , density, ncomponents=5);
0240   Nucleus1->AddElement(H, fractionmass=0.1064);
0241   Nucleus1->AddElement(O, fractionmass=0.745);
0242   Nucleus1->AddElement(C, fractionmass=0.0904);
0243   Nucleus1->AddElement(N, fractionmass=0.0321);
0244   Nucleus1->AddElement(P, fractionmass=0.0261);
0245  
0246   fDensityNucleus = 1.; // in g/cm3
0247   density = fDensityNucleus*g/cm3;
0248   G4Material* Nucleus2 = new G4Material(name="Nucleus2"  , density, ncomponents=5);
0249   Nucleus2->AddElement(H, fractionmass=0.1064);
0250   Nucleus2->AddElement(O, fractionmass=0.745);
0251   Nucleus2->AddElement(C, fractionmass=0.0904);
0252   Nucleus2->AddElement(N, fractionmass=0.0321);
0253   Nucleus2->AddElement(P, fractionmass=0.0261);
0254  
0255   // default
0256   
0257   fDensityNucleus = 1.; // in g/cm3
0258   density = fDensityNucleus*g/cm3;
0259   G4Material* Nucleus3 = new G4Material(name="Nucleus3"  , density, ncomponents=5);
0260   Nucleus3->AddElement(H, fractionmass=0.1064);
0261   Nucleus3->AddElement(O, fractionmass=0.745);
0262   Nucleus3->AddElement(C, fractionmass=0.0904);
0263   Nucleus3->AddElement(N, fractionmass=0.0321);
0264   Nucleus3->AddElement(P, fractionmass=0.0261);
0265  
0266   // Materials in setup
0267   
0268   fDefaultMaterial  = vacuum;
0269   fCollimatorMaterial   = Pt;
0270   fBoiteMaterial    = Butane;
0271   fCathodeMaterial      = Laiton;
0272   fVerreMaterial        = Si3N4;
0273   fVerre2Material   = SiO2;
0274   fKgmMaterial      = H2O;
0275   fBoite2Material       = Air;
0276   fBoite3Material       = Polyprop;
0277   
0278   fNucleusMaterial1     = Nucleus1;
0279   fCytoplasmMaterial1   = Cytoplasm1;
0280   fNucleusMaterial2     = Nucleus2;
0281   fCytoplasmMaterial2   = Cytoplasm2;
0282   fNucleusMaterial3     = Nucleus3;
0283   fCytoplasmMaterial3   = Cytoplasm3;
0284   
0285   // DISPLAY MATERIALS
0286   G4cout << G4endl << *(G4Material::GetMaterialTable()) << G4endl;
0287 
0288 }
0289 
0290 G4VPhysicalVolume* DetectorConstruction::ConstructLine()
0291 {
0292   // WORLD
0293   fWorldSizeXY  = 20*m;
0294   fWorldSizeZ   = 40*m;
0295    
0296   // MICROBEAM LINE ANGLE
0297   fLineAngle = 10*deg;
0298   
0299   // TARGET POSITION
0300   fCiblePositionX = -1461.42*mm;
0301   fCiblePositionY = 0*mm;
0302   fCiblePositionZ = -1327 + (955*std::cos(fLineAngle))*mm;
0303   
0304   //*************
0305   // WORLD VOLUME
0306   //*************
0307   
0308   fSolidWorld = new G4Box("World",                       //its name
0309               fWorldSizeXY/2,fWorldSizeXY/2,fWorldSizeZ/2);  //its size
0310   
0311   
0312   fLogicWorld = new G4LogicalVolume(fSolidWorld,    //its solid
0313                     fDefaultMaterial,   //its material
0314                     "World");       //its name
0315   
0316   fPhysiWorld = new G4PVPlacement(0,            //no rotation
0317                  G4ThreeVector(),   //at (0,0,0)
0318                                  "World",       //its name
0319                                  fLogicWorld,       //its logical volume
0320                                  nullptr,       //its mother  volume
0321                                  false,         //no boolean operation
0322                                  0);            //copy number
0323 
0324   //*****************
0325   // FULL LINE VOLUME
0326   //*****************
0327   
0328   fSolidVol = new G4Box("Vol",                    
0329                 10.*m/2,10.*m/2,(14025)*mm/2);  
0330                
0331   fLogicVol = new G4LogicalVolume(fSolidVol,           
0332                   fDefaultMaterial,     
0333                   "Vol");       
0334   
0335   fPhysiVol = new G4PVPlacement(0,          
0336                    G4ThreeVector(0,0,-2012.5*mm),   
0337                    "Vol",           
0338                    fLogicVol,       
0339                    fPhysiWorld,      
0340                    false,             
0341                    0);
0342                    
0343   // *************************************************                          
0344   // Whole microbeam line at 10 deg contained in a box 
0345   // *************************************************
0346 
0347   G4double PosX = fCiblePositionX*mm +( (6958.3/2-3.3)*std::sin(fLineAngle))*mm;
0348   G4double PosZ = (fCiblePositionZ+2012.5)*mm - ((6958.3/2-3.3)*std::cos(fLineAngle))*mm;
0349 
0350   // Adjust box absolute position
0351   
0352   PosX = PosX + 1.3 * micrometer * std::cos(fLineAngle);
0353   PosZ = PosZ + 1.3 * micrometer * std::sin(fLineAngle);
0354       
0355   G4RotationMatrix *rot = new G4RotationMatrix();
0356   //  rot->rotateX(0*deg);
0357   rot->rotateY(10*deg);
0358   //  rot->rotateZ(0*deg);
0359  
0360   fSolidBoite = new G4Box("Boite", 4*cm, 4*cm, 6958.3*mm/2);
0361   
0362   fLogicBoite = new G4LogicalVolume(fSolidBoite, fDefaultMaterial, "Boite");
0363   
0364   fPhysiBoite = new G4PVPlacement(rot,
0365                  G4ThreeVector(PosX,0,PosZ),
0366                  "Boite", 
0367                  fLogicBoite,
0368                  fPhysiVol,
0369                  false, 
0370                  0);
0371   
0372   //*********************************************************************
0373   // OBJECT COLLIMATOR (after switching magnet, 5 micrometer in diameter)
0374   //*********************************************************************
0375   
0376   fCollObjSizeXY = 8*cm;
0377   fCollObjSizeZ = 0.07*mm;
0378   
0379   fSolidYoke1 = new G4Box("_CollObj_yoke1_", fCollObjSizeXY/2,fCollObjSizeXY/2,fCollObjSizeZ/2);
0380   
0381   fLogicYoke1 = new G4LogicalVolume(fSolidYoke1, fCollimatorMaterial, "_CollObj_yoke1_");
0382   
0383   fPhysiYoke1 = new G4PVPlacement( 0, G4ThreeVector(0,0,6958.3*mm/2-3.3*mm-6955*mm+0.07*mm/2), fLogicYoke1, 
0384                                    "_CollObj_yoke1_",fLogicBoite, false, 0);
0385    
0386   // --> FIRST PART
0387   
0388   fSolid1Gap = new G4Cons("_CollObj_gap1_", 0.*micrometer, 6*micrometer,
0389              0.*micrometer,2.5*micrometer,
0390              3.5*micrometer, 
0391              0, twopi);
0392   
0393   fLogic1Gap = new G4LogicalVolume(fSolid1Gap, fDefaultMaterial, "_CollObj_gap1_");
0394   
0395   fPhysi1Gap = new G4PVPlacement(0, G4ThreeVector(0,0,0.0315*mm), fLogic1Gap, "_CollObj_gap1_", 
0396                                  fLogicYoke1, false, 0);
0397   
0398   
0399   // --> SECOND PART
0400   
0401   fSolid2Gap = new G4Cons("_CollObj_gap2_", 0.*micrometer, 15*micrometer,
0402              0.*micrometer,6*micrometer,
0403              6.5*micrometer, 
0404              0, twopi);
0405   
0406   fLogic2Gap = new G4LogicalVolume(fSolid2Gap, fDefaultMaterial, "_CollObj_gap2_");
0407   
0408   fPhysi2Gap = new G4PVPlacement(0, G4ThreeVector(0,0,0.0215*mm), fLogic2Gap, "_CollObj_gap2_", 
0409                                  fLogicYoke1, false, 0);
0410   
0411   
0412   // --> THIRD PART
0413   
0414   fSolid3Gap = new G4Cons("_CollObj_gap3_", 0.*micrometer, 105*micrometer, 
0415              0.*micrometer,15*micrometer,
0416              25*micrometer, 
0417              0, twopi);
0418   
0419   fLogic3Gap = new G4LogicalVolume(fSolid3Gap, fDefaultMaterial, "_CollObj_gap3_");
0420   
0421   fPhysi3Gap = new G4PVPlacement(0, G4ThreeVector(0,0,-0.010*mm), fLogic3Gap, "_CollObj_gap3_", fLogicYoke1, 
0422                                  false, 0);
0423 
0424 
0425   //************************
0426   // GAS DETECTOR COLLIMATOR
0427   //************************
0428   
0429   fSolidYoke2 = new G4Box("_CollDet_yoke_", 2.5*cm, 2.5*cm, 0.035*mm);
0430  
0431   fLogicYoke2 = new G4LogicalVolume(fSolidYoke2, fCollimatorMaterial, "_CollDet_yoke_");
0432   
0433   fPhysiYoke2 = new G4PVPlacement(0,
0434                                   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), 
0435                                   fLogicYoke2, "_CollDet_yoke_", fLogicBoite, false, 0);
0436 
0437   // --> FIRST PART
0438   
0439   fSolid4Gap = new G4Cons("_CollDet_gap4_", 0.*micrometer, 8*micrometer,
0440              0.*micrometer,5*micrometer,
0441              7.5*micrometer, 
0442              0, twopi);
0443 
0444   fLogic4Gap = new G4LogicalVolume(fSolid4Gap, fDefaultMaterial, "_CollDet_gap4_");
0445   
0446   fPhysi4Gap = new G4PVPlacement(0, G4ThreeVector(0,0,0.0275*mm), fLogic4Gap, "_CollDet_gap4_", 
0447                                  fLogicYoke2, false, 0);
0448   
0449   // --> SECOND PART
0450   
0451   fSolid5Gap = new G4Cons("_CollDet_gap5_", 0.*micrometer, 105*micrometer,
0452              0.*micrometer,8*micrometer,
0453              27.5*micrometer, 
0454              0, twopi);
0455 
0456   fLogic5Gap = new G4LogicalVolume(fSolid5Gap, fDefaultMaterial, "_CollDet_gap5_");
0457   
0458   fPhysi5Gap = new G4PVPlacement(0,
0459                 G4ThreeVector(0,0,-0.0075*mm),
0460                 fLogic5Gap,
0461                 "_CollDet_gap5_", 
0462                 fLogicYoke2,
0463                 false,
0464                 0);
0465   // ************
0466   // GAS DETECTOR
0467   // ************
0468  
0469   fSolidBoiteIso = new G4Box("Isobutane", 2.5*cm, 2.5*cm, 1.75*mm);
0470   
0471   fLogicBoiteIso = new G4LogicalVolume(fSolidBoiteIso, fBoiteMaterial, "Isobutane");
0472   
0473   fPhysiBoiteIso = new G4PVPlacement(0,
0474                  G4ThreeVector(0,0,6958.3*mm/2-0.3*mm-3*mm-0.004*mm-0.1*mm-3.5*mm/2),
0475                  "Isobutane", 
0476                  fLogicBoiteIso,
0477                  fPhysiBoite,
0478                  false, 
0479                  0);
0480   
0481   // --> GAS DETECTOR END CAP
0482   
0483   fSolidCathode = new G4Box("_Laiton_", 2.5*cm, 2.5*cm, 0.5*mm);
0484   
0485   fLogicCathode = new G4LogicalVolume(fSolidCathode, fCathodeMaterial, "_Laiton_");
0486   
0487   fPhysiCathode = new G4PVPlacement(0,
0488                    G4ThreeVector(0,0,1.25*mm),
0489                    "_Laiton_", 
0490                    fLogicCathode,
0491                    fPhysiBoiteIso,
0492                    false, 0);
0493 
0494   // --> ISOBUTANE GAS  
0495   
0496   fSolidIso = new G4Box("_Iso_", 1.*mm, 1.*mm, 0.499925*mm);
0497   
0498   fLogicIso = new G4LogicalVolume(fSolidIso, fBoiteMaterial, "_Iso_");
0499   
0500   fPhysiIso = new G4PVPlacement(0, 
0501                    G4ThreeVector(0,0,-0.000075*mm),
0502                    "_Iso_", 
0503                    fLogicIso,
0504                    fPhysiCathode,
0505                    false, 
0506                    0);
0507 
0508   // --> Si3N4 WINDOW
0509   
0510   fSolidVerre = new G4Box("_Si3N4_", 0.5*mm, 0.5*mm, 0.075*micrometer);
0511   
0512   fLogicVerre = new G4LogicalVolume(fSolidVerre, fVerreMaterial, "_Si3N4_");
0513   
0514   
0515   fPhysiVerre = new G4PVPlacement(0,
0516                  G4ThreeVector(0,0,0.499925*mm),
0517                  "_Si3N4_", 
0518                  fLogicVerre,
0519                  fPhysiCathode,
0520                  false,
0521                  0);
0522   // *******
0523   // AIR GAP
0524   // *******
0525    
0526   fSolidBoite2 = new G4Box("_Air_", 2.5*cm, 2.5*cm, 0.1*mm/2);
0527   
0528   fLogicBoite2 = new G4LogicalVolume(fSolidBoite2, fBoite2Material, "_Air_");
0529   
0530   fPhysiBoite2 = new G4PVPlacement(0,
0531                  G4ThreeVector(0,0,6958.3*mm/2-0.3*mm-3*mm-0.004*mm-0.1*mm/2),
0532                  "_Air_", 
0533                  fLogicBoite2,
0534                  fPhysiBoite,
0535                  false, 
0536                  0);
0537 
0538   //*************                       
0539   // CELL SUPPORT
0540   //*************  
0541   
0542   fSolidBoite3 = new G4Box("Polyprop", 2.5*cm, 2.5*cm, 0.004*mm/2);
0543   
0544   fLogicBoite3 = new G4LogicalVolume(fSolidBoite3, fBoite3Material, "Polyprop");
0545   
0546   fPhysiBoite3 = new G4PVPlacement(0, 
0547                   G4ThreeVector(0,0,6958.3*mm/2-0.3*mm-3*mm-0.004*mm/2),
0548                   "Polyprop", 
0549                   fLogicBoite3, 
0550                   fPhysiBoite, 
0551                   false, 
0552                   0);
0553   //****
0554   // KGM   
0555   //****
0556     
0557   fSolidKgm = new G4Box("KGM", 2.5*cm, 2.5*cm, 3*mm/2);
0558 
0559   fLogicKgm = new G4LogicalVolume(fSolidKgm, fKgmMaterial, "KGM");
0560   
0561   fPhysiKgm = new G4PVPlacement(0,
0562                    G4ThreeVector(0,0,6958.3*mm/2-0.3*mm-3*mm/2),
0563                    "KGM",
0564                    fLogicKgm,
0565                    fPhysiBoite, 
0566                    false,
0567                    0);
0568 
0569   //*****************
0570   // MICROSCOPE PLATE
0571   //*****************
0572   
0573   fSolidVerre2 = new G4Box("_Lame_", 2.5*cm, 2.5*cm, 0.150*mm);
0574   
0575   fLogicVerre2 = new G4LogicalVolume(fSolidVerre2, fVerre2Material, "_Lame_");
0576   
0577   fPhysiVerre2 = new G4PVPlacement(0,
0578                   G4ThreeVector(0,0,6958.3*mm/2-0.3*mm/2),
0579                   "_Lame_", 
0580                   fLogicVerre2,
0581                   fPhysiBoite, 
0582                   false,
0583                   0);
0584 
0585   // **************
0586   // CELL CYTOPLASM
0587   // **************
0588   
0589   // WITHIN KGM
0590 /*  
0591   fSolidCyto=new G4Ellipsoid("CYTO",25*micrometer, 25*micrometer, 11*micrometer);
0592  
0593   fLogicCyto=new G4LogicalVolume (fSolidCyto, fDefaultMaterial, "CYTO");
0594 
0595   fPhysiCyto=new G4PVPlacement(0, G4ThreeVector(0,0,-1.5*mm+11*micrometer),"CYTO",fLogicCyto, fPhysiKgm, false, 0);
0596 */
0597 
0598   // ************
0599   // CELL PHANTOM
0600   // ************
0601 
0602   fMyCellParameterisation = new CellParameterisation
0603         (fNucleusMaterial1,fCytoplasmMaterial1,
0604      fNucleusMaterial2,fCytoplasmMaterial2,
0605      fNucleusMaterial3,fCytoplasmMaterial3);
0606 
0607   fSolidPhantom = new G4Box("Phantom", 
0608     fMyCellParameterisation->GetPixelSizeX()/2, 
0609     fMyCellParameterisation->GetPixelSizeY()/2, 
0610     fMyCellParameterisation->GetPixelSizeZ()/2); 
0611   
0612   fLogicPhantom = new G4LogicalVolume(fSolidPhantom,fDefaultMaterial,"Phantom",0,0,0);
0613     
0614   SetNbOfPixelsInPhantom (fMyCellParameterisation->GetPhantomTotalPixels());
0615 
0616   SetMassNucleus(fMyCellParameterisation->GetNucleusMass());
0617 
0618   SetMassCytoplasm(fMyCellParameterisation->GetCytoplasmMass());
0619 
0620   fPhysiPhantom = new G4PVParameterised(
0621                             "Phantom",        // their name
0622                             fLogicPhantom,    // their logical volumr
0623                             //logicCyto,      // Mother logical volume is Cyto
0624                             fLogicKgm,        // Mother logical volume is Kgm
0625                 kUndefined,       // Are placed along this axis 
0626                             fMyCellParameterisation->GetPhantomTotalPixels(),    // Number of boxes
0627                             fMyCellParameterisation,false);   // The parametrisation
0628 
0629   G4cout << " ==========> The phantom contains " << fMyCellParameterisation->GetPhantomTotalPixels() << " voxels " << G4endl;           
0630   G4cout << " ==========> Nucleus mass (kg)=" << fMyCellParameterisation->GetNucleusMass() / kg << G4endl;
0631   G4cout << " ==========> Cytoplasm mass (kg)=" << fMyCellParameterisation->GetCytoplasmMass()/ kg << G4endl;
0632   G4cout << " ==========> Voxel size X (um)=" << fMyCellParameterisation->GetPixelSizeX()/um << G4endl;
0633   G4cout << " ==========> Voxel size Y (um)=" << fMyCellParameterisation->GetPixelSizeY()/um << G4endl;
0634   G4cout << " ==========> Voxel size Z (um)=" << fMyCellParameterisation->GetPixelSizeZ()/um << G4endl; 
0635   G4cout << G4endl; 
0636 
0637   // VISUALISATION ATTRIBUTES (for phantom, see in Parameterisation class)
0638   
0639   G4VisAttributes* simpleWorldVisAtt= new G4VisAttributes(G4Colour(1.0,1.0,1.0)); //White
0640   simpleWorldVisAtt->SetVisibility(true);
0641   
0642   G4VisAttributes* simplePlain= new G4VisAttributes(G4Colour(1.0,1.0,1.0)); //White
0643   simplePlain->SetVisibility(true);
0644   simplePlain->SetForceSolid(true);
0645     
0646   G4VisAttributes* simpleBoxAttLine= new G4VisAttributes(G4Colour(1.0,0.0,0.0));
0647   simpleBoxAttLine->SetVisibility(true);
0648    
0649   G4VisAttributes* simpleBoxAtt= new G4VisAttributes(G4Colour(1.0,1.0,0.0));
0650   simpleBoxAtt->SetDaughtersInvisible(false);
0651   simpleBoxAtt->SetForceSolid(false);
0652  
0653   G4VisAttributes* simpleBoxAtt2= new G4VisAttributes(G4Colour(0.0,1.0,0.0));
0654   simpleBoxAtt2->SetDaughtersInvisible(false);
0655   simpleBoxAtt2->SetForceSolid(false);
0656   
0657   G4VisAttributes* simpleBoxAttKGM= new G4VisAttributes(G4Colour(0.0,0.0,1.0));
0658   simpleBoxAttKGM->SetDaughtersInvisible(false);
0659   simpleBoxAttKGM->SetForceSolid(false);
0660   
0661   G4VisAttributes* simpleBoxAttPropyl= new G4VisAttributes(G4Colour(1.0,1.0,1.0));
0662   simpleBoxAttPropyl->SetDaughtersInvisible(true);
0663   simpleBoxAttPropyl->SetForceSolid(false);
0664   
0665   G4VisAttributes* simpleBoxAttAir= new G4VisAttributes(G4Colour(0.0,1.0,0.0));
0666   simpleBoxAttAir->SetDaughtersInvisible(true);
0667   simpleBoxAttAir->SetForceSolid(false);
0668   
0669   G4VisAttributes* simpleBoxAtt3= new G4VisAttributes(G4Colour(0.0,0.0,1.0));
0670   simpleBoxAtt3->SetDaughtersInvisible(false);
0671   simpleBoxAtt3->SetForceSolid(false);
0672   
0673   fLogicYoke1->SetVisAttributes(simpleBoxAtt);
0674   fLogic1Gap->SetVisAttributes(simpleBoxAtt);
0675   fLogic2Gap->SetVisAttributes(simpleBoxAtt);
0676   fLogic3Gap->SetVisAttributes(simpleBoxAtt);
0677   fLogicYoke2->SetVisAttributes(simpleBoxAtt);  
0678   fLogic4Gap->SetVisAttributes(simpleBoxAtt);
0679   fLogic5Gap->SetVisAttributes(simpleBoxAtt);
0680   fLogicBoite->SetVisAttributes(simpleBoxAttLine);
0681   fLogicCathode->SetVisAttributes(simpleBoxAttPropyl);
0682   fLogicIso->SetVisAttributes(simpleBoxAttPropyl);
0683   fLogicBoiteIso->SetVisAttributes(simpleBoxAttPropyl);
0684   fLogicVerre->SetVisAttributes(simpleBoxAtt);
0685   fLogicBoite2->SetVisAttributes(simpleBoxAttAir);
0686   fLogicBoite3->SetVisAttributes(simpleBoxAtt);
0687   fLogicKgm->SetVisAttributes(simpleBoxAttKGM);
0688   fLogicVerre2->SetVisAttributes(simpleBoxAtt);
0689   
0690   return fPhysiWorld;
0691 }
0692 
0693 void DetectorConstruction::ConstructSDandField()
0694 {
0695   EMField* field = new EMField();
0696   G4AutoDelete::Register(field);
0697   
0698   G4EqMagElectricField* fEquation = new G4EqMagElectricField(field);
0699   G4MagIntegratorStepper* fStepper = new G4ClassicalRK4 (fEquation,8);
0700   G4FieldManager* fFieldMgr = 
0701     G4TransportationManager::GetTransportationManager()->GetFieldManager();
0702 
0703   // Relaxed
0704   G4MagInt_Driver* fIntgrDriver = 
0705     new G4MagInt_Driver(1*mm,fStepper,fStepper->GetNumberOfVariables() );
0706 
0707   G4ChordFinder* fChordFinder = new G4ChordFinder(fIntgrDriver);
0708   fFieldMgr->SetChordFinder(fChordFinder);
0709   fFieldMgr->SetDetectorField(field);
0710 
0711   // FOLLOWING PARAMETERS TUNED FROM RAY-TRACING SIMULATIONS OF THE AIFIRA NANOBEAM LINE
0712   /*
0713   fFieldMgr->GetChordFinder()->SetDeltaChord(1e-9*m);
0714   fFieldMgr->SetDeltaIntersection(1e-9*m);
0715   fFieldMgr->SetDeltaOneStep(1e-9*m);     
0716       
0717   fPropInField =
0718     G4TransportationManager::GetTransportationManager()->GetPropagatorInField();
0719   fPropInField->SetMinimumEpsilonStep(1e-16); // instead of 11
0720   fPropInField->SetMaximumEpsilonStep(1e-15); // instead of 10
0721   */
0722 }