Geant4  10.02.p02
LaserDrivenBeamLine.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 // Hadrontherapy advanced example for Geant4
27 // See more at: https://twiki.cern.ch/twiki/bin/view/Geant4/AdvancedExamplesHadrontherapy
28 
29 #include "globals.hh"
30 #include "G4SystemOfUnits.hh"
31 #include "G4Box.hh"
32 #include "G4Tubs.hh"
33 #include "G4Sphere.hh"
34 #include "G4NistManager.hh"
35 #include "G4NistElementBuilder.hh"
36 #include "G4VisAttributes.hh"
37 #include "G4Colour.hh"
38 #include "G4RunManager.hh"
39 #include "G4LogicalVolume.hh"
40 #include "G4PVPlacement.hh"
41 #include "G4RotationMatrix.hh"
43 #include "LaserDrivenBeamLine.hh"
45 //
46 #include "G4PhysicalConstants.hh"
47 #include "G4ThreeVector.hh"
48 #include "G4Material.hh"
49 //
50 #include "G4FieldManager.hh"
52 #include "G4Mag_UsualEqRhs.hh"
53 #include "G4ExplicitEuler.hh"
54 #include "G4ChordFinder.hh"
55 //#include "G4TransportationManager.hh"
56 #include "G4EqMagElectricField.hh"
57 #include "G4UniformMagField.hh"
58 #include "G4PropagatorInField.hh"
59 #include "G4VisCommandsViewer.hh"
60 #include "G4UImanager.hh"
61 #include "G4ExplicitEuler.hh"
62 #include "G4ImplicitEuler.hh"
63 #include "G4SimpleRunge.hh"
64 #include "G4SimpleHeum.hh"
65 #include "G4ClassicalRK4.hh"
66 #include "G4HelixExplicitEuler.hh"
67 #include "G4HelixImplicitEuler.hh"
68 #include "G4HelixSimpleRunge.hh"
69 #include "G4CashKarpRKF45.hh"
70 #include "G4RKG3_Stepper.hh"
71 #include "G4SubtractionSolid.hh"
72 
73 //
75 #include "G4ElectricField.hh"
77 
79 //
80 //G4bool LaserDrivenBeamLine::doCalculation = false;
83  hadrontherapydetectorconstruction(0), physicTreatmentRoom(0),
84 PFirstTriplet(0),PSecondTriplet(0),PThirdTriplet(0),PFourthTriplet(0), physicFirstQuad(0),physicSecondQuad(0),physicThirdQuad(0),physicFourthQuad(0),
85 solidExternalChamber(0),logicExternalChamber(0),physicExternalChamber(0),
86 solidInternalChamber(0),logicInternalChamber(0),physicInternalChamber(0),
87 solidCollimator(0),logicCollimator(0),physicCollimator(0),
88 solidCollimatorHole(0),logicCollimatorHole(0),physicCollimatorHole(0),
89 solidFinalCollimator(0), logicFinalCollimator(0),physicFinalCollimator(0),
90 solidFinalCollimatorHole(0),logicFinalCollimatorHole(0),physicFinalCollimatorHole(0),
91 solidExternalMagnet_1(0),logicExternalMagnet_1(0),physicExternalMagnet_1(0), physicExternalMagnet_1Down(0),
92 solidMagnet_1(0),logicMagnet_1(0),physicMagnet_1Right(0),physicMagnet_1Left(0), solidExternalMagnet_2(0),logicExternalMagnet_2(0),
93 physicExternalMagnet_2(0),physicExternalMagnet_2Down(0),solidMagnet_2(0),logicMagnet_2(0),physicMagnet_2Right(0),physicMagnet_2Left(0), solidExternalMagnet_3(0),logicExternalMagnet_3(0),physicExternalMagnet_3(0),physicExternalMagnet_3Down(0),
94 solidMagnet_3(0),logicMagnet_3(0),physicMagnet_3Right(0),physicMagnet_3Left(0),
95 solidExternalMagnet_4(0),logicExternalMagnet_4(0),physicExternalMagnet_4(0),physicExternalMagnet_4Down(0),
96 solidMagnet_4(0),logicMagnet_4(0),physicMagnet_4Right(0),physicMagnet_4Left(0),
97 solidExternalSlit(0), logicExternalSlit(0), physicExternalSlit(0),
98 solidInternalSlit(0),logicInternalSlit(0),physicInternalSlit(0),
99  physicExitPipe(0),physicExitWindow(0),physicExithole(0),physicEntrancePipe(0),physicEntrancehole(0)
100 {
102 
103  //***************************** PW ***************************************
104 
105  static G4String ROGeometryName = "DetectorROGeometry";
106  RO = new HadrontherapyDetectorROGeometry(ROGeometryName);
107 
108  G4cout << "Going to register Parallel world...";
110  G4cout << "... done" << G4endl;
111  //***************************** PW ***************************************
112 }
113 
116 {
117  //delete laserDrivenMessenger;
119 }
120 
123 {
124  // Sets default geometry and materials
126 
127  // Construct the energyselector (magnetic part and slit) and detector plane
129 
130  //***************************** PW ***************************************
132 
133  //***************************** PW ***************************************
134 
135  // HadrontherapyDetectorConstruction builds ONLY the phantom and the detector with its associated ROGeometry
137  G4cout<<"HadrontherapyDetectorConstruction"<<G4endl;
138  //***************************** PW ***************************************
139 
141 
142  //***************************** PW ***************************************
143  return physicTreatmentRoom;
144 }
147 {
149  // Definition of the colour sets
150  white = new G4VisAttributes( G4Colour(1.,1.,1., 0.2));
151  white -> SetVisibility(true);
152  white -> SetForceSolid(true);
153  white -> SetForceWireframe(true);
154 
155  blue = new G4VisAttributes(G4Colour(0. ,0. ,1.));
156  blue -> SetVisibility(true);
157  //blue -> SetForceSolid(true);
158 
159  gray = new G4VisAttributes( G4Colour(0.5, 0.5, 0.5, 0.5 ));
160  gray-> SetVisibility(true);
161  gray-> SetForceSolid(true);
162 
163  red = new G4VisAttributes(G4Colour(1. ,0. ,0., 0.2));
164  red-> SetVisibility(true);
165  red-> SetForceSolid(true);
166  //red -> SetForceWireframe(true);
167 
168  yellow = new G4VisAttributes(G4Colour(1., 1., 0., 0.2));
169  yellow-> SetVisibility(true);
170  yellow-> SetForceSolid(true);
171 
172  green = new G4VisAttributes( G4Colour(25/255. , 255/255. , 25/255., 0.4));
173  green -> SetVisibility(true);
174  green -> SetForceWireframe(true);
175  green -> SetForceSolid(true);
176 
177  black = new G4VisAttributes( G4Colour(255/255. , 255/255., 255/255.));
178  black -> SetVisibility(true);
179  black -> SetForceSolid(true);
180 
181  darkGreen = new G4VisAttributes( G4Colour(0/255. , 100/255. , 0/255.));
182  darkGreen -> SetVisibility(true);
183  darkGreen -> SetForceSolid(true);
184 
185  darkOrange3 = new G4VisAttributes( G4Colour(205/255. , 102/255. , 000/255., 0.7));
186  darkOrange3 -> SetVisibility(true);
187  darkOrange3 -> SetForceSolid(true);
188 
189  skyBlue = new G4VisAttributes( G4Colour(135/255. , 206/255. , 235/255., 0.1));
190  skyBlue -> SetVisibility(true);
191  skyBlue -> SetForceSolid(true);
192 
193  // DEFAULT DIMENSIONS AND POSITIONS ARE PROVIDED HERE.
195  G4double defaultInnerRadiusExitWindow=0. *mm;
196  InnerRadiusExitWindow=defaultInnerRadiusExitWindow;
197 
198  G4double defaultExternalRadiusExitWindow=55*mm;
199  ExternalRadiusExitWindow=defaultExternalRadiusExitWindow;
200 
201  G4double defaultExitWindowThickness=25 *um;
202  ExitWindowThickness=defaultExitWindowThickness;
203 
204  G4double defaultExitWindowXPosition=-ExitWindowThickness/2.;
205  ExitWindowXPosition=defaultExitWindowXPosition;
206 
207  G4double defaultExitWindowYPosition=0.;
208  ExitWindowYPosition=defaultExitWindowYPosition;
209 
210  G4double defaultExitWindowZPosition=0.0*mm;
211  ExitWindowZPosition=defaultExitWindowZPosition;
212 
213  G4double defaultStartAngleExitWindow = 0.0 *deg;
214  startAngleExitWindow = defaultStartAngleExitWindow;
215 
216  G4double defaultSpanningAngleExitWindow = 360.*deg;
217  spanningAngleExitWindow = defaultSpanningAngleExitWindow;
219  G4double defaultExitPipeheight=105. *mm;
220  ExitPipeheight=defaultExitPipeheight;
221 
222  G4double defaultInnerRadiusExitPipe=50. *mm;
223  InnerRadiusExitPipe=defaultInnerRadiusExitPipe;
224 
225  G4double defaultExternalRadiusExitPipe=55 *mm;
226  ExternalRadiusExitPipe=defaultExternalRadiusExitPipe;
227 
228  G4double defaultExitPipeXPosition=-ExitPipeheight/2-ExitWindowThickness;
229  ExitPipeXPosition=defaultExitPipeXPosition;
230 
231  G4double defaultExitPipeYPosition=0;
232  ExitPipeYPosition=defaultExitPipeYPosition;
233 
234  G4double defaultExitPipeZPosition=0.0*mm;
235  ExitPipeZPosition=defaultExitPipeZPosition;
236 
237  G4double defaultStartAngleExitPipe = 0.0 *deg;
238  startAngleExitPipe = defaultStartAngleExitPipe;
239 
240  G4double defaultSpanningAngleExitPipe = 360.*deg;
241  spanningAngleExitPipe = defaultSpanningAngleExitPipe;
243  G4double defaultExternalChamberXSize = 79.6*cm;
244  externalChamberXSize = defaultExternalChamberXSize;
245 
246  G4double defaultExternalChamberYSize = 50. *cm;
247  externalChamberYSize = defaultExternalChamberYSize;
248 
249  G4double defaultExternalChamberZSize = 50. *cm;
250  externalChamberZSize = defaultExternalChamberZSize;
251 
252  G4double defaultExternalChamberXPosition = -(externalChamberXSize/2.+ExitPipeheight/2.)+ ExitPipeXPosition;
253  externalChamberXPosition = defaultExternalChamberXPosition;
254 
255  G4double defaultExternalChamberYPosition = 0.0 *mm;
256  externalChamberYPosition = defaultExternalChamberYPosition;
257 
258  G4double defaultExternalChamberZPosition = 0.0 *mm;
259  externalChamberZPosition = defaultExternalChamberZPosition;
260 
261  // Defaults of the internal chamber dimensions
262  // The position of its center is in the center
263  // of the internal chamber while the dimension are
264  // authomatically calculated respect to the external chamber ones
265  G4double defaultVaccumChamberWallThickness=5 *mm;
266  VaccumChamberWallThickness=defaultVaccumChamberWallThickness;
267 
268  G4double defaultInternalChamberXSize =externalChamberXSize - 2*VaccumChamberWallThickness;
269  internalChamberXSize = defaultInternalChamberXSize;
270 
271  G4double defaultInternalChamberYSize =externalChamberYSize - 2*VaccumChamberWallThickness;
272  internalChamberYSize = defaultInternalChamberYSize;
273 
274  G4double defaultInternalChamberZSize = externalChamberZSize - 2*VaccumChamberWallThickness;
275  internalChamberZSize = defaultInternalChamberZSize;
277  G4double defaultInnerRadiusExithole=0.*mm;
278  InnerRadiusExithole=defaultInnerRadiusExithole;
279 
280  G4double defaultExternalRadiusExithole=50.*mm;
281  ExternalRadiusExithole=defaultExternalRadiusExithole;
282 
283  G4double defaultExitholeThickness=VaccumChamberWallThickness;
284  ExitholeThickness=defaultExitholeThickness;
285 
286  G4double defaultExitholeXPosition=(externalChamberXSize/2.-ExitholeThickness/2.);
287  ExitholeXPosition=defaultExitholeXPosition;
288 
289  G4double defaultExitholeYPosition=0.;
290  ExitholeYPosition=defaultExitholeYPosition;
291 
292  G4double defaultExitholeZPosition=0.*mm;
293  ExitholeZPosition=defaultExitholeZPosition;
294 
295  G4double defaultStartAngleExithole = 0.0 *deg;
296  startAngleExithole= defaultStartAngleExithole;
297 
298  G4double defaultSpanningAngleExithole = 360.*deg;
299  spanningAngleExithole = defaultSpanningAngleExithole;
301  // The Final Collimator is located after the 4th magnet
302  G4double defaultExitholeToFinalCollimator=70 *mm;
303  ExitholeToFinalCollimator=defaultExitholeToFinalCollimator;
304 
307 
310 
313 
316 
319 
322  FinalcollimatorXPosition = 0.0*mm; //HOLE IN THE FINAL COLLIMATOR
323 
327 
331 
337 
338  //Magnet characteristics
339  G4double defaultExternalMagnet_XSize = 88.0*mm;
340  G4double defaultExternalMagnet_YSizeTotal=87.*mm;
341  G4double defaultInternalMagnet_YSize = 10. *mm;
342  G4double defaultExternalMagnet_YSize =(defaultExternalMagnet_YSizeTotal-defaultInternalMagnet_YSize)/2.;
343  G4double defaultExternalMagnet_ZSize = 104 *mm;
344 
345  G4double defaultExternalMagnet_YPosition =defaultInternalMagnet_YSize/2.+defaultExternalMagnet_YSize/2.;
346  G4double defaultExternalMagnet_ZPosition = 0.0 *mm;
347 
348  G4double defaultMagnet_XSize=defaultExternalMagnet_XSize;
349  G4double defaultMagnet_YSize=defaultExternalMagnet_YSizeTotal;
350  G4double defaultMagnet_ZSize=19*mm;
351 
352  // Defaults of the external part of the magnet 4:
353  G4double defaultFinalCollimatorToMagnet4=25.*mm;
354  FinalCollimatorToMagnet4=defaultFinalCollimatorToMagnet4;
355 
356  externalMagnet_4XSize = defaultExternalMagnet_XSize;
357  externalMagnet_4YSize = defaultExternalMagnet_YSize;
358  externalMagnet_4ZSize = defaultExternalMagnet_ZSize;
359 
360  Magnet_4XSize=defaultMagnet_XSize;
361  Magnet_4YSize=defaultMagnet_YSize;
362  Magnet_4ZSize=defaultMagnet_ZSize;
363 
364  G4double defaultExternalMagnet_4XPosition = -(FinalCollimatorThickness/2.+FinalCollimatorToMagnet4+defaultExternalMagnet_XSize/2.)+ collimatorFinalBox_XPosition;
365  externalMagnet_4XPosition = defaultExternalMagnet_4XPosition;
366 
367  externalMagnet_4YPosition = defaultExternalMagnet_YPosition;
368  externalMagnet_4ZPosition = defaultExternalMagnet_ZPosition;
369 
371  Magnet_4YPosition=0.0*mm;
372  Magnet_4ZPosition=(defaultExternalMagnet_ZSize+defaultMagnet_ZSize)/2.;
374  // Defaults of the external part of the magnet 3:
375  externalMagnet_3XSize = defaultExternalMagnet_XSize;
376  externalMagnet_3YSize = defaultExternalMagnet_YSize;
377  externalMagnet_3ZSize = defaultExternalMagnet_ZSize;
378 
379  Magnet_3XSize=defaultMagnet_XSize;
380  Magnet_3YSize=defaultMagnet_YSize;
381  Magnet_3ZSize=defaultMagnet_ZSize;
382 
383  G4double defaultMagnet4ToMagnet3=65.*mm; //85.*mm ANTONELLA
384  Magnet4ToMagnet3=defaultMagnet4ToMagnet3;
385 
386  G4double defaultExternalMagnet_3XPosition =-(Magnet4ToMagnet3+defaultExternalMagnet_XSize/2.+defaultExternalMagnet_XSize/2.)+externalMagnet_4XPosition;
387  externalMagnet_3XPosition = defaultExternalMagnet_3XPosition;
388 
389  externalMagnet_3YPosition =defaultExternalMagnet_YPosition;
390  externalMagnet_3ZPosition = defaultExternalMagnet_ZPosition;
391 
392 
394  Magnet_3YPosition=0.0*mm;
395  Magnet_3ZPosition=(defaultExternalMagnet_ZSize+defaultMagnet_ZSize)/2.;
397  // Defaults of the external part of the magnet 2:
398  externalMagnet_2XSize = defaultExternalMagnet_XSize;
399  externalMagnet_2YSize = defaultExternalMagnet_YSize;
400  externalMagnet_2ZSize = defaultExternalMagnet_ZSize;
401 
402  Magnet_2XSize=defaultMagnet_XSize;
403  Magnet_2YSize=defaultMagnet_YSize;
404  Magnet_2ZSize=defaultMagnet_ZSize;
405 
406  G4double defaultMagnet3ToMagnet2=10 *mm;
407  Magnet3ToMagnet2=defaultMagnet3ToMagnet2;
408 
409  G4double defaultExternalMagnet_2XPosition =-(Magnet3ToMagnet2+defaultExternalMagnet_XSize/2.+defaultExternalMagnet_XSize/2.)+externalMagnet_3XPosition;
410  externalMagnet_2XPosition = defaultExternalMagnet_2XPosition;
411 
412  externalMagnet_2YPosition = defaultExternalMagnet_YPosition;
413  externalMagnet_2ZPosition = defaultExternalMagnet_ZPosition;
414 
416  Magnet_2YPosition=0.0*mm;
417  Magnet_2ZPosition=(defaultExternalMagnet_ZSize+defaultMagnet_ZSize)/2.;
419  // Defaults of the external part of the magnet 1:
420  externalMagnet_1XSize=defaultExternalMagnet_XSize;
421  externalMagnet_1YSize = defaultExternalMagnet_YSize;
422  externalMagnet_1ZSize = defaultExternalMagnet_ZSize;
423 
424  Magnet_1XSize=defaultMagnet_XSize;
425  Magnet_1YSize=defaultMagnet_YSize;
426  Magnet_1ZSize=defaultMagnet_ZSize;
427 
428  G4double defaultMagnet2ToMagnet1=85 *mm;
429  Magnet2ToMagnet1=defaultMagnet2ToMagnet1;
430 
431  G4double defaultExternalMagnet_1XPosition = -(Magnet2ToMagnet1+defaultExternalMagnet_XSize/2.+defaultExternalMagnet_XSize/2.)+externalMagnet_2XPosition;
432  externalMagnet_1XPosition = defaultExternalMagnet_1XPosition;
433 
434  externalMagnet_1YPosition = defaultExternalMagnet_YPosition;
435  externalMagnet_1ZPosition = defaultExternalMagnet_ZPosition;
436 
437  Magnet_1XPosition=defaultExternalMagnet_1XPosition;
438  Magnet_1YPosition=0.0*mm;
439  Magnet_1ZPosition=(defaultExternalMagnet_ZSize+defaultMagnet_ZSize)/2.;
440 
441  // Defaults of the external part of the Slit
442  G4double defaultExternalSlitXSize = 8.0 *mm;
443  externalSlitXSize = defaultExternalSlitXSize;
444 
445  G4double defaultExternalSlitYSize = 82. *mm;
446  externalSlitYSize = defaultExternalSlitYSize;
447 
448  G4double defaultExternalSlitZSize = 210. *mm;
449  externalSlitZSize = defaultExternalSlitZSize;
450 
451  G4double defaultExternalSlitXPosition = -(Magnet3ToMagnet2/2.+defaultExternalMagnet_XSize/2.)+externalMagnet_3XPosition;
452  externalSlitXPosition = defaultExternalSlitXPosition;
453 
454  G4double defaultExternalSlitYPosition = 0.0 *mm;
455  externalSlitYPosition = defaultExternalSlitYPosition;
456 
457  G4double defaultExternalSlitZPosition = 0.0 *mm;
458  externalSlitZPosition = defaultExternalSlitZPosition;
459 
460  // Defaults of the internal part of the Slit:
461  internalSlitXSize = defaultExternalSlitXSize;
462 
463  G4double defaultInternalSlitYSize = 3 *mm;
464  internalSlitYSize = defaultInternalSlitYSize;
465 
466  G4double defaultInternalSlitZSize = 3 *mm;
467  internalSlitZSize = defaultInternalSlitZSize;
468 
469  G4double defaultInternalSlitXPosition = 0.0 *mm;
470  internalSlitXPosition = defaultInternalSlitXPosition;
471 
472  G4double defaultInternalSlitYPosition = 0.0 *mm;
473  internalSlitYPosition = defaultInternalSlitYPosition;
474 
475  G4double defaultInternalSlitZPosition = 40.0 *mm;
476  internalSlitZPosition = defaultInternalSlitZPosition;
477 
478  // Defaults of the particle collimator (First collimator).
479  // The Collimator should be located before the 1st magnet
480  //
483 
486 
488 
491 
494 
495  G4double defultMagnet1ToFirstCollimator=25.*mm;
496  Magnet1ToFirstCollimator=defultMagnet1ToFirstCollimator;
497 
500  collimatorXPosition = 0.0*mm;
501 
504  collimatorYPosition = 0.0*mm;
505 
508  collimatorZPosition = 0.*mm;
509 
510  collimatorBoxYSize=82.0* mm;
511  collimatorBoxZSize=210.0* mm;
512 
514  G4double defaultInnerRadiusEntrancehole=0. *mm;
515  InnerRadiusEntrancehole=defaultInnerRadiusEntrancehole;
516 
517  G4double defaultExternalRadiusEntrancehole=50.*mm;
518  ExternalRadiusEntrancehole=defaultExternalRadiusEntrancehole;
519 
520  G4double defaultEntranceholeThickness=VaccumChamberWallThickness;
521  EntranceholeThickness=defaultEntranceholeThickness;
522 
523  G4double defaultEntranceholeXPosition=-(externalChamberXSize/2.-EntranceholeThickness/2.);
524  EntranceholeXPosition=defaultEntranceholeXPosition;
525 
526  G4double defaultEntranceholeQuadXPosition=+(externalChamberXSize/2.-EntranceholeThickness/2.);
527  EntranceholeQuadXPosition=defaultEntranceholeQuadXPosition;
528 
529  G4double defaultEntranceholeYPosition=0.;
530  EntranceholeYPosition=defaultEntranceholeYPosition;
531 
532  G4double defaultEntranceholeZPosition=0.0*mm;
533  EntranceholeZPosition=defaultEntranceholeZPosition;
534 
535  G4double defaultStartAngleEntrancehole= 0.0 *deg;
536  startAngleEntrancehole= defaultStartAngleEntrancehole;
537 
538  G4double defaultSpanningAngleEntrancehole= 360.*deg;
539  spanningAngleEntrancehole=defaultSpanningAngleEntrancehole;
540 
542 
543  G4double defaultEntrancePipeheight=105. *mm;
544  EntrancePipeheight=defaultEntrancePipeheight;
545 
546  G4double defaultInnerRadiusEntrancePipe=50. *mm;
547  InnerRadiusEntrancePipe=defaultInnerRadiusEntrancePipe;
548 
549  G4double defaultExternalRadiusEntrancePipe=55 *mm;
550  ExternalRadiusEntrancePipe=defaultExternalRadiusEntrancePipe;
551 
553  EntrancePipeXPosition=defaultEntrancePipeXPosition;
554 
555  G4double defaultEntrancePipeYPosition=0;
556  EntrancePipeYPosition=defaultEntrancePipeYPosition;
557 
558  G4double defaultEntrancePipeZPosition=0.0*mm;
559  EntrancePipeZPosition=defaultEntrancePipeZPosition;
560 
561  G4double defaultStartAngleEntrancePipe= 0.0 *deg;
562  startAngleEntrancePipe= defaultStartAngleEntrancePipe;
563 
564  G4double defaultSpanningAngleEntrancePipe= 360.*deg;
565  spanningAngleEntrancePipe=defaultSpanningAngleEntrancePipe;
566 
568  G4double defaultQuadChamberWallPosX=-(externalChamberXSize/2.)-EntrancePipeheight/2.+EntrancePipeXPosition;
569  QuadChamberWallPosX=defaultQuadChamberWallPosX;
570  G4double defaultQuadChamberWallPosY=0.0*cm;
571  QuadChamberWallPosY=defaultQuadChamberWallPosY;
572  G4double defaultQuadChamberWallPosZ=0.0*cm;
573  QuadChamberWallPosZ=defaultQuadChamberWallPosZ;
574 
575  G4double defaultInnerRadiusQuad=10.0*mm;
576  InnerRadiusQuad=defaultInnerRadiusQuad;
577 
578  G4double defaultInnerRadiusTriplet=0.0*mm;
579  InnerRadiusTriplet=defaultInnerRadiusTriplet;
580 
581  G4double defaultExternalRadiusQuad=30.0*mm;
582  ExternalRadiusQuad=defaultExternalRadiusQuad;
583 
584  G4double defaultFirstQuadThickness=80.0*mm;
585  FirstQuadThickness=defaultFirstQuadThickness;
586  G4double defaultSecondQuadThickness=40.0*mm;
587  SecondQuadThickness=defaultSecondQuadThickness;
588  G4double defaultThirdQuadThickness=40.0*mm;
589  ThirdQuadThickness=defaultThirdQuadThickness;
590  G4double defaultFourthQuadThickness=80.0*mm;
591  FourthQuadThickness=defaultFourthQuadThickness;
592 
593  G4double defaultStartAngleQuad = 0.0 *deg;
594  startAngleQuad = defaultStartAngleQuad;
595 
596  G4double defaultSpanningAngleQuad = 360.*deg;
597  spanningAngleQuad = defaultSpanningAngleQuad;
598 
599  G4double distancefromQuadChamber=100.0*mm;
600  G4double defaultFourthQuadXPosition= internalChamberXSize/2.-distancefromQuadChamber-FourthQuadThickness/2.;
601  FourthQuadXPosition=defaultFourthQuadXPosition;
602  FourthQXPosition=0.0*mm;
603 
604  G4double distanceFQuadTQuad=100.0*mm;
605  G4double defaultThirdQuadXPosition=-ThirdQuadThickness/2.-distanceFQuadTQuad-FourthQuadThickness/2.+FourthQuadXPosition;
606  ThirdQuadXPosition=defaultThirdQuadXPosition;
607  ThirdQXPosition=0.0*mm;
608 
609  G4double distanceTQuadSQuad=100.0*mm;
610  G4double defaultSecondQuadXPosition=-SecondQuadThickness/2.-distanceTQuadSQuad-ThirdQuadThickness/2.+ThirdQuadXPosition;
611  SecondQuadXPosition=defaultSecondQuadXPosition;
612  SecondQXPosition=0.0*mm;
613 
614  G4double distanceSQuadFQuad=100.0*mm;
615  G4double defaultFirstQuadXPosition=-FirstQuadThickness/2.-distanceSQuadFQuad-SecondQuadThickness/2.+SecondQuadXPosition;
616  FirstQuadXPosition=defaultFirstQuadXPosition;
617  FirstQXPosition=0.0*mm;
618 
619  G4double defaultQuadYPosition=0.0*mm;
620  QuadYPosition=defaultQuadYPosition;
621  QYPosition=defaultQuadYPosition;
622 
623  G4double defaultQuadTZPosition= 0.*mm;
624  QuadZPosition=defaultQuadTZPosition;
625  G4double defaultQuadZPosition=0.0*mm;
626  QZPosition=defaultQuadZPosition;
627 
628  // DEFAULT DEFINITION OF THE MATERIALS
629  // All elements and compound definition follows the NIST database
630 
631  //ELEMENTS
632  G4bool isotopes = false;
635 
636  //COMPOUNDS
637  G4Material* ironNist = G4NistManager::Instance()->FindOrBuildMaterial("G4_Fe", isotopes);
638  G4Material* aluminiumNist = G4NistManager::Instance()->FindOrBuildMaterial("G4_Al");
639  G4Material* kaptonNist = G4NistManager::Instance()->FindOrBuildMaterial("G4_KAPTON", isotopes);
640  //G4Material* waterNist = G4NistManager::Instance()->FindOrBuildMaterial("G4_WATER", isotopes);
641  G4Material* stainless_steelNist = G4NistManager::Instance()->FindOrBuildMaterial("G4_STAINLESS-STEEL", isotopes);
642 
643  // Elements and compunds not pre-defined in Geant4
644  G4double d; // Density
645  G4int nComponents;// Number of components
646  G4double fractionmass; // Fraction in mass of an element in a material
647  d = 8.40*g/cm3;
648  nComponents = 2;
649  G4Material* brass = new G4Material("Brass", d, nComponents);
650  brass -> AddElement(zincNist, fractionmass = 30 *perCent);
651  brass -> AddElement(copperNist, fractionmass = 70 *perCent);
652 
653  G4double atomicNumber = 1.;
654  G4double massOfMole = 1.008*g/mole;
655  d = 1.e-25*g/cm3;
656  G4double temperature = 2.73*kelvin;
657  G4double pressure = 3.e-18*pascal;
658  G4Material* vacuum = new G4Material("interGalactic", atomicNumber,massOfMole, d, kStateGas,temperature, pressure);
659 
660  //***************************** PW ***************************************
661 
662  // DetectorROGeometry Material
663  new G4Material("dummyMat", 1., 1.*g/mole, 1.*g/cm3);
664 
665  //***************************** PW ***************************************
666 
667  // MATERIAL ASSIGNMENT
668  MotherMaterial=vacuum;
669  QuadMaterial=ironNist;
670  externalChamberMaterial = stainless_steelNist;
671  internalChamberMaterial = vacuum;
672  collimatorMaterial = aluminiumNist;
673  collimatorHoleMaterial=vacuum;
674  FinalcollimatorMaterial=aluminiumNist;
676  WindowMaterial=kaptonNist;
677  PipeMaterial=stainless_steelNist;
678 
679  externalMagnet_1Material = ironNist;
680  externalMagnet_2Material = ironNist;
681  externalMagnet_3Material = ironNist;
682  externalMagnet_4Material = ironNist;
683 
684  externalSlitMaterial = brass;
685  internalSlitMaterial =vacuum;
686 
687  //FC Material
688 
689  KaptonEntranceWindowMaterial=kaptonNist;
690  GuardRingMaterial=stainless_steelNist;
691  FaradayCupBottomMaterial=aluminiumNist;
694 
695 }
696 
699 {
700  // -----------------------------
701  // Treatment room - World volume
702  //------------------------------
703 
704  const G4double worldX = 800.0 *cm;
705  const G4double worldY = 400.0 *cm;
706  const G4double worldZ = 400.0 *cm;
707 
708  solidTreatmentRoom = new G4Box("TreatmentRoom",
709  worldX,
710  worldY,
711  worldZ);
712 
715  "logicTreatmentRoom",
716  0,
717  0,
718  0);
719 
721  G4ThreeVector(),
722  "physicalTreatmentRoom",
724  0,
725  false,
726  0);
727 
728 
729  // The treatment room is invisible in the Visualisation
730  logicTreatmentRoom -> SetVisAttributes (G4VisAttributes::Invisible);
731 
732  // The various components of the energyselector are constructed calling
733  // the following methods
734 
735  // This method constructs the chamber where the energyselector is located
737  // This method construct the exit window
738  ExitWindow();
739  // This method construct the exit pipe
740  ExitPipe();
741  // This method construct the exit hole
742  Exithole();
743 
744  // This method constructs a circular collimator of variable thickness and
745  // aperture. It is placed befor the magnet to collimate particles caming from the
746  // plasma;
747  Collimator();
748 
749  // This method constructs the magnet 1 and its associated magnetic field
750  Magnet_1();
751 
752  // This method constructs the magnet 2 and its associated magnetic field
753  Magnet_2();
754 
755  // This method constructs the magnet 3 and its associated magnetic field
756  Magnet_3();
757 
758  // This method constructs the magnet 4 and its associated magnetic field
759  Magnet_4();
760 
761  // The selection slit is a square hole moveable inside a metallic plate
762  Slit();
763 
764  FinalCollimator();
765 
766  // This method construct the quadrupoles
767  Quadrupole();
768  // This method construct the entrance hole
769  Entrancehole();
770  // This method construct the entrance pipe
771  EntrancePipe();
772 
773  FaradayCup();
774 
775 }
776 
777 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
778 
780 {
781  G4double minEps=1.0e-5; // Minimum & value for smallest steps
782  G4double maxEps=1.0e-4;
783  G4bool allLocal = true;
784  // G4int nvar = 8; For pure magnetic field, the number of integration variables is the default!
785 
786  //....oooOO0OOooo..........ENERGY SELECTOR SYSTEM FIELD..........oooOO0OOooo....
788  PurgMagField = new HadrontherapyMagneticField3D("field/ESSMagneticField.TABLE", xOffset);
789  pFieldMgr =new G4FieldManager();
790  pFieldMgr -> SetDetectorField(PurgMagField);
791  G4cout << "DeltaStep "<< pFieldMgr -> GetDeltaOneStep()/mm <<"mm" <<endl;
792  pFieldMgr -> CreateChordFinder(PurgMagField);
796  pIntgrDriver = new G4MagInt_Driver(1*mm,fstepper,fstepper-> GetNumberOfVariables());
797  //the first parameter is the minimum step
802  pFieldMgr->SetDeltaOneStep(0.5e-3*mm);//default value of DeltaChord is 0.25 mm
803  logicInternalChamber -> SetFieldManager(pFieldMgr, allLocal);}
804  //....oooOO0OOooo..........QUADS FIELDS..........oooOO0OOooo....
805  //....oooOO0OOooo..........FOURTH QUAD FIELD..........oooOO0OOooo....
807  PurgMagFieldQuadFourth = new HadrontherapyMagneticField3D("field/Quad80MagneticField.TABLE", xOffsetFQ);
809  pFieldMgrQuadFourth -> SetDetectorField(PurgMagFieldQuadFourth);
810 
811  pFieldMgrQuadFourth -> CreateChordFinder(PurgMagFieldQuadFourth);
815  //the first parameter is the minimum step
820  pFieldMgrQuadFourth->SetDeltaOneStep(0.5e-3*mm);//default value of DeltaChord is 0.25 mm
821  LFourthTriplet -> SetFieldManager(pFieldMgrQuadFourth, allLocal);}
822  //....oooOO0OOooo..........THIRD QUAD FIELD..........oooOO0OOooo....
824  PurgMagFieldQuadThird = new HadrontherapyMagneticField3D("field/Quad40MagneticField.TABLE", xOffsetTQ);
826  pFieldMgrQuadThird -> SetDetectorField(PurgMagFieldQuadThird);
827  pFieldMgrQuadThird -> CreateChordFinder(PurgMagFieldQuadThird);
831  //the first parameter is the minimum step
836  pFieldMgrQuadThird->SetDeltaOneStep(0.5e-3*mm);//default value of DeltaChord is 0.25 mm
837  LThirdTriplet -> SetFieldManager(pFieldMgrQuadThird, allLocal);}
838  //....oooOO0OOooo..........SECOND QUAD FIELD..........oooOO0OOooo....
840  PurgMagFieldQuadSecond = new HadrontherapyMagneticField3D("field/Quad40MagneticField.TABLE", xOffsetSQ);
842  pFieldMgrQuadSecond -> SetDetectorField(PurgMagFieldQuadSecond);
843  pFieldMgrQuadSecond -> CreateChordFinder(PurgMagFieldQuadSecond);
847  //the first parameter is the minimum step
852  pFieldMgrQuadSecond->SetDeltaOneStep(0.5e-3*mm);//default value of DeltaChord is 0.25 mm
853  LSecondTriplet -> SetFieldManager(pFieldMgrQuadSecond, allLocal);}
854  //....oooOO0OOooo..........FIRST QUAD FIELD..........oooOO0OOooo....
856  PurgMagFieldQuadFirst = new HadrontherapyMagneticField3D("field/Quad80MagneticField.TABLE", xOffsetFirstQ);
858  pFieldMgrQuadFirst -> SetDetectorField(PurgMagFieldQuadFirst);
859  pFieldMgrQuadFirst -> CreateChordFinder(PurgMagFieldQuadFirst);
863  //the first parameter is the minimum step
868  pFieldMgrQuadFirst->SetDeltaOneStep(0.5e-3*mm);//default value of DeltaChord is 0.25 mm
869  LFirstTriplet -> SetFieldManager(pFieldMgrQuadFirst, allLocal);}
870  //....oooOO0OOooo..........FARADAY CUP FIELD..........oooOO0OOooo....
871  if(logicVirtualMag) {G4double exOffset= -20*cm;
872  G4double eyOffset= 0*cm;
873  G4double ezOffset= 0*cm;
874  G4FieldManager *pEFieldmanager = new G4FieldManager();
875  G4ElectricField *ElectricField = new HadrontherapyElectricTabulatedField3D("field/ElectricFieldFC-600V.TABLE", exOffset, eyOffset, ezOffset);
876  // UNIFORM FIELD
877  // G4ElectroMagneticField* ElectricField = new G4UniformElectricField(G4ThreeVector(0.0, 10.0*volt/m, 0.0)); //G4UniformElectricField
878  // The following is only for global field in the whole geometry
879  //pEFieldmanager = G4TransportationManager::GetTransportationManager() -> GetFieldManager();
880 
881  const G4int nvarElectric=8; // The Equation of motion for Electric (or combined Electric/Magnetic)
882  // field requires 8 integration variables
883 
884  G4EqMagElectricField *fLocalEquation = new G4EqMagElectricField(ElectricField);
885  G4MagIntegratorStepper* fLocalStepper = new G4ClassicalRK4(fLocalEquation, nvarElectric);
886  G4MagInt_Driver *pIntgrDriver_E = new G4MagInt_Driver(0.02*mm, fLocalStepper, fLocalStepper -> GetNumberOfVariables() );
887  G4ChordFinder *fLocalChordFinder = new G4ChordFinder(pIntgrDriver_E);
888  pEFieldmanager -> SetDetectorField(ElectricField);
889  pEFieldmanager -> SetChordFinder(fLocalChordFinder);
890  //G4double deltainter=0.0001*mm;
891  //G4double missdist=0.1*mm;
892  //pEFieldmanager->SetDeltaIntersection(deltainter);
893  //fLocalChordFinder->SetDeltaChord(missdist);
894  pEFieldmanager->SetMinimumEpsilonStep(minEps);
895  pEFieldmanager->SetMaximumEpsilonStep(maxEps);
896  pEFieldmanager->SetDeltaOneStep( 0.5e-3 * mm );
897  //pEFieldmanager -> SetFieldChangesEnergy(true);
898  logicVirtualMag -> SetFieldManager(pEFieldmanager, allLocal);}
899  //....oooOO0OOooo....................oooOO0OOooo....
900  G4cout<<" //....oooOO0OOooo.......... FIELDS HAVE BEEN IMPLEMENTED..........oooOO0OOooo...."<<G4endl;
901  return;
902 }
903 
906 {
908 
909 G4double InnerRadiusFC=25*mm;
910 G4double OuterRadiusFC=45*mm;
911 G4double MassRingThickness=5*mm;
912 G4double GuardRingThickness=180*mm;
913 G4double FaradayCupBottomThickness=120*mm;
914 G4double CupThickness=10*cm;
915 G4double KaptonEntranceWindowThickness=25*um;
916 
918 
919 G4double VirtualWindowThickness=1.*um ;
920 G4double VirtualMiddleThickness= 1.*um ;
921 G4double VirtualBottomThickness= 1. *um ;
922 G4double VirtualOverBottomThickness=1. *um ;
923 G4double VirtualLateralLength=FaradayCupBottomThickness+CupThickness+VirtualBottomThickness;
924 
925 
927 
928 G4double virtualMagPosX=31*cm;
929 G4double FC_XOffset=20*cm;
930 G4double KaptonEntranceWindowPosX=-virtualMagPosX+KaptonEntranceWindowThickness/2+FC_XOffset;
931 G4double MassRingPosX=KaptonEntranceWindowPosX+KaptonEntranceWindowThickness/2+MassRingThickness/2;
932 G4double VirtualWindowPosX=MassRingPosX+MassRingThickness/2+VirtualWindowThickness/2;
933 G4double GuardRingPosX=MassRingPosX+MassRingThickness/2+GuardRingThickness/2+2*mm;
934 G4double VirtualMiddlePosX=GuardRingPosX+GuardRingThickness/2+VirtualMiddleThickness/2;
935 G4double FaradayCupBottomPosX=GuardRingPosX+GuardRingThickness/2+FaradayCupBottomThickness/2+1*cm;
936 G4double VirtualBottomPosX=FaradayCupBottomPosX+FaradayCupBottomThickness/2+VirtualBottomThickness/2;
937 G4double CupPosX=VirtualBottomPosX+VirtualBottomThickness/2+CupThickness/2;
938 G4double VirtualOverBottomPosX=CupPosX+CupThickness/2+VirtualOverBottomThickness/2;
939 G4double VirtualLateralPosX=GuardRingPosX+GuardRingThickness/2+1*cm+(FaradayCupBottomThickness+CupThickness+VirtualBottomThickness)/2;
940  G4double phi = 90. *deg;
941  G4RotationMatrix rm;
942  rm.rotateY(phi);
943 
944  virtualMag= new G4Box("virtualMag", 31.*cm, 6*cm, 6*cm );
945 
948  "LVirtualMag",
949  0,0,0);
951  G4ThreeVector(virtualMagPosX, 0.*cm, 0*mm),
952  "PVirtualMag",
955  true, 0);
956 
957 
958  logicVirtualMag -> SetVisAttributes(blue);
959 
961 
963  Rot->rotateX(14*deg);
964  G4ThreeVector trans(0.,22.5*mm,-15*mm);
965  Cylinder= new G4Tubs("cylinder",20*mm,22.5*mm,90*mm,0.,2*pi);
966  Box= new G4Box("Box",22.5*mm,22.5*mm,90*mm);
967 
968  G4SubtractionSolid* BeveledCylinder=new G4SubtractionSolid("Cylinder-Box",
969  Cylinder,
970  Box,
971  Rot,
972  trans);
973 
974  logicBeveledCylinder= new G4LogicalVolume (BeveledCylinder,
976  "LBeveledCylinder",
977  0,0,0);
978 
980  "physicBeveledCylinder",
983  true,0);
984 
986 
987 
989 
990  KaptonEntranceWindow= new G4Tubs("KaptonEntranceWindow",
991  0,
992  OuterRadiusFC,
993  KaptonEntranceWindowThickness/2,
994  0*deg,360*deg);
995 
997  // internalChamberMaterial, for track control
999  "LKaptonEntranceWindow",
1000  0,0,0);
1001 
1002  physicKaptonEntranceWindow=new G4PVPlacement(G4Transform3D(rm,G4ThreeVector(KaptonEntranceWindowPosX,0,0)),
1003  "PhysicEntranceWindow",
1005  physicVirtualMag,true,0);
1006  logicKaptonEntranceWindow -> SetVisAttributes(gray);
1007 
1009 
1010  MassRing=new G4Tubs ("MassRing",
1011  InnerRadiusFC,
1012  OuterRadiusFC,
1013  MassRingThickness/2,
1014  0*deg,360*deg);
1015 
1018  "logicMassRing",
1019  0,0,0);
1020 
1021  physicMassRing=new G4PVPlacement( G4Transform3D(rm,G4ThreeVector(MassRingPosX,0,0)),
1022 
1023  "PhysicMassRing",logicMassRing,
1024 
1026  true,0);
1027  logicMassRing -> SetVisAttributes(green);
1028 
1029 
1030 
1031 
1033 
1034 
1035  VirtualWindow=new G4Tubs("VirtualWindow",
1036  0,
1037  OuterRadiusFC,
1038  VirtualWindowThickness/2,
1039  0*deg,360*deg);
1040 
1043  "logicVirtualWindow",
1044  0,0,0);
1045 
1046  physicVirtualWindow=new G4PVPlacement( G4Transform3D(rm,G4ThreeVector(VirtualWindowPosX,0,0)),
1047 
1048  "PhysicVirtualWindow",
1051  true,0);
1053 
1055 
1056  GuardRing=new G4Tubs ("GuardRing",
1057  InnerRadiusFC,
1058  OuterRadiusFC,
1059  GuardRingThickness/2,
1060  0*deg,360*deg);
1061 
1064  "logicGuardRing",
1065  0,0,0);
1066 
1067  physicGuardRing=new G4PVPlacement(G4Transform3D(rm,G4ThreeVector(GuardRingPosX,0,0)),
1068 
1069  "PhysicGuardRing", logicGuardRing,
1070 
1072  true,0);
1073  logicGuardRing -> SetVisAttributes(red);
1074 
1075 
1077 
1078 
1079  VirtualMiddle=new G4Tubs ("VirtualMiddle",
1080  0,
1081  OuterRadiusFC,
1082  VirtualMiddleThickness/2,
1083  0*deg,360*deg);
1084 
1087  "logicVirtualMiddle",
1088  0,0,0);
1089 
1090  physicVirtualMiddle=new G4PVPlacement(G4Transform3D(rm,G4ThreeVector(VirtualMiddlePosX,0,0)),
1091 
1092  "PhysicVirtualMiddle", logicVirtualMiddle,
1093 
1095  true,0);
1096 
1098 
1100 
1101  FaradayCupBottom=new G4Tubs ("FaradayCupBottom",
1102  InnerRadiusFC,
1103  OuterRadiusFC,
1104  FaradayCupBottomThickness/2,
1105  0*deg,360*deg);
1106 
1109  "logicFaradayCupBottom",
1110  0,0,0);
1111 
1112  physicFaradayCupBottom=new G4PVPlacement(G4Transform3D(rm,G4ThreeVector(FaradayCupBottomPosX,0,0)),
1113  "PhysicFaradayCupBottom",logicFaradayCupBottom,
1115  true,0);
1116  logicFaradayCupBottom -> SetVisAttributes(yellow);
1117 
1118 
1120 
1121  VirtualBottom=new G4Tubs ("VirtualBottom",
1122  0,
1123  OuterRadiusFC,
1124  VirtualBottomThickness/2,
1125  0*deg,360*deg);
1126 
1129  "logicVirtualBottom",
1130  0,0,0);
1131 
1132  physicVirtualBottom=new G4PVPlacement(G4Transform3D(rm,G4ThreeVector(VirtualBottomPosX,0,0)),
1133  "PhysicVirtualBottom",
1136  true,0);
1137 
1139 
1141 
1142  Cup=new G4Tubs ("Cup",
1143  0,
1144  OuterRadiusFC,
1145  CupThickness/2,
1146  0*deg,360*deg);
1147 
1149  CupMaterial,
1150  "logicCup",
1151  0,0,0);
1152 
1153  physicCup=new G4PVPlacement(G4Transform3D(rm,G4ThreeVector(CupPosX,0,0)),
1154  "PhysicCup", logicCup,
1155 
1157  true,0);
1158 
1159  logicCup -> SetVisAttributes(darkGreen);
1160 
1161 
1163 
1164  VirtualOverBottom=new G4Tubs ("VirtualOverBottom",
1165  0,
1166  OuterRadiusFC,
1167  VirtualOverBottomThickness/2,
1168  0*deg,360*deg);
1169 
1172  "logicVirtualOverBottom",
1173  0,0,0);
1174 
1175  physicVirtualOverBottom=new G4PVPlacement(G4Transform3D(rm,G4ThreeVector(VirtualOverBottomPosX,0,0)),
1176  "PhysicVirtualOverBottom",logicVirtualOverBottom,
1177 
1179  true,0);
1181 
1182 
1184 
1185 
1186  VirtualLateral=new G4Tubs ("VirtualLateral",
1187  OuterRadiusFC,
1188  OuterRadiusFC+1*um,// the VirtualLateralThickness is 1*um
1189  VirtualLateralLength/2,
1190  0*deg,360*deg);
1191 
1194  "logicVirtualLateral",
1195  0,0,0);
1196 
1197  physicVirtualLateral=new G4PVPlacement(G4Transform3D(rm,G4ThreeVector(VirtualLateralPosX,0,0)),
1198  "VirtualLateral",logicVirtualLateral,
1199 
1201  true,0);
1202 
1203 
1204 
1206  }
1207 
1210 {
1211  // To rotate the quadrupoles putting their axis (along X direction) parallel to the beam axis
1212  G4double phi = 90. *deg;
1213  G4RotationMatrix rm;
1214  rm.rotateY(phi);
1215 
1217 
1219 
1221  "physQuadChamberWall", LQuadChamberWall,physicTreatmentRoom, false, 0);
1222 
1223 
1225 
1227 
1228  PQuadChamber = new G4PVPlacement(0, G4ThreeVector(0.0, 0.0, 0.0),
1229  "physQuadChamber", LQuadChamber,PQuadChamberWall, false, 0);
1230 
1231  LQuadChamberWall -> SetVisAttributes(red);
1232  LQuadChamber -> SetVisAttributes(white);
1236 
1238 
1240  "PhysFourthTQuad", LFourthTriplet, PQuadChamber, false, 0);
1241 
1244 
1245  logicFourthQuad = new G4LogicalVolume(solidFourthQuad, QuadMaterial, "LogicQuad", 0, 0, 0);
1246 
1248  "PhysFourthQuad",logicFourthQuad, PFourthTriplet, false, 0);
1249 
1250  LFourthTriplet -> SetVisAttributes(yellow);
1251  logicFourthQuad -> SetVisAttributes(green);
1255 
1256  LThirdTriplet = new G4LogicalVolume(SThirdTriplet, internalChamberMaterial,"LogicTTQuad", 0, 0, 0);
1257 
1259  "PhysThirdTQuad",LThirdTriplet,PQuadChamber, false, 0);
1260 
1263 
1264  logicThirdQuad = new G4LogicalVolume(solidThirdQuad, QuadMaterial, "LogicTQuad", 0, 0, 0);
1265 
1267  "PhysThirdQuad",logicThirdQuad, PThirdTriplet, false, 0);
1268 
1269  LThirdTriplet -> SetVisAttributes(yellow);
1270  logicThirdQuad -> SetVisAttributes(green);
1274 
1276 
1278  "PhysSecondTQuad", LSecondTriplet, PQuadChamber, false, 0);
1279 
1282 
1283  logicSecondQuad = new G4LogicalVolume(solidSecondQuad, QuadMaterial, "LogicSQuad", 0, 0, 0);
1284 
1286  "PhysSecondQuad", logicSecondQuad, PSecondTriplet, false, 0);
1287 
1288  LSecondTriplet -> SetVisAttributes(yellow);
1289  logicSecondQuad -> SetVisAttributes(green);
1293 
1295 
1297  "PhysFirstTQuad", LFirstTriplet, PQuadChamber, false, 0);
1298 
1301 
1302  logicFirstQuad = new G4LogicalVolume(solidFirstQuad, QuadMaterial, "LogicQuad", 0, 0, 0);
1303 
1305  "PhysFirstQuad",logicFirstQuad, PFirstTriplet, false, 0);
1306 
1307  LFirstTriplet -> SetVisAttributes(yellow);
1308  logicFirstQuad -> SetVisAttributes(green);
1309 }
1310 
1313 {
1314  // The whole energyselector is mounted inside a
1315  // a vacuum chamber (called 'ExternalChamber')
1316  // inside which a vacuum box is inserted.
1317 
1318  solidExternalChamber = new G4Box("ExternalChamber",
1321  externalChamberZSize/2.0);
1322 
1325  "ExternalChamber");
1326 
1331  "ExternalChamber",
1334  false,
1335  0);
1336 
1337  // Visualisation of the External part
1338  logicExternalChamber -> SetVisAttributes(red);
1339 
1340  // This is a vacuum box inside the steel box
1341  solidInternalChamber = new G4Box("SInternalChamber",
1344  internalChamberZSize/2.0);
1345 
1348  "LInternalChamber");
1349 
1351  G4ThreeVector(0,0,0),
1352  "InternalChamber",
1355  false,
1356  0);
1357  logicInternalChamber -> SetVisAttributes(white);
1358 }
1359 
1362 {
1363  // To rotate the EntrancePipe putting its axis (along X direction) parallel to the beam axis
1364  G4double phi = 90. *deg;
1365  G4RotationMatrix rm;
1366  rm.rotateY(phi);
1367 
1368  solidEntrancePipe = new G4Tubs("EntrancePipe",
1371  EntrancePipeheight/2.,
1374 
1376  PipeMaterial,
1377  "EntrancePipe",
1378  0,
1379  0,
1380  0);
1381 
1386  "EntrancePipe",
1389  false,
1390  0);
1391 
1392  logicEntrancePipe -> SetVisAttributes(red);
1393 
1394 }
1395 
1398 {
1399  // To rotate the ExitPipe putting its axis (along X direction) parallel to the beam axis
1400  G4double phi = 90. *deg;
1401  G4RotationMatrix rm;
1402  rm.rotateY(phi);
1403 
1404  solidEntrancehole = new G4Tubs("Entrancehole",
1410 
1413  "Entrancehole",
1414  0,
1415  0,
1416  0);
1417  //the hole in the energy selector chamber
1422  "Entrancehole",
1425  false,
1426  0);
1427  //the hole in the quadrupoles chamber
1432  "EntranceholeQuad",
1435  false,
1436  0);
1437 
1438  logicEntrancehole -> SetVisAttributes(skyBlue);
1439 
1440 
1441 }
1444 {
1445  // To rotate the collimator putting its axis (along X direction) parallel to the beam axis
1446  G4double phi = 90. *deg;
1447  G4RotationMatrix rm;
1448  rm.rotateY(phi);
1449  //8x82x210 mm are the collimator default dimensions
1450  solidCollimator = new G4Box("collimator",
1451  thicknessCollimator/2.0,
1452  collimatorBoxYSize/2.0,
1453  collimatorBoxZSize/2.0);
1454 
1457  "collimator");
1458 
1463  "collimator",
1466  false,
1467  0);
1468 
1469  logicCollimator -> SetVisAttributes(darkOrange3);
1470 
1471  solidCollimatorHole = new G4Tubs("CollimatorHole",
1477 
1480  "CollimatorHole",
1481  0,
1482  0,
1483  0);
1484 
1489  "CollimatorHole",
1492  false,
1493  0);
1494 
1495  logicCollimatorHole -> SetVisAttributes(skyBlue);
1496 }
1497 
1499 // Magnet number 1
1501 { // The positions of the external and internal partes are given as respect the external chamber.
1502  solidExternalMagnet_1 = new G4Box("SolidExternalMagnet_1",
1505  externalMagnet_1ZSize/2.0);
1506 
1509  "LogicExternalMagnet_1");
1510 
1515  "PhysicExternalMagnet_1",
1518  false,
1519  0);
1524  "PhysicExternalMagnet_1Down",
1527  false,
1528  0);
1529 
1530 
1531  logicExternalMagnet_1 -> SetVisAttributes(gray);
1532 
1533  // The right and left part of the magnet
1534  solidMagnet_1 = new G4Box("SolidMagnet_1",
1535  Magnet_1XSize/2.0,
1536  Magnet_1YSize/2.0,
1537  Magnet_1ZSize/2.0);
1538 
1541  "LogicMagnet_1");
1542 
1546  "PhysicMagnet_1Right",
1547  logicMagnet_1,
1549  false,
1550  0);
1554  "PhysicMagnet_1Left",
1555  logicMagnet_1,
1557  false,
1558  0);
1559 
1560  logicMagnet_1 -> SetVisAttributes(gray);
1561 }
1562 
1564 // Magnet number 2
1566 { // The position of the external part are given as respect the external chamber.
1567 
1568  solidExternalMagnet_2 = new G4Box("SolidExternalMagnet_2",
1571  externalMagnet_2ZSize/2.0);
1572 
1575  "LogicExternalMagnet_2");
1576 
1581  "PhysicExternalMagnet_2",
1584  false,
1585  0);
1586 
1591  "PhysicExternalMagnet_2Down",
1594  false,
1595  0);
1596 
1597 
1598  logicExternalMagnet_2 -> SetVisAttributes(gray);
1599 
1600  // The right and left part of the magnet
1601  solidMagnet_2 = new G4Box("SolidMagnet_2",
1602  Magnet_2XSize/2.0,
1603  Magnet_2YSize/2.0,
1604  Magnet_2ZSize/2.0);
1605 
1608  "LogicMagnet_2");
1609 
1612  (Magnet_2ZPosition)+32*mm),
1613  "PhysicMagnet_2Right",
1614  logicMagnet_2,
1616  false,
1617  0);
1620  (-(Magnet_2ZPosition)+32*mm)),
1621  "PhysicMagnet_2Left",
1622  logicMagnet_2,
1624  false,
1625  0);
1626  logicMagnet_2 -> SetVisAttributes(gray);
1627 }
1628 
1630 // Magnet number 3
1632 { // The position of the external part are given as respect the external chamber.
1633 
1634  solidExternalMagnet_3 = new G4Box("SolidExternalMagnet_3",
1637  externalMagnet_3ZSize/2.0);
1638 
1641  "LogicExternalMagnet_3");
1642 
1647  "PhysicExternalMagnet_3",
1650  false,
1651  0);
1652 
1657  "PhysicExternalMagnet_3Down",
1660  false,
1661  0);
1662 
1663  logicExternalMagnet_3 -> SetVisAttributes(gray);
1664 
1665  // The right and left part of the magnet
1666  solidMagnet_3 = new G4Box("SolidMagnet_3",
1667  Magnet_3XSize/2.0,
1668  Magnet_3YSize/2.0,
1669  Magnet_3ZSize/2.0);
1670 
1673  "LogicMagnet_3");
1674 
1677  (Magnet_3ZPosition+32*mm)),
1678  "PhysicMagnet_3Right",
1679  logicMagnet_3,
1681  false,
1682  0);
1685  (-(Magnet_3ZPosition)+32*mm)),
1686  "PhysicMagnet_3Left",
1687  logicMagnet_3,
1689  false,
1690  0);
1691  logicMagnet_3 -> SetVisAttributes(gray);
1692 
1693 }
1694 
1696 // Magnet number 4
1698 { // The position of the external part are given as respect the external chamber.
1699 
1700  solidExternalMagnet_4 = new G4Box("SolidExternalMagnet_4",
1703  externalMagnet_4ZSize/2.0);
1704 
1707  "LogicExternalMagnet_4");
1708 
1713  "PhysicExternalMagnet_4",
1716  false,
1717  0);
1718 
1723  "PhysicExternalMagnet_4Down",
1726  false,
1727  0);
1728 
1729  logicExternalMagnet_4 -> SetVisAttributes(gray);
1730 
1731  // The right and left part of the magnet
1732  solidMagnet_4 = new G4Box("SolidMagnet_4",
1733  Magnet_4XSize/2.0,
1734  Magnet_4YSize/2.0,
1735  Magnet_4ZSize/2.0);
1736 
1739  "LogicMagnet_4");
1740 
1744  "PhysicMagnet_4Right",
1745  logicMagnet_4,
1747  false,
1748  0);
1752  "PhysicMagnet_4Left",
1753  logicMagnet_4,
1755  false,
1756  0);
1757  logicMagnet_4 -> SetVisAttributes(gray);
1758 }
1759 
1761 // Slit
1763 {
1764  solidExternalSlit = new G4Box("ExternalSlit",
1765  externalSlitXSize/2.0,
1766  externalSlitYSize/2.0,
1767  externalSlitZSize/2.0);
1768 
1771  "ExternalSlit");
1772 
1777  "ExternalSlit",
1780  false,
1781  0);
1782 
1783  logicExternalSlit -> SetVisAttributes(green);
1784  // The hole
1785  solidInternalSlit = new G4Box("InternalSlit",
1786  internalSlitXSize/2.0,
1787  internalSlitYSize/2.0,
1788  internalSlitZSize/2.0);
1789 
1792  "InternalSlit");
1793 
1798  "InternalSlit",
1801  false,
1802  0);
1803 
1804  logicInternalSlit -> SetVisAttributes(skyBlue);
1805 
1806 }
1809 {
1810  // To rotate the collimator putting its axis (along X direction) parallel to the beam axis
1811  G4double phi = 90. *deg;
1812  G4RotationMatrix rm;
1813  rm.rotateY(phi);
1814 
1815  solidFinalCollimator = new G4Box("collimatorFinal",
1819 
1822  "collimatorFinal");
1823 
1828  "collimatorFinal",
1831  false,
1832  0);
1833  logicFinalCollimator -> SetVisAttributes(darkOrange3);
1834 
1835  solidFinalCollimatorHole= new G4Tubs("FinalCollimatorHole",
1841 
1844  "FinalCollimatorHole",
1845  0,
1846  0,
1847  0);
1848 
1853  "FinalCollimatorHole",
1856  false,
1857  0);
1858  logicFinalCollimatorHole -> SetVisAttributes(skyBlue);
1859 }
1862 {
1863  // To rotate the ExitWindow putting its axis (along X direction) parallel to the beam axis
1864  G4double phi = 90. *deg;
1865  G4RotationMatrix rm;
1866  rm.rotateY(phi);
1867 
1868  solidExitWindow = new G4Tubs("ExitWindow",
1874 
1877  "ExitWindow",
1878  0,
1879  0,
1880  0);
1881 
1886  "ExitWindow",
1889  false,
1890  0);
1891 
1892  logicExitWindow -> SetVisAttributes(skyBlue);
1893 
1894 }
1895 
1898 {
1899  // To rotate the ExitPipe putting its axis (along X direction) parallel to the beam axis
1900  G4double phi = 90. *deg;
1901  G4RotationMatrix rm;
1902  rm.rotateY(phi);
1903 
1904  solidExitPipe = new G4Tubs("ExitPipe",
1907  ExitPipeheight/2.,
1910 
1912  PipeMaterial,
1913  "ExitPipe",
1914  0,
1915  0,
1916  0);
1917 
1922  "ExitPipe",
1923  logicExitPipe,
1925  false,
1926  0);
1927 
1928  logicExitPipe -> SetVisAttributes(red);
1929 
1930 }
1931 
1934 {
1935  // To rotate the ExitPipe putting its axis (along X direction) parallel to the beam axis
1936  G4double phi = 90. *deg;
1937  G4RotationMatrix rm;
1938  rm.rotateY(phi);
1939 
1940  solidExithole = new G4Tubs("Exithole",
1943  ExitholeThickness/2.,
1946 
1949  "Exithole",
1950  0,
1951  0,
1952  0);
1953 
1958  "Exithole",
1959  logicExithole,
1961  false,
1962  0);
1963 
1964  logicExithole -> SetVisAttributes(skyBlue);
1965 
1966 }
1969 // Disable via external macro command the Energy Selector System
1971 {
1981  if(physicCollimator) {delete physicCollimator; delete logicCollimator; delete solidCollimator; }
1986  if(physicExithole){delete physicExithole; delete logicExithole; delete solidExithole;}
1988  if(physicExitPipe){delete physicExitPipe; delete logicExitPipe; delete solidExitPipe;}
1992  if(pFieldMgr) {delete pFieldMgr;}
1993 
1994 
1995 
1996  G4cout << "****************************************************" << G4endl;
1997  G4cout << "************ The ESS has been disabled *************" << G4endl;
1998  G4cout << "****************************************************" << G4endl;
2000  #ifdef G4VIS_USE
2001  G4UImanager::GetUIpointer() -> ApplyCommand("/vis/viewer/flush");
2002  #endif
2003 }
2004 // Change via external macro command the diameter of the first collimator
2006 {
2007  G4double radius = valueR;
2008  solidCollimatorHole -> SetOuterRadius(radius);
2010  #ifdef G4VIS_USE
2011  G4UImanager::GetUIpointer() -> ApplyCommand("/vis/viewer/flush");
2012  #endif
2013  G4cout << "The first collimator aperture has been modified to "<< valueR/mm <<"mm in diameter" << G4endl;
2014 }
2016 // Change via external macro command the thickness of the first collimator
2018 {
2019  G4double thickness = valueC/2;
2020  solidCollimator -> SetXHalfLength(thickness);
2021  solidCollimatorHole -> SetZHalfLength(thickness);
2023  #ifdef G4VIS_USE
2024  G4UImanager::GetUIpointer() -> ApplyCommand("/vis/viewer/flush");
2025  #endif
2026  G4cout << "The first collimator thickness has been modified to "<< valueC/mm <<" mm in thickness" << G4endl;
2027 }
2028 
2029 // Change via external macro command the Z position of the first collimator hole
2031 {
2032  physicCollimatorHole -> SetTranslation(G4ThreeVector(0., 0., valueQ));
2034  #ifdef G4VIS_USE
2035  G4UImanager::GetUIpointer() -> ApplyCommand("/vis/viewer/flush");
2036  #endif
2037  G4cout << "The first collimator has been translated to "<< valueQ/mm <<"mm (along the z axis)" << G4endl;
2038 }
2039 
2040 // Change via external macro command the diameter of the second collimator
2042 {
2043  G4double radius = value;
2044  solidFinalCollimatorHole -> SetOuterRadius(radius);
2046  #ifdef G4VIS_USE
2047  G4UImanager::GetUIpointer() -> ApplyCommand("/vis/viewer/flush");
2048  #endif
2049  G4cout << "The second collimator aperture has been modified to "<< value/mm <<"mm in diameter" << G4endl;
2050 }
2051 
2053 // Change via external macro command the thickness of the second collimator
2055 {
2056  G4double thickness = value/2;
2057  solidFinalCollimator -> SetXHalfLength(thickness);
2058  solidFinalCollimatorHole -> SetZHalfLength(thickness);
2060  #ifdef G4VIS_USE
2061  G4UImanager::GetUIpointer() -> ApplyCommand("/vis/viewer/flush");
2062  #endif
2063  G4cout << "The second collimator thickness has been modified to "<< value/mm <<" mm in thickness" << G4endl;
2064 }
2065 
2066 // Change via external macro command the Z position of the second collimator hole
2068 {
2069  physicFinalCollimatorHole -> SetTranslation(G4ThreeVector(0., 0., value));
2071  #ifdef G4VIS_USE
2072  G4UImanager::GetUIpointer() -> ApplyCommand("/vis/viewer/flush");
2073  #endif
2074  G4cout << "The second collimator has been translated to "<< value/mm <<"mm (along the z axis)" << G4endl;
2075 }
2076 // THE SLIT MESSENGERS
2078 // Change the thickness of the Slit
2080 {
2081  if (value >(10.0*mm)) {
2082  G4cout <<"***************************************"<< G4endl;
2083  G4cout <<"******This is a warning messenger******"<< G4endl;
2084  G4cout <<"***************************************"<< G4endl;
2085  G4cout <<"The maximum value of the thickness of the slit is 10 mm, your value is >10 mm." << G4endl;
2086  G4cout <<"The default thickness value is used, it is: " << ((solidExternalSlit -> GetXHalfLength())*2.)/mm
2087  << G4endl;
2088  G4cout <<"***************************************"<< G4endl;
2089 
2090  }
2091  else {
2092  G4double dimension = value/2;
2093  solidExternalSlit -> SetXHalfLength(dimension);
2094  solidInternalSlit -> SetXHalfLength(dimension);
2096  #ifdef G4VIS_USE
2097  G4UImanager::GetUIpointer() -> ApplyCommand("/vis/viewer/flush");
2098  #endif
2099  G4cout <<"The thickness of the slit is:" << ((solidExternalSlit -> GetXHalfLength())*2.)/mm
2100  << G4endl;
2101  }
2102 }
2104 // Change the hole size (in Y direction) of the Slit
2106 {
2107  G4double hole = value/2;
2108  solidInternalSlit -> SetYHalfLength(hole);
2110  #ifdef G4VIS_USE
2111  G4UImanager::GetUIpointer() -> ApplyCommand("/vis/viewer/flush");
2112  #endif
2113  G4cout << "The hole of the Slit has been changed in the Y direction to "<< value/mm <<" mm" <<G4endl;
2114 }
2115 
2117 // Change the hole size (in Z direction) of the Slit
2119 {
2120  G4double hole = value/2;
2121  solidInternalSlit -> SetZHalfLength(hole);
2123  #ifdef G4VIS_USE
2124  G4UImanager::GetUIpointer() -> ApplyCommand("/vis/viewer/flush");
2125  #endif
2126  G4cout << "The hole of the Slit has been changed in the Z direction to "<< value/mm <<" mm" <<G4endl;
2127 }
2129 // Change the Z position of the hole of the Slit
2131 {
2132  physicInternalSlit -> SetTranslation(G4ThreeVector(0., 0., value));
2134  #ifdef G4VIS_USE
2135  G4UImanager::GetUIpointer() -> ApplyCommand("/vis/viewer/flush");
2136  #endif
2137  G4cout << "The hole of the slit has been translated to "<< value/mm <<" mm (along the Z axis)" <<G4endl;
2138 }
2139 
2140 // QUADRUPOLES
2141 
2142 // Disable via external macro command all quadrupoles
2144 {
2145  if(physicFirstQuad)
2146  {delete solidFirstQuad; delete logicFirstQuad; delete physicFirstQuad;delete SFirstTriplet; delete LFirstTriplet; delete PFirstTriplet;}
2147  if(physicSecondQuad)
2148  {delete solidSecondQuad; delete logicSecondQuad; delete physicSecondQuad;delete SSecondTriplet; delete LSecondTriplet; delete PSecondTriplet;}
2149  if(physicThirdQuad)
2150 {delete solidThirdQuad; delete logicThirdQuad; delete physicThirdQuad;delete SThirdTriplet; delete LThirdTriplet; delete PThirdTriplet;}
2151  if(physicFourthQuad)
2152  {delete solidFourthQuad; delete logicFourthQuad; delete physicFourthQuad;delete SFourthTriplet; delete LFourthTriplet; delete PFourthTriplet;}
2157 
2158 
2159  G4cout << "******************************************************************" << G4endl;
2160  G4cout << "************ The Quadrupoles system has been disabled *************" << G4endl;
2161  G4cout << "******************************************************************" << G4endl;
2163  #ifdef G4VIS_USE
2164  G4UImanager::GetUIpointer() -> ApplyCommand("/vis/viewer/flush");
2165  #endif
2166 }
2167 
HadrontherapyDetectorROGeometry * RO
G4Material * externalMagnet_3Material
static const double cm
Definition: G4SIunits.hh:118
G4VPhysicalVolume * physicExitWindow
G4ChordFinder * pChordFinderQuadFourth
G4VPhysicalVolume * physicFaradayCupBottom
G4LogicalVolume * LFourthTriplet
G4LogicalVolume * logicMassRing
G4LogicalVolume * logicFaradayCupBottom
G4VPhysicalVolume * PQuadChamberWall
G4VPhysicalVolume * physicFinalCollimatorHole
G4double defaultStartAngleFinalCollimator
G4VPhysicalVolume * physicExitPipe
G4Material * FindOrBuildMaterial(const G4String &name, G4bool isotopes=true, G4bool warning=false)
G4LogicalVolume * logicVirtualLateral
G4VPhysicalVolume * physicVirtualLateral
G4MagneticField * PurgMagFieldQuadSecond
G4VPhysicalVolume * physicInternalSlit
G4VPhysicalVolume * physicCollimator
G4VPhysicalVolume * physicVirtualBottom
G4LogicalVolume * logicEntrancehole
G4MagInt_Driver * pIntgrDriverQuadSecond
G4VPhysicalVolume * physicMagnet_4Left
LaserDrivenBeamLineMessenger * laserDrivenMessenger
CLHEP::Hep3Vector G4ThreeVector
G4VisAttributes * darkGreen
G4LogicalVolume * logicEntrancePipe
CLHEP::HepRotation G4RotationMatrix
G4Material * internalSlitMaterial
G4VPhysicalVolume * physicMagnet_3Right
G4VPhysicalVolume * physicExternalMagnet_4Down
G4LogicalVolume * LThirdTriplet
G4LogicalVolume * logicExternalMagnet_3
G4VisAttributes * darkOrange3
void SetSecondCollimatorRadius(G4double value)
G4VPhysicalVolume * physicCollimatorHole
Definition: G4Box.hh:64
G4LogicalVolume * logicKaptonEntranceWindow
G4LogicalVolume * logicCollimatorHole
G4VPhysicalVolume * PThirdTriplet
G4LogicalVolume * logicExternalMagnet_4
G4double defaultInnerRadiusFinalCollimator
G4VPhysicalVolume * physicExternalSlit
G4LogicalVolume * logicExternalSlit
G4VPhysicalVolume * physicExternalChamber
Definition: G4Tubs.hh:85
G4double defaultFinalCollimatorThickness
G4LogicalVolume * logicVirtualOverBottom
HadrontherapyDetectorConstruction * hadrontherapydetectorconstruction
G4VPhysicalVolume * physicGuardRing
G4Material * collimatorHoleMaterial
G4LogicalVolume * logicVirtualMag
G4LogicalVolume * logicTreatmentRoom
G4Material * externalMagnet_2Material
G4VPhysicalVolume * physicVirtualMag
G4LogicalVolume * LSecondTriplet
G4Mag_UsualEqRhs * fEquationQuadFourth
G4VisAttributes * green
G4VisAttributes * white
G4VPhysicalVolume * physicMassRing
G4FieldManager * pFieldMgr
G4LogicalVolume * logicCup
G4Mag_UsualEqRhs * fEquationQuadFirst
G4int nComponents
Definition: TRTMaterials.hh:41
G4LogicalVolume * logicInternalChamber
G4LogicalVolume * logicMagnet_1
G4double defaultFinalCollimatorXPosition
void SetSecondCollimatorThickness(G4double value)
G4LogicalVolume * logicFirstQuad
void SetChordFinder(G4ChordFinder *aChordFinder)
G4LogicalVolume * logicMagnet_4
int G4int
Definition: G4Types.hh:78
static G4NistManager * Instance()
G4MagInt_Driver * pIntgrDriverQuadThird
G4Mag_UsualEqRhs * fEquation
void RegisterParallelWorld(G4VUserParallelWorld *)
G4MagneticField * PurgMagFieldQuadFirst
G4LogicalVolume * LQuadChamberWall
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:58
void SetSlitHolePositionZ(G4double value)
G4VPhysicalVolume * physicMagnet_1Left
G4MagIntegratorStepper * fstepperQuadThird
G4VPhysicalVolume * physicMagnet_4Right
G4VisAttributes * skyBlue
G4ChordFinder * pChordFinderQuadSecond
G4LogicalVolume * logicVirtualBottom
void SetMinimumEpsilonStep(G4double newEpsMin)
G4MagIntegratorStepper * fstepperQuadSecond
G4LogicalVolume * logicExithole
G4double defaultOuterRadiusFinalCollimator
G4VPhysicalVolume * physicSecondQuad
G4Material * externalMagnet_4Material
G4GLOB_DLL std::ostream G4cout
G4LogicalVolume * logicFourthQuad
G4VPhysicalVolume * physicBeveledCylinder
G4LogicalVolume * logicMagnet_2
G4MagneticField * PurgMagField
void SetThicknessSlit(G4double value)
#define minEps
static const double deg
Definition: G4SIunits.hh:151
G4VPhysicalVolume * physicThirdQuad
bool G4bool
Definition: G4Types.hh:79
G4VPhysicalVolume * physicEntranceholeESSChamber
G4Material * FinalcollimatorHoleMaterial
G4VPhysicalVolume * physicKaptonEntranceWindow
G4VPhysicalVolume * PFourthTriplet
G4LogicalVolume * logicExternalChamber
void SetSecondCollimatorPositionZ(G4double value)
G4FieldManager * pFieldMgrQuadFourth
static const double cm3
Definition: G4SIunits.hh:120
G4VPhysicalVolume * physicVirtualOverBottom
HepGeom::Transform3D G4Transform3D
static const double perCent
Definition: G4SIunits.hh:329
G4MagIntegratorStepper * fstepper
G4MagneticField * PurgMagFieldQuadThird
G4VPhysicalVolume * physicExithole
G4MagInt_Driver * pIntgrDriverQuadFourth
G4VPhysicalVolume * PFirstTriplet
void SetSlitHoleDimensionZ(G4double value)
G4double defaultFinalCollimatorYPosition
G4ChordFinder * pChordFinder
G4LogicalVolume * logicMagnet_3
G4ChordFinder * pChordFinderQuadFirst
void SetFirstCollimatorPositionZ(G4double value)
G4VPhysicalVolume * Construct()
G4LogicalVolume * logicExitWindow
G4Material * KaptonEntranceWindowMaterial
G4Material * FinalcollimatorMaterial
G4LogicalVolume * logicFinalCollimator
G4VisAttributes * yellow
G4VisAttributes * black
G4VPhysicalVolume * physicMagnet_2Left
static const double kelvin
Definition: G4SIunits.hh:278
G4LogicalVolume * LFirstTriplet
#define pascal
Definition: G4SIunits.hh:231
G4MagInt_Driver * pIntgrDriver
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:79
G4VPhysicalVolume * physicVirtualWindow
G4FieldManager * pFieldMgrQuadThird
G4MagIntegratorStepper * fstepperQuadFirst
G4LogicalVolume * logicVirtualWindow
G4LogicalVolume * logicSecondQuad
G4Material * internalChamberMaterial
G4MagIntegratorStepper * fstepperQuadFourth
static const double pi
Definition: G4SIunits.hh:74
G4VPhysicalVolume * physicMagnet_3Left
void SetSlitHoleDimensionY(G4double value)
G4VPhysicalVolume * PSecondTriplet
static const double g
Definition: G4SIunits.hh:180
G4VPhysicalVolume * physicExternalMagnet_2
G4LogicalVolume * LQuadChamber
G4MagInt_Driver * pIntgrDriverQuadFirst
G4VPhysicalVolume * physicMagnet_1Right
G4VPhysicalVolume * physicMagnet_2Right
static const G4VisAttributes Invisible
G4VisAttributes * gray
G4Material * FaradayCupBottomMaterial
void SetFirstCollimatorThickness(G4double value)
G4double defaultSpanningAngleFinalCollimator
G4LogicalVolume * logicVirtualMiddle
G4LogicalVolume * logicInternalSlit
G4VPhysicalVolume * physicExternalMagnet_1Down
G4Material * externalMagnet_1Material
G4VPhysicalVolume * physicExternalMagnet_3Down
static const double um
Definition: G4SIunits.hh:112
G4LogicalVolume * logicCollimator
G4VPhysicalVolume * physicInternalChamber
static const double mole
Definition: G4SIunits.hh:283
#define G4endl
Definition: G4ios.hh:61
G4Material * externalChamberMaterial
void SetMaximumEpsilonStep(G4double newEpsMax)
G4VPhysicalVolume * physicEntrancehole
G4MagneticField * PurgMagFieldQuadFourth
G4Mag_UsualEqRhs * fEquationQuadSecond
void InitializeDetectorROGeometry(HadrontherapyDetectorROGeometry *, G4ThreeVector detectorToWorldPosition)
G4VPhysicalVolume * physicVirtualMiddle
G4VPhysicalVolume * physicFinalCollimator
G4LogicalVolume * logicGuardRing
G4VPhysicalVolume * physicCup
G4VPhysicalVolume * physicFirstQuad
G4VisAttributes * blue
double G4double
Definition: G4Types.hh:76
G4LogicalVolume * logicExternalMagnet_1
G4LogicalVolume * logicFinalCollimatorHole
G4Element * FindOrBuildElement(G4int Z, G4bool isotopes=true)
G4Mag_UsualEqRhs * fEquationQuadThird
G4LogicalVolume * logicThirdQuad
Air AddElement(elN,.7)
void SetDeltaOneStep(G4double valueD1step)
G4VPhysicalVolume * physicExternalMagnet_4
G4VPhysicalVolume * physicExternalMagnet_2Down
G4VPhysicalVolume * physicFourthQuad
G4LogicalVolume * logicExitPipe
static const double mm
Definition: G4SIunits.hh:114
G4LogicalVolume * logicExternalMagnet_2
void SetVisAttributes(const G4VisAttributes *pVA)
void SetFirstCollimatorRadius(G4double value)
G4double defaultFinalCollimatorZPosition
G4ChordFinder * pChordFinderQuadThird
G4VPhysicalVolume * physicTreatmentRoom
G4VPhysicalVolume * physicExternalMagnet_1
G4VPhysicalVolume * physicExternalMagnet_3
G4Material * externalSlitMaterial
G4FieldManager * pFieldMgrQuadSecond
G4LogicalVolume * logicBeveledCylinder
G4VPhysicalVolume * PQuadChamber
G4VPhysicalVolume * physicEntrancePipe
G4FieldManager * pFieldMgrQuadFirst