File indexing completed on 2025-01-31 09:22:33
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
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
0073
0074
0075 fDensityPhantom = 0.;
0076 fDensityNucleus = 0.;
0077 fDensityCytoplasm = 0.;
0078 fWorldSizeXY=fWorldSizeZ=0.;
0079 fCollObjSizeXY = 0.;
0080 fCollObjSizeZ = 0.;
0081
0082
0083 fCiblePositionX = 0.;
0084 fCiblePositionY = 0.;
0085 fCiblePositionZ = 0.;
0086
0087
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
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
0125
0126 density = universe_mean_density;
0127 G4Material* vacuum = new G4Material(name="Vacuum", z=1., a=1.01*g/mole,
0128 density);
0129
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
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
0146
0147 density = (5e-6/1013.)*1.290*mg/cm3;
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
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
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
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
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
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
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
0199
0200 fDensityPhantom = 1.;
0201
0202
0203
0204
0205
0206
0207
0208
0209 fDensityCytoplasm = 1.;
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
0216
0217 fDensityCytoplasm = 1.;
0218
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
0228
0229 fDensityCytoplasm = 1.;
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
0236
0237 fDensityNucleus = 1.;
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.;
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
0256
0257 fDensityNucleus = 1.;
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
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
0286 G4cout << G4endl << *(G4Material::GetMaterialTable()) << G4endl;
0287
0288 }
0289
0290 G4VPhysicalVolume* DetectorConstruction::ConstructLine()
0291 {
0292
0293 fWorldSizeXY = 20*m;
0294 fWorldSizeZ = 40*m;
0295
0296
0297 fLineAngle = 10*deg;
0298
0299
0300 fCiblePositionX = -1461.42*mm;
0301 fCiblePositionY = 0*mm;
0302 fCiblePositionZ = -1327 + (955*std::cos(fLineAngle))*mm;
0303
0304
0305
0306
0307
0308 fSolidWorld = new G4Box("World",
0309 fWorldSizeXY/2,fWorldSizeXY/2,fWorldSizeZ/2);
0310
0311
0312 fLogicWorld = new G4LogicalVolume(fSolidWorld,
0313 fDefaultMaterial,
0314 "World");
0315
0316 fPhysiWorld = new G4PVPlacement(0,
0317 G4ThreeVector(),
0318 "World",
0319 fLogicWorld,
0320 nullptr,
0321 false,
0322 0);
0323
0324
0325
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
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
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
0357 rot->rotateY(10*deg);
0358
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
0587
0588
0589
0590
0591
0592
0593
0594
0595
0596
0597
0598
0599
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",
0622 fLogicPhantom,
0623
0624 fLogicKgm,
0625 kUndefined,
0626 fMyCellParameterisation->GetPhantomTotalPixels(),
0627 fMyCellParameterisation,false);
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
0638
0639 G4VisAttributes* simpleWorldVisAtt= new G4VisAttributes(G4Colour(1.0,1.0,1.0));
0640 simpleWorldVisAtt->SetVisibility(true);
0641
0642 G4VisAttributes* simplePlain= new G4VisAttributes(G4Colour(1.0,1.0,1.0));
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
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
0712
0713
0714
0715
0716
0717
0718
0719
0720
0721
0722 }