Geant4  10.01
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=60.*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;
787 
788  //....oooOO0OOooo..........ENERGY SELECTOR SYSTEM FIELD..........oooOO0OOooo....
790  PurgMagField = new HadrontherapyMagneticField3D("field/Mappa32shift25Dip.TABLE", xOffset);
791  pFieldMgr =new G4FieldManager();
792  pFieldMgr -> SetDetectorField(PurgMagField);
793  G4cout << "DeltaStep "<< pFieldMgr -> GetDeltaOneStep()/mm <<"mm" <<endl;
794  pFieldMgr -> CreateChordFinder(PurgMagField);
796  fstepper = new G4ClassicalRK4(fEquation,nvar);
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/MappaQuad80NoF90deg.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/MappaQuadNoF.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/MappaQuadNoF.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/MappaQuad80NoF90deg.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/ElectricField-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  G4EqMagElectricField *fLocalEquation = new G4EqMagElectricField(ElectricField);
883  G4MagIntegratorStepper* fLocalStepper = new G4ClassicalRK4(fLocalEquation, nvar);
884  G4MagInt_Driver *pIntgrDriver_E = new G4MagInt_Driver(0.02*mm, fLocalStepper, fLocalStepper -> GetNumberOfVariables() );
885  G4ChordFinder *fLocalChordFinder = new G4ChordFinder(pIntgrDriver_E);
886  pEFieldmanager -> SetDetectorField(ElectricField);
887  pEFieldmanager -> SetChordFinder(fLocalChordFinder);
888  //G4double deltainter=0.0001*mm;
889  //G4double missdist=0.1*mm;
890  //pEFieldmanager->SetDeltaIntersection(deltainter);
891  //fLocalChordFinder->SetDeltaChord(missdist);
892  pEFieldmanager->SetMinimumEpsilonStep(minEps);
893  pEFieldmanager->SetMaximumEpsilonStep(maxEps);
894  pEFieldmanager->SetDeltaOneStep( 0.5e-3 * mm );
895  //pEFieldmanager -> SetFieldChangesEnergy(true);
896  logicVirtualMag -> SetFieldManager(pEFieldmanager, allLocal);}
897  //....oooOO0OOooo....................oooOO0OOooo....
898  G4cout<<" //....oooOO0OOooo.......... FIELDS HAVE BEEN IMPLEMENTED..........oooOO0OOooo...."<<G4endl;
899  return;
900 }
901 
904 {
906 
907 G4double InnerRadiusFC=25*mm;
908 G4double OuterRadiusFC=45*mm;
909 G4double MassRingThickness=5*mm;
910 G4double GuardRingThickness=180*mm;
911 G4double FaradayCupBottomThickness=120*mm;
912 G4double CupThickness=10*cm;
913 G4double KaptonEntranceWindowThickness=25*um;
914 
916 
917 G4double VirtualWindowThickness=1.*um ;
918 G4double VirtualMiddleThickness= 1.*um ;
919 G4double VirtualBottomThickness= 1. *um ;
920 G4double VirtualOverBottomThickness=1. *um ;
921 G4double VirtualLateralLength=FaradayCupBottomThickness+CupThickness+VirtualBottomThickness;
922 
923 
925 
926 G4double virtualMagPosX=31*cm;
927 G4double FC_XOffset=20*cm;
928 G4double KaptonEntranceWindowPosX=-virtualMagPosX+KaptonEntranceWindowThickness/2+FC_XOffset;
929 G4double MassRingPosX=KaptonEntranceWindowPosX+KaptonEntranceWindowThickness/2+MassRingThickness/2;
930 G4double VirtualWindowPosX=MassRingPosX+MassRingThickness/2+VirtualWindowThickness/2;
931 G4double GuardRingPosX=MassRingPosX+MassRingThickness/2+GuardRingThickness/2+2*mm;
932 G4double VirtualMiddlePosX=GuardRingPosX+GuardRingThickness/2+VirtualMiddleThickness/2;
933 G4double FaradayCupBottomPosX=GuardRingPosX+GuardRingThickness/2+FaradayCupBottomThickness/2+1*cm;
934 G4double VirtualBottomPosX=FaradayCupBottomPosX+FaradayCupBottomThickness/2+VirtualBottomThickness/2;
935 G4double CupPosX=VirtualBottomPosX+VirtualBottomThickness/2+CupThickness/2;
936 G4double VirtualOverBottomPosX=CupPosX+CupThickness/2+VirtualOverBottomThickness/2;
937 G4double VirtualLateralPosX=GuardRingPosX+GuardRingThickness/2+1*cm+(FaradayCupBottomThickness+CupThickness+VirtualBottomThickness)/2;
938  G4double phi = 90. *deg;
939  G4RotationMatrix rm;
940  rm.rotateY(phi);
941 
942  virtualMag= new G4Box("virtualMag", 31.*cm, 6*cm, 6*cm );
943 
946  "LVirtualMag",
947  0,0,0);
949  G4ThreeVector(virtualMagPosX, 0.*cm, 0*mm),
950  "PVirtualMag",
953  true, 0);
954 
955 
956  logicVirtualMag -> SetVisAttributes(blue);
957 
959 
961  Rot->rotateX(14*deg);
962  G4ThreeVector trans(0.,22.5*mm,-15*mm);
963  Cylinder= new G4Tubs("cylinder",20*mm,22.5*mm,90*mm,0.,2*pi);
964  Box= new G4Box("Box",22.5*mm,22.5*mm,90*mm);
965 
966  G4SubtractionSolid* BeveledCylinder=new G4SubtractionSolid("Cylinder-Box",
967  Cylinder,
968  Box,
969  Rot,
970  trans);
971 
972  logicBeveledCylinder= new G4LogicalVolume (BeveledCylinder,
974  "LBeveledCylinder",
975  0,0,0);
976 
978  "physicBeveledCylinder",
981  true,0);
982 
984 
985 
987 
988  KaptonEntranceWindow= new G4Tubs("KaptonEntranceWindow",
989  0,
990  OuterRadiusFC,
991  KaptonEntranceWindowThickness/2,
992  0*deg,360*deg);
993 
995  // internalChamberMaterial, for track control
997  "LKaptonEntranceWindow",
998  0,0,0);
999 
1000  physicKaptonEntranceWindow=new G4PVPlacement(G4Transform3D(rm,G4ThreeVector(KaptonEntranceWindowPosX,0,0)),
1001  "PhysicEntranceWindow",
1003  physicVirtualMag,true,0);
1004  logicKaptonEntranceWindow -> SetVisAttributes(gray);
1005 
1007 
1008  MassRing=new G4Tubs ("MassRing",
1009  InnerRadiusFC,
1010  OuterRadiusFC,
1011  MassRingThickness/2,
1012  0*deg,360*deg);
1013 
1016  "logicMassRing",
1017  0,0,0);
1018 
1019  physicMassRing=new G4PVPlacement( G4Transform3D(rm,G4ThreeVector(MassRingPosX,0,0)),
1020 
1021  "PhysicMassRing",logicMassRing,
1022 
1024  true,0);
1025  logicMassRing -> SetVisAttributes(green);
1026 
1027 
1028 
1029 
1031 
1032 
1033  VirtualWindow=new G4Tubs("VirtualWindow",
1034  0,
1035  OuterRadiusFC,
1036  VirtualWindowThickness/2,
1037  0*deg,360*deg);
1038 
1041  "logicVirtualWindow",
1042  0,0,0);
1043 
1044  physicVirtualWindow=new G4PVPlacement( G4Transform3D(rm,G4ThreeVector(VirtualWindowPosX,0,0)),
1045 
1046  "PhysicVirtualWindow",
1049  true,0);
1051 
1053 
1054  GuardRing=new G4Tubs ("GuardRing",
1055  InnerRadiusFC,
1056  OuterRadiusFC,
1057  GuardRingThickness/2,
1058  0*deg,360*deg);
1059 
1062  "logicGuardRing",
1063  0,0,0);
1064 
1065  physicGuardRing=new G4PVPlacement(G4Transform3D(rm,G4ThreeVector(GuardRingPosX,0,0)),
1066 
1067  "PhysicGuardRing", logicGuardRing,
1068 
1070  true,0);
1071  logicGuardRing -> SetVisAttributes(red);
1072 
1073 
1075 
1076 
1077  VirtualMiddle=new G4Tubs ("VirtualMiddle",
1078  0,
1079  OuterRadiusFC,
1080  VirtualMiddleThickness/2,
1081  0*deg,360*deg);
1082 
1085  "logicVirtualMiddle",
1086  0,0,0);
1087 
1088  physicVirtualMiddle=new G4PVPlacement(G4Transform3D(rm,G4ThreeVector(VirtualMiddlePosX,0,0)),
1089 
1090  "PhysicVirtualMiddle", logicVirtualMiddle,
1091 
1093  true,0);
1094 
1096 
1098 
1099  FaradayCupBottom=new G4Tubs ("FaradayCupBottom",
1100  InnerRadiusFC,
1101  OuterRadiusFC,
1102  FaradayCupBottomThickness/2,
1103  0*deg,360*deg);
1104 
1107  "logicFaradayCupBottom",
1108  0,0,0);
1109 
1110  physicFaradayCupBottom=new G4PVPlacement(G4Transform3D(rm,G4ThreeVector(FaradayCupBottomPosX,0,0)),
1111  "PhysicFaradayCupBottom",logicFaradayCupBottom,
1113  true,0);
1114  logicFaradayCupBottom -> SetVisAttributes(yellow);
1115 
1116 
1118 
1119  VirtualBottom=new G4Tubs ("VirtualBottom",
1120  0,
1121  OuterRadiusFC,
1122  VirtualBottomThickness/2,
1123  0*deg,360*deg);
1124 
1127  "logicVirtualBottom",
1128  0,0,0);
1129 
1130  physicVirtualBottom=new G4PVPlacement(G4Transform3D(rm,G4ThreeVector(VirtualBottomPosX,0,0)),
1131  "PhysicVirtualBottom",
1134  true,0);
1135 
1137 
1139 
1140  Cup=new G4Tubs ("Cup",
1141  0,
1142  OuterRadiusFC,
1143  CupThickness/2,
1144  0*deg,360*deg);
1145 
1147  CupMaterial,
1148  "logicCup",
1149  0,0,0);
1150 
1151  physicCup=new G4PVPlacement(G4Transform3D(rm,G4ThreeVector(CupPosX,0,0)),
1152  "PhysicCup", logicCup,
1153 
1155  true,0);
1156 
1157  logicCup -> SetVisAttributes(darkGreen);
1158 
1159 
1161 
1162  VirtualOverBottom=new G4Tubs ("VirtualOverBottom",
1163  0,
1164  OuterRadiusFC,
1165  VirtualOverBottomThickness/2,
1166  0*deg,360*deg);
1167 
1170  "logicVirtualOverBottom",
1171  0,0,0);
1172 
1173  physicVirtualOverBottom=new G4PVPlacement(G4Transform3D(rm,G4ThreeVector(VirtualOverBottomPosX,0,0)),
1174  "PhysicVirtualOverBottom",logicVirtualOverBottom,
1175 
1177  true,0);
1179 
1180 
1182 
1183 
1184  VirtualLateral=new G4Tubs ("VirtualLateral",
1185  OuterRadiusFC,
1186  OuterRadiusFC+1*um,// the VirtualLateralThickness is 1*um
1187  VirtualLateralLength/2,
1188  0*deg,360*deg);
1189 
1192  "logicVirtualLateral",
1193  0,0,0);
1194 
1195  physicVirtualLateral=new G4PVPlacement(G4Transform3D(rm,G4ThreeVector(VirtualLateralPosX,0,0)),
1196  "VirtualLateral",logicVirtualLateral,
1197 
1199  true,0);
1200 
1201 
1202 
1204  }
1205 
1208 {
1209  // To rotate the quadrupoles putting their axis (along X direction) parallel to the beam axis
1210  G4double phi = 90. *deg;
1211  G4RotationMatrix rm;
1212  rm.rotateY(phi);
1213 
1215 
1217 
1219  "physQuadChamberWall", LQuadChamberWall,physicTreatmentRoom, false, 0);
1220 
1221 
1223 
1225 
1226  PQuadChamber = new G4PVPlacement(0, G4ThreeVector(0.0, 0.0, 0.0),
1227  "physQuadChamber", LQuadChamber,PQuadChamberWall, false, 0);
1228 
1229  LQuadChamberWall -> SetVisAttributes(red);
1230  LQuadChamber -> SetVisAttributes(white);
1234 
1236 
1238  "PhysFourthTQuad", LFourthTriplet, PQuadChamber, false, 0);
1239 
1242 
1243  logicFourthQuad = new G4LogicalVolume(solidFourthQuad, QuadMaterial, "LogicQuad", 0, 0, 0);
1244 
1246  "PhysFourthQuad",logicFourthQuad, PFourthTriplet, false, 0);
1247 
1248  LFourthTriplet -> SetVisAttributes(yellow);
1249  logicFourthQuad -> SetVisAttributes(green);
1253 
1254  LThirdTriplet = new G4LogicalVolume(SThirdTriplet, internalChamberMaterial,"LogicTTQuad", 0, 0, 0);
1255 
1257  "PhysThirdTQuad",LThirdTriplet,PQuadChamber, false, 0);
1258 
1261 
1262  logicThirdQuad = new G4LogicalVolume(solidThirdQuad, QuadMaterial, "LogicTQuad", 0, 0, 0);
1263 
1265  "PhysThirdQuad",logicThirdQuad, PThirdTriplet, false, 0);
1266 
1267  LThirdTriplet -> SetVisAttributes(yellow);
1268  logicThirdQuad -> SetVisAttributes(green);
1272 
1274 
1276  "PhysSecondTQuad", LSecondTriplet, PQuadChamber, false, 0);
1277 
1280 
1281  logicSecondQuad = new G4LogicalVolume(solidSecondQuad, QuadMaterial, "LogicSQuad", 0, 0, 0);
1282 
1284  "PhysSecondQuad", logicSecondQuad, PSecondTriplet, false, 0);
1285 
1286  LSecondTriplet -> SetVisAttributes(yellow);
1287  logicSecondQuad -> SetVisAttributes(green);
1291 
1293 
1295  "PhysFirstTQuad", LFirstTriplet, PQuadChamber, false, 0);
1296 
1299 
1300  logicFirstQuad = new G4LogicalVolume(solidFirstQuad, QuadMaterial, "LogicQuad", 0, 0, 0);
1301 
1303  "PhysFirstQuad",logicFirstQuad, PFirstTriplet, false, 0);
1304 
1305  LFirstTriplet -> SetVisAttributes(yellow);
1306  logicFirstQuad -> SetVisAttributes(green);
1307 }
1308 
1311 {
1312  // The whole energyselector is mounted inside a
1313  // a vacuum chamber (called 'ExternalChamber')
1314  // inside which a vacuum box is inserted.
1315 
1316  solidExternalChamber = new G4Box("ExternalChamber",
1319  externalChamberZSize/2.0);
1320 
1323  "ExternalChamber");
1324 
1329  "ExternalChamber",
1332  false,
1333  0);
1334 
1335  // Visualisation of the External part
1336  logicExternalChamber -> SetVisAttributes(red);
1337 
1338  // This is a vacuum box inside the steel box
1339  solidInternalChamber = new G4Box("SInternalChamber",
1342  internalChamberZSize/2.0);
1343 
1346  "LInternalChamber");
1347 
1349  G4ThreeVector(0,0,0),
1350  "InternalChamber",
1353  false,
1354  0);
1355  logicInternalChamber -> SetVisAttributes(white);
1356 }
1357 
1360 {
1361  // To rotate the EntrancePipe putting its axis (along X direction) parallel to the beam axis
1362  G4double phi = 90. *deg;
1363  G4RotationMatrix rm;
1364  rm.rotateY(phi);
1365 
1366  solidEntrancePipe = new G4Tubs("EntrancePipe",
1369  EntrancePipeheight/2.,
1372 
1374  PipeMaterial,
1375  "EntrancePipe",
1376  0,
1377  0,
1378  0);
1379 
1384  "EntrancePipe",
1387  false,
1388  0);
1389 
1390  logicEntrancePipe -> SetVisAttributes(red);
1391 
1392 }
1393 
1396 {
1397  // To rotate the ExitPipe putting its axis (along X direction) parallel to the beam axis
1398  G4double phi = 90. *deg;
1399  G4RotationMatrix rm;
1400  rm.rotateY(phi);
1401 
1402  solidEntrancehole = new G4Tubs("Entrancehole",
1408 
1411  "Entrancehole",
1412  0,
1413  0,
1414  0);
1415  //the hole in the energy selector chamber
1420  "Entrancehole",
1423  false,
1424  0);
1425  //the hole in the quadrupoles chamber
1430  "EntranceholeQuad",
1433  false,
1434  0);
1435 
1436  logicEntrancehole -> SetVisAttributes(skyBlue);
1437 
1438 
1439 }
1442 {
1443  // To rotate the collimator putting its axis (along X direction) parallel to the beam axis
1444  G4double phi = 90. *deg;
1445  G4RotationMatrix rm;
1446  rm.rotateY(phi);
1447  //8x82x210 mm are the collimator default dimensions
1448  solidCollimator = new G4Box("collimator",
1449  thicknessCollimator/2.0,
1450  collimatorBoxYSize/2.0,
1451  collimatorBoxZSize/2.0);
1452 
1455  "collimator");
1456 
1461  "collimator",
1464  false,
1465  0);
1466 
1467  logicCollimator -> SetVisAttributes(darkOrange3);
1468 
1469  solidCollimatorHole = new G4Tubs("CollimatorHole",
1475 
1478  "CollimatorHole",
1479  0,
1480  0,
1481  0);
1482 
1487  "CollimatorHole",
1490  false,
1491  0);
1492 
1493  logicCollimatorHole -> SetVisAttributes(skyBlue);
1494 }
1495 
1497 // Magnet number 1
1499 { // The positions of the external and internal partes are given as respect the external chamber.
1500  solidExternalMagnet_1 = new G4Box("SolidExternalMagnet_1",
1503  externalMagnet_1ZSize/2.0);
1504 
1507  "LogicExternalMagnet_1");
1508 
1513  "PhysicExternalMagnet_1",
1516  false,
1517  0);
1522  "PhysicExternalMagnet_1Down",
1525  false,
1526  0);
1527 
1528 
1529  logicExternalMagnet_1 -> SetVisAttributes(gray);
1530 
1531  // The right and left part of the magnet
1532  solidMagnet_1 = new G4Box("SolidMagnet_1",
1533  Magnet_1XSize/2.0,
1534  Magnet_1YSize/2.0,
1535  Magnet_1ZSize/2.0);
1536 
1539  "LogicMagnet_1");
1540 
1544  "PhysicMagnet_1Right",
1545  logicMagnet_1,
1547  false,
1548  0);
1552  "PhysicMagnet_1Left",
1553  logicMagnet_1,
1555  false,
1556  0);
1557 
1558  logicMagnet_1 -> SetVisAttributes(gray);
1559 }
1560 
1562 // Magnet number 2
1564 { // The position of the external part are given as respect the external chamber.
1565 
1566  solidExternalMagnet_2 = new G4Box("SolidExternalMagnet_2",
1569  externalMagnet_2ZSize/2.0);
1570 
1573  "LogicExternalMagnet_2");
1574 
1579  "PhysicExternalMagnet_2",
1582  false,
1583  0);
1584 
1589  "PhysicExternalMagnet_2Down",
1592  false,
1593  0);
1594 
1595 
1596  logicExternalMagnet_2 -> SetVisAttributes(gray);
1597 
1598  // The right and left part of the magnet
1599  solidMagnet_2 = new G4Box("SolidMagnet_2",
1600  Magnet_2XSize/2.0,
1601  Magnet_2YSize/2.0,
1602  Magnet_2ZSize/2.0);
1603 
1606  "LogicMagnet_2");
1607 
1610  (Magnet_2ZPosition)+32*mm),
1611  "PhysicMagnet_2Right",
1612  logicMagnet_2,
1614  false,
1615  0);
1618  (-(Magnet_2ZPosition)+32*mm)),
1619  "PhysicMagnet_2Left",
1620  logicMagnet_2,
1622  false,
1623  0);
1624  logicMagnet_2 -> SetVisAttributes(gray);
1625 }
1626 
1628 // Magnet number 3
1630 { // The position of the external part are given as respect the external chamber.
1631 
1632  solidExternalMagnet_3 = new G4Box("SolidExternalMagnet_3",
1635  externalMagnet_3ZSize/2.0);
1636 
1639  "LogicExternalMagnet_3");
1640 
1645  "PhysicExternalMagnet_3",
1648  false,
1649  0);
1650 
1655  "PhysicExternalMagnet_3Down",
1658  false,
1659  0);
1660 
1661  logicExternalMagnet_3 -> SetVisAttributes(gray);
1662 
1663  // The right and left part of the magnet
1664  solidMagnet_3 = new G4Box("SolidMagnet_3",
1665  Magnet_3XSize/2.0,
1666  Magnet_3YSize/2.0,
1667  Magnet_3ZSize/2.0);
1668 
1671  "LogicMagnet_3");
1672 
1675  (Magnet_3ZPosition+32*mm)),
1676  "PhysicMagnet_3Right",
1677  logicMagnet_3,
1679  false,
1680  0);
1683  (-(Magnet_3ZPosition)+32*mm)),
1684  "PhysicMagnet_3Left",
1685  logicMagnet_3,
1687  false,
1688  0);
1689  logicMagnet_3 -> SetVisAttributes(gray);
1690 
1691 }
1692 
1694 // Magnet number 4
1696 { // The position of the external part are given as respect the external chamber.
1697 
1698  solidExternalMagnet_4 = new G4Box("SolidExternalMagnet_4",
1701  externalMagnet_4ZSize/2.0);
1702 
1705  "LogicExternalMagnet_4");
1706 
1711  "PhysicExternalMagnet_4",
1714  false,
1715  0);
1716 
1721  "PhysicExternalMagnet_4Down",
1724  false,
1725  0);
1726 
1727  logicExternalMagnet_4 -> SetVisAttributes(gray);
1728 
1729  // The right and left part of the magnet
1730  solidMagnet_4 = new G4Box("SolidMagnet_4",
1731  Magnet_4XSize/2.0,
1732  Magnet_4YSize/2.0,
1733  Magnet_4ZSize/2.0);
1734 
1737  "LogicMagnet_4");
1738 
1742  "PhysicMagnet_4Right",
1743  logicMagnet_4,
1745  false,
1746  0);
1750  "PhysicMagnet_4Left",
1751  logicMagnet_4,
1753  false,
1754  0);
1755  logicMagnet_4 -> SetVisAttributes(gray);
1756 }
1757 
1759 // Slit
1761 {
1762  solidExternalSlit = new G4Box("ExternalSlit",
1763  externalSlitXSize/2.0,
1764  externalSlitYSize/2.0,
1765  externalSlitZSize/2.0);
1766 
1769  "ExternalSlit");
1770 
1775  "ExternalSlit",
1778  false,
1779  0);
1780 
1781  logicExternalSlit -> SetVisAttributes(green);
1782  // The hole
1783  solidInternalSlit = new G4Box("InternalSlit",
1784  internalSlitXSize/2.0,
1785  internalSlitYSize/2.0,
1786  internalSlitZSize/2.0);
1787 
1790  "InternalSlit");
1791 
1796  "InternalSlit",
1799  false,
1800  0);
1801 
1802  logicInternalSlit -> SetVisAttributes(skyBlue);
1803 
1804 }
1807 {
1808  // To rotate the collimator putting its axis (along X direction) parallel to the beam axis
1809  G4double phi = 90. *deg;
1810  G4RotationMatrix rm;
1811  rm.rotateY(phi);
1812 
1813  solidFinalCollimator = new G4Box("collimatorFinal",
1817 
1820  "collimatorFinal");
1821 
1826  "collimatorFinal",
1829  false,
1830  0);
1831  logicFinalCollimator -> SetVisAttributes(darkOrange3);
1832 
1833  solidFinalCollimatorHole= new G4Tubs("FinalCollimatorHole",
1839 
1842  "FinalCollimatorHole",
1843  0,
1844  0,
1845  0);
1846 
1851  "FinalCollimatorHole",
1854  false,
1855  0);
1856  logicFinalCollimatorHole -> SetVisAttributes(skyBlue);
1857 }
1860 {
1861  // To rotate the ExitWindow putting its axis (along X direction) parallel to the beam axis
1862  G4double phi = 90. *deg;
1863  G4RotationMatrix rm;
1864  rm.rotateY(phi);
1865 
1866  solidExitWindow = new G4Tubs("ExitWindow",
1872 
1875  "ExitWindow",
1876  0,
1877  0,
1878  0);
1879 
1884  "ExitWindow",
1887  false,
1888  0);
1889 
1890  logicExitWindow -> SetVisAttributes(skyBlue);
1891 
1892 }
1893 
1896 {
1897  // To rotate the ExitPipe putting its axis (along X direction) parallel to the beam axis
1898  G4double phi = 90. *deg;
1899  G4RotationMatrix rm;
1900  rm.rotateY(phi);
1901 
1902  solidExitPipe = new G4Tubs("ExitPipe",
1905  ExitPipeheight/2.,
1908 
1910  PipeMaterial,
1911  "ExitPipe",
1912  0,
1913  0,
1914  0);
1915 
1920  "ExitPipe",
1921  logicExitPipe,
1923  false,
1924  0);
1925 
1926  logicExitPipe -> SetVisAttributes(red);
1927 
1928 }
1929 
1932 {
1933  // To rotate the ExitPipe putting its axis (along X direction) parallel to the beam axis
1934  G4double phi = 90. *deg;
1935  G4RotationMatrix rm;
1936  rm.rotateY(phi);
1937 
1938  solidExithole = new G4Tubs("Exithole",
1941  ExitholeThickness/2.,
1944 
1947  "Exithole",
1948  0,
1949  0,
1950  0);
1951 
1956  "Exithole",
1957  logicExithole,
1959  false,
1960  0);
1961 
1962  logicExithole -> SetVisAttributes(skyBlue);
1963 
1964 }
1967 // Disable via external macro command the Energy Selector System
1969 {
1979  if(physicCollimator) {delete physicCollimator; delete logicCollimator; delete solidCollimator; }
1984  if(physicExithole){delete physicExithole; delete logicExithole; delete solidExithole;}
1986  if(physicExitPipe){delete physicExitPipe; delete logicExitPipe; delete solidExitPipe;}
1990  if(pFieldMgr) {delete pFieldMgr;}
1991 
1992 
1993 
1994  G4cout << "****************************************************" << G4endl;
1995  G4cout << "************ The ESS has been disabled *************" << G4endl;
1996  G4cout << "****************************************************" << G4endl;
1998  #ifdef G4VIS_USE
1999  G4UImanager::GetUIpointer() -> ApplyCommand("/vis/viewer/flush");
2000  #endif
2001 }
2002 // Change via external macro command the diameter of the first collimator
2004 {
2005  G4double radius = valueR;
2006  solidCollimatorHole -> SetOuterRadius(radius);
2008  #ifdef G4VIS_USE
2009  G4UImanager::GetUIpointer() -> ApplyCommand("/vis/viewer/flush");
2010  #endif
2011  G4cout << "The first collimator aperture has been modified to "<< valueR/mm <<"mm in diameter" << G4endl;
2012 }
2014 // Change via external macro command the thickness of the first collimator
2016 {
2017  G4double thickness = valueC/2;
2018  solidCollimator -> SetXHalfLength(thickness);
2019  solidCollimatorHole -> SetZHalfLength(thickness);
2021  #ifdef G4VIS_USE
2022  G4UImanager::GetUIpointer() -> ApplyCommand("/vis/viewer/flush");
2023  #endif
2024  G4cout << "The first collimator thickness has been modified to "<< valueC/mm <<" mm in thickness" << G4endl;
2025 }
2026 
2027 // Change via external macro command the Z position of the first collimator hole
2029 {
2030  physicCollimatorHole -> SetTranslation(G4ThreeVector(0., 0., valueQ));
2032  #ifdef G4VIS_USE
2033  G4UImanager::GetUIpointer() -> ApplyCommand("/vis/viewer/flush");
2034  #endif
2035  G4cout << "The first collimator has been translated to "<< valueQ/mm <<"mm (along the z axis)" << G4endl;
2036 }
2037 
2038 // Change via external macro command the diameter of the second collimator
2040 {
2041  G4double radius = value;
2042  solidFinalCollimatorHole -> SetOuterRadius(radius);
2044  #ifdef G4VIS_USE
2045  G4UImanager::GetUIpointer() -> ApplyCommand("/vis/viewer/flush");
2046  #endif
2047  G4cout << "The second collimator aperture has been modified to "<< value/mm <<"mm in diameter" << G4endl;
2048 }
2049 
2051 // Change via external macro command the thickness of the second collimator
2053 {
2054  G4double thickness = value/2;
2055  solidFinalCollimator -> SetXHalfLength(thickness);
2056  solidFinalCollimatorHole -> SetZHalfLength(thickness);
2058  #ifdef G4VIS_USE
2059  G4UImanager::GetUIpointer() -> ApplyCommand("/vis/viewer/flush");
2060  #endif
2061  G4cout << "The second collimator thickness has been modified to "<< value/mm <<" mm in thickness" << G4endl;
2062 }
2063 
2064 // Change via external macro command the Z position of the second collimator hole
2066 {
2067  physicFinalCollimatorHole -> SetTranslation(G4ThreeVector(0., 0., value));
2069  #ifdef G4VIS_USE
2070  G4UImanager::GetUIpointer() -> ApplyCommand("/vis/viewer/flush");
2071  #endif
2072  G4cout << "The second collimator has been translated to "<< value/mm <<"mm (along the z axis)" << G4endl;
2073 }
2074 // THE SLIT MESSENGERS
2076 // Change the thickness of the Slit
2078 {
2079  if (value >(10.0*mm)) {
2080  G4cout <<"***************************************"<< G4endl;
2081  G4cout <<"******This is a warning messenger******"<< G4endl;
2082  G4cout <<"***************************************"<< G4endl;
2083  G4cout <<"The maximum value of the thickness of the slit is 10 mm, your value is >10 mm." << G4endl;
2084  G4cout <<"The default thickness value is used, it is: " << ((solidExternalSlit -> GetXHalfLength())*2.)/mm
2085  << G4endl;
2086  G4cout <<"***************************************"<< G4endl;
2087 
2088  }
2089  else {
2090  G4double dimension = value/2;
2091  solidExternalSlit -> SetXHalfLength(dimension);
2092  solidInternalSlit -> SetXHalfLength(dimension);
2094  #ifdef G4VIS_USE
2095  G4UImanager::GetUIpointer() -> ApplyCommand("/vis/viewer/flush");
2096  #endif
2097  G4cout <<"The thickness of the slit is:" << ((solidExternalSlit -> GetXHalfLength())*2.)/mm
2098  << G4endl;
2099  }
2100 }
2102 // Change the hole size (in Y direction) of the Slit
2104 {
2105  G4double hole = value/2;
2106  solidInternalSlit -> SetYHalfLength(hole);
2108  #ifdef G4VIS_USE
2109  G4UImanager::GetUIpointer() -> ApplyCommand("/vis/viewer/flush");
2110  #endif
2111  G4cout << "The hole of the Slit has been changed in the Y direction to "<< value/mm <<" mm" <<G4endl;
2112 }
2113 
2115 // Change the hole size (in Z direction) of the Slit
2117 {
2118  G4double hole = value/2;
2119  solidInternalSlit -> SetZHalfLength(hole);
2121  #ifdef G4VIS_USE
2122  G4UImanager::GetUIpointer() -> ApplyCommand("/vis/viewer/flush");
2123  #endif
2124  G4cout << "The hole of the Slit has been changed in the Z direction to "<< value/mm <<" mm" <<G4endl;
2125 }
2127 // Change the Z position of the hole of the Slit
2129 {
2130  physicInternalSlit -> SetTranslation(G4ThreeVector(0., 0., value));
2132  #ifdef G4VIS_USE
2133  G4UImanager::GetUIpointer() -> ApplyCommand("/vis/viewer/flush");
2134  #endif
2135  G4cout << "The hole of the slit has been translated to "<< value/mm <<" mm (along the Z axis)" <<G4endl;
2136 }
2137 
2138 // QUADRUPOLES
2139 
2140 // Disable via external macro command all quadrupoles
2142 {
2143  if(physicFirstQuad)
2144  {delete solidFirstQuad; delete logicFirstQuad; delete physicFirstQuad;delete SFirstTriplet; delete LFirstTriplet; delete PFirstTriplet;}
2145  if(physicSecondQuad)
2146  {delete solidSecondQuad; delete logicSecondQuad; delete physicSecondQuad;delete SSecondTriplet; delete LSecondTriplet; delete PSecondTriplet;}
2147  if(physicThirdQuad)
2148 {delete solidThirdQuad; delete logicThirdQuad; delete physicThirdQuad;delete SThirdTriplet; delete LThirdTriplet; delete PThirdTriplet;}
2149  if(physicFourthQuad)
2150  {delete solidFourthQuad; delete logicFourthQuad; delete physicFourthQuad;delete SFourthTriplet; delete LFourthTriplet; delete PFourthTriplet;}
2155 
2156 
2157  G4cout << "******************************************************************" << G4endl;
2158  G4cout << "************ The Quadrupoles system has been disabled *************" << G4endl;
2159  G4cout << "******************************************************************" << G4endl;
2161  #ifdef G4VIS_USE
2162  G4UImanager::GetUIpointer() -> ApplyCommand("/vis/viewer/flush");
2163  #endif
2164 }
2165 
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