Geant4  10.01.p03
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 // Visit the Hadrontherapy web site (http://www.lns.infn.it/link/Hadrontherapy) to request
26 // the *COMPLETE* version of this program, together with its documentation;
27 // Hadrontherapy (both basic and full version) are supported by the Italian INFN
28 // Institute in the framework of the MC-INFN Group
29 //
30 
31 #include "globals.hh"
32 #include "G4SystemOfUnits.hh"
33 #include "G4Box.hh"
34 #include "G4Tubs.hh"
35 #include "G4Sphere.hh"
36 #include "G4NistManager.hh"
37 #include "G4NistElementBuilder.hh"
38 #include "G4VisAttributes.hh"
39 #include "G4Colour.hh"
40 #include "G4RunManager.hh"
41 #include "G4LogicalVolume.hh"
42 #include "G4PVPlacement.hh"
43 #include "G4RotationMatrix.hh"
45 #include "LaserDrivenBeamLine.hh"
47 //
48 #include "G4PhysicalConstants.hh"
49 #include "G4ThreeVector.hh"
50 #include "G4Material.hh"
51 //
52 #include "G4FieldManager.hh"
54 #include "G4Mag_UsualEqRhs.hh"
55 #include "G4ExplicitEuler.hh"
56 #include "G4ChordFinder.hh"
57 //#include "G4TransportationManager.hh"
58 #include "G4EqMagElectricField.hh"
59 #include "G4UniformMagField.hh"
60 #include "G4PropagatorInField.hh"
61 #include "G4VisCommandsViewer.hh"
62 #include "G4UImanager.hh"
63 #include "G4ExplicitEuler.hh"
64 #include "G4ImplicitEuler.hh"
65 #include "G4SimpleRunge.hh"
66 #include "G4SimpleHeum.hh"
67 #include "G4ClassicalRK4.hh"
68 #include "G4HelixExplicitEuler.hh"
69 #include "G4HelixImplicitEuler.hh"
70 #include "G4HelixSimpleRunge.hh"
71 #include "G4CashKarpRKF45.hh"
72 #include "G4RKG3_Stepper.hh"
73 #include "G4SubtractionSolid.hh"
74 
75 //
77 #include "G4ElectricField.hh"
79 
81 //
82 //G4bool LaserDrivenBeamLine::doCalculation = false;
85  hadrontherapydetectorconstruction(0), physicTreatmentRoom(0),
86 PFirstTriplet(0),PSecondTriplet(0),PThirdTriplet(0),PFourthTriplet(0), physicFirstQuad(0),physicSecondQuad(0),physicThirdQuad(0),physicFourthQuad(0),
87 solidExternalChamber(0),logicExternalChamber(0),physicExternalChamber(0),
88 solidInternalChamber(0),logicInternalChamber(0),physicInternalChamber(0),
89 solidCollimator(0),logicCollimator(0),physicCollimator(0),
90 solidCollimatorHole(0),logicCollimatorHole(0),physicCollimatorHole(0),
91 solidFinalCollimator(0), logicFinalCollimator(0),physicFinalCollimator(0),
92 solidFinalCollimatorHole(0),logicFinalCollimatorHole(0),physicFinalCollimatorHole(0),
93 solidExternalMagnet_1(0),logicExternalMagnet_1(0),physicExternalMagnet_1(0), physicExternalMagnet_1Down(0),
94 solidMagnet_1(0),logicMagnet_1(0),physicMagnet_1Right(0),physicMagnet_1Left(0), solidExternalMagnet_2(0),logicExternalMagnet_2(0),
95 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),
96 solidMagnet_3(0),logicMagnet_3(0),physicMagnet_3Right(0),physicMagnet_3Left(0),
97 solidExternalMagnet_4(0),logicExternalMagnet_4(0),physicExternalMagnet_4(0),physicExternalMagnet_4Down(0),
98 solidMagnet_4(0),logicMagnet_4(0),physicMagnet_4Right(0),physicMagnet_4Left(0),
99 solidExternalSlit(0), logicExternalSlit(0), physicExternalSlit(0),
100 solidInternalSlit(0),logicInternalSlit(0),physicInternalSlit(0),
101  physicExitPipe(0),physicExitWindow(0),physicExithole(0),physicEntrancePipe(0),physicEntrancehole(0)
102 {
104 
105  //***************************** PW ***************************************
106 
107  static G4String ROGeometryName = "DetectorROGeometry";
108  RO = new HadrontherapyDetectorROGeometry(ROGeometryName);
109 
110  G4cout << "Going to register Parallel world...";
112  G4cout << "... done" << G4endl;
113  //***************************** PW ***************************************
114 }
115 
118 {
119  //delete laserDrivenMessenger;
121 }
122 
125 {
126  // Sets default geometry and materials
128 
129  // Construct the energyselector (magnetic part and slit) and detector plane
131 
132  //***************************** PW ***************************************
134 
135  //***************************** PW ***************************************
136 
137  // HadrontherapyDetectorConstruction builds ONLY the phantom and the detector with its associated ROGeometry
139  G4cout<<"HadrontherapyDetectorConstruction"<<G4endl;
140  //***************************** PW ***************************************
141 
143 
144  //***************************** PW ***************************************
145  return physicTreatmentRoom;
146 }
149 {
151  // Definition of the colour sets
152  white = new G4VisAttributes( G4Colour(1.,1.,1., 0.2));
153  white -> SetVisibility(true);
154  white -> SetForceSolid(true);
155  white -> SetForceWireframe(true);
156 
157  blue = new G4VisAttributes(G4Colour(0. ,0. ,1.));
158  blue -> SetVisibility(true);
159  //blue -> SetForceSolid(true);
160 
161  gray = new G4VisAttributes( G4Colour(0.5, 0.5, 0.5, 0.5 ));
162  gray-> SetVisibility(true);
163  gray-> SetForceSolid(true);
164 
165  red = new G4VisAttributes(G4Colour(1. ,0. ,0., 0.2));
166  red-> SetVisibility(true);
167  red-> SetForceSolid(true);
168  //red -> SetForceWireframe(true);
169 
170  yellow = new G4VisAttributes(G4Colour(1., 1., 0., 0.2));
171  yellow-> SetVisibility(true);
172  yellow-> SetForceSolid(true);
173 
174  green = new G4VisAttributes( G4Colour(25/255. , 255/255. , 25/255., 0.4));
175  green -> SetVisibility(true);
176  green -> SetForceWireframe(true);
177  green -> SetForceSolid(true);
178 
179  black = new G4VisAttributes( G4Colour(255/255. , 255/255., 255/255.));
180  black -> SetVisibility(true);
181  black -> SetForceSolid(true);
182 
183  darkGreen = new G4VisAttributes( G4Colour(0/255. , 100/255. , 0/255.));
184  darkGreen -> SetVisibility(true);
185  darkGreen -> SetForceSolid(true);
186 
187  darkOrange3 = new G4VisAttributes( G4Colour(205/255. , 102/255. , 000/255., 0.7));
188  darkOrange3 -> SetVisibility(true);
189  darkOrange3 -> SetForceSolid(true);
190 
191  skyBlue = new G4VisAttributes( G4Colour(135/255. , 206/255. , 235/255., 0.1));
192  skyBlue -> SetVisibility(true);
193  skyBlue -> SetForceSolid(true);
194 
195  // DEFAULT DIMENSIONS AND POSITIONS ARE PROVIDED HERE.
197  G4double defaultInnerRadiusExitWindow=0. *mm;
198  InnerRadiusExitWindow=defaultInnerRadiusExitWindow;
199 
200  G4double defaultExternalRadiusExitWindow=55*mm;
201  ExternalRadiusExitWindow=defaultExternalRadiusExitWindow;
202 
203  G4double defaultExitWindowThickness=25 *um;
204  ExitWindowThickness=defaultExitWindowThickness;
205 
206  G4double defaultExitWindowXPosition=-ExitWindowThickness/2.;
207  ExitWindowXPosition=defaultExitWindowXPosition;
208 
209  G4double defaultExitWindowYPosition=0.;
210  ExitWindowYPosition=defaultExitWindowYPosition;
211 
212  G4double defaultExitWindowZPosition=0.0*mm;
213  ExitWindowZPosition=defaultExitWindowZPosition;
214 
215  G4double defaultStartAngleExitWindow = 0.0 *deg;
216  startAngleExitWindow = defaultStartAngleExitWindow;
217 
218  G4double defaultSpanningAngleExitWindow = 360.*deg;
219  spanningAngleExitWindow = defaultSpanningAngleExitWindow;
221  G4double defaultExitPipeheight=105. *mm;
222  ExitPipeheight=defaultExitPipeheight;
223 
224  G4double defaultInnerRadiusExitPipe=50. *mm;
225  InnerRadiusExitPipe=defaultInnerRadiusExitPipe;
226 
227  G4double defaultExternalRadiusExitPipe=55 *mm;
228  ExternalRadiusExitPipe=defaultExternalRadiusExitPipe;
229 
230  G4double defaultExitPipeXPosition=-ExitPipeheight/2-ExitWindowThickness;
231  ExitPipeXPosition=defaultExitPipeXPosition;
232 
233  G4double defaultExitPipeYPosition=0;
234  ExitPipeYPosition=defaultExitPipeYPosition;
235 
236  G4double defaultExitPipeZPosition=0.0*mm;
237  ExitPipeZPosition=defaultExitPipeZPosition;
238 
239  G4double defaultStartAngleExitPipe = 0.0 *deg;
240  startAngleExitPipe = defaultStartAngleExitPipe;
241 
242  G4double defaultSpanningAngleExitPipe = 360.*deg;
243  spanningAngleExitPipe = defaultSpanningAngleExitPipe;
245  G4double defaultExternalChamberXSize = 79.6*cm;
246  externalChamberXSize = defaultExternalChamberXSize;
247 
248  G4double defaultExternalChamberYSize = 50. *cm;
249  externalChamberYSize = defaultExternalChamberYSize;
250 
251  G4double defaultExternalChamberZSize = 50. *cm;
252  externalChamberZSize = defaultExternalChamberZSize;
253 
254  G4double defaultExternalChamberXPosition = -(externalChamberXSize/2.+ExitPipeheight/2.)+ ExitPipeXPosition;
255  externalChamberXPosition = defaultExternalChamberXPosition;
256 
257  G4double defaultExternalChamberYPosition = 0.0 *mm;
258  externalChamberYPosition = defaultExternalChamberYPosition;
259 
260  G4double defaultExternalChamberZPosition = 0.0 *mm;
261  externalChamberZPosition = defaultExternalChamberZPosition;
262 
263  // Defaults of the internal chamber dimensions
264  // The position of its center is in the center
265  // of the internal chamber while the dimension are
266  // authomatically calculated respect to the external chamber ones
267  G4double defaultVaccumChamberWallThickness=5 *mm;
268  VaccumChamberWallThickness=defaultVaccumChamberWallThickness;
269 
270  G4double defaultInternalChamberXSize =externalChamberXSize - 2*VaccumChamberWallThickness;
271  internalChamberXSize = defaultInternalChamberXSize;
272 
273  G4double defaultInternalChamberYSize =externalChamberYSize - 2*VaccumChamberWallThickness;
274  internalChamberYSize = defaultInternalChamberYSize;
275 
276  G4double defaultInternalChamberZSize = externalChamberZSize - 2*VaccumChamberWallThickness;
277  internalChamberZSize = defaultInternalChamberZSize;
279  G4double defaultInnerRadiusExithole=0.*mm;
280  InnerRadiusExithole=defaultInnerRadiusExithole;
281 
282  G4double defaultExternalRadiusExithole=50.*mm;
283  ExternalRadiusExithole=defaultExternalRadiusExithole;
284 
285  G4double defaultExitholeThickness=VaccumChamberWallThickness;
286  ExitholeThickness=defaultExitholeThickness;
287 
288  G4double defaultExitholeXPosition=(externalChamberXSize/2.-ExitholeThickness/2.);
289  ExitholeXPosition=defaultExitholeXPosition;
290 
291  G4double defaultExitholeYPosition=0.;
292  ExitholeYPosition=defaultExitholeYPosition;
293 
294  G4double defaultExitholeZPosition=0.*mm;
295  ExitholeZPosition=defaultExitholeZPosition;
296 
297  G4double defaultStartAngleExithole = 0.0 *deg;
298  startAngleExithole= defaultStartAngleExithole;
299 
300  G4double defaultSpanningAngleExithole = 360.*deg;
301  spanningAngleExithole = defaultSpanningAngleExithole;
303  // The Final Collimator is located after the 4th magnet
304  G4double defaultExitholeToFinalCollimator=70 *mm;
305  ExitholeToFinalCollimator=defaultExitholeToFinalCollimator;
306 
309 
312 
315 
318 
321 
324  FinalcollimatorXPosition = 0.0*mm; //HOLE IN THE FINAL COLLIMATOR
325 
329 
333 
339 
340  //Magnet characteristics
341  G4double defaultExternalMagnet_XSize = 88.0*mm;
342  G4double defaultExternalMagnet_YSizeTotal=87.*mm;
343  G4double defaultInternalMagnet_YSize = 10. *mm;
344  G4double defaultExternalMagnet_YSize =(defaultExternalMagnet_YSizeTotal-defaultInternalMagnet_YSize)/2.;
345  G4double defaultExternalMagnet_ZSize = 104 *mm;
346 
347  G4double defaultExternalMagnet_YPosition =defaultInternalMagnet_YSize/2.+defaultExternalMagnet_YSize/2.;
348  G4double defaultExternalMagnet_ZPosition = 0.0 *mm;
349 
350  G4double defaultMagnet_XSize=defaultExternalMagnet_XSize;
351  G4double defaultMagnet_YSize=defaultExternalMagnet_YSizeTotal;
352  G4double defaultMagnet_ZSize=19*mm;
353 
354  // Defaults of the external part of the magnet 4:
355  G4double defaultFinalCollimatorToMagnet4=25.*mm;
356  FinalCollimatorToMagnet4=defaultFinalCollimatorToMagnet4;
357 
358  externalMagnet_4XSize = defaultExternalMagnet_XSize;
359  externalMagnet_4YSize = defaultExternalMagnet_YSize;
360  externalMagnet_4ZSize = defaultExternalMagnet_ZSize;
361 
362  Magnet_4XSize=defaultMagnet_XSize;
363  Magnet_4YSize=defaultMagnet_YSize;
364  Magnet_4ZSize=defaultMagnet_ZSize;
365 
366  G4double defaultExternalMagnet_4XPosition = -(FinalCollimatorThickness/2.+FinalCollimatorToMagnet4+defaultExternalMagnet_XSize/2.)+ collimatorFinalBox_XPosition;
367  externalMagnet_4XPosition = defaultExternalMagnet_4XPosition;
368 
369  externalMagnet_4YPosition = defaultExternalMagnet_YPosition;
370  externalMagnet_4ZPosition = defaultExternalMagnet_ZPosition;
371 
373  Magnet_4YPosition=0.0*mm;
374  Magnet_4ZPosition=(defaultExternalMagnet_ZSize+defaultMagnet_ZSize)/2.;
376  // Defaults of the external part of the magnet 3:
377  externalMagnet_3XSize = defaultExternalMagnet_XSize;
378  externalMagnet_3YSize = defaultExternalMagnet_YSize;
379  externalMagnet_3ZSize = defaultExternalMagnet_ZSize;
380 
381  Magnet_3XSize=defaultMagnet_XSize;
382  Magnet_3YSize=defaultMagnet_YSize;
383  Magnet_3ZSize=defaultMagnet_ZSize;
384 
385  G4double defaultMagnet4ToMagnet3=65.*mm; //85.*mm ANTONELLA
386  Magnet4ToMagnet3=defaultMagnet4ToMagnet3;
387 
388  G4double defaultExternalMagnet_3XPosition =-(Magnet4ToMagnet3+defaultExternalMagnet_XSize/2.+defaultExternalMagnet_XSize/2.)+externalMagnet_4XPosition;
389  externalMagnet_3XPosition = defaultExternalMagnet_3XPosition;
390 
391  externalMagnet_3YPosition =defaultExternalMagnet_YPosition;
392  externalMagnet_3ZPosition = defaultExternalMagnet_ZPosition;
393 
394 
396  Magnet_3YPosition=0.0*mm;
397  Magnet_3ZPosition=(defaultExternalMagnet_ZSize+defaultMagnet_ZSize)/2.;
399  // Defaults of the external part of the magnet 2:
400  externalMagnet_2XSize = defaultExternalMagnet_XSize;
401  externalMagnet_2YSize = defaultExternalMagnet_YSize;
402  externalMagnet_2ZSize = defaultExternalMagnet_ZSize;
403 
404  Magnet_2XSize=defaultMagnet_XSize;
405  Magnet_2YSize=defaultMagnet_YSize;
406  Magnet_2ZSize=defaultMagnet_ZSize;
407 
408  G4double defaultMagnet3ToMagnet2=10 *mm;
409  Magnet3ToMagnet2=defaultMagnet3ToMagnet2;
410 
411  G4double defaultExternalMagnet_2XPosition =-(Magnet3ToMagnet2+defaultExternalMagnet_XSize/2.+defaultExternalMagnet_XSize/2.)+externalMagnet_3XPosition;
412  externalMagnet_2XPosition = defaultExternalMagnet_2XPosition;
413 
414  externalMagnet_2YPosition = defaultExternalMagnet_YPosition;
415  externalMagnet_2ZPosition = defaultExternalMagnet_ZPosition;
416 
418  Magnet_2YPosition=0.0*mm;
419  Magnet_2ZPosition=(defaultExternalMagnet_ZSize+defaultMagnet_ZSize)/2.;
421  // Defaults of the external part of the magnet 1:
422  externalMagnet_1XSize=defaultExternalMagnet_XSize;
423  externalMagnet_1YSize = defaultExternalMagnet_YSize;
424  externalMagnet_1ZSize = defaultExternalMagnet_ZSize;
425 
426  Magnet_1XSize=defaultMagnet_XSize;
427  Magnet_1YSize=defaultMagnet_YSize;
428  Magnet_1ZSize=defaultMagnet_ZSize;
429 
430  G4double defaultMagnet2ToMagnet1=85 *mm;
431  Magnet2ToMagnet1=defaultMagnet2ToMagnet1;
432 
433  G4double defaultExternalMagnet_1XPosition = -(Magnet2ToMagnet1+defaultExternalMagnet_XSize/2.+defaultExternalMagnet_XSize/2.)+externalMagnet_2XPosition;
434  externalMagnet_1XPosition = defaultExternalMagnet_1XPosition;
435 
436  externalMagnet_1YPosition = defaultExternalMagnet_YPosition;
437  externalMagnet_1ZPosition = defaultExternalMagnet_ZPosition;
438 
439  Magnet_1XPosition=defaultExternalMagnet_1XPosition;
440  Magnet_1YPosition=0.0*mm;
441  Magnet_1ZPosition=(defaultExternalMagnet_ZSize+defaultMagnet_ZSize)/2.;
442 
443  // Defaults of the external part of the Slit
444  G4double defaultExternalSlitXSize = 8.0 *mm;
445  externalSlitXSize = defaultExternalSlitXSize;
446 
447  G4double defaultExternalSlitYSize = 82. *mm;
448  externalSlitYSize = defaultExternalSlitYSize;
449 
450  G4double defaultExternalSlitZSize = 210. *mm;
451  externalSlitZSize = defaultExternalSlitZSize;
452 
453  G4double defaultExternalSlitXPosition = -(Magnet3ToMagnet2/2.+defaultExternalMagnet_XSize/2.)+externalMagnet_3XPosition;
454  externalSlitXPosition = defaultExternalSlitXPosition;
455 
456  G4double defaultExternalSlitYPosition = 0.0 *mm;
457  externalSlitYPosition = defaultExternalSlitYPosition;
458 
459  G4double defaultExternalSlitZPosition = 0.0 *mm;
460  externalSlitZPosition = defaultExternalSlitZPosition;
461 
462  // Defaults of the internal part of the Slit:
463  internalSlitXSize = defaultExternalSlitXSize;
464 
465  G4double defaultInternalSlitYSize = 3 *mm;
466  internalSlitYSize = defaultInternalSlitYSize;
467 
468  G4double defaultInternalSlitZSize = 3 *mm;
469  internalSlitZSize = defaultInternalSlitZSize;
470 
471  G4double defaultInternalSlitXPosition = 0.0 *mm;
472  internalSlitXPosition = defaultInternalSlitXPosition;
473 
474  G4double defaultInternalSlitYPosition = 0.0 *mm;
475  internalSlitYPosition = defaultInternalSlitYPosition;
476 
477  G4double defaultInternalSlitZPosition = 40.0 *mm;
478  internalSlitZPosition = defaultInternalSlitZPosition;
479 
480  // Defaults of the particle collimator (First collimator).
481  // The Collimator should be located before the 1st magnet
482  //
485 
488 
490 
493 
496 
497  G4double defultMagnet1ToFirstCollimator=25.*mm;
498  Magnet1ToFirstCollimator=defultMagnet1ToFirstCollimator;
499 
502  collimatorXPosition = 0.0*mm;
503 
506  collimatorYPosition = 0.0*mm;
507 
510  collimatorZPosition = 0.*mm;
511 
512  collimatorBoxYSize=82.0* mm;
513  collimatorBoxZSize=210.0* mm;
514 
516  G4double defaultInnerRadiusEntrancehole=0. *mm;
517  InnerRadiusEntrancehole=defaultInnerRadiusEntrancehole;
518 
519  G4double defaultExternalRadiusEntrancehole=50.*mm;
520  ExternalRadiusEntrancehole=defaultExternalRadiusEntrancehole;
521 
522  G4double defaultEntranceholeThickness=VaccumChamberWallThickness;
523  EntranceholeThickness=defaultEntranceholeThickness;
524 
525  G4double defaultEntranceholeXPosition=-(externalChamberXSize/2.-EntranceholeThickness/2.);
526  EntranceholeXPosition=defaultEntranceholeXPosition;
527 
528  G4double defaultEntranceholeQuadXPosition=+(externalChamberXSize/2.-EntranceholeThickness/2.);
529  EntranceholeQuadXPosition=defaultEntranceholeQuadXPosition;
530 
531  G4double defaultEntranceholeYPosition=0.;
532  EntranceholeYPosition=defaultEntranceholeYPosition;
533 
534  G4double defaultEntranceholeZPosition=0.0*mm;
535  EntranceholeZPosition=defaultEntranceholeZPosition;
536 
537  G4double defaultStartAngleEntrancehole= 0.0 *deg;
538  startAngleEntrancehole= defaultStartAngleEntrancehole;
539 
540  G4double defaultSpanningAngleEntrancehole= 360.*deg;
541  spanningAngleEntrancehole=defaultSpanningAngleEntrancehole;
542 
544 
545  G4double defaultEntrancePipeheight=105. *mm;
546  EntrancePipeheight=defaultEntrancePipeheight;
547 
548  G4double defaultInnerRadiusEntrancePipe=50. *mm;
549  InnerRadiusEntrancePipe=defaultInnerRadiusEntrancePipe;
550 
551  G4double defaultExternalRadiusEntrancePipe=55 *mm;
552  ExternalRadiusEntrancePipe=defaultExternalRadiusEntrancePipe;
553 
555  EntrancePipeXPosition=defaultEntrancePipeXPosition;
556 
557  G4double defaultEntrancePipeYPosition=0;
558  EntrancePipeYPosition=defaultEntrancePipeYPosition;
559 
560  G4double defaultEntrancePipeZPosition=0.0*mm;
561  EntrancePipeZPosition=defaultEntrancePipeZPosition;
562 
563  G4double defaultStartAngleEntrancePipe= 0.0 *deg;
564  startAngleEntrancePipe= defaultStartAngleEntrancePipe;
565 
566  G4double defaultSpanningAngleEntrancePipe= 360.*deg;
567  spanningAngleEntrancePipe=defaultSpanningAngleEntrancePipe;
568 
570  G4double defaultQuadChamberWallPosX=-(externalChamberXSize/2.)-EntrancePipeheight/2.+EntrancePipeXPosition;
571  QuadChamberWallPosX=defaultQuadChamberWallPosX;
572  G4double defaultQuadChamberWallPosY=0.0*cm;
573  QuadChamberWallPosY=defaultQuadChamberWallPosY;
574  G4double defaultQuadChamberWallPosZ=0.0*cm;
575  QuadChamberWallPosZ=defaultQuadChamberWallPosZ;
576 
577  G4double defaultInnerRadiusQuad=10.0*mm;
578  InnerRadiusQuad=defaultInnerRadiusQuad;
579 
580  G4double defaultInnerRadiusTriplet=0.0*mm;
581  InnerRadiusTriplet=defaultInnerRadiusTriplet;
582 
583  G4double defaultExternalRadiusQuad=30.0*mm;
584  ExternalRadiusQuad=defaultExternalRadiusQuad;
585 
586  G4double defaultFirstQuadThickness=80.0*mm;
587  FirstQuadThickness=defaultFirstQuadThickness;
588  G4double defaultSecondQuadThickness=40.0*mm;
589  SecondQuadThickness=defaultSecondQuadThickness;
590  G4double defaultThirdQuadThickness=40.0*mm;
591  ThirdQuadThickness=defaultThirdQuadThickness;
592  G4double defaultFourthQuadThickness=80.0*mm;
593  FourthQuadThickness=defaultFourthQuadThickness;
594 
595  G4double defaultStartAngleQuad = 0.0 *deg;
596  startAngleQuad = defaultStartAngleQuad;
597 
598  G4double defaultSpanningAngleQuad = 360.*deg;
599  spanningAngleQuad = defaultSpanningAngleQuad;
600 
601  G4double distancefromQuadChamber=100.0*mm;
602  G4double defaultFourthQuadXPosition= internalChamberXSize/2.-distancefromQuadChamber-FourthQuadThickness/2.;
603  FourthQuadXPosition=defaultFourthQuadXPosition;
604  FourthQXPosition=0.0*mm;
605 
606  G4double distanceFQuadTQuad=100.0*mm;
607  G4double defaultThirdQuadXPosition=-ThirdQuadThickness/2.-distanceFQuadTQuad-FourthQuadThickness/2.+FourthQuadXPosition;
608  ThirdQuadXPosition=defaultThirdQuadXPosition;
609  ThirdQXPosition=0.0*mm;
610 
611  G4double distanceTQuadSQuad=100.0*mm;
612  G4double defaultSecondQuadXPosition=-SecondQuadThickness/2.-distanceTQuadSQuad-ThirdQuadThickness/2.+ThirdQuadXPosition;
613  SecondQuadXPosition=defaultSecondQuadXPosition;
614  SecondQXPosition=0.0*mm;
615 
616  G4double distanceSQuadFQuad=100.0*mm;
617  G4double defaultFirstQuadXPosition=-FirstQuadThickness/2.-distanceSQuadFQuad-SecondQuadThickness/2.+SecondQuadXPosition;
618  FirstQuadXPosition=defaultFirstQuadXPosition;
619  FirstQXPosition=0.0*mm;
620 
621  G4double defaultQuadYPosition=0.0*mm;
622  QuadYPosition=defaultQuadYPosition;
623  QYPosition=defaultQuadYPosition;
624 
625  G4double defaultQuadTZPosition= 0.*mm;
626  QuadZPosition=defaultQuadTZPosition;
627  G4double defaultQuadZPosition=0.0*mm;
628  QZPosition=defaultQuadZPosition;
629 
630  // DEFAULT DEFINITION OF THE MATERIALS
631  // All elements and compound definition follows the NIST database
632 
633  //ELEMENTS
634  G4bool isotopes = false;
637 
638  //COMPOUNDS
639  G4Material* ironNist = G4NistManager::Instance()->FindOrBuildMaterial("G4_Fe", isotopes);
640  G4Material* aluminiumNist = G4NistManager::Instance()->FindOrBuildMaterial("G4_Al");
641  G4Material* kaptonNist = G4NistManager::Instance()->FindOrBuildMaterial("G4_KAPTON", isotopes);
642  //G4Material* waterNist = G4NistManager::Instance()->FindOrBuildMaterial("G4_WATER", isotopes);
643  G4Material* stainless_steelNist = G4NistManager::Instance()->FindOrBuildMaterial("G4_STAINLESS-STEEL", isotopes);
644 
645  // Elements and compunds not pre-defined in Geant4
646  G4double d; // Density
647  G4int nComponents;// Number of components
648  G4double fractionmass; // Fraction in mass of an element in a material
649  d = 8.40*g/cm3;
650  nComponents = 2;
651  G4Material* brass = new G4Material("Brass", d, nComponents);
652  brass -> AddElement(zincNist, fractionmass = 30 *perCent);
653  brass -> AddElement(copperNist, fractionmass = 70 *perCent);
654 
655  G4double atomicNumber = 1.;
656  G4double massOfMole = 1.008*g/mole;
657  d = 1.e-25*g/cm3;
658  G4double temperature = 2.73*kelvin;
659  G4double pressure = 3.e-18*pascal;
660  G4Material* vacuum = new G4Material("interGalactic", atomicNumber,massOfMole, d, kStateGas,temperature, pressure);
661 
662  //***************************** PW ***************************************
663 
664  // DetectorROGeometry Material
665  new G4Material("dummyMat", 1., 1.*g/mole, 1.*g/cm3);
666 
667  //***************************** PW ***************************************
668 
669  // MATERIAL ASSIGNMENT
670  MotherMaterial=vacuum;
671  QuadMaterial=ironNist;
672  externalChamberMaterial = stainless_steelNist;
673  internalChamberMaterial = vacuum;
674  collimatorMaterial = aluminiumNist;
675  collimatorHoleMaterial=vacuum;
676  FinalcollimatorMaterial=aluminiumNist;
678  WindowMaterial=kaptonNist;
679  PipeMaterial=stainless_steelNist;
680 
681  externalMagnet_1Material = ironNist;
682  externalMagnet_2Material = ironNist;
683  externalMagnet_3Material = ironNist;
684  externalMagnet_4Material = ironNist;
685 
686  externalSlitMaterial = brass;
687  internalSlitMaterial =vacuum;
688 
689  //FC Material
690 
691  KaptonEntranceWindowMaterial=kaptonNist;
692  GuardRingMaterial=stainless_steelNist;
693  FaradayCupBottomMaterial=aluminiumNist;
696 
697 }
698 
701 {
702  // -----------------------------
703  // Treatment room - World volume
704  //------------------------------
705 
706  const G4double worldX = 800.0 *cm;
707  const G4double worldY = 400.0 *cm;
708  const G4double worldZ = 400.0 *cm;
709 
710  solidTreatmentRoom = new G4Box("TreatmentRoom",
711  worldX,
712  worldY,
713  worldZ);
714 
717  "logicTreatmentRoom",
718  0,
719  0,
720  0);
721 
723  G4ThreeVector(),
724  "physicalTreatmentRoom",
726  0,
727  false,
728  0);
729 
730 
731  // The treatment room is invisible in the Visualisation
732  logicTreatmentRoom -> SetVisAttributes (G4VisAttributes::Invisible);
733 
734  // The various components of the energyselector are constructed calling
735  // the following methods
736 
737  // This method constructs the chamber where the energyselector is located
739  // This method construct the exit window
740  ExitWindow();
741  // This method construct the exit pipe
742  ExitPipe();
743  // This method construct the exit hole
744  Exithole();
745 
746  // This method constructs a circular collimator of variable thickness and
747  // aperture. It is placed befor the magnet to collimate particles caming from the
748  // plasma;
749  Collimator();
750 
751  // This method constructs the magnet 1 and its associated magnetic field
752  Magnet_1();
753 
754  // This method constructs the magnet 2 and its associated magnetic field
755  Magnet_2();
756 
757  // This method constructs the magnet 3 and its associated magnetic field
758  Magnet_3();
759 
760  // This method constructs the magnet 4 and its associated magnetic field
761  Magnet_4();
762 
763  // The selection slit is a square hole moveable inside a metallic plate
764  Slit();
765 
766  FinalCollimator();
767 
768  // This method construct the quadrupoles
769  Quadrupole();
770  // This method construct the entrance hole
771  Entrancehole();
772  // This method construct the entrance pipe
773  EntrancePipe();
774 
775  FaradayCup();
776 
777 }
778 
779 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
780 
782 {
783  G4double minEps=1.0e-5; // Minimum & value for smallest steps
784  G4double maxEps=1.0e-4;
785  G4bool allLocal = true;
786  // G4int nvar = 8; For pure magnetic field, the number of integration variables is the default!
787 
788  //....oooOO0OOooo..........ENERGY SELECTOR SYSTEM FIELD..........oooOO0OOooo....
790  PurgMagField = new HadrontherapyMagneticField3D("field/ESSMagneticField.TABLE", xOffset);
791  pFieldMgr =new G4FieldManager();
792  pFieldMgr -> SetDetectorField(PurgMagField);
793  G4cout << "DeltaStep "<< pFieldMgr -> GetDeltaOneStep()/mm <<"mm" <<endl;
794  pFieldMgr -> CreateChordFinder(PurgMagField);
798  pIntgrDriver = new G4MagInt_Driver(1*mm,fstepper,fstepper-> GetNumberOfVariables());
799  //the first parameter is the minimum step
804  pFieldMgr->SetDeltaOneStep(0.5e-3*mm);//default value of DeltaChord is 0.25 mm
805  logicInternalChamber -> SetFieldManager(pFieldMgr, allLocal);}
806  //....oooOO0OOooo..........QUADS FIELDS..........oooOO0OOooo....
807  //....oooOO0OOooo..........FOURTH QUAD FIELD..........oooOO0OOooo....
809  PurgMagFieldQuadFourth = new HadrontherapyMagneticField3D("field/Quad80MagneticField.TABLE", xOffsetFQ);
811  pFieldMgrQuadFourth -> SetDetectorField(PurgMagFieldQuadFourth);
812 
813  pFieldMgrQuadFourth -> CreateChordFinder(PurgMagFieldQuadFourth);
817  //the first parameter is the minimum step
822  pFieldMgrQuadFourth->SetDeltaOneStep(0.5e-3*mm);//default value of DeltaChord is 0.25 mm
823  LFourthTriplet -> SetFieldManager(pFieldMgrQuadFourth, allLocal);}
824  //....oooOO0OOooo..........THIRD QUAD FIELD..........oooOO0OOooo....
826  PurgMagFieldQuadThird = new HadrontherapyMagneticField3D("field/Quad40MagneticField.TABLE", xOffsetTQ);
828  pFieldMgrQuadThird -> SetDetectorField(PurgMagFieldQuadThird);
829  pFieldMgrQuadThird -> CreateChordFinder(PurgMagFieldQuadThird);
833  //the first parameter is the minimum step
838  pFieldMgrQuadThird->SetDeltaOneStep(0.5e-3*mm);//default value of DeltaChord is 0.25 mm
839  LThirdTriplet -> SetFieldManager(pFieldMgrQuadThird, allLocal);}
840  //....oooOO0OOooo..........SECOND QUAD FIELD..........oooOO0OOooo....
842  PurgMagFieldQuadSecond = new HadrontherapyMagneticField3D("field/Quad40MagneticField.TABLE", xOffsetSQ);
844  pFieldMgrQuadSecond -> SetDetectorField(PurgMagFieldQuadSecond);
845  pFieldMgrQuadSecond -> CreateChordFinder(PurgMagFieldQuadSecond);
849  //the first parameter is the minimum step
854  pFieldMgrQuadSecond->SetDeltaOneStep(0.5e-3*mm);//default value of DeltaChord is 0.25 mm
855  LSecondTriplet -> SetFieldManager(pFieldMgrQuadSecond, allLocal);}
856  //....oooOO0OOooo..........FIRST QUAD FIELD..........oooOO0OOooo....
858  PurgMagFieldQuadFirst = new HadrontherapyMagneticField3D("field/Quad80MagneticField.TABLE", xOffsetFirstQ);
860  pFieldMgrQuadFirst -> SetDetectorField(PurgMagFieldQuadFirst);
861  pFieldMgrQuadFirst -> CreateChordFinder(PurgMagFieldQuadFirst);
865  //the first parameter is the minimum step
870  pFieldMgrQuadFirst->SetDeltaOneStep(0.5e-3*mm);//default value of DeltaChord is 0.25 mm
871  LFirstTriplet -> SetFieldManager(pFieldMgrQuadFirst, allLocal);}
872  //....oooOO0OOooo..........FARADAY CUP FIELD..........oooOO0OOooo....
873  if(logicVirtualMag) {G4double exOffset= -20*cm;
874  G4double eyOffset= 0*cm;
875  G4double ezOffset= 0*cm;
876  G4FieldManager *pEFieldmanager = new G4FieldManager();
877  G4ElectricField *ElectricField = new HadrontherapyElectricTabulatedField3D("field/ElectricFieldFC-600V.TABLE", exOffset, eyOffset, ezOffset);
878  // UNIFORM FIELD
879  // G4ElectroMagneticField* ElectricField = new G4UniformElectricField(G4ThreeVector(0.0, 10.0*volt/m, 0.0)); //G4UniformElectricField
880  // The following is only for global field in the whole geometry
881  //pEFieldmanager = G4TransportationManager::GetTransportationManager() -> GetFieldManager();
882 
883  const G4int nvarElectric=8; // The Equation of motion for Electric (or combined Electric/Magnetic)
884  // field requires 8 integration variables
885 
886  G4EqMagElectricField *fLocalEquation = new G4EqMagElectricField(ElectricField);
887  G4MagIntegratorStepper* fLocalStepper = new G4ClassicalRK4(fLocalEquation, nvarElectric);
888  G4MagInt_Driver *pIntgrDriver_E = new G4MagInt_Driver(0.02*mm, fLocalStepper, fLocalStepper -> GetNumberOfVariables() );
889  G4ChordFinder *fLocalChordFinder = new G4ChordFinder(pIntgrDriver_E);
890  pEFieldmanager -> SetDetectorField(ElectricField);
891  pEFieldmanager -> SetChordFinder(fLocalChordFinder);
892  //G4double deltainter=0.0001*mm;
893  //G4double missdist=0.1*mm;
894  //pEFieldmanager->SetDeltaIntersection(deltainter);
895  //fLocalChordFinder->SetDeltaChord(missdist);
896  pEFieldmanager->SetMinimumEpsilonStep(minEps);
897  pEFieldmanager->SetMaximumEpsilonStep(maxEps);
898  pEFieldmanager->SetDeltaOneStep( 0.5e-3 * mm );
899  //pEFieldmanager -> SetFieldChangesEnergy(true);
900  logicVirtualMag -> SetFieldManager(pEFieldmanager, allLocal);}
901  //....oooOO0OOooo....................oooOO0OOooo....
902  G4cout<<" //....oooOO0OOooo.......... FIELDS HAVE BEEN IMPLEMENTED..........oooOO0OOooo...."<<G4endl;
903  return;
904 }
905 
908 {
910 
911 G4double InnerRadiusFC=25*mm;
912 G4double OuterRadiusFC=45*mm;
913 G4double MassRingThickness=5*mm;
914 G4double GuardRingThickness=180*mm;
915 G4double FaradayCupBottomThickness=120*mm;
916 G4double CupThickness=10*cm;
917 G4double KaptonEntranceWindowThickness=25*um;
918 
920 
921 G4double VirtualWindowThickness=1.*um ;
922 G4double VirtualMiddleThickness= 1.*um ;
923 G4double VirtualBottomThickness= 1. *um ;
924 G4double VirtualOverBottomThickness=1. *um ;
925 G4double VirtualLateralLength=FaradayCupBottomThickness+CupThickness+VirtualBottomThickness;
926 
927 
929 
930 G4double virtualMagPosX=31*cm;
931 G4double FC_XOffset=20*cm;
932 G4double KaptonEntranceWindowPosX=-virtualMagPosX+KaptonEntranceWindowThickness/2+FC_XOffset;
933 G4double MassRingPosX=KaptonEntranceWindowPosX+KaptonEntranceWindowThickness/2+MassRingThickness/2;
934 G4double VirtualWindowPosX=MassRingPosX+MassRingThickness/2+VirtualWindowThickness/2;
935 G4double GuardRingPosX=MassRingPosX+MassRingThickness/2+GuardRingThickness/2+2*mm;
936 G4double VirtualMiddlePosX=GuardRingPosX+GuardRingThickness/2+VirtualMiddleThickness/2;
937 G4double FaradayCupBottomPosX=GuardRingPosX+GuardRingThickness/2+FaradayCupBottomThickness/2+1*cm;
938 G4double VirtualBottomPosX=FaradayCupBottomPosX+FaradayCupBottomThickness/2+VirtualBottomThickness/2;
939 G4double CupPosX=VirtualBottomPosX+VirtualBottomThickness/2+CupThickness/2;
940 G4double VirtualOverBottomPosX=CupPosX+CupThickness/2+VirtualOverBottomThickness/2;
941 G4double VirtualLateralPosX=GuardRingPosX+GuardRingThickness/2+1*cm+(FaradayCupBottomThickness+CupThickness+VirtualBottomThickness)/2;
942  G4double phi = 90. *deg;
943  G4RotationMatrix rm;
944  rm.rotateY(phi);
945 
946  virtualMag= new G4Box("virtualMag", 31.*cm, 6*cm, 6*cm );
947 
950  "LVirtualMag",
951  0,0,0);
953  G4ThreeVector(virtualMagPosX, 0.*cm, 0*mm),
954  "PVirtualMag",
957  true, 0);
958 
959 
960  logicVirtualMag -> SetVisAttributes(blue);
961 
963 
965  Rot->rotateX(14*deg);
966  G4ThreeVector trans(0.,22.5*mm,-15*mm);
967  Cylinder= new G4Tubs("cylinder",20*mm,22.5*mm,90*mm,0.,2*pi);
968  Box= new G4Box("Box",22.5*mm,22.5*mm,90*mm);
969 
970  G4SubtractionSolid* BeveledCylinder=new G4SubtractionSolid("Cylinder-Box",
971  Cylinder,
972  Box,
973  Rot,
974  trans);
975 
976  logicBeveledCylinder= new G4LogicalVolume (BeveledCylinder,
978  "LBeveledCylinder",
979  0,0,0);
980 
982  "physicBeveledCylinder",
985  true,0);
986 
988 
989 
991 
992  KaptonEntranceWindow= new G4Tubs("KaptonEntranceWindow",
993  0,
994  OuterRadiusFC,
995  KaptonEntranceWindowThickness/2,
996  0*deg,360*deg);
997 
999  // internalChamberMaterial, for track control
1001  "LKaptonEntranceWindow",
1002  0,0,0);
1003 
1004  physicKaptonEntranceWindow=new G4PVPlacement(G4Transform3D(rm,G4ThreeVector(KaptonEntranceWindowPosX,0,0)),
1005  "PhysicEntranceWindow",
1007  physicVirtualMag,true,0);
1008  logicKaptonEntranceWindow -> SetVisAttributes(gray);
1009 
1011 
1012  MassRing=new G4Tubs ("MassRing",
1013  InnerRadiusFC,
1014  OuterRadiusFC,
1015  MassRingThickness/2,
1016  0*deg,360*deg);
1017 
1020  "logicMassRing",
1021  0,0,0);
1022 
1023  physicMassRing=new G4PVPlacement( G4Transform3D(rm,G4ThreeVector(MassRingPosX,0,0)),
1024 
1025  "PhysicMassRing",logicMassRing,
1026 
1028  true,0);
1029  logicMassRing -> SetVisAttributes(green);
1030 
1031 
1032 
1033 
1035 
1036 
1037  VirtualWindow=new G4Tubs("VirtualWindow",
1038  0,
1039  OuterRadiusFC,
1040  VirtualWindowThickness/2,
1041  0*deg,360*deg);
1042 
1045  "logicVirtualWindow",
1046  0,0,0);
1047 
1048  physicVirtualWindow=new G4PVPlacement( G4Transform3D(rm,G4ThreeVector(VirtualWindowPosX,0,0)),
1049 
1050  "PhysicVirtualWindow",
1053  true,0);
1055 
1057 
1058  GuardRing=new G4Tubs ("GuardRing",
1059  InnerRadiusFC,
1060  OuterRadiusFC,
1061  GuardRingThickness/2,
1062  0*deg,360*deg);
1063 
1066  "logicGuardRing",
1067  0,0,0);
1068 
1069  physicGuardRing=new G4PVPlacement(G4Transform3D(rm,G4ThreeVector(GuardRingPosX,0,0)),
1070 
1071  "PhysicGuardRing", logicGuardRing,
1072 
1074  true,0);
1075  logicGuardRing -> SetVisAttributes(red);
1076 
1077 
1079 
1080 
1081  VirtualMiddle=new G4Tubs ("VirtualMiddle",
1082  0,
1083  OuterRadiusFC,
1084  VirtualMiddleThickness/2,
1085  0*deg,360*deg);
1086 
1089  "logicVirtualMiddle",
1090  0,0,0);
1091 
1092  physicVirtualMiddle=new G4PVPlacement(G4Transform3D(rm,G4ThreeVector(VirtualMiddlePosX,0,0)),
1093 
1094  "PhysicVirtualMiddle", logicVirtualMiddle,
1095 
1097  true,0);
1098 
1100 
1102 
1103  FaradayCupBottom=new G4Tubs ("FaradayCupBottom",
1104  InnerRadiusFC,
1105  OuterRadiusFC,
1106  FaradayCupBottomThickness/2,
1107  0*deg,360*deg);
1108 
1111  "logicFaradayCupBottom",
1112  0,0,0);
1113 
1114  physicFaradayCupBottom=new G4PVPlacement(G4Transform3D(rm,G4ThreeVector(FaradayCupBottomPosX,0,0)),
1115  "PhysicFaradayCupBottom",logicFaradayCupBottom,
1117  true,0);
1118  logicFaradayCupBottom -> SetVisAttributes(yellow);
1119 
1120 
1122 
1123  VirtualBottom=new G4Tubs ("VirtualBottom",
1124  0,
1125  OuterRadiusFC,
1126  VirtualBottomThickness/2,
1127  0*deg,360*deg);
1128 
1131  "logicVirtualBottom",
1132  0,0,0);
1133 
1134  physicVirtualBottom=new G4PVPlacement(G4Transform3D(rm,G4ThreeVector(VirtualBottomPosX,0,0)),
1135  "PhysicVirtualBottom",
1138  true,0);
1139 
1141 
1143 
1144  Cup=new G4Tubs ("Cup",
1145  0,
1146  OuterRadiusFC,
1147  CupThickness/2,
1148  0*deg,360*deg);
1149 
1151  CupMaterial,
1152  "logicCup",
1153  0,0,0);
1154 
1155  physicCup=new G4PVPlacement(G4Transform3D(rm,G4ThreeVector(CupPosX,0,0)),
1156  "PhysicCup", logicCup,
1157 
1159  true,0);
1160 
1161  logicCup -> SetVisAttributes(darkGreen);
1162 
1163 
1165 
1166  VirtualOverBottom=new G4Tubs ("VirtualOverBottom",
1167  0,
1168  OuterRadiusFC,
1169  VirtualOverBottomThickness/2,
1170  0*deg,360*deg);
1171 
1174  "logicVirtualOverBottom",
1175  0,0,0);
1176 
1177  physicVirtualOverBottom=new G4PVPlacement(G4Transform3D(rm,G4ThreeVector(VirtualOverBottomPosX,0,0)),
1178  "PhysicVirtualOverBottom",logicVirtualOverBottom,
1179 
1181  true,0);
1183 
1184 
1186 
1187 
1188  VirtualLateral=new G4Tubs ("VirtualLateral",
1189  OuterRadiusFC,
1190  OuterRadiusFC+1*um,// the VirtualLateralThickness is 1*um
1191  VirtualLateralLength/2,
1192  0*deg,360*deg);
1193 
1196  "logicVirtualLateral",
1197  0,0,0);
1198 
1199  physicVirtualLateral=new G4PVPlacement(G4Transform3D(rm,G4ThreeVector(VirtualLateralPosX,0,0)),
1200  "VirtualLateral",logicVirtualLateral,
1201 
1203  true,0);
1204 
1205 
1206 
1208  }
1209 
1212 {
1213  // To rotate the quadrupoles putting their axis (along X direction) parallel to the beam axis
1214  G4double phi = 90. *deg;
1215  G4RotationMatrix rm;
1216  rm.rotateY(phi);
1217 
1219 
1221 
1223  "physQuadChamberWall", LQuadChamberWall,physicTreatmentRoom, false, 0);
1224 
1225 
1227 
1229 
1230  PQuadChamber = new G4PVPlacement(0, G4ThreeVector(0.0, 0.0, 0.0),
1231  "physQuadChamber", LQuadChamber,PQuadChamberWall, false, 0);
1232 
1233  LQuadChamberWall -> SetVisAttributes(red);
1234  LQuadChamber -> SetVisAttributes(white);
1238 
1240 
1242  "PhysFourthTQuad", LFourthTriplet, PQuadChamber, false, 0);
1243 
1246 
1247  logicFourthQuad = new G4LogicalVolume(solidFourthQuad, QuadMaterial, "LogicQuad", 0, 0, 0);
1248 
1250  "PhysFourthQuad",logicFourthQuad, PFourthTriplet, false, 0);
1251 
1252  LFourthTriplet -> SetVisAttributes(yellow);
1253  logicFourthQuad -> SetVisAttributes(green);
1257 
1258  LThirdTriplet = new G4LogicalVolume(SThirdTriplet, internalChamberMaterial,"LogicTTQuad", 0, 0, 0);
1259 
1261  "PhysThirdTQuad",LThirdTriplet,PQuadChamber, false, 0);
1262 
1265 
1266  logicThirdQuad = new G4LogicalVolume(solidThirdQuad, QuadMaterial, "LogicTQuad", 0, 0, 0);
1267 
1269  "PhysThirdQuad",logicThirdQuad, PThirdTriplet, false, 0);
1270 
1271  LThirdTriplet -> SetVisAttributes(yellow);
1272  logicThirdQuad -> SetVisAttributes(green);
1276 
1278 
1280  "PhysSecondTQuad", LSecondTriplet, PQuadChamber, false, 0);
1281 
1284 
1285  logicSecondQuad = new G4LogicalVolume(solidSecondQuad, QuadMaterial, "LogicSQuad", 0, 0, 0);
1286 
1288  "PhysSecondQuad", logicSecondQuad, PSecondTriplet, false, 0);
1289 
1290  LSecondTriplet -> SetVisAttributes(yellow);
1291  logicSecondQuad -> SetVisAttributes(green);
1295 
1297 
1299  "PhysFirstTQuad", LFirstTriplet, PQuadChamber, false, 0);
1300 
1303 
1304  logicFirstQuad = new G4LogicalVolume(solidFirstQuad, QuadMaterial, "LogicQuad", 0, 0, 0);
1305 
1307  "PhysFirstQuad",logicFirstQuad, PFirstTriplet, false, 0);
1308 
1309  LFirstTriplet -> SetVisAttributes(yellow);
1310  logicFirstQuad -> SetVisAttributes(green);
1311 }
1312 
1315 {
1316  // The whole energyselector is mounted inside a
1317  // a vacuum chamber (called 'ExternalChamber')
1318  // inside which a vacuum box is inserted.
1319 
1320  solidExternalChamber = new G4Box("ExternalChamber",
1323  externalChamberZSize/2.0);
1324 
1327  "ExternalChamber");
1328 
1333  "ExternalChamber",
1336  false,
1337  0);
1338 
1339  // Visualisation of the External part
1340  logicExternalChamber -> SetVisAttributes(red);
1341 
1342  // This is a vacuum box inside the steel box
1343  solidInternalChamber = new G4Box("SInternalChamber",
1346  internalChamberZSize/2.0);
1347 
1350  "LInternalChamber");
1351 
1353  G4ThreeVector(0,0,0),
1354  "InternalChamber",
1357  false,
1358  0);
1359  logicInternalChamber -> SetVisAttributes(white);
1360 }
1361 
1364 {
1365  // To rotate the EntrancePipe putting its axis (along X direction) parallel to the beam axis
1366  G4double phi = 90. *deg;
1367  G4RotationMatrix rm;
1368  rm.rotateY(phi);
1369 
1370  solidEntrancePipe = new G4Tubs("EntrancePipe",
1373  EntrancePipeheight/2.,
1376 
1378  PipeMaterial,
1379  "EntrancePipe",
1380  0,
1381  0,
1382  0);
1383 
1388  "EntrancePipe",
1391  false,
1392  0);
1393 
1394  logicEntrancePipe -> SetVisAttributes(red);
1395 
1396 }
1397 
1400 {
1401  // To rotate the ExitPipe putting its axis (along X direction) parallel to the beam axis
1402  G4double phi = 90. *deg;
1403  G4RotationMatrix rm;
1404  rm.rotateY(phi);
1405 
1406  solidEntrancehole = new G4Tubs("Entrancehole",
1412 
1415  "Entrancehole",
1416  0,
1417  0,
1418  0);
1419  //the hole in the energy selector chamber
1424  "Entrancehole",
1427  false,
1428  0);
1429  //the hole in the quadrupoles chamber
1434  "EntranceholeQuad",
1437  false,
1438  0);
1439 
1440  logicEntrancehole -> SetVisAttributes(skyBlue);
1441 
1442 
1443 }
1446 {
1447  // To rotate the collimator putting its axis (along X direction) parallel to the beam axis
1448  G4double phi = 90. *deg;
1449  G4RotationMatrix rm;
1450  rm.rotateY(phi);
1451  //8x82x210 mm are the collimator default dimensions
1452  solidCollimator = new G4Box("collimator",
1453  thicknessCollimator/2.0,
1454  collimatorBoxYSize/2.0,
1455  collimatorBoxZSize/2.0);
1456 
1459  "collimator");
1460 
1465  "collimator",
1468  false,
1469  0);
1470 
1471  logicCollimator -> SetVisAttributes(darkOrange3);
1472 
1473  solidCollimatorHole = new G4Tubs("CollimatorHole",
1479 
1482  "CollimatorHole",
1483  0,
1484  0,
1485  0);
1486 
1491  "CollimatorHole",
1494  false,
1495  0);
1496 
1497  logicCollimatorHole -> SetVisAttributes(skyBlue);
1498 }
1499 
1501 // Magnet number 1
1503 { // The positions of the external and internal partes are given as respect the external chamber.
1504  solidExternalMagnet_1 = new G4Box("SolidExternalMagnet_1",
1507  externalMagnet_1ZSize/2.0);
1508 
1511  "LogicExternalMagnet_1");
1512 
1517  "PhysicExternalMagnet_1",
1520  false,
1521  0);
1526  "PhysicExternalMagnet_1Down",
1529  false,
1530  0);
1531 
1532 
1533  logicExternalMagnet_1 -> SetVisAttributes(gray);
1534 
1535  // The right and left part of the magnet
1536  solidMagnet_1 = new G4Box("SolidMagnet_1",
1537  Magnet_1XSize/2.0,
1538  Magnet_1YSize/2.0,
1539  Magnet_1ZSize/2.0);
1540 
1543  "LogicMagnet_1");
1544 
1548  "PhysicMagnet_1Right",
1549  logicMagnet_1,
1551  false,
1552  0);
1556  "PhysicMagnet_1Left",
1557  logicMagnet_1,
1559  false,
1560  0);
1561 
1562  logicMagnet_1 -> SetVisAttributes(gray);
1563 }
1564 
1566 // Magnet number 2
1568 { // The position of the external part are given as respect the external chamber.
1569 
1570  solidExternalMagnet_2 = new G4Box("SolidExternalMagnet_2",
1573  externalMagnet_2ZSize/2.0);
1574 
1577  "LogicExternalMagnet_2");
1578 
1583  "PhysicExternalMagnet_2",
1586  false,
1587  0);
1588 
1593  "PhysicExternalMagnet_2Down",
1596  false,
1597  0);
1598 
1599 
1600  logicExternalMagnet_2 -> SetVisAttributes(gray);
1601 
1602  // The right and left part of the magnet
1603  solidMagnet_2 = new G4Box("SolidMagnet_2",
1604  Magnet_2XSize/2.0,
1605  Magnet_2YSize/2.0,
1606  Magnet_2ZSize/2.0);
1607 
1610  "LogicMagnet_2");
1611 
1614  (Magnet_2ZPosition)+32*mm),
1615  "PhysicMagnet_2Right",
1616  logicMagnet_2,
1618  false,
1619  0);
1622  (-(Magnet_2ZPosition)+32*mm)),
1623  "PhysicMagnet_2Left",
1624  logicMagnet_2,
1626  false,
1627  0);
1628  logicMagnet_2 -> SetVisAttributes(gray);
1629 }
1630 
1632 // Magnet number 3
1634 { // The position of the external part are given as respect the external chamber.
1635 
1636  solidExternalMagnet_3 = new G4Box("SolidExternalMagnet_3",
1639  externalMagnet_3ZSize/2.0);
1640 
1643  "LogicExternalMagnet_3");
1644 
1649  "PhysicExternalMagnet_3",
1652  false,
1653  0);
1654 
1659  "PhysicExternalMagnet_3Down",
1662  false,
1663  0);
1664 
1665  logicExternalMagnet_3 -> SetVisAttributes(gray);
1666 
1667  // The right and left part of the magnet
1668  solidMagnet_3 = new G4Box("SolidMagnet_3",
1669  Magnet_3XSize/2.0,
1670  Magnet_3YSize/2.0,
1671  Magnet_3ZSize/2.0);
1672 
1675  "LogicMagnet_3");
1676 
1679  (Magnet_3ZPosition+32*mm)),
1680  "PhysicMagnet_3Right",
1681  logicMagnet_3,
1683  false,
1684  0);
1687  (-(Magnet_3ZPosition)+32*mm)),
1688  "PhysicMagnet_3Left",
1689  logicMagnet_3,
1691  false,
1692  0);
1693  logicMagnet_3 -> SetVisAttributes(gray);
1694 
1695 }
1696 
1698 // Magnet number 4
1700 { // The position of the external part are given as respect the external chamber.
1701 
1702  solidExternalMagnet_4 = new G4Box("SolidExternalMagnet_4",
1705  externalMagnet_4ZSize/2.0);
1706 
1709  "LogicExternalMagnet_4");
1710 
1715  "PhysicExternalMagnet_4",
1718  false,
1719  0);
1720 
1725  "PhysicExternalMagnet_4Down",
1728  false,
1729  0);
1730 
1731  logicExternalMagnet_4 -> SetVisAttributes(gray);
1732 
1733  // The right and left part of the magnet
1734  solidMagnet_4 = new G4Box("SolidMagnet_4",
1735  Magnet_4XSize/2.0,
1736  Magnet_4YSize/2.0,
1737  Magnet_4ZSize/2.0);
1738 
1741  "LogicMagnet_4");
1742 
1746  "PhysicMagnet_4Right",
1747  logicMagnet_4,
1749  false,
1750  0);
1754  "PhysicMagnet_4Left",
1755  logicMagnet_4,
1757  false,
1758  0);
1759  logicMagnet_4 -> SetVisAttributes(gray);
1760 }
1761 
1763 // Slit
1765 {
1766  solidExternalSlit = new G4Box("ExternalSlit",
1767  externalSlitXSize/2.0,
1768  externalSlitYSize/2.0,
1769  externalSlitZSize/2.0);
1770 
1773  "ExternalSlit");
1774 
1779  "ExternalSlit",
1782  false,
1783  0);
1784 
1785  logicExternalSlit -> SetVisAttributes(green);
1786  // The hole
1787  solidInternalSlit = new G4Box("InternalSlit",
1788  internalSlitXSize/2.0,
1789  internalSlitYSize/2.0,
1790  internalSlitZSize/2.0);
1791 
1794  "InternalSlit");
1795 
1800  "InternalSlit",
1803  false,
1804  0);
1805 
1806  logicInternalSlit -> SetVisAttributes(skyBlue);
1807 
1808 }
1811 {
1812  // To rotate the collimator putting its axis (along X direction) parallel to the beam axis
1813  G4double phi = 90. *deg;
1814  G4RotationMatrix rm;
1815  rm.rotateY(phi);
1816 
1817  solidFinalCollimator = new G4Box("collimatorFinal",
1821 
1824  "collimatorFinal");
1825 
1830  "collimatorFinal",
1833  false,
1834  0);
1835  logicFinalCollimator -> SetVisAttributes(darkOrange3);
1836 
1837  solidFinalCollimatorHole= new G4Tubs("FinalCollimatorHole",
1843 
1846  "FinalCollimatorHole",
1847  0,
1848  0,
1849  0);
1850 
1855  "FinalCollimatorHole",
1858  false,
1859  0);
1860  logicFinalCollimatorHole -> SetVisAttributes(skyBlue);
1861 }
1864 {
1865  // To rotate the ExitWindow putting its axis (along X direction) parallel to the beam axis
1866  G4double phi = 90. *deg;
1867  G4RotationMatrix rm;
1868  rm.rotateY(phi);
1869 
1870  solidExitWindow = new G4Tubs("ExitWindow",
1876 
1879  "ExitWindow",
1880  0,
1881  0,
1882  0);
1883 
1888  "ExitWindow",
1891  false,
1892  0);
1893 
1894  logicExitWindow -> SetVisAttributes(skyBlue);
1895 
1896 }
1897 
1900 {
1901  // To rotate the ExitPipe putting its axis (along X direction) parallel to the beam axis
1902  G4double phi = 90. *deg;
1903  G4RotationMatrix rm;
1904  rm.rotateY(phi);
1905 
1906  solidExitPipe = new G4Tubs("ExitPipe",
1909  ExitPipeheight/2.,
1912 
1914  PipeMaterial,
1915  "ExitPipe",
1916  0,
1917  0,
1918  0);
1919 
1924  "ExitPipe",
1925  logicExitPipe,
1927  false,
1928  0);
1929 
1930  logicExitPipe -> SetVisAttributes(red);
1931 
1932 }
1933 
1936 {
1937  // To rotate the ExitPipe putting its axis (along X direction) parallel to the beam axis
1938  G4double phi = 90. *deg;
1939  G4RotationMatrix rm;
1940  rm.rotateY(phi);
1941 
1942  solidExithole = new G4Tubs("Exithole",
1945  ExitholeThickness/2.,
1948 
1951  "Exithole",
1952  0,
1953  0,
1954  0);
1955 
1960  "Exithole",
1961  logicExithole,
1963  false,
1964  0);
1965 
1966  logicExithole -> SetVisAttributes(skyBlue);
1967 
1968 }
1971 // Disable via external macro command the Energy Selector System
1973 {
1983  if(physicCollimator) {delete physicCollimator; delete logicCollimator; delete solidCollimator; }
1988  if(physicExithole){delete physicExithole; delete logicExithole; delete solidExithole;}
1990  if(physicExitPipe){delete physicExitPipe; delete logicExitPipe; delete solidExitPipe;}
1994  if(pFieldMgr) {delete pFieldMgr;}
1995 
1996 
1997 
1998  G4cout << "****************************************************" << G4endl;
1999  G4cout << "************ The ESS has been disabled *************" << G4endl;
2000  G4cout << "****************************************************" << G4endl;
2002  #ifdef G4VIS_USE
2003  G4UImanager::GetUIpointer() -> ApplyCommand("/vis/viewer/flush");
2004  #endif
2005 }
2006 // Change via external macro command the diameter of the first collimator
2008 {
2009  G4double radius = valueR;
2010  solidCollimatorHole -> SetOuterRadius(radius);
2012  #ifdef G4VIS_USE
2013  G4UImanager::GetUIpointer() -> ApplyCommand("/vis/viewer/flush");
2014  #endif
2015  G4cout << "The first collimator aperture has been modified to "<< valueR/mm <<"mm in diameter" << G4endl;
2016 }
2018 // Change via external macro command the thickness of the first collimator
2020 {
2021  G4double thickness = valueC/2;
2022  solidCollimator -> SetXHalfLength(thickness);
2023  solidCollimatorHole -> SetZHalfLength(thickness);
2025  #ifdef G4VIS_USE
2026  G4UImanager::GetUIpointer() -> ApplyCommand("/vis/viewer/flush");
2027  #endif
2028  G4cout << "The first collimator thickness has been modified to "<< valueC/mm <<" mm in thickness" << G4endl;
2029 }
2030 
2031 // Change via external macro command the Z position of the first collimator hole
2033 {
2034  physicCollimatorHole -> SetTranslation(G4ThreeVector(0., 0., valueQ));
2036  #ifdef G4VIS_USE
2037  G4UImanager::GetUIpointer() -> ApplyCommand("/vis/viewer/flush");
2038  #endif
2039  G4cout << "The first collimator has been translated to "<< valueQ/mm <<"mm (along the z axis)" << G4endl;
2040 }
2041 
2042 // Change via external macro command the diameter of the second collimator
2044 {
2045  G4double radius = value;
2046  solidFinalCollimatorHole -> SetOuterRadius(radius);
2048  #ifdef G4VIS_USE
2049  G4UImanager::GetUIpointer() -> ApplyCommand("/vis/viewer/flush");
2050  #endif
2051  G4cout << "The second collimator aperture has been modified to "<< value/mm <<"mm in diameter" << G4endl;
2052 }
2053 
2055 // Change via external macro command the thickness of the second collimator
2057 {
2058  G4double thickness = value/2;
2059  solidFinalCollimator -> SetXHalfLength(thickness);
2060  solidFinalCollimatorHole -> SetZHalfLength(thickness);
2062  #ifdef G4VIS_USE
2063  G4UImanager::GetUIpointer() -> ApplyCommand("/vis/viewer/flush");
2064  #endif
2065  G4cout << "The second collimator thickness has been modified to "<< value/mm <<" mm in thickness" << G4endl;
2066 }
2067 
2068 // Change via external macro command the Z position of the second collimator hole
2070 {
2071  physicFinalCollimatorHole -> SetTranslation(G4ThreeVector(0., 0., value));
2073  #ifdef G4VIS_USE
2074  G4UImanager::GetUIpointer() -> ApplyCommand("/vis/viewer/flush");
2075  #endif
2076  G4cout << "The second collimator has been translated to "<< value/mm <<"mm (along the z axis)" << G4endl;
2077 }
2078 // THE SLIT MESSENGERS
2080 // Change the thickness of the Slit
2082 {
2083  if (value >(10.0*mm)) {
2084  G4cout <<"***************************************"<< G4endl;
2085  G4cout <<"******This is a warning messenger******"<< G4endl;
2086  G4cout <<"***************************************"<< G4endl;
2087  G4cout <<"The maximum value of the thickness of the slit is 10 mm, your value is >10 mm." << G4endl;
2088  G4cout <<"The default thickness value is used, it is: " << ((solidExternalSlit -> GetXHalfLength())*2.)/mm
2089  << G4endl;
2090  G4cout <<"***************************************"<< G4endl;
2091 
2092  }
2093  else {
2094  G4double dimension = value/2;
2095  solidExternalSlit -> SetXHalfLength(dimension);
2096  solidInternalSlit -> SetXHalfLength(dimension);
2098  #ifdef G4VIS_USE
2099  G4UImanager::GetUIpointer() -> ApplyCommand("/vis/viewer/flush");
2100  #endif
2101  G4cout <<"The thickness of the slit is:" << ((solidExternalSlit -> GetXHalfLength())*2.)/mm
2102  << G4endl;
2103  }
2104 }
2106 // Change the hole size (in Y direction) of the Slit
2108 {
2109  G4double hole = value/2;
2110  solidInternalSlit -> SetYHalfLength(hole);
2112  #ifdef G4VIS_USE
2113  G4UImanager::GetUIpointer() -> ApplyCommand("/vis/viewer/flush");
2114  #endif
2115  G4cout << "The hole of the Slit has been changed in the Y direction to "<< value/mm <<" mm" <<G4endl;
2116 }
2117 
2119 // Change the hole size (in Z direction) of the Slit
2121 {
2122  G4double hole = value/2;
2123  solidInternalSlit -> SetZHalfLength(hole);
2125  #ifdef G4VIS_USE
2126  G4UImanager::GetUIpointer() -> ApplyCommand("/vis/viewer/flush");
2127  #endif
2128  G4cout << "The hole of the Slit has been changed in the Z direction to "<< value/mm <<" mm" <<G4endl;
2129 }
2131 // Change the Z position of the hole of the Slit
2133 {
2134  physicInternalSlit -> SetTranslation(G4ThreeVector(0., 0., value));
2136  #ifdef G4VIS_USE
2137  G4UImanager::GetUIpointer() -> ApplyCommand("/vis/viewer/flush");
2138  #endif
2139  G4cout << "The hole of the slit has been translated to "<< value/mm <<" mm (along the Z axis)" <<G4endl;
2140 }
2141 
2142 // QUADRUPOLES
2143 
2144 // Disable via external macro command all quadrupoles
2146 {
2147  if(physicFirstQuad)
2148  {delete solidFirstQuad; delete logicFirstQuad; delete physicFirstQuad;delete SFirstTriplet; delete LFirstTriplet; delete PFirstTriplet;}
2149  if(physicSecondQuad)
2150  {delete solidSecondQuad; delete logicSecondQuad; delete physicSecondQuad;delete SSecondTriplet; delete LSecondTriplet; delete PSecondTriplet;}
2151  if(physicThirdQuad)
2152 {delete solidThirdQuad; delete logicThirdQuad; delete physicThirdQuad;delete SThirdTriplet; delete LThirdTriplet; delete PThirdTriplet;}
2153  if(physicFourthQuad)
2154  {delete solidFourthQuad; delete logicFourthQuad; delete physicFourthQuad;delete SFourthTriplet; delete LFourthTriplet; delete PFourthTriplet;}
2159 
2160 
2161  G4cout << "******************************************************************" << G4endl;
2162  G4cout << "************ The Quadrupoles system has been disabled *************" << G4endl;
2163  G4cout << "******************************************************************" << G4endl;
2165  #ifdef G4VIS_USE
2166  G4UImanager::GetUIpointer() -> ApplyCommand("/vis/viewer/flush");
2167  #endif
2168 }
2169 
HadrontherapyDetectorROGeometry * RO
G4Material * externalMagnet_3Material
static const double cm
Definition: G4SIunits.hh:106
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
const G4double pi
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)
static const double deg
Definition: G4SIunits.hh:133
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:108
G4VPhysicalVolume * physicVirtualOverBottom
HepGeom::Transform3D G4Transform3D
static const double perCent
Definition: G4SIunits.hh:296
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:260
G4LogicalVolume * LFirstTriplet
#define pascal
Definition: G4SIunits.hh:213
G4MagInt_Driver * pIntgrDriver
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:79
G4VPhysicalVolume * physicVirtualWindow
G4FieldManager * pFieldMgrQuadThird
G4MagIntegratorStepper * fstepperQuadFirst
G4LogicalVolume * logicVirtualWindow
G4LogicalVolume * logicSecondQuad
G4Material * internalChamberMaterial
G4MagIntegratorStepper * fstepperQuadFourth
G4VPhysicalVolume * physicMagnet_3Left
void SetSlitHoleDimensionY(G4double value)
G4VPhysicalVolume * PSecondTriplet
static const double g
Definition: G4SIunits.hh:162
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
G4LogicalVolume * logicCollimator
G4VPhysicalVolume * physicInternalChamber
static const double mole
Definition: G4SIunits.hh:265
#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:102
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