Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/examples/advanced/iort_therapy/src/Collimator100BeamLine.cc

Version: [ ReleaseNotes ] [ 1.0 ] [ 1.1 ] [ 2.0 ] [ 3.0 ] [ 3.1 ] [ 3.2 ] [ 4.0 ] [ 4.0.p1 ] [ 4.0.p2 ] [ 4.1 ] [ 4.1.p1 ] [ 5.0 ] [ 5.0.p1 ] [ 5.1 ] [ 5.1.p1 ] [ 5.2 ] [ 5.2.p1 ] [ 5.2.p2 ] [ 6.0 ] [ 6.0.p1 ] [ 6.1 ] [ 6.2 ] [ 6.2.p1 ] [ 6.2.p2 ] [ 7.0 ] [ 7.0.p1 ] [ 7.1 ] [ 7.1.p1 ] [ 8.0 ] [ 8.0.p1 ] [ 8.1 ] [ 8.1.p1 ] [ 8.1.p2 ] [ 8.2 ] [ 8.2.p1 ] [ 8.3 ] [ 8.3.p1 ] [ 8.3.p2 ] [ 9.0 ] [ 9.0.p1 ] [ 9.0.p2 ] [ 9.1 ] [ 9.1.p1 ] [ 9.1.p2 ] [ 9.1.p3 ] [ 9.2 ] [ 9.2.p1 ] [ 9.2.p2 ] [ 9.2.p3 ] [ 9.2.p4 ] [ 9.3 ] [ 9.3.p1 ] [ 9.3.p2 ] [ 9.4 ] [ 9.4.p1 ] [ 9.4.p2 ] [ 9.4.p3 ] [ 9.4.p4 ] [ 9.5 ] [ 9.5.p1 ] [ 9.5.p2 ] [ 9.6 ] [ 9.6.p1 ] [ 9.6.p2 ] [ 9.6.p3 ] [ 9.6.p4 ] [ 10.0 ] [ 10.0.p1 ] [ 10.0.p2 ] [ 10.0.p3 ] [ 10.0.p4 ] [ 10.1 ] [ 10.1.p1 ] [ 10.1.p2 ] [ 10.1.p3 ] [ 10.2 ] [ 10.2.p1 ] [ 10.2.p2 ] [ 10.2.p3 ] [ 10.3 ] [ 10.3.p1 ] [ 10.3.p2 ] [ 10.3.p3 ] [ 10.4 ] [ 10.4.p1 ] [ 10.4.p2 ] [ 10.4.p3 ] [ 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /examples/advanced/iort_therapy/src/Collimator100BeamLine.cc (Version 11.3.0) and /examples/advanced/iort_therapy/src/Collimator100BeamLine.cc (Version 9.6)


  1 //                                                  1 //
  2 // *******************************************      2 // ********************************************************************
  3 // * License and Disclaimer                         3 // * License and Disclaimer                                           *
  4 // *                                                4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of th      5 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
  6 // * the Geant4 Collaboration.  It is provided      6 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
  7 // * conditions of the Geant4 Software License      7 // * conditions of the Geant4 Software License,  included in the file *
  8 // * LICENSE and available at  http://cern.ch/      8 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
  9 // * include a list of copyright holders.           9 // * include a list of copyright holders.                             *
 10 // *                                               10 // *                                                                  *
 11 // * Neither the authors of this software syst     11 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing fin     12 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warran     13 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assum     14 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file      15 // * use.  Please see the license in the file  LICENSE  and URL above *
 16 // * for the full disclaimer and the limitatio     16 // * for the full disclaimer and the limitation of liability.         *
 17 // *                                               17 // *                                                                  *
 18 // * This  code  implementation is the result      18 // * This  code  implementation is the result of  the  scientific and *
 19 // * technical work of the GEANT4 collaboratio     19 // * technical work of the GEANT4 collaboration.                      *
 20 // * By using,  copying,  modifying or  distri     20 // * By using,  copying,  modifying or  distributing the software (or *
 21 // * any work based  on the software)  you  ag     21 // * any work based  on the software)  you  agree  to acknowledge its *
 22 // * use  in  resulting  scientific  publicati     22 // * use  in  resulting  scientific  publications,  and indicate your *
 23 // * acceptance of all terms of the Geant4 Sof     23 // * acceptance of all terms of the Geant4 Software license.          *
 24 // *******************************************     24 // ********************************************************************
 25 //                                                 25 //
 26 // This is the *BASIC* version of IORT, a Gean     26 // This is the *BASIC* version of IORT, a Geant4-based application
 27 //                                                 27 //
 28 // Main Authors: G.Russo(a,b), C.Casarino*(c),     28 // Main Authors: G.Russo(a,b), C.Casarino*(c), G.C. Candiano(c), G.A.P. Cirrone(d), F.Romano(d)
 29 // Contributor Authors: S.Guatelli(e)              29 // Contributor Authors: S.Guatelli(e)
 30 // Past Authors: G.Arnetta(c), S.E.Mazzaglia(d     30 // Past Authors: G.Arnetta(c), S.E.Mazzaglia(d)
 31 //                                                 31 //    
 32 //   (a) Fondazione Istituto San Raffaele G.Gi     32 //   (a) Fondazione Istituto San Raffaele G.Giglio, Cefalù, Italy
 33 //   (b) IBFM-CNR , Segrate (Milano), Italy        33 //   (b) IBFM-CNR , Segrate (Milano), Italy
 34 //   (c) LATO (Laboratorio di Tecnologie Oncol     34 //   (c) LATO (Laboratorio di Tecnologie Oncologiche), Cefalù, Italy
 35 //   (d) Laboratori Nazionali del Sud of the I     35 //   (d) Laboratori Nazionali del Sud of the INFN, Catania, Italy
 36 //   (e) University of Wollongong, Australia   <<  36 //   (e) University of Wallongong, Australia
 37 //                                                 37 //
 38 //   *Corresponding author, email to carlo.cas     38 //   *Corresponding author, email to carlo.casarino@polooncologicocefalu.it
 39 //////////////////////////////////////////////     39 //////////////////////////////////////////////////////////////////////////////////////////////
 40                                                    40 
 41 #include "globals.hh"                              41 #include "globals.hh"
 42 #include "G4SystemOfUnits.hh"                      42 #include "G4SystemOfUnits.hh"
 43 #include "G4Box.hh"                                43 #include "G4Box.hh"
 44 #include "G4Tubs.hh"                               44 #include "G4Tubs.hh"
 45 #include "G4Cons.hh"                               45 #include "G4Cons.hh"  
 46 #include "G4VisAttributes.hh"                      46 #include "G4VisAttributes.hh"
 47 #include "G4Colour.hh"                             47 #include "G4Colour.hh"
 48 #include "G4RunManager.hh"                         48 #include "G4RunManager.hh"
 49 #include "G4LogicalVolume.hh"                      49 #include "G4LogicalVolume.hh"
 50 #include "G4PVPlacement.hh"                        50 #include "G4PVPlacement.hh"
 51 #include "G4RotationMatrix.hh"                     51 #include "G4RotationMatrix.hh"
 52 #include "G4NistManager.hh"                        52 #include "G4NistManager.hh"
 53 #include "G4NistElementBuilder.hh"                 53 #include "G4NistElementBuilder.hh"
 54 #include "G4SubtractionSolid.hh"                   54 #include "G4SubtractionSolid.hh"   
 55 #include "IORTDetectorConstruction.hh"             55 #include "IORTDetectorConstruction.hh" 
 56 #include "Collimator100BeamLine.hh"                56 #include "Collimator100BeamLine.hh"
 57 #include "Collimator100BeamLineMessenger.hh"       57 #include "Collimator100BeamLineMessenger.hh"  
 58                                                    58 
 59 Collimator100BeamLine::Collimator100BeamLine()     59 Collimator100BeamLine::Collimator100BeamLine():
 60   physicalTreatmentRoom(0),iortDetectorConstru     60   physicalTreatmentRoom(0),iortDetectorConstruction(0),
 61                                                    61   
 62                                                    62   
 63   solidFinalCollimatorIORT(0),                     63   solidFinalCollimatorIORT(0),
                                                   >>  64   logicFinalCollimatorIORT(0),
 64   physiFinalCollimatorIORT(0),                     65   physiFinalCollimatorIORT(0),
 65                                                    66 
 66   solidGiunz1FinalCollIORT(0),                     67   solidGiunz1FinalCollIORT(0),
                                                   >>  68   logicGiunz1FinalCollIORT(0),
 67   physiGiunz1FinalCollIORT(0),                     69   physiGiunz1FinalCollIORT(0),
 68                                                    70 
 69   solidGiunz2FinalCollIORT(0),                     71   solidGiunz2FinalCollIORT(0),  
                                                   >>  72   logicGiunz2FinalCollIORT(0),
 70   physiGiunz2FinalCollIORT(0),                     73   physiGiunz2FinalCollIORT(0),
 71                                                    74 
 72   solidGiunz3FinalCollIORT(0),                     75   solidGiunz3FinalCollIORT(0),
                                                   >>  76   logicGiunz3FinalCollIORT(0),
 73   physiGiunz3FinalCollIORT(0),                     77   physiGiunz3FinalCollIORT(0),  
 74                                                    78 
 75   solidGiunz3FinalCollIntIORT(0),                  79   solidGiunz3FinalCollIntIORT(0),
                                                   >>  80   logicGiunz3FinalCollIntIORT(0),
 76   physiGiunz3FinalCollIntIORT(0),                  81   physiGiunz3FinalCollIntIORT(0), 
 77                                                    82   
 78   solidGiunz4FinalCollIORT(0),                     83   solidGiunz4FinalCollIORT(0),
                                                   >>  84   logicGiunz4FinalCollIORT(0),
 79   physiGiunz4FinalCollIORT(0),                     85   physiGiunz4FinalCollIORT(0),
 80                                                    86 
 81   solidGiunz5FinalCollIORT(0),                     87   solidGiunz5FinalCollIORT(0),
                                                   >>  88   logicGiunz5FinalCollIORT(0),
 82   physiGiunz5FinalCollIORT(0),                     89   physiGiunz5FinalCollIORT(0),
 83                                                    90   
 84   solidBlocco1IORT(0),                             91   solidBlocco1IORT(0),
                                                   >>  92   logicBlocco1IORT(0),
 85   physiBlocco1IORT(0),                             93   physiBlocco1IORT(0),
 86                                                    94 
 87   solidBlocco2IORT(0),                             95   solidBlocco2IORT(0),
                                                   >>  96   logicBlocco2IORT(0),
 88   physiBlocco2IORT(0),                             97   physiBlocco2IORT(0),
 89                                                    98 
 90   solidBlocco3IORT(0),                             99   solidBlocco3IORT(0),
                                                   >> 100   logicBlocco3IORT(0),
 91   physiBlocco3IORT(0),                            101   physiBlocco3IORT(0),
 92                                                   102 
 93   solidBlocco20mmIORT(0),                         103   solidBlocco20mmIORT(0),
                                                   >> 104   logicBlocco20mmIORT(0),
 94   physiBlocco20mmIORT(0),                         105   physiBlocco20mmIORT(0),  
 95                                                   106 
 96   solidCM1_1_2IORT(0),                            107   solidCM1_1_2IORT(0),
                                                   >> 108   logicCM1_1_2IORT(0),
 97   physiCM1_1_2IORT(0),                            109   physiCM1_1_2IORT(0),
 98                                                   110   
 99   solidCM1_2_2IORT(0),                            111   solidCM1_2_2IORT(0),
                                                   >> 112   logicCM1_2_2IORT(0),
100   physiCM1_2_2IORT(0),                            113   physiCM1_2_2IORT(0),
101                                                   114   
102   solidCM2_1_2IORT(0),                            115   solidCM2_1_2IORT(0),
                                                   >> 116   logicCM2_1_2IORT(0),
103   physiCM2_1_2IORT(0),                            117   physiCM2_1_2IORT(0),
104                                                   118 
105   solidCM2_2_2IORT(0),                            119   solidCM2_2_2IORT(0),
                                                   >> 120   logicCM2_2_2IORT(0),
106   physiCM2_2_2IORT(0),                            121   physiCM2_2_2IORT(0),  
107                                                   122 
108   solidCCMIORT(0),                                123   solidCCMIORT(0),
                                                   >> 124   logicCCMIORT(0),
109   physiCCMIORT(0),                                125   physiCCMIORT(0),
110                                                   126 
111   solidPFS1IORT(0),                               127   solidPFS1IORT(0),
                                                   >> 128   logicPFS1IORT(0),
112   physiPFS1IORT(0),                               129   physiPFS1IORT(0),
113                                                   130 
114   solidPFS2IORT(0),                               131   solidPFS2IORT(0),
                                                   >> 132   logicPFS2IORT(0),
115   physiPFS2IORT(0),                               133   physiPFS2IORT(0),
116                                                   134 
117   solidPFS3IORT(0),                               135   solidPFS3IORT(0),
                                                   >> 136   logicPFS3IORT(0),
118   physiPFS3IORT(0),                               137   physiPFS3IORT(0),
119                                                   138 
120   solidFTIORT(0),                                 139   solidFTIORT(0),
                                                   >> 140   logicFTIORT(0),
121   physiFTIORT(0)                                  141   physiFTIORT(0)
122                                                   142 
123                                                   143 
124 {                                                 144 {
125   // Messenger to change parameters of the col    145   // Messenger to change parameters of the collimator100BeamLine geometry
126   collimatorMessenger = new Collimator100BeamL    146   collimatorMessenger = new Collimator100BeamLineMessenger(this);
127                                                   147 
128 }                                                 148 }
129 //////////////////////////////////////////////    149 /////////////////////////////////////////////////////////////////////////////
130 Collimator100BeamLine::~Collimator100BeamLine(    150 Collimator100BeamLine::~Collimator100BeamLine()
131 {                                                 151 {
132   delete collimatorMessenger;                     152   delete collimatorMessenger;
133   delete iortDetectorConstruction;                153   delete iortDetectorConstruction;
134 }                                                 154 }
135                                                   155 
136 //////////////////////////////////////////////    156 /////////////////////////////////////////////////////////////////////////////
137                                                   157 
138                                                   158 
139 G4VPhysicalVolume* Collimator100BeamLine::Cons    159 G4VPhysicalVolume* Collimator100BeamLine::Construct()
140 {                                                 160 { 
141   // Sets default geometry and materials          161   // Sets default geometry and materials
142   SetDefaultDimensions();                         162   SetDefaultDimensions();
143                                                   163   
144   // Construct the whole Collimator Beam Line     164   // Construct the whole Collimator Beam Line 
145   ConstructCollimator100BeamLine();               165   ConstructCollimator100BeamLine();
146                                                   166 
147                                                   167   
148   // IORTDetectorConstruction builds ONLY the     168   // IORTDetectorConstruction builds ONLY the phantom and the detector with its associated ROGeometry
149   iortDetectorConstruction = new IORTDetectorC    169   iortDetectorConstruction = new IORTDetectorConstruction(physicalTreatmentRoom); 
150                                                   170   
151   return physicalTreatmentRoom;                   171   return physicalTreatmentRoom;
152 }                                                 172 }
153                                                   173 
154 // In the following method the DEFAULTS used i    174 // In the following method the DEFAULTS used in the geometry of 
155 // collimator beam line are provided              175 // collimator beam line are provided
156 // HERE THE USER CAN CHANGE THE GEOMETRY CHARA    176 // HERE THE USER CAN CHANGE THE GEOMETRY CHARACTERISTICS OF BEAM
157 // LINE ELEMENTS, ALTERNATIVELY HE/SHE CAN USE    177 // LINE ELEMENTS, ALTERNATIVELY HE/SHE CAN USE THE MACRO FILE (IF A 
158 // MESSENGER IS PROVIDED)                         178 // MESSENGER IS PROVIDED)
159 //                                                179 //
160 // DEFAULT MATERIAL ARE ALSO PROVIDED             180 // DEFAULT MATERIAL ARE ALSO PROVIDED 
161 // and COLOURS ARE ALSO DEFINED                   181 // and COLOURS ARE ALSO DEFINED
162 // -------------------------------------------    182 // ----------------------------------------------------------
163 //////////////////////////////////////////////    183 /////////////////////////////////////////////////////////////////////////////
164 void Collimator100BeamLine::SetDefaultDimensio    184 void Collimator100BeamLine::SetDefaultDimensions()
165 {                                                 185 {
166                                                   186 
167    // Set of coulors that can be used             187    // Set of coulors that can be used
168   white = new G4VisAttributes( G4Colour());       188   white = new G4VisAttributes( G4Colour());
169   white -> SetVisibility(true);                   189   white -> SetVisibility(true);
170   //white -> SetForceSolid(true);                 190   //white -> SetForceSolid(true);
171                                                   191   
172   blue = new G4VisAttributes(G4Colour(0. ,0. ,    192   blue = new G4VisAttributes(G4Colour(0. ,0. ,1.));
173   blue -> SetVisibility(true);                    193   blue -> SetVisibility(true);
174   //blue -> SetForceSolid(true);                  194   //blue -> SetForceSolid(true);
175                                                   195   
176   gray = new G4VisAttributes( G4Colour(0.5, 0.    196   gray = new G4VisAttributes( G4Colour(0.5, 0.5, 0.5 ));
177   gray-> SetVisibility(true);                     197   gray-> SetVisibility(true);
178   //gray-> SetForceSolid(true);                   198   //gray-> SetForceSolid(true);
179                                                   199   
180   red = new G4VisAttributes(G4Colour(1. ,0. ,0    200   red = new G4VisAttributes(G4Colour(1. ,0. ,0.));
181   red-> SetVisibility(true);                      201   red-> SetVisibility(true);
182   //red-> SetForceSolid(true);                    202   //red-> SetForceSolid(true);
183                                                   203   
184   yellow = new G4VisAttributes(G4Colour(1., 1.    204   yellow = new G4VisAttributes(G4Colour(1., 1., 0. ));
185   yellow-> SetVisibility(true);                   205   yellow-> SetVisibility(true);
186   //yellow-> SetForceSolid(true);                 206   //yellow-> SetForceSolid(true);
187                                                   207   
188   green = new G4VisAttributes( G4Colour(25/255    208   green = new G4VisAttributes( G4Colour(25/255. , 255/255. ,  25/255. ));
189   green -> SetVisibility(true);                   209   green -> SetVisibility(true);
190   //green -> SetForceSolid(true);                 210   //green -> SetForceSolid(true);
191                                                   211   
192   darkGreen = new G4VisAttributes( G4Colour(0/    212   darkGreen = new G4VisAttributes( G4Colour(0/255. , 100/255. ,  0/255. ));
193   darkGreen -> SetVisibility(true);               213   darkGreen -> SetVisibility(true);
194   //darkGreen -> SetForceSolid(true);             214   //darkGreen -> SetForceSolid(true);
195                                                   215     
196   darkOrange3 = new G4VisAttributes( G4Colour(    216   darkOrange3 = new G4VisAttributes( G4Colour(205/255. , 102/255. ,  000/255. ));
197   darkOrange3 -> SetVisibility(true);             217   darkOrange3 -> SetVisibility(true);
198   //darkOrange3 -> SetForceSolid(true);           218   //darkOrange3 -> SetForceSolid(true);
199                                                   219   
200   skyBlue = new G4VisAttributes( G4Colour(135/    220   skyBlue = new G4VisAttributes( G4Colour(135/255. , 206/255. ,  235/255. ));
201   skyBlue -> SetVisibility(true);                 221   skyBlue -> SetVisibility(true);
202   //skyBlue -> SetForceSolid(true);               222   //skyBlue -> SetForceSolid(true);
203                                                   223 
204                                                   224   
205                                                   225 
206   // Geometry FINAL COLLIMATOR DEFAULTS           226   // Geometry FINAL COLLIMATOR DEFAULTS
207                                                   227 
208   G4double defaultOuterRadiusFinalCollimatorIO    228   G4double defaultOuterRadiusFinalCollimatorIORT = 55. *mm;
209   OuterRadiusFinalCollimatorIORT = defaultOute    229   OuterRadiusFinalCollimatorIORT = defaultOuterRadiusFinalCollimatorIORT;
210                                                   230 
211   G4double defaultinnerRadiusFinalCollimatorIO    231   G4double defaultinnerRadiusFinalCollimatorIORT = 50. *mm;
212   innerRadiusFinalCollimatorIORT = defaultinne    232   innerRadiusFinalCollimatorIORT = defaultinnerRadiusFinalCollimatorIORT;
213                                                   233 
214   // DEFAULT DEFINITION OF THE MATERIALS          234   // DEFAULT DEFINITION OF THE MATERIALS
215   // All elements and compound definition foll    235   // All elements and compound definition follows the NIST database
216                                                   236  
217   // ELEMENTS                                     237   // ELEMENTS
218   G4bool isotopes = false;                        238   G4bool isotopes = false;
219   G4Material* aluminumNist = G4NistManager::In    239   G4Material* aluminumNist = G4NistManager::Instance()->FindOrBuildMaterial("G4_Al", isotopes);
220   //G4Material* tantalumNist = G4NistManager::    240   //G4Material* tantalumNist = G4NistManager::Instance()->FindOrBuildMaterial("G4_Ta", isotopes); 
221   //G4Material* copperNistAsMaterial = G4NistM    241   //G4Material* copperNistAsMaterial = G4NistManager::Instance()->FindOrBuildMaterial("G4_Cu", isotopes);
222   G4Element* zincNist = G4NistManager::Instanc    242   G4Element* zincNist = G4NistManager::Instance()->FindOrBuildElement("Zn");
223   G4Element* copperNist = G4NistManager::Insta    243   G4Element* copperNist = G4NistManager::Instance()->FindOrBuildElement("Cu");
224                                                   244 
225   // COMPOUND                                     245   // COMPOUND
226   G4Material* airNist =  G4NistManager::Instan    246   G4Material* airNist =  G4NistManager::Instance()->FindOrBuildMaterial("G4_AIR", isotopes);
227   //G4Material* kaptonNist = G4NistManager::In    247   //G4Material* kaptonNist = G4NistManager::Instance()->FindOrBuildMaterial("G4_KAPTON", isotopes);
228   G4Material* galacticNist = G4NistManager::In    248   G4Material* galacticNist = G4NistManager::Instance()->FindOrBuildMaterial("G4_Galactic", isotopes);
229   G4Material* PMMANist = G4NistManager::Instan    249   G4Material* PMMANist = G4NistManager::Instance()->FindOrBuildMaterial("G4_PLEXIGLASS", isotopes);
230   //G4Material* mylarNist = G4NistManager::Ins    250   //G4Material* mylarNist = G4NistManager::Instance()->FindOrBuildMaterial("G4_MYLAR", isotopes);
231   G4Material* titanioNist = G4NistManager::Ins    251   G4Material* titanioNist = G4NistManager::Instance()->FindOrBuildMaterial("G4_Ti", isotopes); 
232                                                   252   
233                                                   253   
234   G4double d; // Density                          254   G4double d; // Density
235   G4int nComponents;// Number of components       255   G4int nComponents;// Number of components 
236   G4double fractionmass; // Fraction in mass o    256   G4double fractionmass; // Fraction in mass of an element in a material
237                                                   257 
238   d = 8.40*g/cm3;   // brass                      258   d = 8.40*g/cm3;   // brass 
239   nComponents = 2;                                259   nComponents = 2;
240   G4Material* brass = new G4Material("Brass",     260   G4Material* brass = new G4Material("Brass", d, nComponents);  
241   brass -> AddElement(zincNist, fractionmass =    261   brass -> AddElement(zincNist, fractionmass = 30 *perCent);
242   brass -> AddElement(copperNist, fractionmass    262   brass -> AddElement(copperNist, fractionmass = 70 *perCent);
243                                                   263 
244                                                   264  
245   // MATERIAL ASSIGNMENT                          265   // MATERIAL ASSIGNMENT
246                                                   266 
247                                                   267 
248  // Material of the FINAL COLLIMATOR IORT         268  // Material of the FINAL COLLIMATOR IORT
249   finalCollimatorMaterialIORT = PMMANist;         269   finalCollimatorMaterialIORT = PMMANist;
250                                                   270 
251  // Junction 1 FINAL COLLIMATOR IORT              271  // Junction 1 FINAL COLLIMATOR IORT
252   Giunz1FinalCollMaterialIORT = PMMANist;         272   Giunz1FinalCollMaterialIORT = PMMANist;
253                                                   273 
254  // Junction 2 FINAL COLLIMATOR IORT              274  // Junction 2 FINAL COLLIMATOR IORT
255   Giunz2FinalCollMaterialIORT = PMMANist;         275   Giunz2FinalCollMaterialIORT = PMMANist;
256                                                   276  
257  // Junction 3 FINAL COLLIMATOR IORT              277  // Junction 3 FINAL COLLIMATOR IORT
258   Giunz3FinalCollMaterialIORT = PMMANist;         278   Giunz3FinalCollMaterialIORT = PMMANist;
259                                                   279  
260  // Junction 3 FINAL COLLIMATOR Int IORT          280  // Junction 3 FINAL COLLIMATOR Int IORT
261   Giunz3FinalCollMaterialIntIORT = airNist;       281   Giunz3FinalCollMaterialIntIORT = airNist;
262                                                   282 
263  // Junction 4 FINAL COLLIMATOR IORT              283  // Junction 4 FINAL COLLIMATOR IORT
264   Giunz4FinalCollMaterialIORT = PMMANist;         284   Giunz4FinalCollMaterialIORT = PMMANist;
265                                                   285 
266  // Junction 5 FINAL COLLIMATOR IORT              286  // Junction 5 FINAL COLLIMATOR IORT
267   Giunz5FinalCollMaterialIORT = PMMANist;         287   Giunz5FinalCollMaterialIORT = PMMANist;
268                                                   288 
269  // Block 1 Diameter 30 mm                        289  // Block 1 Diameter 30 mm 
270   Blocco1IORTMaterialIORT = PMMANist;             290   Blocco1IORTMaterialIORT = PMMANist; 
271                                                   291 
272  // Block 2 Diameter 30 mm                        292  // Block 2 Diameter 30 mm 
273   Blocco2IORTMaterialIORT = PMMANist;             293   Blocco2IORTMaterialIORT = PMMANist; 
274                                                   294 
275  // Block 3 Diameter 30 mm                        295  // Block 3 Diameter 30 mm 
276   Blocco3IORTMaterialIORT = PMMANist;             296   Blocco3IORTMaterialIORT = PMMANist;
277                                                   297 
278  // Block Diameter 20 mm                          298  // Block Diameter 20 mm 
279   Blocco20mmIORTMaterialIORT = PMMANist;          299   Blocco20mmIORTMaterialIORT = PMMANist;
280                                                   300 
281  // First Monitor Chamber Lamina Al 1 of 2        301  // First Monitor Chamber Lamina Al 1 of 2  
282     CM1_1_2IORTMaterialIORT = aluminumNist;       302     CM1_1_2IORTMaterialIORT = aluminumNist;
283                                                   303 
284  // First Monitor Chamber Lamina Al 2 of 2        304  // First Monitor Chamber Lamina Al 2 of 2  
285     CM1_2_2IORTMaterialIORT = aluminumNist;       305     CM1_2_2IORTMaterialIORT = aluminumNist;
286                                                   306 
287  // Second Monitor Chamber Lamina Al 1 of 2       307  // Second Monitor Chamber Lamina Al 1 of 2  
288     CM2_1_2IORTMaterialIORT = aluminumNist;       308     CM2_1_2IORTMaterialIORT = aluminumNist;
289                                                   309 
290  // Second Monitor Chamber Lamina Al 2 of 2       310  // Second Monitor Chamber Lamina Al 2 of 2  
291     CM2_2_2IORTMaterialIORT = aluminumNist;       311     CM2_2_2IORTMaterialIORT = aluminumNist;
292                                                   312     
293  // Monitor Chamber Cylinder                      313  // Monitor Chamber Cylinder 
294     CCMIORTMaterialIORT = PMMANist;               314     CCMIORTMaterialIORT = PMMANist;
295                                                   315 
296  // Superior Final Part Monitor Chambers          316  // Superior Final Part Monitor Chambers
297     PFS1IORTMaterialIORT = PMMANist;              317     PFS1IORTMaterialIORT = PMMANist;
298                                                   318 
299  // Superior Final Part Monitor Chambers          319  // Superior Final Part Monitor Chambers
300     PFS2IORTMaterialIORT = PMMANist;              320     PFS2IORTMaterialIORT = PMMANist;
301                                                   321 
302  // Superior Final Part Monitor Chambers          322  // Superior Final Part Monitor Chambers
303     PFS3IORTMaterialIORT = PMMANist;              323     PFS3IORTMaterialIORT = PMMANist;
304                                                   324 
305  // Superior Final Part Monitor Chambers Mater    325  // Superior Final Part Monitor Chambers Material
306     FTIORTMaterialIORT = titanioNist;             326     FTIORTMaterialIORT = titanioNist;
307                                                   327 
308  // Vacuum Source                                 328  // Vacuum Source
309     VSIORTMaterialIORT = galacticNist;            329     VSIORTMaterialIORT = galacticNist;
310                                                   330 
311 }                                                 331 }
312                                                   332 
313 //////////////////////////////////////////////    333 /////////////////////////////////////////////////////////////////////////////
314 void Collimator100BeamLine::ConstructCollimato    334 void Collimator100BeamLine::ConstructCollimator100BeamLine()
315 {                                                 335 { 
316   // -----------------------------                336   // -----------------------------
317   // Treatment room - World volume                337   // Treatment room - World volume
318   //------------------------------                338   //------------------------------
319   // Treatment room sizes                         339   // Treatment room sizes
320   const G4double worldX = 400.0 *cm;              340   const G4double worldX = 400.0 *cm;
321   const G4double worldY = 400.0 *cm;              341   const G4double worldY = 400.0 *cm;
322   const G4double worldZ = 400.0 *cm;              342   const G4double worldZ = 400.0 *cm;
323   G4bool isotopes = false;                        343   G4bool isotopes = false;
324                                                   344  
325   G4Material* airNist =  G4NistManager::Instan    345   G4Material* airNist =  G4NistManager::Instance()->FindOrBuildMaterial("G4_AIR", isotopes);
326   G4Box* treatmentRoom = new G4Box("TreatmentR    346   G4Box* treatmentRoom = new G4Box("TreatmentRoom",worldX,worldY,worldZ);
327   G4LogicalVolume* logicTreatmentRoom = new G4    347   G4LogicalVolume* logicTreatmentRoom = new G4LogicalVolume(treatmentRoom, 
328                                                   348                                                             airNist, 
329                                                   349                                                             "logicTreatmentRoom", 
330                   0,0,0);                         350                   0,0,0);
331   physicalTreatmentRoom = new G4PVPlacement(0,    351   physicalTreatmentRoom = new G4PVPlacement(0,
332               G4ThreeVector(),                    352               G4ThreeVector(),
333               "physicalTreatmentRoom",            353               "physicalTreatmentRoom", 
334               logicTreatmentRoom,                 354               logicTreatmentRoom, 
335               0,false,0);                         355               0,false,0);
336                                                   356  
337                                                   357 
338   // The treatment room is invisible in the Vi    358   // The treatment room is invisible in the Visualisation
339   logicTreatmentRoom -> SetVisAttributes (G4Vi << 359   logicTreatmentRoom -> SetVisAttributes (G4VisAttributes::Invisible);
340                                                   360  
341   // Components of the Collimator Beam Line       361   // Components of the Collimator Beam Line
342                                                   362 
343   IortBeamLineVacuumSource();                     363   IortBeamLineVacuumSource();
344   IortBeamLineTitaniumWindows();                  364   IortBeamLineTitaniumWindows();
345   IortBeamLineMonitorChambers();                  365   IortBeamLineMonitorChambers();
346   IortBeamLineBlocks() ;                          366   IortBeamLineBlocks() ;
347   IortBeamLineJunctions();                        367   IortBeamLineJunctions(); 
348   IortBeamLineFinalCollimator();                  368   IortBeamLineFinalCollimator();
349                                                   369     
350 }                                                 370 }
351                                                   371 
352                                                   372 
353 void Collimator100BeamLine::IortBeamLineVacuum    373 void Collimator100BeamLine::IortBeamLineVacuumSource()
354 {                                                 374 {
355  // ------------------------------------------    375  // ---------------------------------------------------------------//
356   //                     Vacuum Source            376   //                     Vacuum Source                             //
357   // -----------------------------------------    377   // ---------------------------------------------------------------//
358                                                   378 
359                                                   379   
360   G4double phi1 = 90. *deg;                       380   G4double phi1 = 90. *deg;     
361                                                   381 
362                                                   382            
363    G4RotationMatrix rm1;                          383    G4RotationMatrix rm1;               
364    rm1.rotateY(phi1);                             384    rm1.rotateY(phi1);
365                                                   385 
366   const G4double outRadiusVSIORT = 44.75 *mm;     386   const G4double outRadiusVSIORT = 44.75 *mm;
367   const G4double innRadiusVSIORT = 0.*mm;         387   const G4double innRadiusVSIORT = 0.*mm;
368   const G4double hightVSIORT = 1. *mm;            388   const G4double hightVSIORT = 1. *mm;
369   const G4double startAngleVSIORT = 0.*deg;       389   const G4double startAngleVSIORT = 0.*deg;
370   const G4double spanningAngleVSIORT = 360.*de    390   const G4double spanningAngleVSIORT = 360.*deg;
371   const G4double XPositionVSIORT = -1062.797 *    391   const G4double XPositionVSIORT = -1062.797 *mm;
372                                                   392     
373   solidVSIORT = new G4Tubs("VSIORT", innRadius    393   solidVSIORT = new G4Tubs("VSIORT", innRadiusVSIORT, 
374              outRadiusVSIORT,                     394              outRadiusVSIORT,
375              hightVSIORT,                         395              hightVSIORT, 
376              startAngleVSIORT,                    396              startAngleVSIORT, 
377              spanningAngleVSIORT);                397              spanningAngleVSIORT);
378                                                   398 
379   G4LogicalVolume* logVSIORT = new G4LogicalVo    399   G4LogicalVolume* logVSIORT = new G4LogicalVolume(solidVSIORT, 
380                     VSIORTMaterialIORT, "VSIOR    400                     VSIORTMaterialIORT, "VSIORT", 0, 0, 0);
381                                                   401 
382   physiVSIORT = new G4PVPlacement(G4Transform3    402   physiVSIORT = new G4PVPlacement(G4Transform3D(rm1, G4ThreeVector((XPositionVSIORT),0.,0.)),
383              "VSIORT", logVSIORT, physicalTrea << 403              "VSIORT", logicVSIORT, physicalTreatmentRoom, false, 0); 
384   logVSIORT -> SetVisAttributes(green);           404   logVSIORT -> SetVisAttributes(green);
385 }                                                 405 }
386                                                   406 
387 void Collimator100BeamLine::IortBeamLineTitani    407 void Collimator100BeamLine::IortBeamLineTitaniumWindows()
388 {                                                 408 {
389 // -------------------------------------------    409 // ---------------------------------------------------------------//
390   //                     Titanium Window          410   //                     Titanium Window                        //
391   // -----------------------------------------    411   // ---------------------------------------------------------------//
392                                                   412 
393   G4double phi2 = 90. *deg;                       413   G4double phi2 = 90. *deg;     
394                                                   414 
395                                                   415             
396    G4RotationMatrix rm2;                          416    G4RotationMatrix rm2;               
397    rm2.rotateY(phi2);                             417    rm2.rotateY(phi2);
398                                                   418 
399                                                   419 
400   const G4double outRadiusFTIORT = 44.75 *mm;     420   const G4double outRadiusFTIORT = 44.75 *mm;
401   const G4double innRadiusFTIORT = 8.5 *mm;       421   const G4double innRadiusFTIORT = 8.5 *mm;
402   const G4double hightFTIORT = 0.006 *mm;         422   const G4double hightFTIORT = 0.006 *mm;
403   const G4double startAngleFTIORT = 0.*deg;       423   const G4double startAngleFTIORT = 0.*deg;
404   const G4double spanningAngleFTIORT = 360.*de    424   const G4double spanningAngleFTIORT = 360.*deg;
405   const G4double XPositionFTIORT = -1061.791 *    425   const G4double XPositionFTIORT = -1061.791 *mm;
406                                                   426     
407                                                   427   
408   solidFTIORT = new G4Tubs("FTIORT", innRadius    428   solidFTIORT = new G4Tubs("FTIORT", innRadiusFTIORT, 
409              outRadiusFTIORT,                     429              outRadiusFTIORT,
410              hightFTIORT,                         430              hightFTIORT, 
411              startAngleFTIORT,                    431              startAngleFTIORT, 
412              spanningAngleFTIORT);                432              spanningAngleFTIORT);
413                                                   433 
414   G4LogicalVolume* logFTIORT = new G4LogicalVo    434   G4LogicalVolume* logFTIORT = new G4LogicalVolume(solidFTIORT, 
415                     FTIORTMaterialIORT, "FTIOR    435                     FTIORTMaterialIORT, "FTIORT", 0, 0, 0);
416                                                   436 
417   physiFTIORT = new G4PVPlacement(G4Transform3    437   physiFTIORT = new G4PVPlacement(G4Transform3D(rm2, G4ThreeVector((XPositionFTIORT),0.,0.)),
418              "FTIORT", logFTIORT, physicalTrea    438              "FTIORT", logFTIORT, physicalTreatmentRoom, false, 0); 
419                                                   439 
420   logFTIORT -> SetVisAttributes(yellow);          440   logFTIORT -> SetVisAttributes(yellow);
421 }                                                 441 }
422                                                   442 
423 void Collimator100BeamLine::IortBeamLineMonito    443 void Collimator100BeamLine::IortBeamLineMonitorChambers()
424 {                                                 444 {
425                                                   445 
426    G4double phi3 = 90. *deg;                      446    G4double phi3 = 90. *deg;     
427                                                   447 
428      // Matrix definition for a 90 deg rotatio    448      // Matrix definition for a 90 deg rotation. Also used for other volumes       
429    G4RotationMatrix rm3;                          449    G4RotationMatrix rm3;               
430    rm3.rotateY(phi3);                             450    rm3.rotateY(phi3);
431 //////////////////////////////////////////////    451 ///////////////////////////////////////////////////////////////////////////////
432                                                   452 
433   // Monitor Chambers System                      453   // Monitor Chambers System
434                                                   454 
435 //////////////////////////////////////////////    455 ///////////////////////////////////////////////////////////////////////////////
436                                                   456  
437                                                   457 
438   // -----------------------------------------    458   // ---------------------------------------------------------------//
439   //             Superior Final Part Monitor C    459   //             Superior Final Part Monitor Chambers   3      //
440   // -----------------------------------------    460   // ---------------------------------------------------------------//
441                                                   461 
442   const G4double outRadiusPFS3IORT = 44.75 *mm    462   const G4double outRadiusPFS3IORT = 44.75 *mm;
443   const G4double innRadiusPFS3IORT = 17.5 *mm;    463   const G4double innRadiusPFS3IORT = 17.5 *mm;
444   const G4double hightPFS3IORT = 3.03 *mm;        464   const G4double hightPFS3IORT = 3.03 *mm;
445   const G4double startAnglePFS3IORT = 0.*deg;     465   const G4double startAnglePFS3IORT = 0.*deg;
446   const G4double spanningAnglePFS3IORT = 360.*    466   const G4double spanningAnglePFS3IORT = 360.*deg;
447   const G4double XPositionPFS3IORT = -1048.755    467   const G4double XPositionPFS3IORT = -1048.755 *mm;
448                                                   468     
449                                                   469   
450   solidPFS3IORT = new G4Tubs("PFS3IORT", innRa    470   solidPFS3IORT = new G4Tubs("PFS3IORT", innRadiusPFS3IORT, 
451             outRadiusPFS3IORT,                    471             outRadiusPFS3IORT,
452             hightPFS3IORT,                        472             hightPFS3IORT, 
453             startAnglePFS3IORT,                   473             startAnglePFS3IORT, 
454             spanningAnglePFS3IORT);               474             spanningAnglePFS3IORT);
455                                                   475 
456   G4LogicalVolume* logPFS3IORT = new G4Logical    476   G4LogicalVolume* logPFS3IORT = new G4LogicalVolume(solidPFS3IORT, 
457                     PFS3IORTMaterialIORT, "PFS    477                     PFS3IORTMaterialIORT, "PFS3IORT", 0, 0, 0);
458                                                   478 
459   physiPFS3IORT = new G4PVPlacement(G4Transfor    479   physiPFS3IORT = new G4PVPlacement(G4Transform3D(rm3, G4ThreeVector((XPositionPFS3IORT),0.,0.)),
460              "PFS3IORT", logPFS3IORT, physical    480              "PFS3IORT", logPFS3IORT, physicalTreatmentRoom, false, 0); 
461                                                   481 
462   logPFS3IORT -> SetVisAttributes(white);         482   logPFS3IORT -> SetVisAttributes(white);
463                                                   483 
464                                                   484   
465   // -----------------------------------------    485   // ---------------------------------------------------------------//
466   //             Superior Final Part Monitor C    486   //             Superior Final Part Monitor Chambers   2       //
467   // -----------------------------------------    487   // ---------------------------------------------------------------//
468                                                   488 
469   const G4double outRadiusPFS2IORT = 44.75 *mm    489   const G4double outRadiusPFS2IORT = 44.75 *mm;
470   const G4double innRadiusPFS2IORT = 10. *mm;     490   const G4double innRadiusPFS2IORT = 10. *mm;
471   const G4double hightPFS2IORT = 1.47 *mm;        491   const G4double hightPFS2IORT = 1.47 *mm;
472   const G4double startAnglePFS2IORT = 0.*deg;     492   const G4double startAnglePFS2IORT = 0.*deg;
473   const G4double spanningAnglePFS2IORT = 360.*    493   const G4double spanningAnglePFS2IORT = 360.*deg;
474   const G4double XPositionPFS2IORT = -1044.255    494   const G4double XPositionPFS2IORT = -1044.255 *mm;
475                                                   495     
476                                                   496   
477   solidPFS2IORT = new G4Tubs("PFS2IORT", innRa    497   solidPFS2IORT = new G4Tubs("PFS2IORT", innRadiusPFS2IORT, 
478             outRadiusPFS2IORT,                    498             outRadiusPFS2IORT,
479             hightPFS2IORT,                        499             hightPFS2IORT, 
480             startAnglePFS2IORT,                   500             startAnglePFS2IORT, 
481             spanningAnglePFS2IORT);               501             spanningAnglePFS2IORT);
482                                                   502 
483   G4LogicalVolume* logPFS2IORT = new G4Logical    503   G4LogicalVolume* logPFS2IORT = new G4LogicalVolume(solidPFS2IORT, 
484                     PFS2IORTMaterialIORT, "PFS    504                     PFS2IORTMaterialIORT, "PFS2IORT", 0, 0, 0);
485                                                   505 
486   physiPFS2IORT = new G4PVPlacement(G4Transfor    506   physiPFS2IORT = new G4PVPlacement(G4Transform3D(rm3, G4ThreeVector((XPositionPFS2IORT),0.,0.)),
487              "PFS2IORT", logPFS2IORT, physical    507              "PFS2IORT", logPFS2IORT, physicalTreatmentRoom, false, 0); 
488                                                   508 
489   logPFS2IORT -> SetVisAttributes(green);         509   logPFS2IORT -> SetVisAttributes(green);
490                                                   510 
491   // -----------------------------------------    511   // ---------------------------------------------------------------//
492   //             Superior Final Part Monitor C    512   //             Superior Final Part Monitor Chambers   1       //
493   // -----------------------------------------    513   // ---------------------------------------------------------------//
494                                                   514 
495   const G4double outRadiusPFS1IORT = 35. *mm;     515   const G4double outRadiusPFS1IORT = 35. *mm;
496   const G4double innRadiusPFS1IORT = 10. *mm;     516   const G4double innRadiusPFS1IORT = 10. *mm;
497   const G4double hightPFS1IORT = 0.88 *mm;        517   const G4double hightPFS1IORT = 0.88 *mm;
498   const G4double startAnglePFS1IORT = 0.*deg;     518   const G4double startAnglePFS1IORT = 0.*deg;
499   const G4double spanningAnglePFS1IORT = 360.*    519   const G4double spanningAnglePFS1IORT = 360.*deg;
500   const G4double XPositionPFS1IORT = -1041.905    520   const G4double XPositionPFS1IORT = -1041.905 *mm;
501                                                   521     
502                                                   522   
503   solidPFS1IORT = new G4Tubs("PFS1IORT", innRa    523   solidPFS1IORT = new G4Tubs("PFS1IORT", innRadiusPFS1IORT, 
504             outRadiusPFS1IORT,                    524             outRadiusPFS1IORT,
505             hightPFS1IORT,                        525             hightPFS1IORT, 
506             startAnglePFS1IORT,                   526             startAnglePFS1IORT, 
507             spanningAnglePFS1IORT);               527             spanningAnglePFS1IORT);
508                                                   528 
509   G4LogicalVolume* logPFS1IORT = new G4Logical    529   G4LogicalVolume* logPFS1IORT = new G4LogicalVolume(solidPFS1IORT, 
510                     PFS1IORTMaterialIORT, "PFS    530                     PFS1IORTMaterialIORT, "PFS1IORT", 0, 0, 0);
511                                                   531 
512   physiPFS1IORT = new G4PVPlacement(G4Transfor    532   physiPFS1IORT = new G4PVPlacement(G4Transform3D(rm3, G4ThreeVector((XPositionPFS1IORT),0.,0.)),
513              "PFS1IORT", logPFS1IORT, physical    533              "PFS1IORT", logPFS1IORT, physicalTreatmentRoom, false, 0); 
514                                                   534 
515   logPFS1IORT -> SetVisAttributes(green);         535   logPFS1IORT -> SetVisAttributes(green);
516                                                   536 
517   // -----------------------------------------    537   // ------------------------------------------------//
518   //           Monitor Chambers Cylinder          538   //           Monitor Chambers Cylinder               //
519   // -----------------------------------------    539   // ------------------------------------------------//
520                                                   540 
521   const G4double outRadiusCCMIORT = 35. *mm;      541   const G4double outRadiusCCMIORT = 35. *mm;
522   const G4double innRadiusCCMIORT = 10. *mm;      542   const G4double innRadiusCCMIORT = 10. *mm;
523   const G4double hightCCMIORT = 4.0125 *mm;       543   const G4double hightCCMIORT = 4.0125 *mm;
524   const G4double startAngleCCMIORT = 0.*deg;      544   const G4double startAngleCCMIORT = 0.*deg;
525   const G4double spanningAngleCCMIORT = 360.*d    545   const G4double spanningAngleCCMIORT = 360.*deg;
526   const G4double XPositionCCMIORT = -1037.0125    546   const G4double XPositionCCMIORT = -1037.0125 *mm;
527                                                   547     
528                                                   548   
529   solidCCMIORT = new G4Tubs("CCMIORT", innRadi    549   solidCCMIORT = new G4Tubs("CCMIORT", innRadiusCCMIORT, 
530             outRadiusCCMIORT,                     550             outRadiusCCMIORT,
531             hightCCMIORT,                         551             hightCCMIORT, 
532             startAngleCCMIORT,                    552             startAngleCCMIORT, 
533             spanningAngleCCMIORT);                553             spanningAngleCCMIORT);
534                                                   554 
535   G4LogicalVolume* logCCMIORT = new G4LogicalV    555   G4LogicalVolume* logCCMIORT = new G4LogicalVolume(solidCCMIORT, 
536                     CCMIORTMaterialIORT, "CCMI    556                     CCMIORTMaterialIORT, "CCMIORT", 0, 0, 0);
537                                                   557 
538   physiCCMIORT = new G4PVPlacement(G4Transform    558   physiCCMIORT = new G4PVPlacement(G4Transform3D(rm3, G4ThreeVector((XPositionCCMIORT),0.,0.)),
539              "CCMIORT", logCCMIORT, physicalTr    559              "CCMIORT", logCCMIORT, physicalTreatmentRoom, false, 0); 
540                                                   560 
541   logCCMIORT -> SetVisAttributes(green);          561   logCCMIORT -> SetVisAttributes(green);
542                                                   562 
543                                                   563 
544   // -----------------------------------------    564   // ------------------------------------------------//
545   //        Second Monitor Chamber Lamina Al 2    565   //        Second Monitor Chamber Lamina Al 2 of 2  //
546   // -----------------------------------------    566   // ------------------------------------------------//
547                                                   567 
548   const G4double outRadiusCM2_2_2IORT = 20. *m    568   const G4double outRadiusCM2_2_2IORT = 20. *mm;
549   const G4double innRadiusCM2_2_2IORT = 0. *mm    569   const G4double innRadiusCM2_2_2IORT = 0. *mm;
550   const G4double hightCM2_2_2IORT = 0.025 *mm;    570   const G4double hightCM2_2_2IORT = 0.025 *mm;
551   const G4double startAngleCM2_2_2IORT = 0.*de    571   const G4double startAngleCM2_2_2IORT = 0.*deg;
552   const G4double spanningAngleCM2_2_2IORT = 36    572   const G4double spanningAngleCM2_2_2IORT = 360.*deg;
553   const G4double XPositionCM2_2_2IORT = -1041.    573   const G4double XPositionCM2_2_2IORT = -1041. *mm;
554                                                   574     
555                                                   575   
556   solidCM2_2_2IORT = new G4Tubs("CM2_2_2IORT",    576   solidCM2_2_2IORT = new G4Tubs("CM2_2_2IORT", innRadiusCM2_2_2IORT, 
557             outRadiusCM2_2_2IORT,                 577             outRadiusCM2_2_2IORT,
558             hightCM2_2_2IORT,                     578             hightCM2_2_2IORT, 
559             startAngleCM2_2_2IORT,                579             startAngleCM2_2_2IORT, 
560             spanningAngleCM2_2_2IORT);            580             spanningAngleCM2_2_2IORT);
561                                                   581 
562   G4LogicalVolume* logCM2_2_2IORT = new G4Logi    582   G4LogicalVolume* logCM2_2_2IORT = new G4LogicalVolume(solidCM2_2_2IORT, 
563                     CM2_2_2IORTMaterialIORT, "    583                     CM2_2_2IORTMaterialIORT, "CM2_2_2IORT", 0, 0, 0);
564                                                   584 
565   physiCM2_2_2IORT = new G4PVPlacement(G4Trans    585   physiCM2_2_2IORT = new G4PVPlacement(G4Transform3D(rm3, G4ThreeVector((XPositionCM2_2_2IORT),0.,0.)),
566              "CM2_2_2ORT", logCM2_2_2IORT, phy    586              "CM2_2_2ORT", logCM2_2_2IORT, physicalTreatmentRoom, false, 0); 
567                                                   587 
568   logCM2_2_2IORT -> SetVisAttributes(green);      588   logCM2_2_2IORT -> SetVisAttributes(green);  
569                                                   589 
570                                                   590 
571 // -------------------------------------------    591 // ------------------------------------------------//
572   //        Second Monitor Chamber Lamina Al 1    592   //        Second Monitor Chamber Lamina Al 1 of 2  //
573   // -----------------------------------------    593   // ------------------------------------------------//
574                                                   594 
575   const G4double outRadiusCM2_1_2IORT = 20. *m    595   const G4double outRadiusCM2_1_2IORT = 20. *mm;
576   const G4double innRadiusCM2_1_2IORT = 0. *mm    596   const G4double innRadiusCM2_1_2IORT = 0. *mm;
577   const G4double hightCM2_1_2IORT = 0.025 *mm;    597   const G4double hightCM2_1_2IORT = 0.025 *mm;
578   const G4double startAngleCM2_1_2IORT = 0.*de    598   const G4double startAngleCM2_1_2IORT = 0.*deg;
579   const G4double spanningAngleCM2_1_2IORT = 36    599   const G4double spanningAngleCM2_1_2IORT = 360.*deg;
580   const G4double XPositionCM2_1_2IORT = -1039.    600   const G4double XPositionCM2_1_2IORT = -1039. *mm;
581                                                   601     
582                                                   602   
583   solidCM2_1_2IORT = new G4Tubs("CM2_1_2IORT",    603   solidCM2_1_2IORT = new G4Tubs("CM2_1_2IORT", innRadiusCM2_1_2IORT, 
584             outRadiusCM2_1_2IORT,                 604             outRadiusCM2_1_2IORT,
585             hightCM2_1_2IORT,                     605             hightCM2_1_2IORT, 
586             startAngleCM2_1_2IORT,                606             startAngleCM2_1_2IORT, 
587             spanningAngleCM2_1_2IORT);            607             spanningAngleCM2_1_2IORT);
588                                                   608 
589   G4LogicalVolume* logCM2_1_2IORT = new G4Logi    609   G4LogicalVolume* logCM2_1_2IORT = new G4LogicalVolume(solidCM2_1_2IORT, 
590                     CM2_1_2IORTMaterialIORT, "    610                     CM2_1_2IORTMaterialIORT, "CM2_1_2IORT", 0, 0, 0);
591                                                   611 
592   physiCM2_1_2IORT = new G4PVPlacement(G4Trans    612   physiCM2_1_2IORT = new G4PVPlacement(G4Transform3D(rm3, G4ThreeVector((XPositionCM2_1_2IORT),0.,0.)),
593              "CM2_1_2ORT", logCM2_1_2IORT, phy    613              "CM2_1_2ORT", logCM2_1_2IORT, physicalTreatmentRoom, false, 0); 
594                                                   614 
595   logCM2_1_2IORT -> SetVisAttributes(yellow);     615   logCM2_1_2IORT -> SetVisAttributes(yellow); 
596                                                   616 
597   // -----------------------------------------    617   // ------------------------------------------------//
598   //        First Monitor Chamber Lamina Al 2     618   //        First Monitor Chamber Lamina Al 2 of 2    //
599   // -----------------------------------------    619   // ------------------------------------------------//
600                                                   620 
601   const G4double outRadiusCM1_2_2IORT = 20. *m    621   const G4double outRadiusCM1_2_2IORT = 20. *mm;
602   const G4double innRadiusCM1_2_2IORT = 0. *mm    622   const G4double innRadiusCM1_2_2IORT = 0. *mm;
603   const G4double hightCM1_2_2IORT = 0.025 *mm;    623   const G4double hightCM1_2_2IORT = 0.025 *mm;
604   const G4double startAngleCM1_2_2IORT = 0.*de    624   const G4double startAngleCM1_2_2IORT = 0.*deg;
605   const G4double spanningAngleCM1_2_2IORT = 36    625   const G4double spanningAngleCM1_2_2IORT = 360.*deg;
606   const G4double XPositionCM1_2_2IORT = -1037.    626   const G4double XPositionCM1_2_2IORT = -1037. *mm;
607                                                   627     
608                                                   628   
609   solidCM1_2_2IORT = new G4Tubs("CM1_2_2IORT",    629   solidCM1_2_2IORT = new G4Tubs("CM1_2_2IORT", innRadiusCM1_2_2IORT, 
610             outRadiusCM1_2_2IORT,                 630             outRadiusCM1_2_2IORT,
611             hightCM1_2_2IORT,                     631             hightCM1_2_2IORT, 
612             startAngleCM1_2_2IORT,                632             startAngleCM1_2_2IORT, 
613             spanningAngleCM1_2_2IORT);            633             spanningAngleCM1_2_2IORT);
614                                                   634 
615   G4LogicalVolume* logCM1_2_2IORT = new G4Logi    635   G4LogicalVolume* logCM1_2_2IORT = new G4LogicalVolume(solidCM1_2_2IORT, 
616                 CM1_2_2IORTMaterialIORT, "CM1_    636                 CM1_2_2IORTMaterialIORT, "CM1_2_2IORT", 0, 0, 0);
617                                                   637 
618   physiCM1_2_2IORT = new G4PVPlacement(G4Trans    638   physiCM1_2_2IORT = new G4PVPlacement(G4Transform3D(rm3, G4ThreeVector((XPositionCM1_2_2IORT),0.,0.)),
619              "CM1_2_2ORT", logCM1_2_2IORT, phy    639              "CM1_2_2ORT", logCM1_2_2IORT, physicalTreatmentRoom, false, 0); 
620                                                   640 
621                                                   641 
622   logCM1_2_2IORT -> SetVisAttributes(yellow);     642   logCM1_2_2IORT -> SetVisAttributes(yellow);
623                                                   643   
624   // -----------------------------------------    644   // ------------------------------------------------//
625   //        First Monitor Chamber Lamina Al 1     645   //        First Monitor Chamber Lamina Al 1 of 2         //
626   // -----------------------------------------    646   // ------------------------------------------------//
627                                                   647 
628   const G4double outRadiusCM1_1_2IORT = 20. *m    648   const G4double outRadiusCM1_1_2IORT = 20. *mm;
629   const G4double innRadiusCM1_1_2IORT = 0. *mm    649   const G4double innRadiusCM1_1_2IORT = 0. *mm;
630   const G4double hightCM1_1_2IORT = 0.025 *mm;    650   const G4double hightCM1_1_2IORT = 0.025 *mm;
631   const G4double startAngleCM1_1_2IORT = 0.*de    651   const G4double startAngleCM1_1_2IORT = 0.*deg;
632   const G4double spanningAngleCM1_1_2IORT = 36    652   const G4double spanningAngleCM1_1_2IORT = 360.*deg;
633   const G4double XPositionCM1_1_2IORT = -1035.    653   const G4double XPositionCM1_1_2IORT = -1035. *mm;
634                                                   654   
635                                                   655   
636                                                   656 
637   solidCM1_1_2IORT = new G4Tubs("CM1_1_2IORT",    657   solidCM1_1_2IORT = new G4Tubs("CM1_1_2IORT", innRadiusCM1_1_2IORT, 
638             outRadiusCM1_1_2IORT,                 658             outRadiusCM1_1_2IORT,
639             hightCM1_1_2IORT,                     659             hightCM1_1_2IORT, 
640             startAngleCM1_1_2IORT,                660             startAngleCM1_1_2IORT, 
641             spanningAngleCM1_1_2IORT);            661             spanningAngleCM1_1_2IORT);
642                                                   662 
643   G4LogicalVolume* logCM1_1_2IORT = new G4Logi    663   G4LogicalVolume* logCM1_1_2IORT = new G4LogicalVolume(solidCM1_1_2IORT, 
644                     CM1_1_2IORTMaterialIORT, "    664                     CM1_1_2IORTMaterialIORT, "CM1_1_2IORT", 0, 0, 0);
645                                                   665 
646   physiCM1_1_2IORT = new G4PVPlacement(G4Trans    666   physiCM1_1_2IORT = new G4PVPlacement(G4Transform3D(rm3, G4ThreeVector((XPositionCM1_1_2IORT),0.,0.)),
647              "CM1_1_2ORT", logCM1_1_2IORT, phy    667              "CM1_1_2ORT", logCM1_1_2IORT, physicalTreatmentRoom, false, 0); 
648   logCM1_1_2IORT -> SetVisAttributes(yellow);     668   logCM1_1_2IORT -> SetVisAttributes(yellow);
649 }                                                 669 }
650                                                   670 
651 void Collimator100BeamLine::IortBeamLineBlocks    671 void Collimator100BeamLine::IortBeamLineBlocks()
652 {                                                 672 {
653                                                   673 
654    G4double phi4 = 90. *deg;                      674    G4double phi4 = 90. *deg;     
655                                                   675 
656                                                   676             
657    G4RotationMatrix rm4;                          677    G4RotationMatrix rm4;               
658    rm4.rotateY(phi4);                             678    rm4.rotateY(phi4);
659                                                   679 
660 //////////////////////////////////////////////    680 ///////////////////////////////////////////////////////////////////////////////
661                                                   681 
662   // IORT BEAM LINE BLOCKS                        682   // IORT BEAM LINE BLOCKS
663                                                   683   
664 //////////////////////////////////////////////    684 ///////////////////////////////////////////////////////////////////////////////
665                                                   685 
666   // -----------------------------------------    686   // ------------------------------------------------//
667   //        Block 4       //                      687   //        Block 4       //
668   // -----------------------------------------    688   // ------------------------------------------------//
669                                                   689 
670   const G4double outRadiusBlocco20mmIORT = 36.    690   const G4double outRadiusBlocco20mmIORT = 36.5 *mm;
671   const G4double innRadiusBlocco20mmIORT = 10.    691   const G4double innRadiusBlocco20mmIORT = 10. *mm;
672   const G4double hightBlocco20mmIORT = 3. *mm;    692   const G4double hightBlocco20mmIORT = 3. *mm;
673   const G4double startAngleBlocco20mmIORT = 0.    693   const G4double startAngleBlocco20mmIORT = 0.*deg;
674   const G4double spanningAngleBlocco20mmIORT =    694   const G4double spanningAngleBlocco20mmIORT = 360.*deg;
675   const G4double XPositionBlocco20mmIORT = -10    695   const G4double XPositionBlocco20mmIORT = -1030. *mm;
676                                                   696     
677                                                   697   
678   solidBlocco20mmIORT = new G4Tubs("Blocco20mm    698   solidBlocco20mmIORT = new G4Tubs("Blocco20mmIORT", innRadiusBlocco20mmIORT, 
679             outRadiusBlocco20mmIORT,              699             outRadiusBlocco20mmIORT,
680             hightBlocco20mmIORT,                  700             hightBlocco20mmIORT, 
681             startAngleBlocco20mmIORT,             701             startAngleBlocco20mmIORT, 
682             spanningAngleBlocco20mmIORT);         702             spanningAngleBlocco20mmIORT);
683                                                   703 
684   G4LogicalVolume* logBlocco20mmIORT = new G4L    704   G4LogicalVolume* logBlocco20mmIORT = new G4LogicalVolume(solidBlocco20mmIORT, 
685                     Blocco20mmIORTMaterialIORT    705                     Blocco20mmIORTMaterialIORT, "Blocco20mmIORT", 0, 0, 0);
686                                                   706 
687   physiBlocco20mmIORT = new G4PVPlacement(G4Tr    707   physiBlocco20mmIORT = new G4PVPlacement(G4Transform3D(rm4, G4ThreeVector((XPositionBlocco20mmIORT),0.,0.)),
688              "Blocco20mmORT", logBlocco20mmIOR    708              "Blocco20mmORT", logBlocco20mmIORT, physicalTreatmentRoom, false, 0); 
689                                                   709 
690                                                   710 
691   logBlocco20mmIORT -> SetVisAttributes(green)    711   logBlocco20mmIORT -> SetVisAttributes(green);
692                                                   712 
693                                                   713 
694   // -----------------------//                    714   // -----------------------//
695   //        Block 3        //                     715   //        Block 3        //
696   // -----------------------//                    716   // -----------------------//
697                                                   717 
698   const G4double outRadiusBlocco3IORT = 36.5 *    718   const G4double outRadiusBlocco3IORT = 36.5 *mm;
699   const G4double innRadiusBlocco3IORT = 15. *m    719   const G4double innRadiusBlocco3IORT = 15. *mm;
700   const G4double hightBlocco3IORT = 3.5 *mm;      720   const G4double hightBlocco3IORT = 3.5 *mm;
701   const G4double startAngleBlocco3IORT = 0.*de    721   const G4double startAngleBlocco3IORT = 0.*deg;
702   const G4double spanningAngleBlocco3IORT = 36    722   const G4double spanningAngleBlocco3IORT = 360.*deg;
703   const G4double XPositionBlocco3IORT = -1023.    723   const G4double XPositionBlocco3IORT = -1023.5 *mm;
704                                                   724     
705                                                   725   
706   solidBlocco3IORT = new G4Tubs("Blocco3IORT",    726   solidBlocco3IORT = new G4Tubs("Blocco3IORT", innRadiusBlocco3IORT, 
707             outRadiusBlocco3IORT,                 727             outRadiusBlocco3IORT,
708             hightBlocco3IORT,                     728             hightBlocco3IORT, 
709             startAngleBlocco3IORT,                729             startAngleBlocco3IORT, 
710             spanningAngleBlocco3IORT);            730             spanningAngleBlocco3IORT);
711                                                   731 
712   G4LogicalVolume* logBlocco3IORT = new G4Logi    732   G4LogicalVolume* logBlocco3IORT = new G4LogicalVolume(solidBlocco3IORT, 
713                     Blocco3IORTMaterialIORT, "    733                     Blocco3IORTMaterialIORT, "Blocco3IORT", 0, 0, 0);
714                                                   734 
715   physiBlocco3IORT = new G4PVPlacement(G4Trans    735   physiBlocco3IORT = new G4PVPlacement(G4Transform3D(rm4, G4ThreeVector((XPositionBlocco3IORT),0.,0.)),
716              "Blocco3ORT", logBlocco3IORT, phy    736              "Blocco3ORT", logBlocco3IORT, physicalTreatmentRoom, false, 0); 
717                                                   737 
718                                                   738 
719   logBlocco3IORT -> SetVisAttributes(yellow);     739   logBlocco3IORT -> SetVisAttributes(yellow);
720                                                   740 
721  // -----------------------//                     741  // -----------------------//
722   //        Block 2        //                     742   //        Block 2        //
723   // -----------------------//                    743   // -----------------------//
724                                                   744 
725   const G4double outRadiusBlocco2IORT = 41.5 *    745   const G4double outRadiusBlocco2IORT = 41.5 *mm;
726   const G4double innRadiusBlocco2IORT = 15. *m    746   const G4double innRadiusBlocco2IORT = 15. *mm;
727   const G4double hightBlocco2IORT = 8. *mm;       747   const G4double hightBlocco2IORT = 8. *mm;
728   const G4double startAngleBlocco2IORT = 0.*de    748   const G4double startAngleBlocco2IORT = 0.*deg;
729   const G4double spanningAngleBlocco2IORT = 36    749   const G4double spanningAngleBlocco2IORT = 360.*deg;
730   const G4double XPositionBlocco2IORT = -1012.    750   const G4double XPositionBlocco2IORT = -1012. *mm;
731                                                   751     
732                                                   752   
733   solidBlocco2IORT = new G4Tubs("Blocco2IORT",    753   solidBlocco2IORT = new G4Tubs("Blocco2IORT", innRadiusBlocco2IORT, 
734             outRadiusBlocco2IORT,                 754             outRadiusBlocco2IORT,
735             hightBlocco2IORT,                     755             hightBlocco2IORT, 
736             startAngleBlocco2IORT,                756             startAngleBlocco2IORT, 
737             spanningAngleBlocco2IORT);            757             spanningAngleBlocco2IORT);
738                                                   758 
739   G4LogicalVolume* logBlocco2IORT = new G4Logi    759   G4LogicalVolume* logBlocco2IORT = new G4LogicalVolume(solidBlocco2IORT, 
740                     Blocco2IORTMaterialIORT, "    760                     Blocco2IORTMaterialIORT, "Blocco2IORT", 0, 0, 0);
741                                                   761 
742   physiBlocco2IORT = new G4PVPlacement(G4Trans    762   physiBlocco2IORT = new G4PVPlacement(G4Transform3D(rm4, G4ThreeVector((XPositionBlocco2IORT),0.,0.)),
743              "Blocco2IORT", logBlocco2IORT, ph    763              "Blocco2IORT", logBlocco2IORT, physicalTreatmentRoom, false, 0); 
744                                                   764 
745                                                   765 
746   logBlocco2IORT -> SetVisAttributes(red);        766   logBlocco2IORT -> SetVisAttributes(red);
747                                                   767 
748   // ----------------------- //                   768   // ----------------------- //
749   //       Block 1          //                    769   //       Block 1          //
750   // ----------------------- //                   770   // ----------------------- //
751                                                   771 
752   const G4double outRadiusBlocco1IORT = 52.0 *    772   const G4double outRadiusBlocco1IORT = 52.0 *mm;
753   const G4double innRadiusBlocco1IORT = 15. *m    773   const G4double innRadiusBlocco1IORT = 15. *mm;
754   const G4double hightBlocco1IORT = 8.5 *mm;      774   const G4double hightBlocco1IORT = 8.5 *mm;
755   const G4double startAngleBlocco1IORT = 0.*de    775   const G4double startAngleBlocco1IORT = 0.*deg;
756   const G4double spanningAngleBlocco1IORT = 36    776   const G4double spanningAngleBlocco1IORT = 360.*deg;
757   const G4double XPositionBlocco1IORT = -995.5    777   const G4double XPositionBlocco1IORT = -995.5*mm;
758                                                   778     
759                                                   779   
760   solidBlocco1IORT = new G4Tubs("Blocco1IORT",    780   solidBlocco1IORT = new G4Tubs("Blocco1IORT", innRadiusBlocco1IORT, 
761             outRadiusBlocco1IORT,                 781             outRadiusBlocco1IORT,
762             hightBlocco1IORT,                     782             hightBlocco1IORT, 
763             startAngleBlocco1IORT,                783             startAngleBlocco1IORT, 
764             spanningAngleBlocco1IORT);            784             spanningAngleBlocco1IORT);
765                                                   785 
766   G4LogicalVolume* logBlocco1IORT = new G4Logi    786   G4LogicalVolume* logBlocco1IORT = new G4LogicalVolume(solidBlocco1IORT, 
767                     Blocco1IORTMaterialIORT, "    787                     Blocco1IORTMaterialIORT, "Blocco1IORT", 0, 0, 0);
768                                                   788 
769   physiBlocco1IORT = new G4PVPlacement(G4Trans    789   physiBlocco1IORT = new G4PVPlacement(G4Transform3D(rm4, G4ThreeVector((XPositionBlocco1IORT),0.,0.)),
770              "Blocco1IORT", logBlocco1IORT, ph    790              "Blocco1IORT", logBlocco1IORT, physicalTreatmentRoom, false, 0); 
771                                                   791 
772                                                   792 
773   logBlocco1IORT -> SetVisAttributes(white);      793   logBlocco1IORT -> SetVisAttributes(white);
774                                                   794  
775 }                                                 795 }
776                                                   796 
777 void Collimator100BeamLine::IortBeamLineJuncti    797 void Collimator100BeamLine::IortBeamLineJunctions()
778 {                                                 798 {
779                                                   799  
780                                                   800 
781   G4double phi5 = 90. *deg;                       801   G4double phi5 = 90. *deg;     
782                                                   802 
783                                                   803        
784    G4RotationMatrix rm5;                          804    G4RotationMatrix rm5;               
785    rm5.rotateY(phi5);                             805    rm5.rotateY(phi5);
786 // --------------------------------- //           806 // --------------------------------- //
787   // Junction 5 FINAL COLLIMATOR IORT //          807   // Junction 5 FINAL COLLIMATOR IORT //
788   // --------------------------------- //         808   // --------------------------------- //
789                                                   809 
790   const G4double outRadiusGiunz5FinalCollIORT     810   const G4double outRadiusGiunz5FinalCollIORT = 48.25 *mm;
791   const G4double innRadiusGiunz5FinalCollIORT     811   const G4double innRadiusGiunz5FinalCollIORT = 13.75 *mm;
792   const G4double hightGiunz5FinalCollIORT = 3.    812   const G4double hightGiunz5FinalCollIORT = 3.5 *mm;
793   const G4double startAngleGiunz5FinalCollIORT    813   const G4double startAngleGiunz5FinalCollIORT = 0.*deg;
794   const G4double spanningAngleGiunz5FinalCollI    814   const G4double spanningAngleGiunz5FinalCollIORT = 360.*deg;
795   const G4double Giunz5FinalCollXPositionIORT     815   const G4double Giunz5FinalCollXPositionIORT = -983.5 *mm;
796                                                   816     
797                                                   817   
798                                                   818    
799   solidGiunz5FinalCollIORT = new G4Tubs("Giunz    819   solidGiunz5FinalCollIORT = new G4Tubs("Giunz5FinalCollIORT", innRadiusGiunz5FinalCollIORT, 
800             outRadiusGiunz5FinalCollIORT,         820             outRadiusGiunz5FinalCollIORT,
801             hightGiunz5FinalCollIORT,             821             hightGiunz5FinalCollIORT, 
802             startAngleGiunz5FinalCollIORT,        822             startAngleGiunz5FinalCollIORT, 
803             spanningAngleGiunz5FinalCollIORT);    823             spanningAngleGiunz5FinalCollIORT);
804                                                   824 
805   G4LogicalVolume* logGiunz5FinalCollIORT = ne    825   G4LogicalVolume* logGiunz5FinalCollIORT = new G4LogicalVolume(solidGiunz5FinalCollIORT, 
806                     Giunz5FinalCollMaterialIOR    826                     Giunz5FinalCollMaterialIORT, "Giunz5FinalCollIORT", 0, 0, 0);
807                                                   827 
808   physiGiunz5FinalCollIORT = new G4PVPlacement    828   physiGiunz5FinalCollIORT = new G4PVPlacement(G4Transform3D(rm5, G4ThreeVector((Giunz5FinalCollXPositionIORT),0.,0.)),
809              "Giunz5FinalCollIORT", logGiunz5F    829              "Giunz5FinalCollIORT", logGiunz5FinalCollIORT, physicalTreatmentRoom, false, 0); 
810                                                   830 
811   logGiunz5FinalCollIORT -> SetVisAttributes(y    831   logGiunz5FinalCollIORT -> SetVisAttributes(yellow);
812                                                   832 
813 // --------------------------------- //           833 // --------------------------------- //
814   // Junction 4 FINAL COLLIMATOR IORT //          834   // Junction 4 FINAL COLLIMATOR IORT //
815   // --------------------------------- //         835   // --------------------------------- //
816                                                   836 
817   const G4double outRadiusGiunz4FinalCollIORT     837   const G4double outRadiusGiunz4FinalCollIORT = 42. *mm;
818   const G4double innRadiusGiunz4FinalCollIORT     838   const G4double innRadiusGiunz4FinalCollIORT = 13.75 *mm;
819   const G4double hightGiunz4FinalCollIORT = 8.    839   const G4double hightGiunz4FinalCollIORT = 8.5 *mm;
820   const G4double startAngleGiunz4FinalCollIORT    840   const G4double startAngleGiunz4FinalCollIORT = 0.*deg;
821   const G4double spanningAngleGiunz4FinalCollI    841   const G4double spanningAngleGiunz4FinalCollIORT = 360.*deg;
822   const G4double Giunz4FinalCollXPositionIORT     842   const G4double Giunz4FinalCollXPositionIORT = -971.5 *mm;
823                                                   843     
824                                                   844  
825                                                   845    
826   solidGiunz4FinalCollIORT = new G4Tubs("Giunz    846   solidGiunz4FinalCollIORT = new G4Tubs("Giunz4FinalCollIORT", innRadiusGiunz4FinalCollIORT, 
827             outRadiusGiunz4FinalCollIORT,         847             outRadiusGiunz4FinalCollIORT,
828             hightGiunz4FinalCollIORT,             848             hightGiunz4FinalCollIORT, 
829             startAngleGiunz4FinalCollIORT,        849             startAngleGiunz4FinalCollIORT, 
830             spanningAngleGiunz4FinalCollIORT);    850             spanningAngleGiunz4FinalCollIORT);
831                                                   851 
832   G4LogicalVolume* logGiunz4FinalCollIORT = ne    852   G4LogicalVolume* logGiunz4FinalCollIORT = new G4LogicalVolume(solidGiunz4FinalCollIORT, 
833                     Giunz4FinalCollMaterialIOR    853                     Giunz4FinalCollMaterialIORT, "Giunz4FinalCollIORT", 0, 0, 0);
834                                                   854 
835   physiGiunz4FinalCollIORT = new G4PVPlacement    855   physiGiunz4FinalCollIORT = new G4PVPlacement(G4Transform3D(rm5, G4ThreeVector((Giunz4FinalCollXPositionIORT),0.,0.)),
836              "Giunz4FinalCollIORT", logGiunz4F    856              "Giunz4FinalCollIORT", logGiunz4FinalCollIORT, physicalTreatmentRoom, false, 0); 
837                                                   857 
838   logGiunz4FinalCollIORT -> SetVisAttributes(b    858   logGiunz4FinalCollIORT -> SetVisAttributes(blue); 
839                                                   859 
840                                                   860 
841                                                   861   
842  // --------------------------------- //          862  // --------------------------------- //
843   // Junction 3 FINAL COLLIMATOR IORT //          863   // Junction 3 FINAL COLLIMATOR IORT //
844   // --------------------------------- //         864   // --------------------------------- //
845                                                   865    
846   const G4double outRadiusGiunz3FinalCollIORT     866   const G4double outRadiusGiunz3FinalCollIORT = 42. *mm;
847   const G4double innRadiusGiunz3FinalCollIORT     867   const G4double innRadiusGiunz3FinalCollIORT = 0. *mm;
848   const G4double hightGiunz3FinalCollIORT = 4.    868   const G4double hightGiunz3FinalCollIORT = 4.25 *mm;
849   const G4double startAngleGiunz3FinalCollIORT    869   const G4double startAngleGiunz3FinalCollIORT = 0.*deg;
850   const G4double spanningAngleGiunz3FinalCollI    870   const G4double spanningAngleGiunz3FinalCollIORT = 360.*deg;
851   const G4double Giunz3FinalCollXPositionIORT     871   const G4double Giunz3FinalCollXPositionIORT = -958.75 *mm;
852                                                   872     
853                                                   873      
854   solidGiunz3FinalCollIORT = new G4Tubs("Giunz    874   solidGiunz3FinalCollIORT = new G4Tubs("Giunz3FinalCollIORT", innRadiusGiunz3FinalCollIORT, 
855             outRadiusGiunz3FinalCollIORT,         875             outRadiusGiunz3FinalCollIORT,
856             hightGiunz3FinalCollIORT,             876             hightGiunz3FinalCollIORT, 
857             startAngleGiunz3FinalCollIORT,        877             startAngleGiunz3FinalCollIORT, 
858             spanningAngleGiunz3FinalCollIORT);    878             spanningAngleGiunz3FinalCollIORT);
859                                                   879 
860   G4LogicalVolume* logicsolidGiunz3FinalCollIO    880   G4LogicalVolume* logicsolidGiunz3FinalCollIORT = new G4LogicalVolume(solidGiunz3FinalCollIORT, 
861                     Giunz3FinalCollMaterialIOR    881                     Giunz3FinalCollMaterialIORT, "Giunz3FinalCollIORT", 0, 0, 0);
862                                                   882 
863   physiGiunz3FinalCollIORT = new G4PVPlacement    883   physiGiunz3FinalCollIORT = new G4PVPlacement(G4Transform3D(rm5, G4ThreeVector((Giunz3FinalCollXPositionIORT),0.,0.)),
864              "Giunz3FinalCollIORT", logicsolid    884              "Giunz3FinalCollIORT", logicsolidGiunz3FinalCollIORT, physicalTreatmentRoom, false, 0); 
865                                                   885 
866   logicsolidGiunz3FinalCollIORT -> SetVisAttri    886   logicsolidGiunz3FinalCollIORT -> SetVisAttributes(yellow);
867  //  logicsolidGiunz3FinalCollIORT -> SetVisAt << 887  //  logicsolidGiunz3FinalCollIORT -> SetVisAttributes (G4VisAttributes::Invisible);
868                                                   888 
869                                                   889 
870                                                   890 
871   // --------------------------------- //         891   // --------------------------------- //
872   // Junction 3 FINAL COLLIMATOR IORT internal    892   // Junction 3 FINAL COLLIMATOR IORT internal //
873   // --------------------------------- //         893   // --------------------------------- //
874                                                   894    
875                                                   895  
876                                                   896      
877   solidGiunz3FinalCollIntIORT = new G4Cons("Gi    897   solidGiunz3FinalCollIntIORT = new G4Cons("Giunz3FinalCollIntIORT",0.*mm,13.75*mm,0.*mm,22.25*mm,4.25*mm,0.*deg,360.*deg);
878                                                   898 
879   G4LogicalVolume* logicsolidGiunz3FinalCollIn    899   G4LogicalVolume* logicsolidGiunz3FinalCollIntIORT = new G4LogicalVolume(solidGiunz3FinalCollIntIORT, 
880                     Giunz3FinalCollMaterialInt    900                     Giunz3FinalCollMaterialIntIORT, "Giunz3FinalCollIntIORT", 0, 0, 0);
881                                                   901 
882   physiGiunz3FinalCollIntIORT = new G4PVPlacem    902   physiGiunz3FinalCollIntIORT = new G4PVPlacement(0, G4ThreeVector(0.,0.,0.),"Giunz3FinalCollIntIORT", logicsolidGiunz3FinalCollIntIORT,physiGiunz3FinalCollIORT, false, 0); 
883                                                   903 
884   logicsolidGiunz3FinalCollIntIORT -> SetVisAt    904   logicsolidGiunz3FinalCollIntIORT -> SetVisAttributes(yellow); 
885                                                   905 
886                                                   906 
887 // --------------------------------- //           907 // --------------------------------- //
888   // Junction 2 FINAL COLLIMATOR IORT //          908   // Junction 2 FINAL COLLIMATOR IORT //
889   // --------------------------------- //         909   // --------------------------------- //
890                                                   910 
891   const G4double outRadiusGiunz2FinalCollIORT     911   const G4double outRadiusGiunz2FinalCollIORT = 42. *mm;
892   const G4double innRadiusGiunz2FinalCollIORT     912   const G4double innRadiusGiunz2FinalCollIORT = 22.25 *mm;
893   const G4double hightGiunz2FinalCollIORT = 5.    913   const G4double hightGiunz2FinalCollIORT = 5.75 *mm;
894   const G4double startAngleGiunz2FinalCollIORT    914   const G4double startAngleGiunz2FinalCollIORT = 0.*deg;
895   const G4double spanningAngleGiunz2FinalCollI    915   const G4double spanningAngleGiunz2FinalCollIORT = 360.*deg;
896   const G4double Giunz2FinalCollXPositionIORT     916   const G4double Giunz2FinalCollXPositionIORT = -948.75 *mm;
897                                                   917     
898                                                   918   
899                                                   919    
900   solidGiunz2FinalCollIORT = new G4Tubs("Giunz    920   solidGiunz2FinalCollIORT = new G4Tubs("Giunz2FinalCollIORT", innRadiusGiunz2FinalCollIORT, 
901             outRadiusGiunz2FinalCollIORT,         921             outRadiusGiunz2FinalCollIORT,
902             hightGiunz2FinalCollIORT,             922             hightGiunz2FinalCollIORT, 
903             startAngleGiunz2FinalCollIORT,        923             startAngleGiunz2FinalCollIORT, 
904             spanningAngleGiunz2FinalCollIORT);    924             spanningAngleGiunz2FinalCollIORT);
905                                                   925 
906   G4LogicalVolume* logGiunz2FinalCollIORT = ne    926   G4LogicalVolume* logGiunz2FinalCollIORT = new G4LogicalVolume(solidGiunz2FinalCollIORT, 
907                     Giunz2FinalCollMaterialIOR    927                     Giunz2FinalCollMaterialIORT, "Giunz2FinalCollIORT", 0, 0, 0);
908                                                   928 
909   physiGiunz2FinalCollIORT = new G4PVPlacement    929   physiGiunz2FinalCollIORT = new G4PVPlacement(G4Transform3D(rm5, G4ThreeVector((Giunz2FinalCollXPositionIORT),0.,0.)),
910              "Giunz2FinalCollIORT", logGiunz2F    930              "Giunz2FinalCollIORT", logGiunz2FinalCollIORT, physicalTreatmentRoom, false, 0); 
911                                                   931 
912   logGiunz2FinalCollIORT -> SetVisAttributes(r    932   logGiunz2FinalCollIORT -> SetVisAttributes(red); 
913                                                   933  
914 // --------------------------------- //           934 // --------------------------------- //
915   // Junction 1 FINAL COLLIMATOR IORT //          935   // Junction 1 FINAL COLLIMATOR IORT //
916   // --------------------------------- //         936   // --------------------------------- //
917                                                   937 
918   const G4double outRadiusGiunz1FinalCollIORT     938   const G4double outRadiusGiunz1FinalCollIORT = 65. *mm;
919   const G4double innRadiusGiunz1FinalCollIORT     939   const G4double innRadiusGiunz1FinalCollIORT = 22.25 *mm;
920   const G4double hightGiunz1FinalCollIORT = 10    940   const G4double hightGiunz1FinalCollIORT = 10. *mm;
921   const G4double startAngleGiunz1FinalCollIORT    941   const G4double startAngleGiunz1FinalCollIORT = 0.*deg;
922   const G4double spanningAngleGiunz1FinalCollI    942   const G4double spanningAngleGiunz1FinalCollIORT = 360.*deg;
923   const G4double Giunz1FinalCollXPositionIORT     943   const G4double Giunz1FinalCollXPositionIORT = -933.*mm;
924                                                   944     
925                                                   945   
926                                                   946    
927   solidGiunz1FinalCollIORT = new G4Tubs("Giunz    947   solidGiunz1FinalCollIORT = new G4Tubs("Giunz1FinalCollIORT", innRadiusGiunz1FinalCollIORT, 
928             outRadiusGiunz1FinalCollIORT,         948             outRadiusGiunz1FinalCollIORT,
929             hightGiunz1FinalCollIORT,             949             hightGiunz1FinalCollIORT, 
930             startAngleGiunz1FinalCollIORT,        950             startAngleGiunz1FinalCollIORT, 
931             spanningAngleGiunz1FinalCollIORT);    951             spanningAngleGiunz1FinalCollIORT);
932                                                   952 
933   G4LogicalVolume* logGiunz1FinalCollIORT = ne    953   G4LogicalVolume* logGiunz1FinalCollIORT = new G4LogicalVolume(solidGiunz1FinalCollIORT, 
934                     Giunz1FinalCollMaterialIOR    954                     Giunz1FinalCollMaterialIORT, "Giunz1FinalCollIORT", 0, 0, 0);
935                                                   955 
936   physiGiunz1FinalCollIORT = new G4PVPlacement    956   physiGiunz1FinalCollIORT = new G4PVPlacement(G4Transform3D(rm5, G4ThreeVector((Giunz1FinalCollXPositionIORT),0.,0.)),
937              "Giunz1FinalCollIORT", logGiunz1F    957              "Giunz1FinalCollIORT", logGiunz1FinalCollIORT, physicalTreatmentRoom, false, 0); 
938                                                   958 
939    logGiunz1FinalCollIORT -> SetVisAttributes(    959    logGiunz1FinalCollIORT -> SetVisAttributes(gray); 
940                                                   960 
941 }                                                 961 }
942                                                   962 
943 void Collimator100BeamLine::IortBeamLineFinalC    963 void Collimator100BeamLine::IortBeamLineFinalCollimator()
944 {                                                 964 {
945 // -----------------------//                      965 // -----------------------//
946   // FINAL COLLIMATOR IORT  //                    966   // FINAL COLLIMATOR IORT  //
947   //------------------------//                    967   //------------------------//
948                                                   968 
949  // const G4double outRadiusFinalCollimatorIOR    969  // const G4double outRadiusFinalCollimatorIORT = 45. *mm;
950  // const G4double innRadiusFinalCollimatorIOR    970  // const G4double innRadiusFinalCollimatorIORT = 40. *mm;
951   const G4double hightFinalCollimatorIORT = 43    971   const G4double hightFinalCollimatorIORT = 434. *mm;
952   const G4double startAngleFinalCollimatorIORT    972   const G4double startAngleFinalCollimatorIORT = 0.*deg;
953   const G4double spanningAngleFinalCollimatorI    973   const G4double spanningAngleFinalCollimatorIORT = 360.*deg;
954   const G4double finalCollimatorXPositionIORT     974   const G4double finalCollimatorXPositionIORT = -489.*mm;
955                                                   975 
956                                                   976   
957                                                   977  
958                                                   978   
959   G4double phi6 = 90. *deg;                       979   G4double phi6 = 90. *deg;     
960                                                   980 
961                                                   981            
962    G4RotationMatrix rm6;                          982    G4RotationMatrix rm6;               
963    rm6.rotateY(phi6);                             983    rm6.rotateY(phi6);
964                                                   984 
965                                                   985     
966   solidFinalCollimatorIORT = new G4Tubs("Final    986   solidFinalCollimatorIORT = new G4Tubs("FinalCollimatorIORT", innerRadiusFinalCollimatorIORT, 
967             OuterRadiusFinalCollimatorIORT,       987             OuterRadiusFinalCollimatorIORT,
968             hightFinalCollimatorIORT,             988             hightFinalCollimatorIORT, 
969             startAngleFinalCollimatorIORT,        989             startAngleFinalCollimatorIORT, 
970             spanningAngleFinalCollimatorIORT);    990             spanningAngleFinalCollimatorIORT);
971                                                   991 
972   G4LogicalVolume* logFinalCollimatorIORT = ne    992   G4LogicalVolume* logFinalCollimatorIORT = new G4LogicalVolume(solidFinalCollimatorIORT, 
973                     finalCollimatorMaterialIOR    993                     finalCollimatorMaterialIORT, "FinalCollimatorIORT", 0, 0, 0);
974                                                   994 
975   physiFinalCollimatorIORT = new G4PVPlacement    995   physiFinalCollimatorIORT = new G4PVPlacement(G4Transform3D(rm6, G4ThreeVector((finalCollimatorXPositionIORT),0.,0.)),
976              "FinalCollimatorIORT", logFinalCo    996              "FinalCollimatorIORT", logFinalCollimatorIORT, physicalTreatmentRoom, false, 0); 
977                                                   997 
978   //  logFinalCollimatorIORT -> SetVisAttribut << 998   //  logFinalCollimatorIORT -> SetVisAttributes(G4VisAttributes::Invisible); 
979    logFinalCollimatorIORT -> SetVisAttributes(    999    logFinalCollimatorIORT -> SetVisAttributes(darkGreen); 
980                                                   1000 
981 }                                                 1001 }
982                                                   1002 
983 //////////////////////////////////////////////    1003 /////////////////////////////////////////////////////////////////////////////
984 /////////////////////////// MESSENGER ////////    1004 /////////////////////////// MESSENGER ///////////////////////////////////////
985 //////////////////////////////////////////////    1005 /////////////////////////////////////////////////////////////////////////////
986                                                   1006 
987                                                   1007 
988 void Collimator100BeamLine::SetInnerRadiusFina    1008 void Collimator100BeamLine::SetInnerRadiusFinalCollimatorIORT(G4double value)
989 {                                                 1009 {
990   solidFinalCollimatorIORT -> SetInnerRadius(v    1010   solidFinalCollimatorIORT -> SetInnerRadius(value);
991   G4RunManager::GetRunManager() -> GeometryHas    1011   G4RunManager::GetRunManager() -> GeometryHasBeenModified();
992   G4cout<<"Inner Radius of the final collimato    1012   G4cout<<"Inner Radius of the final collimator IORT is (mm):"
993   << solidFinalCollimatorIORT -> GetInnerRadiu    1013   << solidFinalCollimatorIORT -> GetInnerRadius()/mm
994   << G4endl;                                      1014   << G4endl; 
995 }                                                 1015 }
996                                                   1016 
997 //////////////////////////////////////////////    1017 /////////////////////////////////////////////////////////////////////////
998                                                   1018 
999 void Collimator100BeamLine::SetOuterRadiusFina    1019 void Collimator100BeamLine::SetOuterRadiusFinalCollimatorIORT(G4double value)
1000 {                                                1020 {
1001   solidFinalCollimatorIORT -> SetOuterRadius(    1021   solidFinalCollimatorIORT -> SetOuterRadius(value);
1002   G4RunManager::GetRunManager() -> GeometryHa    1022   G4RunManager::GetRunManager() -> GeometryHasBeenModified();
1003   G4cout<<"Outer Radius of the final collimat    1023   G4cout<<"Outer Radius of the final collimator IORT is (mm):"
1004   << solidFinalCollimatorIORT -> GetOuterRadi    1024   << solidFinalCollimatorIORT -> GetOuterRadius()/mm
1005   << G4endl;                                     1025   << G4endl; 
1006 }                                                1026 }
1007                                                  1027 
1008 /////////////////////////////////////////////    1028 /////////////////////////////////////////////////////////////////////////////
1009                                                  1029 
1010                                                  1030 
1011                                                  1031 
1012                                                  1032