ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ML2AccSaturn.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file ML2AccSaturn.cc
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 // The code was written by :
27 // ^Claudio Andenna claudio.andenna@ispesl.it, claudio.andenna@iss.infn.it
28 // *Barbara Caccia barbara.caccia@iss.it
29 // with the support of Pablo Cirrone (LNS, INFN Catania Italy)
30 // with the contribute of Alessandro Occhigrossi*
31 //
32 // ^INAIL DIPIA - ex ISPESL and INFN Roma, gruppo collegato Sanità, Italy
33 // *Istituto Superiore di Sanità and INFN Roma, gruppo collegato Sanità, Italy
34 // Viale Regina Elena 299, 00161 Roma (Italy)
35 // tel (39) 06 49902246
36 // fax (39) 06 49387075
37 //
38 // more information:
39 // http://g4advancedexamples.lngs.infn.it/Examples/medical-linac
40 //
41 //*******************************************************//
42 
43 
44 #include "ML2AccSaturn.hh"
45 #include "ML2AccSaturnMessenger.hh"
46 #include "ML2Accelerator.hh"
47 
48 #include "G4ios.hh"
49 #include "G4SystemOfUnits.hh"
50 
51 
52 
53 
54 using namespace std;
55 
57 {
58  PVWorld = 0;
59  accSaturnMessenger = new CML2AccSaturnMessenger(this);
60  buildMaterial_SSteel();
61  buildMaterial_XC10();
62  buildMaterial_WNICU();
63  buildMaterial_Kapton();
64 }
65 
67 {
68 }
69 
70 //void CML2AccSaturn::reset()
71 //{
72 // vec_leavesA.clear();
73 // vec_leavesB.clear();
74 //}
75 
77 
79 {
80  if (instance == 0)
81  {
82 // G4cout << "in CML2AccSaturn::GetInstance" << G4endl;
83  instance = new CML2AccSaturn();
84  }
85  return instance;
86 }
87 
89 {
90  G4cout << "----------------------------------------------------------------" << G4endl;
91  G4cout << "Accelerator VARIAN SATURN 43" << G4endl;
92  G4cout <<"\n\n\tnominal beam energy: "<<idEnergy << G4endl;
93  G4cout << "\tdistance isocentre [mm]:"<< isoCentre/mm << G4endl;
94  G4cout <<"\tJaw X aperture: 1) "<< jaw1XAperture/mm<<"[mm]\t2) " << jaw2XAperture/mm<< " [mm]"<< G4endl;
95  G4cout <<"\tJaw Y aperture: 1) "<< jaw1YAperture/mm<<"[mm]\t2) " << jaw2YAperture/mm<< " [mm]"<< G4endl;
96  if (vec_leavesA.size()>0)
97  {
98  G4cout << "\tleaves A aperture [mm]" << G4endl;
99  for (int i=0; i< (int)vec_leavesA.size(); i++)
100  {
101  G4cout<<"\t" <<i <<") "<< vec_leavesA[i]/mm << G4endl;
102  }
103  }
104  else
105  {
106  G4cout << "\tNo leaves A" << G4endl;
107  }
108  if (vec_leavesB.size()>0)
109  {
110  G4cout << "\tleaves B aperture [mm]" << G4endl;
111  for (int i=0; i< (int)vec_leavesB.size(); i++)
112  {
113  G4cout<<"\t" <<i <<") "<< vec_leavesB[i]/mm << G4endl;
114  }
115  }
116  else
117  {
118  G4cout << "\tNo leaves B" << G4endl;
119  }
120  G4cout << "______________________________________________________________" << G4endl;
121 }
122 
123 
125 {
126 
133 
134  mat_ssteel = new G4Material("StainlessSteel", 7.8 *g/cm3, 6);
135  mat_ssteel -> AddMaterial(elFe, 0.6898);
136  mat_ssteel -> AddMaterial(elCr, 0.18);
137  mat_ssteel -> AddMaterial(elNi, 0.10);
138  mat_ssteel -> AddMaterial(elMn, 0.02);
139  mat_ssteel -> AddMaterial(elSi, 0.01);
140  mat_ssteel -> AddMaterial(elC, 0.0002);
141 
142 }
143 
145 {
149 
150  mat_XC10 = new G4Material("CARBON_STEEL", 7.8 *g/cm3, 3);
151  mat_XC10 -> AddMaterial(elFe, 0.993);
152  mat_XC10 -> AddMaterial(elMn, 0.006);
153  mat_XC10 -> AddMaterial(elC, 0.001);
154 
155 }
156 
158 {
162 
163  mat_WNICU = new G4Material("Denal(WNICU)", 16.8*g/cm3, 3);
164  mat_WNICU -> AddMaterial(elW, 0.905);
165  mat_WNICU -> AddMaterial(elNi, 0.07);
166  mat_WNICU -> AddMaterial(elCu, 0.025);
167 
168 }
169 
171 {
176 
177  mat_Kapton = new G4Material("kapton", 1.42*g/cm3, 4);
178  mat_Kapton -> AddMaterial(elC, 0.69113);
179  mat_Kapton -> AddMaterial(elO, 0.20924);
180  mat_Kapton -> AddMaterial(elN, 0.07327);
181  mat_Kapton -> AddMaterial(elH, 0.026362);
182 
183 }
184 
186 {
187  G4Material *material = 0;
188 
189  if (materialName == "steel")
190  {
191  material = mat_ssteel;
192  }
193  else if (materialName == "xc10")
194  {
195  material = mat_XC10;
196  }
197  else if (materialName == "wnicu")
198  {
199  material = mat_WNICU;
200  }
201  else if (materialName == "kapton")
202  {
203  material = mat_Kapton;
204  }
205  else
206  {
207  G4cout << "Sbajato" << G4endl;
208  }
209  return material;
210 }
211 
213 {
214  PVWorld = PWorld;
215  setIsoCentre(iso);
216  target();
217  vacuumWindow();
218  ionizationChamber();
219  flatteningFilter();
220  primaryCollimator();
221  Jaw1X();
222  Jaw2X();
223  Jaw1Y();
224  Jaw2Y();
225 }
226 
228 {
229  bool bCreated = false;
230 
231  G4ThreeVector targetCentre, boxHalfSize, tubeCentre;
232  G4double tubeRadius, tubeHeight;
233  targetCentre.set(0,0,-3.5*mm);
234  boxHalfSize.set(5.*mm,5.*mm, 7.5*mm);
235  tubeCentre.set(0,0,-5.5*mm);
236  tubeRadius = 3.*mm;
237  tubeHeight = 5.5*mm;
238 
239  G4Material *diskMaterial = G4NistManager::Instance()->FindOrBuildMaterial("G4_Ti");
240  G4Material *targetMaterial = G4NistManager::Instance()->FindOrBuildMaterial("G4_W");
241 
242  // Region for cuts
243  G4Region *regVol;
244  regVol = new G4Region("TargetR");
246  cuts -> SetProductionCut(1.*cm);
247  regVol -> SetProductionCuts(cuts);
248 
249  // Physical volumes
250  G4Box *box = new G4Box("targetBox", boxHalfSize.getX(), boxHalfSize.getY(), boxHalfSize.getZ());
251  G4Tubs *tube = new G4Tubs("targetTube", 0.*mm, tubeRadius, tubeHeight, 0.*deg, 360.*deg);
252  G4SubtractionSolid* BoxMinusTube = new G4SubtractionSolid("TargetSolid", box, tube,0, G4ThreeVector(0.,0.,-4.*mm));
253  G4LogicalVolume* BoxMinusTubeLV = new G4LogicalVolume(BoxMinusTube, targetMaterial, "BoxMinusTubeLV",0,0,0);
254  new G4PVPlacement(0, targetCentre, "TargetPV", BoxMinusTubeLV, this->PVWorld, false, 0);
255 
256  G4Tubs *disk = new G4Tubs("targetDisk", 0.*mm, 4.*mm, 0.025*mm, 0.*deg, 360.*deg);
257  G4LogicalVolume *diskLV = new G4LogicalVolume(disk,diskMaterial,"targetDiskLV",0,0,0);
258 
259  new G4PVPlacement(0, G4ThreeVector(0.,0.,-15.*mm), "diskPV", diskLV, this->PVWorld, false, 0);
260 
261  // Visualization
262  G4VisAttributes* simpleAlSVisAtt;
263  simpleAlSVisAtt = new G4VisAttributes(G4Colour::Grey());
264  simpleAlSVisAtt -> SetVisibility(true);
265  simpleAlSVisAtt -> SetForceSolid(true);
266  BoxMinusTubeLV -> SetVisAttributes(simpleAlSVisAtt);
267  diskLV -> SetVisAttributes(simpleAlSVisAtt);
268 
269  // Region for cuts
270  BoxMinusTubeLV -> SetRegion(regVol);
271  regVol -> AddRootLogicalVolume(BoxMinusTubeLV);
272  diskLV -> SetRegion(regVol);
273  regVol -> AddRootLogicalVolume(diskLV);
274 
275  bCreated = true;
276  return bCreated;
277 
278 }
280 {
281  bool bCreated = false;
282 
283  G4double tube1Radius, tube1Height, tube1Z;
284  G4double tube2Radius, tube2Height, tube2Z;
285  G4double tube3Radius, tube3Height;
286  G4double tube4Radius, tube4Height, tube4Z;
287  G4double cone1RadiusMin, cone1RadiusMax, cone1Height;
288  G4double cone2RadiusMin, cone2RadiusMax, cone2Height;
289  G4double cone3RadiusMin, cone3RadiusMax, cone3Height;
290 
291  tube1Radius = 141./2.*mm; // upper principal tube
292  tube1Height = 79./2.*mm;
293  tube1Z = 5.*mm+tube1Height;
294 
295  tube2Radius = 141./2.*mm; // middle principal tube
296  tube2Height = 57.5/2.*mm;
297  tube2Z = 1.35*mm+tube1Z+tube1Height+tube2Height;
298 
299  tube3Radius = 34./2.*mm; // tube of air to be subtracted
300  tube3Height = 15.86/2.*mm;
301 
302  tube4Radius = 241./2.*mm; // lower principal tube
303  tube4Height = 40.50/2.*mm;
304  tube4Z = 161.*mm+tube4Height;
305 
306  cone1RadiusMin=34./2.*mm; // upper cone
307  cone1RadiusMax=54./2.*mm;
308  cone1Height=(79.-15.86)/2.*mm;
309 
310  cone2RadiusMin=53./2.*mm; // middle cone
311  cone2RadiusMax=81./2.*mm;
312  cone2Height=57.50/2.*mm;
313 
314  cone3RadiusMin=88.06/2.*mm; // lower cone
315  cone3RadiusMax=109.76/2.*mm;
316  cone3Height=40.50/2.*mm;
317 
318 // G4Material *upperTubeMaterial = SetMaterials("XC10");
319 // G4Material *middleTubeMaterial = SetMaterials("Denal(WNICU)");
320  G4Material *upperTubeMaterial = getMaterial("xc10");
321  G4Material *middleTubeMaterial = getMaterial("wnicu");
322 
323  G4Material *lowerTubeMaterial = G4NistManager::Instance()->FindOrBuildMaterial("G4_Pb");
324  G4Region *regVol;
325  G4VisAttributes* simpleAlSVisAtt;
326 
327  // Region for cuts
328  regVol = new G4Region("primaryCollimatorR");
330  cuts->SetProductionCut(1.*cm);
331  regVol->SetProductionCuts(cuts);
332 
333  // Physical volumes
334  G4Tubs *tube1 = new G4Tubs(
335  "PriCollTube1",
336  0.*mm,
337  tube1Radius,
338  tube1Height,
339  0.*deg,
340  360.*deg);
341  G4Cons *cone1 = new G4Cons(
342  "PriCollCone1",
343  0.,
344  cone1RadiusMin,
345  0.,
346  cone1RadiusMax,
347  cone1Height,
348  0,
349  360.*deg);
350  G4Tubs *tube2 = new G4Tubs("PriCollTube2", 0.*mm, tube2Radius, tube2Height, 0.*deg, 360.*deg);
351  G4Cons *cone2 = new G4Cons("PriCollCone2", 0., cone2RadiusMin, 0.,cone2RadiusMax,cone2Height, 0, 360.*deg);
352  G4Tubs *tube3 = new G4Tubs("PriCollTube3", 0.*mm, tube3Radius, tube3Height, 0.*deg, 360.*deg);
353  G4Cons *cone3 = new G4Cons("PriCollCone3", 0., cone3RadiusMin,0.,cone3RadiusMax, cone3Height, 0, 360.*deg);
354  G4Tubs *tube4 = new G4Tubs("PriCollTube4", 0.*mm, tube4Radius, tube4Height, 0.*deg, 360.*deg);
355 
356  G4UnionSolid *tube3AndCone1 = new G4UnionSolid("PriCollTube3AndCone1",tube3,cone1,0, G4ThreeVector(0.,0.,tube3Height+cone1Height));
357  G4SubtractionSolid* tube1NotTube3AndCone1 = new G4SubtractionSolid("PriColltube1NotTube3AndCone1", tube1, tube3AndCone1,0, G4ThreeVector(0.,0.,-tube1Height+tube3Height));
358  G4LogicalVolume* tube1NotTube3AndCone1LV = new G4LogicalVolume(tube1NotTube3AndCone1, upperTubeMaterial, "PriColltube1NotTube3AndCone1LV",0,0,0);
359 
360  G4SubtractionSolid* tube2NotCone2 = new G4SubtractionSolid("PriCollTube2NotCone2", tube2, cone2);
361  G4LogicalVolume* tube2NotCone2LV = new G4LogicalVolume(tube2NotCone2, middleTubeMaterial, "PriCollTube2NotCone2LV",0,0,0);
362 
363  G4SubtractionSolid* tube4NotCone3 = new G4SubtractionSolid("PriCollTube4NotCone3", tube4, cone3);
364  G4LogicalVolume* tube4NotCone3LV = new G4LogicalVolume(tube4NotCone3, lowerTubeMaterial, "PriCollTube4NotCone3LV",0,0,0);
365 
366  new G4PVPlacement(0, G4ThreeVector(0,0,tube1Z), "PriCollUpperPV", tube1NotTube3AndCone1LV, PVWorld, false, 0);
367  new G4PVPlacement(0, G4ThreeVector(0,0,tube2Z), "PriCollMiddlePV", tube2NotCone2LV, PVWorld, false, 0);
368  new G4PVPlacement(0, G4ThreeVector(0,0,tube4Z), "PriCollLowerPV", tube4NotCone3LV, PVWorld, false, 0);
369 
370  // Visualization
371  simpleAlSVisAtt = new G4VisAttributes(G4Colour::Green());
372  simpleAlSVisAtt -> SetVisibility(true);
373  simpleAlSVisAtt -> SetForceSolid(true);
374  tube1NotTube3AndCone1LV -> SetVisAttributes(simpleAlSVisAtt);
375  simpleAlSVisAtt -> SetColour(G4Colour::Red());
376  tube2NotCone2LV -> SetVisAttributes(simpleAlSVisAtt);
377  simpleAlSVisAtt -> SetColour(G4Colour::Blue());
378  tube4NotCone3LV -> SetVisAttributes(simpleAlSVisAtt);
379 
380 
381  // Region for cuts
382  tube1NotTube3AndCone1LV -> SetRegion(regVol);
383  regVol -> AddRootLogicalVolume(tube1NotTube3AndCone1LV);
384  tube2NotCone2LV -> SetRegion(regVol);
385  regVol -> AddRootLogicalVolume(tube2NotCone2LV);
386  tube4NotCone3LV -> SetRegion(regVol);
387  regVol -> AddRootLogicalVolume(tube4NotCone3LV);
388 
389  bCreated = true;
390  return bCreated;
391 }
392 
394 {
395  bool bCreated = false;
396 
397  G4double tubeRadius, tubeHeight, tubeZ;
398 
399  tubeRadius = 116.53/2.*mm; // upper principal tube
400  tubeHeight = 2./2.*mm;
401  tubeZ = 215.75*mm+tubeHeight;
402 
404 
405  G4Region *regVol;
406  G4VisAttributes* simpleAlSVisAtt;
407  // Region for cuts
408  regVol= new G4Region("VacWindowR");
410  cuts->SetProductionCut(0.1*cm);
411  regVol->SetProductionCuts(cuts);
412 
413  // Physical volumes
414  G4Tubs *tube = new G4Tubs("VacWindowTube", 0.*mm, tubeRadius, tubeHeight, 0.*deg, 360.*deg);
415  G4LogicalVolume* tubeLV = new G4LogicalVolume(tube, elAl, "VacWindowTubeLV",0,0,0);
416 
417  new G4PVPlacement(0, G4ThreeVector(0,0,tubeZ), "VacWindowTubePV", tubeLV, PVWorld, false, 0);
418 
419  // Visualization
420  simpleAlSVisAtt = new G4VisAttributes(G4Colour::Green());
421  simpleAlSVisAtt -> SetVisibility(true);
422  simpleAlSVisAtt -> SetForceSolid(true);
423  tubeLV -> SetVisAttributes(simpleAlSVisAtt);
424 
425  // Region for cuts
426  tubeLV -> SetRegion(regVol);
427  regVol -> AddRootLogicalVolume(tubeLV);
428 
429  bCreated = true;
430  return bCreated;
431 }
433 {
434  bool bCreated = false;
435 
436  G4double tube1Radius, tube1Height;
437  G4double cone1RadiusMin, cone1RadiusMax, cone1Height;
438  G4double cone2RadiusMin, cone2RadiusMax, cone2Height;
439  G4double cone3RadiusMin, cone3RadiusMax, cone3Height, ffZ;
440 
441  tube1Radius = 108./2.*mm; // upper principal tube
442  tube1Height = 7.5/2.*mm;
443 
444  cone1RadiusMin = 54./2.*mm; // upper cone
445  cone1RadiusMax = 76./2.*mm;
446  cone1Height = 13.7/2.*mm;
447 
448  cone2RadiusMin = 8./2.*mm; // middle cone
449  cone2RadiusMax = 54./2.*mm;
450  cone2Height = (44.3-13.7)/2.*mm;
451 
452  cone3RadiusMin = 0.000001*mm; // lower cone
453  cone3RadiusMax = 8./2.*mm;
454  cone3Height = (46.8-44.3)/2.*mm;
455  ffZ=149.50+tube1Height; // the half point is located ad the centre of the tube1 because of the solids unions and translations
456 
457 // G4Material *ffMaterial = SetMaterials("StainlessSteel");
458  G4Material *ffMaterial = getMaterial("steel");
459 
460  G4Region *regVol;
461  G4VisAttributes* simpleAlSVisAtt;
462  // Region for cuts
463  regVol= new G4Region("ffR");
465  cuts->SetProductionCut(0.1*cm);
466  regVol->SetProductionCuts(cuts);
467 
468  // Physical volumes
469 
470  G4Tubs *tube1 = new G4Tubs("ffTube1", 0.*mm, tube1Radius, tube1Height, 0.*deg, 360.*deg);
471  G4Cons *cone1 = new G4Cons("ffCone1",0.,cone1RadiusMax, 0., cone1RadiusMin, cone1Height, 0, 360.*deg);
472  G4Cons *cone2 = new G4Cons("ffCone2", 0.,cone2RadiusMax, 0., cone2RadiusMin,cone2Height, 0, 360.*deg);
473  G4Cons *cone3 = new G4Cons("ffCone3", 0.,cone3RadiusMax, 0., cone3RadiusMin,cone3Height, 0, 360.*deg);
474 
475  G4double pos = (cone1Height-tube1Height-1.)*mm;
476  G4UnionSolid *tube1AndCone1 = new G4UnionSolid(
477  "ffTube1AndCone1",
478  tube1,
479  cone1,
480  0,
481  G4ThreeVector(0., 0., pos));
482 
483  pos+=cone1Height+cone2Height;
484  G4UnionSolid *tubeCone1AndCone2 = new G4UnionSolid(
485  "fftubeCone1AndCone2",
486  tube1AndCone1,
487  cone2,
488  0,
489  G4ThreeVector(0., 0., pos));
490  pos+=cone2Height+cone3Height;
491  G4UnionSolid *tubeCone12AndCone3 = new G4UnionSolid(
492  "fftubeCone12AndCone3",
493  tubeCone1AndCone2,
494  cone3,
495  0,
496  G4ThreeVector(0., 0., pos));
497 
498  G4LogicalVolume* ffLV = new G4LogicalVolume(tubeCone12AndCone3, ffMaterial, "ffLV",0,0,0);
499 
500  new G4PVPlacement(0, G4ThreeVector(0,0,ffZ), "ffPV", ffLV, PVWorld, false, 0);
501 
502  // Visualization
503  simpleAlSVisAtt= new G4VisAttributes(G4Colour::Magenta());
504  simpleAlSVisAtt->SetVisibility(true);
505  simpleAlSVisAtt->SetForceSolid(true);
506  ffLV->SetVisAttributes(simpleAlSVisAtt);
507 
508  // Region for cuts
509  ffLV->SetRegion(regVol);
510  regVol->AddRootLogicalVolume(ffLV);
511 
512  bCreated = true;
513  return bCreated;
514 }
516 {
517  bool bCreated = false;
518 
519  G4double tubeRadius, tubeA1Z, tubeA2Z, tubeA3Z, tubeA4Z, tubeA5Z, tubeA6Z;
520  G4double kaptonThickness, AlThickness1, AlThickness8;
521 
522  kaptonThickness = 0.025/2.*mm;
523  AlThickness1 = 1.6e-5/2.*cm;
524  AlThickness8 = 8e-6/2.*cm;
525 
526  tubeRadius = 110./2.*mm; // upper principal tube
527  tubeA1Z=(202.5+AlThickness8)*mm;
528  tubeA2Z=(204.5+AlThickness1)*mm;
529  tubeA3Z=(206.5+AlThickness8)*mm;
530  tubeA4Z=(207.5+AlThickness8)*mm;
531  tubeA5Z=(209.5+AlThickness1)*mm;
532  tubeA6Z=(211.5+AlThickness8)*mm;
533 
534  G4double pos1=(AlThickness1+kaptonThickness)*mm;
535  G4double pos8=(AlThickness8+kaptonThickness)*mm;
536 
537 
539 // G4Material *kapton = SetMaterials("kapton");
540  G4Material *kapton = getMaterial("kapton");
541 
542  G4Region *regVol;
543  G4VisAttributes* simpleAlSVisAttAl1;
544  G4VisAttributes* simpleAlSVisAttAl8;
545  G4VisAttributes* simpleAlSVisAttK;
546  // Region for cuts
547  regVol = new G4Region("IonChamberR");
549  cuts -> SetProductionCut(0.1*mm);
550  regVol -> SetProductionCuts(cuts);
551 
552  // Physical volumes
553 
554  G4Tubs *tubeAl8 = new G4Tubs("ICTube1A", 0.*mm, tubeRadius, AlThickness8, 0.*deg, 360.*deg);
555  G4Tubs *tubeK = new G4Tubs("ICTube1B", 0.*mm, tubeRadius, kaptonThickness, 0.*deg, 360.*deg);
556  G4Tubs *tubeAl1 = new G4Tubs("ICTube2A", 0.*mm, tubeRadius, AlThickness1, 0.*deg, 360.*deg);
557 
558 
559  G4LogicalVolume* IC_Al8_LV = new G4LogicalVolume(tubeAl8, elAL, "IC_Al8_LV", 0, 0, 0);
560  G4LogicalVolume* IC_Al1_LV = new G4LogicalVolume(tubeAl1, elAL, "IC_Al1_LV", 0, 0, 0);
561  G4LogicalVolume* IC_K_LV = new G4LogicalVolume(tubeK, kapton, "IC_Al_LV", 0, 0, 0);
562 
563  new G4PVPlacement(0, G4ThreeVector(0,0,tubeA1Z), "IC_AL8_PV1", IC_Al8_LV, PVWorld, false, 0);
564  new G4PVPlacement(0, G4ThreeVector(0,0,tubeA1Z+pos8), "IC_K_PV1", IC_K_LV, PVWorld, false, 0);
565  new G4PVPlacement(0, G4ThreeVector(0,0,tubeA2Z), "IC_AL1_PV2", IC_Al1_LV, PVWorld, false, 0);
566  new G4PVPlacement(0, G4ThreeVector(0,0,tubeA2Z+pos1), "IC_K_PV2", IC_K_LV, PVWorld, false, 0);
567  new G4PVPlacement(0, G4ThreeVector(0,0,tubeA3Z), "IC_AL8_PV3", IC_Al8_LV, PVWorld, false, 0);
568  new G4PVPlacement(0, G4ThreeVector(0,0,tubeA3Z+pos8), "IC_K_PV3", IC_K_LV, PVWorld, false, 0);
569  new G4PVPlacement(0, G4ThreeVector(0,0,tubeA4Z), "IC_AL8_PV4", IC_Al8_LV, PVWorld, false, 0);
570  new G4PVPlacement(0, G4ThreeVector(0,0,tubeA4Z+pos8), "IC_K_PV4", IC_K_LV, PVWorld, false, 0);
571  new G4PVPlacement(0, G4ThreeVector(0,0,tubeA5Z), "IC_AL1_PV5", IC_Al1_LV, PVWorld, false, 0);
572  new G4PVPlacement(0, G4ThreeVector(0,0,tubeA5Z+pos1), "IC_K_PV5", IC_K_LV, PVWorld, false, 0);
573  new G4PVPlacement(0, G4ThreeVector(0,0,tubeA6Z), "IC_AL8_PV6", IC_Al8_LV, PVWorld, false, 0);
574  new G4PVPlacement(0, G4ThreeVector(0,0,tubeA6Z+pos8), "IC_K_PV6", IC_K_LV, PVWorld, false, 0);
575 
576 
577  // Visualization
578  simpleAlSVisAttAl8 = new G4VisAttributes(G4Colour::Magenta());
579  simpleAlSVisAttAl8 -> SetVisibility(true);
580  simpleAlSVisAttAl8 -> SetForceSolid(true);
581  IC_Al8_LV -> SetVisAttributes(simpleAlSVisAttAl8);
582 
583  simpleAlSVisAttAl1 = new G4VisAttributes(G4Colour::Red());
584  simpleAlSVisAttAl1 -> SetVisibility(true);
585  simpleAlSVisAttAl1 -> SetForceSolid(true);
586  IC_Al1_LV -> SetVisAttributes(simpleAlSVisAttAl1);
587 
588  simpleAlSVisAttK = new G4VisAttributes(G4Colour::Blue());
589  simpleAlSVisAttK -> SetVisibility(true);
590  simpleAlSVisAttK -> SetForceSolid(true);
591  IC_K_LV -> SetVisAttributes(simpleAlSVisAttK);
592 
593  // Region for cuts
594  IC_Al1_LV -> SetRegion(regVol);
595  regVol -> AddRootLogicalVolume(IC_Al1_LV);
596  IC_Al8_LV -> SetRegion(regVol);
597  regVol -> AddRootLogicalVolume(IC_Al8_LV);
598  IC_K_LV -> SetRegion(regVol);
599  regVol -> AddRootLogicalVolume(IC_K_LV);
600 
601  bCreated = true;
602  return bCreated;
603 }
604 
606 {
607  using namespace std;
608  G4double theta, x, y, z, dx, dy;
609  x=centre.getX();
610  y=centre.getY();
611  z=centre.getZ();
612  dx=halfSize.getX();
613  dy=halfSize.getY();
614 
615 
616  switch (idJaw)
617  {
618  case 1: //idJaw1XV2100:
619  theta=fabs(atan(jaw1XAperture/isoCentre));
620  centre.set(z*sin(theta)+dx*cos(theta), y, z*cos(theta)-dx*sin(theta));
621  cRotation->rotateY(-theta);
622  break;
623  case 2: //idJaw2XV2100:
624  theta=fabs(atan(jaw2XAperture/isoCentre));
625  centre.set(-(z*sin(theta)+dx*cos(theta)), y, z*cos(theta)-dx*sin(theta));
626  cRotation->rotateY(theta);
627  break;
628  case 3: //idJaw1YV2100:
629  theta=fabs(atan(jaw1YAperture/isoCentre));
630  centre.set(x, z*sin(theta)+dy*cos(theta), z*cos(theta)-dy*sin(theta));
631  cRotation->rotateX(theta);
632  break;
633  case 4: //idJaw2YV2100:
634  theta=fabs(atan(jaw2YAperture/isoCentre));
635  centre.set(x, -(z*sin(theta)+dy*cos(theta)), z*cos(theta)-dy*sin(theta));
636  cRotation->rotateX(-theta);
637  break;
638  }
639 }
640 
641 
642 
644 {
645  bool bCreated = false;
646 
647  G4double boxSide, box1Height, box1Z, box2Height, box2Z, box3Height, box3Z, box4Height, box4Z, box5Height, box5Z, box6Height, box6Z;
648 
649  boxSide=101./2.*mm; // upper principal box
650 
651  box1Height=3./2.*mm;
652  box1Z=275.50*mm+box1Height;
653 
654  box2Height=35./2.*mm;
655  box2Z=box1Z+box1Height+box2Height;
656 
657  box3Height=35./2.*mm;
658  box3Z=box2Z+box2Height+box3Height;
659 
660  box4Height=27./2.*mm;
661  box4Z=box3Z+box3Height+box4Height;
662 
663  box5Height=10./2.*mm;
664  box5Z=472.50*mm+box5Height;
665 
666  box6Height=5./2.*mm;
667  box6Z=box5Z+box5Height+box6Height;
668 
670 // G4Material *XC10 = SetMaterials("XC10");
671 // G4Material *WNICU = SetMaterials("Denal(WNICU)");
672  G4Material *XC10 = getMaterial("xc10");
673  G4Material *WNICU = getMaterial("wnicu");
674 
675  G4Region *regVol;
676  G4VisAttributes* simpleAlSVisAttPb;
677  G4VisAttributes* simpleAlSVisAttXC10;
678  G4VisAttributes* simpleAlSVisAttWNICU;
679  // Region for cuts
680  regVol = new G4Region("Jaws1XR");
682  cuts -> SetProductionCut(2.*cm);
683  regVol -> SetProductionCuts(cuts);
684 
685  // Physical volumes
686 
687  G4Box *box1 = new G4Box("Jaws1XBox1", boxSide, boxSide, box1Height);
688  G4Box *box2 = new G4Box("Jaws1XBox2", boxSide, boxSide, box2Height);
689  G4Box *box3 = new G4Box("Jaws1XBox3", boxSide, boxSide, box3Height);
690  G4Box *box4 = new G4Box("Jaws1XBox4", boxSide, boxSide, box4Height);
691  G4Box *box5 = new G4Box("Jaws1XBox5", boxSide, boxSide, box5Height);
692  G4Box *box6 = new G4Box("Jaws1XBox6", boxSide, boxSide, box6Height);
693  G4LogicalVolume* box1LV = new G4LogicalVolume(box1, XC10, "Jaws1XLV1", 0, 0, 0);
694  G4LogicalVolume* box2LV = new G4LogicalVolume(box2, elPb, "Jaws1XLV2", 0, 0, 0);
695  G4LogicalVolume* box3LV = new G4LogicalVolume(box3, WNICU, "Jaws1XLV3", 0, 0, 0);
696  G4LogicalVolume* box4LV = new G4LogicalVolume(box4, elPb, "Jaws1XLV4", 0, 0, 0);
697  G4LogicalVolume* box5LV = new G4LogicalVolume(box5, elPb, "Jaws1XLV5", 0, 0, 0);
698  G4LogicalVolume* box6LV = new G4LogicalVolume(box6, WNICU, "Jaws1XLV6", 0, 0, 0);
699 
700  G4ThreeVector centre;
701  G4RotationMatrix *cRotationId = new G4RotationMatrix();
702  G4RotationMatrix *cRotation = new G4RotationMatrix();
703 
704  *cRotation = *cRotationId;
705  centre.set(boxSide,0.,box1Z);
706  SetJawAperture(1, centre, G4ThreeVector(boxSide, boxSide, box1Height), cRotation);
707  new G4PVPlacement(cRotation, centre, "Jaws1XPV1", box1LV, PVWorld, false, 0);
708 
709  *cRotation = *cRotationId;
710  centre.set(boxSide,0.,box2Z);
711  SetJawAperture(1, centre, G4ThreeVector(boxSide, boxSide, box2Height), cRotation);
712  new G4PVPlacement(cRotation, centre, "Jaws1XPV2", box2LV, PVWorld, false, 0);
713 
714  *cRotation = *cRotationId;
715  centre.set(boxSide,0.,box3Z);
716  SetJawAperture(1, centre, G4ThreeVector(boxSide, boxSide, box3Height), cRotation);
717  new G4PVPlacement(cRotation, centre, "Jaws1XPV3", box3LV, PVWorld, false, 0);
718 
719  *cRotation = *cRotationId;
720  centre.set(boxSide,0.,box4Z);
721  SetJawAperture(1, centre, G4ThreeVector(boxSide, boxSide, box4Height), cRotation);
722  new G4PVPlacement(cRotation, centre, "Jaws1XPV4", box4LV, PVWorld, false, 0);
723 
724  *cRotation = *cRotationId;
725  centre.set(boxSide,0.,box5Z);
726  SetJawAperture(1, centre, G4ThreeVector(boxSide, boxSide, box5Height), cRotation);
727  new G4PVPlacement(cRotation, centre, "Jaws1XPV5", box5LV, PVWorld, false, 0);
728 
729  *cRotation = *cRotationId;
730  centre.set(boxSide,0.,box6Z);
731  SetJawAperture(1, centre, G4ThreeVector(boxSide, boxSide, box6Height), cRotation);
732  new G4PVPlacement(cRotation, centre, "Jaws1XPV6", box6LV, PVWorld, false, 0);
733 
734  // Visualization
735  simpleAlSVisAttPb = new G4VisAttributes(G4Colour::Blue());
736  simpleAlSVisAttPb -> SetVisibility(true);
737  simpleAlSVisAttPb -> SetForceSolid(true);
738  simpleAlSVisAttXC10 = new G4VisAttributes(G4Colour::Green());
739  simpleAlSVisAttXC10 -> SetVisibility(true);
740  simpleAlSVisAttXC10 ->SetForceSolid(true);
741  simpleAlSVisAttWNICU = new G4VisAttributes(G4Colour::Red());
742  simpleAlSVisAttWNICU ->SetVisibility(true);
743  simpleAlSVisAttWNICU ->SetForceSolid(true);
744 
745  box1LV -> SetVisAttributes(simpleAlSVisAttXC10);
746  box2LV -> SetVisAttributes(simpleAlSVisAttPb);
747  box3LV -> SetVisAttributes(simpleAlSVisAttWNICU);
748  box4LV -> SetVisAttributes(simpleAlSVisAttPb);
749  box5LV -> SetVisAttributes(simpleAlSVisAttPb);
750  box6LV -> SetVisAttributes(simpleAlSVisAttWNICU);
751 
752  // Region for cuts
753  box1LV->SetRegion(regVol);
754  regVol->AddRootLogicalVolume(box1LV);
755  box2LV->SetRegion(regVol);
756  regVol->AddRootLogicalVolume(box2LV);
757  box3LV->SetRegion(regVol);
758  regVol->AddRootLogicalVolume(box3LV);
759  box4LV->SetRegion(regVol);
760  regVol->AddRootLogicalVolume(box4LV);
761  box5LV->SetRegion(regVol);
762  regVol->AddRootLogicalVolume(box5LV);
763  box6LV->SetRegion(regVol);
764  regVol->AddRootLogicalVolume(box6LV);
765 
766  bCreated = true;
767  return bCreated;
768 }
770 {
771  bool bCreated = false;
772 
773  G4double boxSide;
774  G4double box1Height, box1Z;
775  G4double box2Height, box2Z;
776  G4double box3Height, box3Z;
777  G4double box4Height, box4Z;
778  G4double box5Height, box5Z;
779  G4double box6Height, box6Z;
780 
781  boxSide=101./2.*mm; // upper principal box
782 
783  box1Height=3./2.*mm;
784  box1Z=275.50*mm+box1Height;
785 
786  box2Height=35./2.*mm;
787  box2Z=box1Z+box1Height+box2Height;
788 
789  box3Height=35./2.*mm;
790  box3Z=box2Z+box2Height+box3Height;
791 
792  box4Height=27./2.*mm;
793  box4Z=box3Z+box3Height+box4Height;
794 
795  box5Height=10./2.*mm;
796  box5Z=472.50*mm+box5Height;
797 
798  box6Height=5./2.*mm;
799  box6Z=box5Z+box5Height+box6Height;
800 
802 // G4Material *XC10 = SetMaterials("XC10");
803 // G4Material *WNICU = SetMaterials("Denal(WNICU)");
804  G4Material *XC10 = getMaterial("xc10");
805  G4Material *WNICU = getMaterial("wnicu");
806 
807  G4Region *regVol;
808  G4VisAttributes* simpleAlSVisAttPb;
809  G4VisAttributes* simpleAlSVisAttXC10;
810  G4VisAttributes* simpleAlSVisAttWNICU;
811  // Region for cuts
812  regVol= new G4Region("Jaws2XR");
814  cuts->SetProductionCut(2.*cm);
815  regVol->SetProductionCuts(cuts);
816 
817  // Physical volumes
818 
819  G4Box *box1 = new G4Box("Jaws2XBox1", boxSide, boxSide, box1Height);
820  G4Box *box2 = new G4Box("Jaws2XBox2", boxSide, boxSide, box2Height);
821  G4Box *box3 = new G4Box("Jaws2XBox3", boxSide, boxSide, box3Height);
822  G4Box *box4 = new G4Box("Jaws2XBox4", boxSide, boxSide, box4Height);
823  G4Box *box5 = new G4Box("Jaws2XBox5", boxSide, boxSide, box5Height);
824  G4Box *box6 = new G4Box("Jaws2XBox6", boxSide, boxSide, box6Height);
825  G4LogicalVolume* box1LV = new G4LogicalVolume(box1, XC10, "Jaws2XLV1",0,0,0);
826  G4LogicalVolume* box2LV = new G4LogicalVolume(box2, elPb, "Jaws2XLV2",0,0,0);
827  G4LogicalVolume* box3LV = new G4LogicalVolume(box3, WNICU, "Jaws2XLV3",0,0,0);
828  G4LogicalVolume* box4LV = new G4LogicalVolume(box4, elPb, "Jaws2XLV4",0,0,0);
829  G4LogicalVolume* box5LV = new G4LogicalVolume(box5, elPb, "Jaws2XLV5",0,0,0);
830  G4LogicalVolume* box6LV = new G4LogicalVolume(box6, WNICU, "Jaws2XLV6",0,0,0);
831 
832  G4ThreeVector centre;
833  G4RotationMatrix *cRotationId = new G4RotationMatrix();
834  G4RotationMatrix *cRotation = new G4RotationMatrix();
835 
836  *cRotation=*cRotationId;
837  centre.set(boxSide,0.,box1Z);
838  SetJawAperture(2,centre,G4ThreeVector(boxSide ,boxSide ,box1Height),cRotation);
839  new G4PVPlacement(cRotation, centre, "Jaws2XPV1", box1LV, PVWorld, false, 0);
840 
841  *cRotation=*cRotationId;
842  centre.set(boxSide,0.,box2Z);
843  SetJawAperture(2,centre,G4ThreeVector(boxSide ,boxSide ,box2Height),cRotation);
844  new G4PVPlacement(cRotation, centre, "Jaws2XPV2", box2LV, PVWorld, false, 0);
845 
846  *cRotation=*cRotationId;
847  centre.set(boxSide,0.,box3Z);
848  SetJawAperture(2,centre,G4ThreeVector(boxSide ,boxSide ,box3Height),cRotation);
849  new G4PVPlacement(cRotation, centre, "Jaws2XPV3", box3LV, PVWorld, false, 0);
850 
851  *cRotation=*cRotationId;
852  centre.set(boxSide,0.,box4Z);
853  SetJawAperture(2,centre,G4ThreeVector(boxSide ,boxSide ,box4Height),cRotation);
854  new G4PVPlacement(cRotation, centre, "Jaws2XPV4", box4LV, PVWorld, false, 0);
855 
856  *cRotation=*cRotationId;
857  centre.set(boxSide,0.,box5Z);
858  SetJawAperture(2,centre,G4ThreeVector(boxSide ,boxSide ,box5Height),cRotation);
859  new G4PVPlacement(cRotation, centre, "Jaws2XPV5", box5LV, PVWorld, false, 0);
860 
861  *cRotation=*cRotationId;
862  centre.set(boxSide,0.,box6Z);
863  SetJawAperture(2,centre,G4ThreeVector(boxSide ,boxSide ,box6Height),cRotation);
864  new G4PVPlacement(cRotation, centre, "Jaws2XPV6", box6LV, PVWorld, false, 0);
865 
866  // Visualization
867  simpleAlSVisAttPb = new G4VisAttributes(G4Colour::Blue());
868  simpleAlSVisAttPb -> SetVisibility(true);
869  simpleAlSVisAttPb -> SetForceSolid(true);
870  simpleAlSVisAttXC10 = new G4VisAttributes(G4Colour::Green());
871  simpleAlSVisAttXC10 -> SetVisibility(true);
872  simpleAlSVisAttXC10 -> SetForceSolid(true);
873  simpleAlSVisAttWNICU = new G4VisAttributes(G4Colour::Red());
874  simpleAlSVisAttWNICU -> SetVisibility(true);
875  simpleAlSVisAttWNICU -> SetForceSolid(true);
876 
877  box1LV -> SetVisAttributes(simpleAlSVisAttXC10);
878  box2LV -> SetVisAttributes(simpleAlSVisAttPb);
879  box3LV -> SetVisAttributes(simpleAlSVisAttWNICU);
880  box4LV -> SetVisAttributes(simpleAlSVisAttPb);
881  box5LV -> SetVisAttributes(simpleAlSVisAttPb);
882  box6LV -> SetVisAttributes(simpleAlSVisAttWNICU);
883 
884  // Region for cuts
885  box1LV -> SetRegion(regVol);
886  regVol -> AddRootLogicalVolume(box1LV);
887  box2LV -> SetRegion(regVol);
888  regVol -> AddRootLogicalVolume(box2LV);
889  box3LV -> SetRegion(regVol);
890  regVol -> AddRootLogicalVolume(box3LV);
891  box4LV -> SetRegion(regVol);
892  regVol -> AddRootLogicalVolume(box4LV);
893  box5LV -> SetRegion(regVol);
894  regVol -> AddRootLogicalVolume(box5LV);
895  box6LV -> SetRegion(regVol);
896  regVol -> AddRootLogicalVolume(box6LV);
897 
898  bCreated = true;
899  return bCreated;
900 }
902 {
903  bool bCreated = false;
904 
905  G4double boxSide;
906  G4double box1Height, box1Z;
907  G4double box2Height, box2Z;
908  G4double box3Height, box3Z;
909  G4double box4Height, box4Z;
910 
911  boxSide=101./2.*mm; // upper principal box
912 
913  box1Height = 15./2.*mm;
914  box1Z = 248.50*mm+box1Height;
915 
916  box2Height = 31./2.*mm;
917  box2Z = 380.5+box2Height;
918 
919  box3Height = 35./2.*mm;
920  box3Z = box2Z+box2Height+box3Height;
921 
922  box4Height = 21./2.*mm;
923  box4Z = box3Z+box3Height+box4Height;
924 
926 // G4Material *XC10 = SetMaterials("XC10");
927 // G4Material *WNICU = SetMaterials("Denal(WNICU)");
928  G4Material *XC10 = getMaterial("xc10");
929  G4Material *WNICU = getMaterial("wnicu");
930 
931  G4Region *regVol;
932  G4VisAttributes* simpleAlSVisAttPb;
933  G4VisAttributes* simpleAlSVisAttXC10;
934  G4VisAttributes* simpleAlSVisAttWNICU;
935  // Region for cuts
936  regVol= new G4Region("Jaws1YR");
938  cuts->SetProductionCut(2.*cm);
939  regVol->SetProductionCuts(cuts);
940 
941  // Physical volumes
942 
943  G4Box *box1 = new G4Box("Jaws1YBox1", boxSide, boxSide, box1Height);
944  G4Box *box2 = new G4Box("Jaws1YBox2", boxSide, boxSide, box2Height);
945  G4Box *box3 = new G4Box("Jaws1YBox3", boxSide, boxSide, box3Height);
946  G4Box *box4 = new G4Box("Jaws1YBox4", boxSide, boxSide, box4Height);
947  G4LogicalVolume* box1LV = new G4LogicalVolume(box1, XC10, "Jaws1YLV1",0,0,0);
948  G4LogicalVolume* box2LV = new G4LogicalVolume(box2, elPb, "Jaws1YLV2",0,0,0);
949  G4LogicalVolume* box3LV = new G4LogicalVolume(box3, WNICU, "Jaws1YLV3",0,0,0);
950  G4LogicalVolume* box4LV = new G4LogicalVolume(box4, elPb, "Jaws1YLV4",0,0,0);
951 
952  G4ThreeVector centre;
953  G4RotationMatrix *cRotationId = new G4RotationMatrix();
954  G4RotationMatrix *cRotation = new G4RotationMatrix();
955 
956  *cRotation = *cRotationId;
957  centre.set(0.,boxSide,box1Z);
958  SetJawAperture(3,centre,G4ThreeVector(boxSide ,boxSide ,box1Height),cRotation);
959  new G4PVPlacement(cRotation, centre, "Jaws1YPV1", box1LV, PVWorld, false, 0);
960 
961  *cRotation=*cRotationId;
962  centre.set(0.,boxSide,box2Z);
963  SetJawAperture(3,centre,G4ThreeVector(boxSide ,boxSide ,box2Height),cRotation);
964  new G4PVPlacement(cRotation, centre, "Jaws1YPV2", box2LV, PVWorld, false, 0);
965 
966  *cRotation=*cRotationId;
967  centre.set(0.,boxSide,box3Z);
968  SetJawAperture(3,centre,G4ThreeVector(boxSide ,boxSide ,box3Height),cRotation);
969  new G4PVPlacement(cRotation, centre, "Jaws1YPV3", box3LV, PVWorld, false, 0);
970 
971  *cRotation=*cRotationId;
972  centre.set(0.,boxSide,box4Z);
973  SetJawAperture(3,centre,G4ThreeVector(boxSide ,boxSide ,box4Height),cRotation);
974  new G4PVPlacement(cRotation, centre, "Jaws1YPV4", box4LV, PVWorld, false, 0);
975 
976 
977  // Visualization
978  simpleAlSVisAttPb= new G4VisAttributes(G4Colour::Blue());
979  simpleAlSVisAttPb->SetVisibility(true);
980  simpleAlSVisAttPb->SetForceSolid(true);
981  simpleAlSVisAttXC10= new G4VisAttributes(G4Colour::Green());
982  simpleAlSVisAttXC10->SetVisibility(true);
983  simpleAlSVisAttXC10->SetForceSolid(true);
984  simpleAlSVisAttWNICU= new G4VisAttributes(G4Colour::Red());
985  simpleAlSVisAttWNICU->SetVisibility(true);
986  simpleAlSVisAttWNICU->SetForceSolid(true);
987 
988  box1LV->SetVisAttributes(simpleAlSVisAttWNICU);
989  box2LV->SetVisAttributes(simpleAlSVisAttPb);
990  box3LV->SetVisAttributes(simpleAlSVisAttWNICU);
991  box4LV->SetVisAttributes(simpleAlSVisAttPb);
992 
993  // Region for cuts
994  box1LV->SetRegion(regVol);
995  regVol->AddRootLogicalVolume(box1LV);
996  box2LV->SetRegion(regVol);
997  regVol->AddRootLogicalVolume(box2LV);
998  box3LV->SetRegion(regVol);
999  regVol->AddRootLogicalVolume(box3LV);
1000  box4LV->SetRegion(regVol);
1001  regVol->AddRootLogicalVolume(box4LV);
1002 
1003  bCreated = true;
1004  return bCreated;
1005 }
1007 {
1008  bool bCreated = false;
1009 
1010  G4double boxSide, box1Height, box1Z, box2Height, box2Z, box3Height, box3Z, box4Height, box4Z;
1011 
1012  boxSide = 101./2.*mm; // upper principal box
1013 
1014  box1Height = 15./2.*mm;
1015  box1Z = 248.50*mm+box1Height;
1016 
1017  box2Height = 31./2.*mm;
1018  box2Z = 380.5+box2Height;
1019 
1020  box3Height = 35./2.*mm;
1021  box3Z = box2Z+box2Height+box3Height;
1022 
1023  box4Height = 21./2.*mm;
1024  box4Z = box3Z+box3Height+box4Height;
1025 
1027 // G4Material *XC10 = SetMaterials("XC10");
1028 // G4Material *WNICU = SetMaterials("Denal(WNICU)");
1029  G4Material *XC10 = getMaterial("xc10");
1030  G4Material *WNICU = getMaterial("wnicu");
1031 
1032  G4Region *regVol;
1033  G4VisAttributes* simpleAlSVisAttPb;
1034  G4VisAttributes* simpleAlSVisAttXC10;
1035  G4VisAttributes* simpleAlSVisAttWNICU;
1036  // Region for cuts
1037  regVol= new G4Region("Jaws2YR");
1038  G4ProductionCuts* cuts = new G4ProductionCuts;
1039  cuts -> SetProductionCut(2.*cm);
1040  regVol -> SetProductionCuts(cuts);
1041 
1042  // Physical volumes
1043  G4Box *box1 = new G4Box("Jaws2YBox1", boxSide, boxSide, box1Height);
1044  G4Box *box2 = new G4Box("Jaws2YBox2", boxSide, boxSide, box2Height);
1045  G4Box *box3 = new G4Box("Jaws2YBox3",boxSide, boxSide, box3Height);
1046  G4Box *box4 = new G4Box("Jaws2YBox4", boxSide, boxSide, box4Height);
1047  G4LogicalVolume* box1LV = new G4LogicalVolume(box1, XC10, "Jaws2YLV1",0,0,0);
1048  G4LogicalVolume* box2LV = new G4LogicalVolume(box2, elPb, "Jaws2YLV2",0,0,0);
1049  G4LogicalVolume* box3LV = new G4LogicalVolume(box3, WNICU, "Jaws2YLV3",0,0,0);
1050  G4LogicalVolume* box4LV = new G4LogicalVolume(box4, elPb, "Jaws2YLV4",0,0,0);
1051 
1052  G4ThreeVector centre;
1053  G4RotationMatrix *cRotationId = new G4RotationMatrix();
1054  G4RotationMatrix *cRotation = new G4RotationMatrix();
1055 
1056  *cRotation = *cRotationId;
1057  centre.set(0.,boxSide,box1Z);
1058  SetJawAperture(4,centre,G4ThreeVector(boxSide ,boxSide ,box1Height),cRotation);
1059  new G4PVPlacement(cRotation, centre, "Jaws2YPV1", box1LV, PVWorld, false, 0);
1060 
1061  *cRotation = *cRotationId;
1062  centre.set(0.,boxSide,box2Z);
1063  SetJawAperture(4,centre,G4ThreeVector(boxSide ,boxSide ,box2Height),cRotation);
1064  new G4PVPlacement(cRotation, centre, "Jaws2YPV2", box2LV, PVWorld, false, 0);
1065 
1066  *cRotation = *cRotationId;
1067  centre.set(0.,boxSide,box3Z);
1068  SetJawAperture(4,centre,G4ThreeVector(boxSide ,boxSide ,box3Height),cRotation);
1069  new G4PVPlacement(cRotation, centre, "Jaws2YPV3", box3LV, PVWorld, false, 0);
1070 
1071  *cRotation = *cRotationId;
1072  centre.set(0.,boxSide,box4Z);
1073  SetJawAperture(4,centre,G4ThreeVector(boxSide ,boxSide ,box4Height),cRotation);
1074  new G4PVPlacement(cRotation, centre, "Jaws2YPV4", box4LV, PVWorld, false, 0);
1075 
1076 
1077  // Visualization
1078  simpleAlSVisAttPb = new G4VisAttributes(G4Colour::Blue());
1079  simpleAlSVisAttPb -> SetVisibility(true);
1080  simpleAlSVisAttPb -> SetForceSolid(true);
1081  simpleAlSVisAttXC10 = new G4VisAttributes(G4Colour::Green());
1082  simpleAlSVisAttXC10 -> SetVisibility(true);
1083  simpleAlSVisAttXC10 -> SetForceSolid(true);
1084  simpleAlSVisAttWNICU = new G4VisAttributes(G4Colour::Red());
1085  simpleAlSVisAttWNICU -> SetVisibility(true);
1086  simpleAlSVisAttWNICU -> SetForceSolid(true);
1087 
1088  box1LV -> SetVisAttributes(simpleAlSVisAttWNICU);
1089  box2LV -> SetVisAttributes(simpleAlSVisAttPb);
1090  box3LV -> SetVisAttributes(simpleAlSVisAttWNICU);
1091  box4LV -> SetVisAttributes(simpleAlSVisAttPb);
1092 
1093  // Region for cuts
1094  box1LV -> SetRegion(regVol);
1095  regVol -> AddRootLogicalVolume(box1LV);
1096  box2LV -> SetRegion(regVol);
1097  regVol -> AddRootLogicalVolume(box2LV);
1098  box3LV -> SetRegion(regVol);
1099  regVol -> AddRootLogicalVolume(box3LV);
1100  box4LV -> SetRegion(regVol);
1101  regVol -> AddRootLogicalVolume(box4LV);
1102 
1103  bCreated = true;
1104  return bCreated;
1105 }
1106