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