Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-31 09:22:29

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 // This is the *BASIC* version of IORT, a Geant4-based application
0027 //
0028 // Main Authors: G.Russo(a,b), C.Casarino*(c), G.C. Candiano(c), G.A.P. Cirrone(d), F.Romano(d)
0029 // Contributor Authors: S.Guatelli(e)
0030 // Past Authors: G.Arnetta(c), S.E.Mazzaglia(d)
0031 //    
0032 //   (a) Fondazione Istituto San Raffaele G.Giglio, Cefalù, Italy
0033 //   (b) IBFM-CNR , Segrate (Milano), Italy
0034 //   (c) LATO (Laboratorio di Tecnologie Oncologiche), Cefalù, Italy
0035 //   (d) Laboratori Nazionali del Sud of the INFN, Catania, Italy
0036 //   (e) University of Wollongong, Australia
0037 //
0038 //   *Corresponding author, email to carlo.casarino@polooncologicocefalu.it
0039 //////////////////////////////////////////////////////////////////////////////////////////////
0040 
0041 #include "globals.hh"
0042 #include "G4SystemOfUnits.hh"
0043 #include "G4Box.hh"
0044 #include "G4Tubs.hh"
0045 #include "G4Cons.hh"  
0046 #include "G4VisAttributes.hh"
0047 #include "G4Colour.hh"
0048 #include "G4RunManager.hh"
0049 #include "G4LogicalVolume.hh"
0050 #include "G4PVPlacement.hh"
0051 #include "G4RotationMatrix.hh"
0052 #include "G4NistManager.hh"
0053 #include "G4NistElementBuilder.hh"
0054 #include "G4SubtractionSolid.hh"   
0055 #include "IORTDetectorConstruction.hh" 
0056 #include "Collimator40BeamLine.hh"
0057 #include "Collimator40BeamLineMessenger.hh"  
0058 
0059 Collimator40BeamLine::Collimator40BeamLine():
0060   physicalTreatmentRoom(0),iortDetectorConstruction(0),
0061   
0062   
0063 
0064   solidFinalCollimatorIORT(0),
0065   physiFinalCollimatorIORT(0),
0066 
0067   solidGiunz3FinalCollIORT(0),
0068   physiGiunz3FinalCollIORT(0),  
0069 
0070   solidGiunz3FinalCollIntIORT(0),
0071   physiGiunz3FinalCollIntIORT(0), 
0072   
0073   solidGiunz4FinalCollIORT(0),
0074   physiGiunz4FinalCollIORT(0),
0075 
0076   solidGiunz5FinalCollIORT(0),
0077   physiGiunz5FinalCollIORT(0),
0078   
0079   solidBlocco1IORT(0),
0080   physiBlocco1IORT(0),
0081 
0082   solidBlocco2IORT(0),
0083   physiBlocco2IORT(0),
0084 
0085   solidBlocco3IORT(0),
0086   physiBlocco3IORT(0),
0087 
0088   solidBlocco20mmIORT(0),
0089   physiBlocco20mmIORT(0),  
0090 
0091   solidCM1_1_2IORT(0),
0092   physiCM1_1_2IORT(0),
0093   
0094   solidCM1_2_2IORT(0),
0095   physiCM1_2_2IORT(0),
0096   
0097   solidCM2_1_2IORT(0),
0098   physiCM2_1_2IORT(0),
0099 
0100   solidCM2_2_2IORT(0),
0101   physiCM2_2_2IORT(0),  
0102 
0103   solidCCMIORT(0),
0104   physiCCMIORT(0),
0105 
0106   solidPFS1IORT(0),
0107   physiPFS1IORT(0),
0108 
0109   solidPFS2IORT(0),
0110   physiPFS2IORT(0),
0111 
0112   solidPFS3IORT(0),
0113   physiPFS3IORT(0),
0114 
0115   solidFTIORT(0),
0116   physiFTIORT(0)
0117 
0118 
0119 {
0120   // Messenger to change parameters of the collimator40BeamLine geometry
0121   collimatorMessenger = new Collimator40BeamLineMessenger(this);
0122 
0123 }
0124 /////////////////////////////////////////////////////////////////////////////
0125 Collimator40BeamLine::~Collimator40BeamLine()
0126 {
0127   delete collimatorMessenger;
0128   delete iortDetectorConstruction;
0129 }
0130 
0131 /////////////////////////////////////////////////////////////////////////////
0132 
0133 
0134 G4VPhysicalVolume* Collimator40BeamLine::Construct()
0135 { 
0136   // Sets default geometry and materials
0137   SetDefaultDimensions();
0138   
0139   // Construct the whole Collimator Beam Line 
0140   ConstructCollimator40BeamLine();
0141 
0142   // IORTDetectorConstruction builds ONLY the phantom and the detector with its associated ROGeometry
0143   iortDetectorConstruction = new IORTDetectorConstruction(physicalTreatmentRoom); 
0144   
0145   return physicalTreatmentRoom;
0146 }
0147 
0148 // In the following method the DEFAULTS used in the geometry of 
0149 // collimator beam line are provided
0150 // HERE THE USER CAN CHANGE THE GEOMETRY CHARACTERISTICS OF BEAM
0151 // LINE ELEMENTS, ALTERNATIVELY HE/SHE CAN USE THE MACRO FILE (IF A 
0152 // MESSENGER IS PROVIDED)
0153 //
0154 // DEFAULT MATERIAL ARE ALSO PROVIDED   
0155 // and COLOURS ARE ALSO DEFINED
0156 // ----------------------------------------------------------
0157 /////////////////////////////////////////////////////////////////////////////
0158 void Collimator40BeamLine::SetDefaultDimensions()
0159 {
0160 
0161    // Set of coulors that can be used
0162   white = new G4VisAttributes( G4Colour());
0163   white -> SetVisibility(true);
0164   //white -> SetForceSolid(true);
0165     
0166   blue = new G4VisAttributes(G4Colour(0. ,0. ,1.));
0167   blue -> SetVisibility(true);
0168   //blue -> SetForceSolid(true);
0169     
0170   gray = new G4VisAttributes( G4Colour(0.5, 0.5, 0.5 ));
0171   gray-> SetVisibility(true);
0172   //gray-> SetForceSolid(true);
0173     
0174   red = new G4VisAttributes(G4Colour(1. ,0. ,0.));
0175   red-> SetVisibility(true);
0176   //red-> SetForceSolid(true);
0177     
0178   yellow = new G4VisAttributes(G4Colour(1., 1., 0. ));
0179   yellow-> SetVisibility(true);
0180   //yellow-> SetForceSolid(true);
0181     
0182   green = new G4VisAttributes( G4Colour(25/255. , 255/255. ,  25/255. ));
0183   green -> SetVisibility(true);
0184   //green -> SetForceSolid(true);
0185     
0186   darkGreen = new G4VisAttributes( G4Colour(0/255. , 100/255. ,  0/255. ));
0187   darkGreen -> SetVisibility(true);
0188   //darkGreen -> SetForceSolid(true);
0189         
0190   darkOrange3 = new G4VisAttributes( G4Colour(205/255. , 102/255. ,  000/255. ));
0191   darkOrange3 -> SetVisibility(true);
0192   //darkOrange3 -> SetForceSolid(true);
0193     
0194   skyBlue = new G4VisAttributes( G4Colour(135/255. , 206/255. ,  235/255. ));
0195   skyBlue -> SetVisibility(true);
0196   //skyBlue -> SetForceSolid(true);
0197 
0198   
0199 
0200   // Geometry FINAL COLLIMATOR DEFAULTS
0201 
0202   G4double defaultOuterRadiusFinalCollimatorIORT = 25. *mm;
0203   OuterRadiusFinalCollimatorIORT = defaultOuterRadiusFinalCollimatorIORT;
0204 
0205   G4double defaultinnerRadiusFinalCollimatorIORT = 20. *mm;
0206   innerRadiusFinalCollimatorIORT = defaultinnerRadiusFinalCollimatorIORT;
0207 
0208   // DEFAULT DEFINITION OF THE MATERIALS
0209   // All elements and compound definition follows the NIST database
0210  
0211   // ELEMENTS
0212   G4bool isotopes = false;
0213   G4Material* aluminumNist = G4NistManager::Instance()->FindOrBuildMaterial("G4_Al", isotopes);
0214   //G4Material* tantalumNist = G4NistManager::Instance()->FindOrBuildMaterial("G4_Ta", isotopes); 
0215   //G4Material* copperNistAsMaterial = G4NistManager::Instance()->FindOrBuildMaterial("G4_Cu", isotopes);
0216   G4Element* zincNist = G4NistManager::Instance()->FindOrBuildElement("Zn");
0217   G4Element* copperNist = G4NistManager::Instance()->FindOrBuildElement("Cu");
0218 
0219   // COMPOUND
0220   G4Material* airNist =  G4NistManager::Instance()->FindOrBuildMaterial("G4_AIR", isotopes);
0221   //G4Material* kaptonNist = G4NistManager::Instance()->FindOrBuildMaterial("G4_KAPTON", isotopes);
0222   G4Material* galacticNist = G4NistManager::Instance()->FindOrBuildMaterial("G4_Galactic", isotopes);
0223   G4Material* PMMANist = G4NistManager::Instance()->FindOrBuildMaterial("G4_PLEXIGLASS", isotopes);
0224   //G4Material* mylarNist = G4NistManager::Instance()->FindOrBuildMaterial("G4_MYLAR", isotopes);
0225   G4Material* titanioNist = G4NistManager::Instance()->FindOrBuildMaterial("G4_Ti", isotopes); 
0226     
0227   G4double d; // Density
0228   G4int nComponents;// Number of components 
0229   G4double fractionmass; // Fraction in mass of an element in a material
0230 
0231   d = 8.40*g/cm3;   // brass 
0232   nComponents = 2;
0233   G4Material* brass = new G4Material("Brass", d, nComponents);  
0234   brass -> AddElement(zincNist, fractionmass = 30 *perCent);
0235   brass -> AddElement(copperNist, fractionmass = 70 *perCent);
0236 
0237  
0238   // MATERIAL ASSIGNMENT
0239 
0240 
0241  // Material of the FINAL COLLIMATOR IORT
0242   finalCollimatorMaterialIORT = PMMANist;
0243 
0244  // Junction 1 FINAL COLLIMATOR IORT
0245   Giunz1FinalCollMaterialIORT = PMMANist;
0246 
0247  // Junction 2 FINAL COLLIMATOR IORT
0248   Giunz2FinalCollMaterialIORT = PMMANist;
0249  
0250  // Junction 3 FINAL COLLIMATOR IORT
0251   Giunz3FinalCollMaterialIORT = PMMANist;
0252  
0253  // Junction 3 FINAL COLLIMATOR Int IORT
0254   Giunz3FinalCollMaterialIntIORT = airNist;
0255 
0256  // Junction 4 FINAL COLLIMATOR IORT
0257   Giunz4FinalCollMaterialIORT = PMMANist;
0258 
0259  // Junction 5 FINAL COLLIMATOR IORT
0260   Giunz5FinalCollMaterialIORT = PMMANist;
0261 
0262  // Block 1 Diameter 30 mm 
0263   Blocco1IORTMaterialIORT = PMMANist; 
0264 
0265  // Block 2 Diameter 30 mm 
0266   Blocco2IORTMaterialIORT = PMMANist; 
0267 
0268  // Block 3 Diameter 30 mm 
0269   Blocco3IORTMaterialIORT = PMMANist;
0270 
0271  // Block Diameter 20 mm 
0272   Blocco20mmIORTMaterialIORT = PMMANist;
0273 
0274  // First Monitor Chamber Lamina Al 1 of 2  
0275     CM1_1_2IORTMaterialIORT = aluminumNist;
0276 
0277  // First Monitor Chamber Lamina Al 2 of 2  
0278     CM1_2_2IORTMaterialIORT = aluminumNist;
0279 
0280  // Second Monitor Chamber Lamina Al 1 of 2  
0281     CM2_1_2IORTMaterialIORT = aluminumNist;
0282 
0283  // Second Monitor Chamber Lamina Al 2 of 2  
0284     CM2_2_2IORTMaterialIORT = aluminumNist;
0285     
0286  // Monitor Chamber Cylinder 
0287     CCMIORTMaterialIORT = PMMANist;
0288 
0289  // Superior Final Part Monitor Chambers
0290     PFS1IORTMaterialIORT = PMMANist;
0291 
0292  // Superior Final Part Monitor Chambers
0293     PFS2IORTMaterialIORT = PMMANist;
0294 
0295  // Superior Final Part Monitor Chambers
0296     PFS3IORTMaterialIORT = PMMANist;
0297 
0298  // Superior Final Part Monitor Chambers Material
0299     FTIORTMaterialIORT = titanioNist;
0300 
0301  // Vacuum Source
0302     VSIORTMaterialIORT = galacticNist;
0303 }
0304 
0305 /////////////////////////////////////////////////////////////////////////////
0306 void Collimator40BeamLine::ConstructCollimator40BeamLine()
0307 { 
0308   // -----------------------------
0309   // Treatment room - World volume
0310   //------------------------------
0311   // Treatment room sizes
0312   const G4double worldX = 400.0 *cm;
0313   const G4double worldY = 400.0 *cm;
0314   const G4double worldZ = 400.0 *cm;
0315   G4bool isotopes = false;
0316  
0317   G4Material* airNist =  G4NistManager::Instance()->FindOrBuildMaterial("G4_AIR", isotopes);
0318   G4Box* treatmentRoom = new G4Box("TreatmentRoom",worldX,worldY,worldZ);
0319   G4LogicalVolume* logicTreatmentRoom = new G4LogicalVolume(treatmentRoom, 
0320                                                             airNist, 
0321                                                             "logicTreatmentRoom", 
0322                                 0,0,0);
0323   physicalTreatmentRoom = new G4PVPlacement(0,
0324                         G4ThreeVector(),
0325                         "physicalTreatmentRoom", 
0326                         logicTreatmentRoom, 
0327                         0,false,0);
0328  
0329 
0330   // The treatment room is invisible in the Visualisation
0331   logicTreatmentRoom -> SetVisAttributes (G4VisAttributes::GetInvisible());
0332  
0333   // Components of the Collimator Beam Line
0334 
0335   IortBeamLineVacuumSource();
0336   IortBeamLineTitaniumWindows();
0337   IortBeamLineMonitorChambers();
0338   IortBeamLineBlocks() ;
0339   IortBeamLineJunctions(); 
0340   IortBeamLineFinalCollimator();
0341     
0342 }
0343 
0344 
0345 void Collimator40BeamLine::IortBeamLineVacuumSource()
0346 {
0347  // ---------------------------------------------------------------//
0348   //                     Vacuum Source                             //
0349   // ---------------------------------------------------------------//
0350 
0351   
0352   G4double phi1 = 90. *deg;     
0353 
0354             
0355    G4RotationMatrix rm1;               
0356    rm1.rotateY(phi1);
0357 
0358   const G4double outRadiusVSIORT = 44.75 *mm;
0359   const G4double innRadiusVSIORT = 0.*mm;
0360   const G4double hightVSIORT = 1. *mm;
0361   const G4double startAngleVSIORT = 0.*deg;
0362   const G4double spanningAngleVSIORT = 360.*deg;
0363   const G4double XPositionVSIORT = -862.797 *mm;
0364     
0365   solidVSIORT = new G4Tubs("VSIORT", innRadiusVSIORT, 
0366                     outRadiusVSIORT,
0367                     hightVSIORT, 
0368                     startAngleVSIORT, 
0369                     spanningAngleVSIORT);
0370 
0371   G4LogicalVolume* logVSIORT = new G4LogicalVolume(solidVSIORT, 
0372                                   VSIORTMaterialIORT, "VSIORT", 0, 0, 0);
0373 
0374   physiVSIORT = new G4PVPlacement(G4Transform3D(rm1, G4ThreeVector((XPositionVSIORT),0.,0.)),
0375                        "VSIORT", logVSIORT, physicalTreatmentRoom, false, 0); 
0376 
0377   logVSIORT -> SetVisAttributes(green);
0378 
0379 }
0380 
0381 void Collimator40BeamLine::IortBeamLineTitaniumWindows()
0382 {
0383 // ---------------------------------------------------------------//
0384   //                     Titanium Window                        //
0385   // ---------------------------------------------------------------//
0386 
0387   G4double phi2 = 90. *deg;     
0388 
0389            
0390    G4RotationMatrix rm2;               
0391    rm2.rotateY(phi2);
0392 
0393   const G4double outRadiusFTIORT = 44.75 *mm;
0394   const G4double innRadiusFTIORT = 8.5 *mm;
0395   const G4double hightFTIORT = 0.006 *mm;
0396   const G4double startAngleFTIORT = 0.*deg;
0397   const G4double spanningAngleFTIORT = 360.*deg;
0398   const G4double XPositionFTIORT = -861.791 *mm;
0399     
0400   solidFTIORT = new G4Tubs("FTIORT", innRadiusFTIORT, 
0401                     outRadiusFTIORT,
0402                     hightFTIORT, 
0403                     startAngleFTIORT, 
0404                     spanningAngleFTIORT);
0405 
0406   G4LogicalVolume* logFTIORT = new G4LogicalVolume(solidFTIORT, 
0407                                   FTIORTMaterialIORT, "FTIORT", 0, 0, 0);
0408 
0409   physiFTIORT = new G4PVPlacement(G4Transform3D(rm2, G4ThreeVector((XPositionFTIORT),0.,0.)),
0410                        "FTIORT", logFTIORT, physicalTreatmentRoom, false, 0); 
0411 
0412   logFTIORT -> SetVisAttributes(yellow);
0413 }
0414 
0415 void Collimator40BeamLine::IortBeamLineMonitorChambers()
0416 {
0417 
0418    G4double phi3 = 90. *deg;     
0419 
0420             
0421    G4RotationMatrix rm3;               
0422    rm3.rotateY(phi3);
0423 
0424 ///////////////////////////////////////////////////////////////////////////////
0425 
0426   // Monitor Chamber System
0427 
0428 ///////////////////////////////////////////////////////////////////////////////
0429  
0430 
0431   // ---------------------------------------------------------------//
0432   //             Superior Final Part Monitor Chambers   3      //
0433   // ---------------------------------------------------------------//
0434 
0435   const G4double outRadiusPFS3IORT = 44.75 *mm;
0436   const G4double innRadiusPFS3IORT = 17.5 *mm;
0437   const G4double hightPFS3IORT = 3.03 *mm;
0438   const G4double startAnglePFS3IORT = 0.*deg;
0439   const G4double spanningAnglePFS3IORT = 360.*deg;
0440   const G4double XPositionPFS3IORT = -848.755 *mm;
0441     
0442   solidPFS3IORT = new G4Tubs("PFS3IORT", innRadiusPFS3IORT, 
0443                     outRadiusPFS3IORT,
0444                     hightPFS3IORT, 
0445                     startAnglePFS3IORT, 
0446                     spanningAnglePFS3IORT);
0447 
0448   G4LogicalVolume* logPFS3IORT = new G4LogicalVolume(solidPFS3IORT, 
0449                                   PFS3IORTMaterialIORT, "PFS3IORT", 0, 0, 0);
0450 
0451   physiPFS3IORT = new G4PVPlacement(G4Transform3D(rm3, G4ThreeVector((XPositionPFS3IORT),0.,0.)),
0452                        "PFS3IORT", logPFS3IORT, physicalTreatmentRoom, false, 0); 
0453 
0454   logPFS3IORT -> SetVisAttributes(white);
0455 
0456   
0457   // ---------------------------------------------------------------//
0458   //             Superior Final Part Monitor Chambers  2       //
0459   // ---------------------------------------------------------------//
0460 
0461   const G4double outRadiusPFS2IORT = 44.75 *mm;
0462   const G4double innRadiusPFS2IORT = 10. *mm;
0463   const G4double hightPFS2IORT = 1.47 *mm;
0464   const G4double startAnglePFS2IORT = 0.*deg;
0465   const G4double spanningAnglePFS2IORT = 360.*deg;
0466   const G4double XPositionPFS2IORT = -844.255 *mm;
0467     
0468   
0469   solidPFS2IORT = new G4Tubs("PFS2IORT", innRadiusPFS2IORT, 
0470                     outRadiusPFS2IORT,
0471                     hightPFS2IORT, 
0472                     startAnglePFS2IORT, 
0473                     spanningAnglePFS2IORT);
0474 
0475   G4LogicalVolume* logPFS2IORT = new G4LogicalVolume(solidPFS2IORT, 
0476                                   PFS2IORTMaterialIORT, "PFS2IORT", 0, 0, 0);
0477 
0478   physiPFS2IORT = new G4PVPlacement(G4Transform3D(rm3, G4ThreeVector((XPositionPFS2IORT),0.,0.)),
0479                        "PFS2IORT", logPFS2IORT, physicalTreatmentRoom, false, 0); 
0480 
0481   logPFS2IORT -> SetVisAttributes(green);
0482 
0483   // ---------------------------------------------------------------//
0484   //             Superior Final Part Monitor Chambers  1       //
0485   // ---------------------------------------------------------------//
0486 
0487   const G4double outRadiusPFS1IORT = 35. *mm;
0488   const G4double innRadiusPFS1IORT = 10. *mm;
0489   const G4double hightPFS1IORT = 0.88 *mm;
0490   const G4double startAnglePFS1IORT = 0.*deg;
0491   const G4double spanningAnglePFS1IORT = 360.*deg;
0492   const G4double XPositionPFS1IORT = -841.905 *mm;
0493     
0494   
0495   solidPFS1IORT = new G4Tubs("PFS1IORT", innRadiusPFS1IORT, 
0496                     outRadiusPFS1IORT,
0497                     hightPFS1IORT, 
0498                     startAnglePFS1IORT, 
0499                     spanningAnglePFS1IORT);
0500 
0501   G4LogicalVolume* logPFS1IORT = new G4LogicalVolume(solidPFS1IORT, 
0502                                   PFS1IORTMaterialIORT, "PFS1IORT", 0, 0, 0);
0503 
0504   physiPFS1IORT = new G4PVPlacement(G4Transform3D(rm3, G4ThreeVector((XPositionPFS1IORT),0.,0.)),
0505                        "PFS1IORT", logPFS1IORT, physicalTreatmentRoom, false, 0); 
0506 
0507   logPFS1IORT -> SetVisAttributes(green);
0508 
0509   // ------------------------------------------------//
0510   //           Monitor Chambers Cylinder              //
0511   // ------------------------------------------------//
0512 
0513   const G4double outRadiusCCMIORT = 35. *mm;
0514   const G4double innRadiusCCMIORT = 10. *mm;
0515   const G4double hightCCMIORT = 4.0125 *mm;
0516   const G4double startAngleCCMIORT = 0.*deg;
0517   const G4double spanningAngleCCMIORT = 360.*deg;
0518   const G4double XPositionCCMIORT = -837.0125 *mm;
0519     
0520   
0521   solidCCMIORT = new G4Tubs("CCMIORT", innRadiusCCMIORT, 
0522                     outRadiusCCMIORT,
0523                     hightCCMIORT, 
0524                     startAngleCCMIORT, 
0525                     spanningAngleCCMIORT);
0526 
0527   G4LogicalVolume* logCCMIORT = new G4LogicalVolume(solidCCMIORT, 
0528                                   CCMIORTMaterialIORT, "CCMIORT", 0, 0, 0);
0529 
0530   physiCCMIORT = new G4PVPlacement(G4Transform3D(rm3, G4ThreeVector((XPositionCCMIORT),0.,0.)),
0531                        "CCMIORT", logCCMIORT, physicalTreatmentRoom, false, 0); 
0532 
0533   logCCMIORT -> SetVisAttributes(green);
0534 
0535 
0536   // ------------------------------------------------//
0537   //        Second Monitor Chamber Lamina Al 2 of 2  //
0538   // ------------------------------------------------//
0539 
0540   const G4double outRadiusCM2_2_2IORT = 20. *mm;
0541   const G4double innRadiusCM2_2_2IORT = 0. *mm;
0542   const G4double hightCM2_2_2IORT = 0.025 *mm;
0543   const G4double startAngleCM2_2_2IORT = 0.*deg;
0544   const G4double spanningAngleCM2_2_2IORT = 360.*deg;
0545   const G4double XPositionCM2_2_2IORT = -841. *mm;
0546     
0547   
0548   solidCM2_2_2IORT = new G4Tubs("CM2_2_2IORT", innRadiusCM2_2_2IORT, 
0549                     outRadiusCM2_2_2IORT,
0550                     hightCM2_2_2IORT, 
0551                     startAngleCM2_2_2IORT, 
0552                     spanningAngleCM2_2_2IORT);
0553 
0554   G4LogicalVolume* logCM2_2_2IORT = new G4LogicalVolume(solidCM2_2_2IORT, 
0555                                   CM2_2_2IORTMaterialIORT, "CM2_2_2IORT", 0, 0, 0);
0556 
0557   physiCM2_2_2IORT = new G4PVPlacement(G4Transform3D(rm3, G4ThreeVector((XPositionCM2_2_2IORT),0.,0.)),
0558                        "CM2_2_2ORT", logCM2_2_2IORT, physicalTreatmentRoom, false, 0); 
0559 
0560   logCM2_2_2IORT -> SetVisAttributes(green);  
0561 
0562 
0563 // ------------------------------------------------//
0564   //        Second Monitor Chamber Lamina Al 1 of 2  //
0565   // ------------------------------------------------//
0566 
0567   const G4double outRadiusCM2_1_2IORT = 20. *mm;
0568   const G4double innRadiusCM2_1_2IORT = 0. *mm;
0569   const G4double hightCM2_1_2IORT = 0.025 *mm;
0570   const G4double startAngleCM2_1_2IORT = 0.*deg;
0571   const G4double spanningAngleCM2_1_2IORT = 360.*deg;
0572   const G4double XPositionCM2_1_2IORT = -839. *mm;
0573     
0574   
0575   solidCM2_1_2IORT = new G4Tubs("CM2_1_2IORT", innRadiusCM2_1_2IORT, 
0576                     outRadiusCM2_1_2IORT,
0577                     hightCM2_1_2IORT, 
0578                     startAngleCM2_1_2IORT, 
0579                     spanningAngleCM2_1_2IORT);
0580 
0581   G4LogicalVolume* logCM2_1_2IORT = new G4LogicalVolume(solidCM2_1_2IORT, 
0582                                   CM2_1_2IORTMaterialIORT, "CM2_1_2IORT", 0, 0, 0);
0583 
0584   physiCM2_1_2IORT = new G4PVPlacement(G4Transform3D(rm3, G4ThreeVector((XPositionCM2_1_2IORT),0.,0.)),
0585                        "CM2_1_2ORT", logCM2_1_2IORT, physicalTreatmentRoom, false, 0); 
0586 
0587   logCM2_1_2IORT -> SetVisAttributes(yellow); 
0588 
0589   // ------------------------------------------------//
0590   //        First Monitor Chamber Lamina Al 2 of 2    //
0591   // ------------------------------------------------//
0592 
0593   const G4double outRadiusCM1_2_2IORT = 20. *mm;
0594   const G4double innRadiusCM1_2_2IORT = 0. *mm;
0595   const G4double hightCM1_2_2IORT = 0.025 *mm;
0596   const G4double startAngleCM1_2_2IORT = 0.*deg;
0597   const G4double spanningAngleCM1_2_2IORT = 360.*deg;
0598   const G4double XPositionCM1_2_2IORT = -837. *mm;
0599     
0600   solidCM1_2_2IORT = new G4Tubs("CM1_2_2IORT", innRadiusCM1_2_2IORT, 
0601                     outRadiusCM1_2_2IORT,
0602                     hightCM1_2_2IORT, 
0603                     startAngleCM1_2_2IORT, 
0604                     spanningAngleCM1_2_2IORT);
0605 
0606   G4LogicalVolume* logCM1_2_2IORT = new G4LogicalVolume(solidCM1_2_2IORT, 
0607                               CM1_2_2IORTMaterialIORT, "CM1_2_2IORT", 0, 0, 0);
0608 
0609   physiCM1_2_2IORT = new G4PVPlacement(G4Transform3D(rm3, G4ThreeVector((XPositionCM1_2_2IORT),0.,0.)),
0610                        "CM1_2_2ORT", logCM1_2_2IORT, physicalTreatmentRoom, false, 0); 
0611 
0612   logCM1_2_2IORT -> SetVisAttributes(yellow);
0613   
0614   // ------------------------------------------------//
0615   //        First Monitor Chamber Lamina Al 1 of 2        //
0616   // ------------------------------------------------//
0617 
0618   const G4double outRadiusCM1_1_2IORT = 20. *mm;
0619   const G4double innRadiusCM1_1_2IORT = 0. *mm;
0620   const G4double hightCM1_1_2IORT = 0.025 *mm;
0621   const G4double startAngleCM1_1_2IORT = 0.*deg;
0622   const G4double spanningAngleCM1_1_2IORT = 360.*deg;
0623   const G4double XPositionCM1_1_2IORT = -835. *mm;
0624   
0625   
0626 
0627   solidCM1_1_2IORT = new G4Tubs("CM1_1_2IORT", innRadiusCM1_1_2IORT, 
0628                     outRadiusCM1_1_2IORT,
0629                     hightCM1_1_2IORT, 
0630                     startAngleCM1_1_2IORT, 
0631                     spanningAngleCM1_1_2IORT);
0632 
0633   G4LogicalVolume* logCM1_1_2IORT = new G4LogicalVolume(solidCM1_1_2IORT, 
0634                                   CM1_1_2IORTMaterialIORT, "CM1_1_2IORT", 0, 0, 0);
0635 
0636   physiCM1_1_2IORT = new G4PVPlacement(G4Transform3D(rm3, G4ThreeVector((XPositionCM1_1_2IORT),0.,0.)),
0637                        "CM1_1_2ORT", logCM1_1_2IORT, physicalTreatmentRoom, false, 0); 
0638 
0639   logCM1_1_2IORT -> SetVisAttributes(yellow);
0640 }
0641 
0642 void Collimator40BeamLine::IortBeamLineBlocks()
0643 {
0644 
0645    G4double phi4 = 90. *deg;     
0646 
0647             
0648    G4RotationMatrix rm4;               
0649    rm4.rotateY(phi4);
0650 
0651 ///////////////////////////////////////////////////////////////////////////////
0652 
0653   // IORT BEAM LINE BLOCKS
0654   
0655 ///////////////////////////////////////////////////////////////////////////////
0656 
0657   // ------------------------------------------------//
0658   //        Block 4                                  //
0659   // ------------------------------------------------//
0660 
0661   const G4double outRadiusBlocco20mmIORT = 36.5 *mm;
0662   const G4double innRadiusBlocco20mmIORT = 10. *mm;
0663   const G4double hightBlocco20mmIORT = 3. *mm;
0664   const G4double startAngleBlocco20mmIORT = 0.*deg;
0665   const G4double spanningAngleBlocco20mmIORT = 360.*deg;
0666   const G4double XPositionBlocco20mmIORT = -830. *mm;
0667     
0668   
0669   solidBlocco20mmIORT = new G4Tubs("Blocco20mmIORT", innRadiusBlocco20mmIORT, 
0670                     outRadiusBlocco20mmIORT,
0671                     hightBlocco20mmIORT, 
0672                     startAngleBlocco20mmIORT, 
0673                     spanningAngleBlocco20mmIORT);
0674 
0675   G4LogicalVolume* logBlocco20mmIORT = new G4LogicalVolume(solidBlocco20mmIORT, 
0676                                   Blocco20mmIORTMaterialIORT, "Blocco20mmIORT", 0, 0, 0);
0677 
0678   physiBlocco20mmIORT = new G4PVPlacement(G4Transform3D(rm4, G4ThreeVector((XPositionBlocco20mmIORT),0.,0.)),
0679                        "Blocco20mmORT", logBlocco20mmIORT, physicalTreatmentRoom, false, 0); 
0680 
0681   logBlocco20mmIORT -> SetVisAttributes(green);
0682 
0683 
0684   // -----------------------//
0685   //        Block 3        //
0686   // -----------------------//
0687 
0688   const G4double outRadiusBlocco3IORT = 36.5 *mm;
0689   const G4double innRadiusBlocco3IORT = 15. *mm;
0690   const G4double hightBlocco3IORT = 3.5 *mm;
0691   const G4double startAngleBlocco3IORT = 0.*deg;
0692   const G4double spanningAngleBlocco3IORT = 360.*deg;
0693   const G4double XPositionBlocco3IORT = -823.5 *mm;
0694     
0695   
0696   solidBlocco3IORT = new G4Tubs("Blocco3IORT", innRadiusBlocco3IORT, 
0697                     outRadiusBlocco3IORT,
0698                     hightBlocco3IORT, 
0699                     startAngleBlocco3IORT, 
0700                     spanningAngleBlocco3IORT);
0701 
0702   G4LogicalVolume* logBlocco3IORT = new G4LogicalVolume(solidBlocco3IORT, 
0703                                   Blocco3IORTMaterialIORT, "Blocco3IORT", 0, 0, 0);
0704 
0705   physiBlocco3IORT = new G4PVPlacement(G4Transform3D(rm4, G4ThreeVector((XPositionBlocco3IORT),0.,0.)),
0706                        "Blocco3ORT", logBlocco3IORT, physicalTreatmentRoom, false, 0); 
0707 
0708   logBlocco3IORT -> SetVisAttributes(yellow);
0709 
0710  // -----------------------//
0711   //        Block 2        //
0712   // -----------------------//
0713 
0714   const G4double outRadiusBlocco2IORT = 41.5 *mm;
0715   const G4double innRadiusBlocco2IORT = 15. *mm;
0716   const G4double hightBlocco2IORT = 8. *mm;
0717   const G4double startAngleBlocco2IORT = 0.*deg;
0718   const G4double spanningAngleBlocco2IORT = 360.*deg;
0719   const G4double XPositionBlocco2IORT = -812. *mm;
0720     
0721   
0722   solidBlocco2IORT = new G4Tubs("Blocco2IORT", innRadiusBlocco2IORT, 
0723                     outRadiusBlocco2IORT,
0724                     hightBlocco2IORT, 
0725                     startAngleBlocco2IORT, 
0726                     spanningAngleBlocco2IORT);
0727 
0728   G4LogicalVolume* logBlocco2IORT = new G4LogicalVolume(solidBlocco2IORT, 
0729                                   Blocco2IORTMaterialIORT, "Blocco2IORT", 0, 0, 0);
0730 
0731   physiBlocco2IORT = new G4PVPlacement(G4Transform3D(rm4, G4ThreeVector((XPositionBlocco2IORT),0.,0.)),
0732                        "Blocco2IORT", logBlocco2IORT, physicalTreatmentRoom, false, 0); 
0733 
0734   logBlocco2IORT -> SetVisAttributes(red);
0735 
0736   // ----------------------- //
0737   //       Block 1          //
0738   // ----------------------- //
0739 
0740   const G4double outRadiusBlocco1IORT = 52.0 *mm;
0741   const G4double innRadiusBlocco1IORT = 15. *mm;
0742   const G4double hightBlocco1IORT = 8.5 *mm;
0743   const G4double startAngleBlocco1IORT = 0.*deg;
0744   const G4double spanningAngleBlocco1IORT = 360.*deg;
0745   const G4double XPositionBlocco1IORT = -795.5*mm;
0746     
0747   
0748   solidBlocco1IORT = new G4Tubs("Blocco1IORT", innRadiusBlocco1IORT, 
0749                     outRadiusBlocco1IORT,
0750                     hightBlocco1IORT, 
0751                     startAngleBlocco1IORT, 
0752                     spanningAngleBlocco1IORT);
0753 
0754   G4LogicalVolume* logBlocco1IORT = new G4LogicalVolume(solidBlocco1IORT, 
0755                                   Blocco1IORTMaterialIORT, "Blocco1IORT", 0, 0, 0);
0756 
0757   physiBlocco1IORT = new G4PVPlacement(G4Transform3D(rm4, G4ThreeVector((XPositionBlocco1IORT),0.,0.)),
0758                        "Blocco1IORT", logBlocco1IORT, physicalTreatmentRoom, false, 0); 
0759 
0760   logBlocco1IORT -> SetVisAttributes(white);
0761 }
0762 
0763 void Collimator40BeamLine::IortBeamLineJunctions()
0764 {
0765  
0766 
0767   G4double phi5 = 90. *deg;     
0768 
0769           
0770    G4RotationMatrix rm5;               
0771    rm5.rotateY(phi5);
0772 // --------------------------------- //
0773   // Junction 5 FINAL COLLIMATOR IORT //
0774   // --------------------------------- //
0775 
0776   const G4double outRadiusGiunz5FinalCollIORT = 48.25 *mm;
0777   const G4double innRadiusGiunz5FinalCollIORT = 13.75 *mm;
0778   const G4double hightGiunz5FinalCollIORT = 3.5 *mm;
0779   const G4double startAngleGiunz5FinalCollIORT = 0.*deg;
0780   const G4double spanningAngleGiunz5FinalCollIORT = 360.*deg;
0781   const G4double Giunz5FinalCollXPositionIORT = -783.5 *mm;
0782     
0783   solidGiunz5FinalCollIORT = new G4Tubs("Giunz5FinalCollIORT", innRadiusGiunz5FinalCollIORT, 
0784                     outRadiusGiunz5FinalCollIORT,
0785                     hightGiunz5FinalCollIORT, 
0786                     startAngleGiunz5FinalCollIORT, 
0787                     spanningAngleGiunz5FinalCollIORT);
0788 
0789   G4LogicalVolume* logGiunz5FinalCollIORT = new G4LogicalVolume(solidGiunz5FinalCollIORT, 
0790                                   Giunz5FinalCollMaterialIORT, "Giunz5FinalCollIORT", 0, 0, 0);
0791 
0792   physiGiunz5FinalCollIORT = new G4PVPlacement(G4Transform3D(rm5, G4ThreeVector((Giunz5FinalCollXPositionIORT),0.,0.)),
0793                        "Giunz5FinalCollIORT", logGiunz5FinalCollIORT, physicalTreatmentRoom, false, 0); 
0794 
0795   logGiunz5FinalCollIORT -> SetVisAttributes(yellow);
0796 
0797 // --------------------------------- //
0798   // Junction 4 FINAL COLLIMATOR IORT //
0799   // --------------------------------- //
0800 
0801   const G4double outRadiusGiunz4FinalCollIORT = 42. *mm;
0802   const G4double innRadiusGiunz4FinalCollIORT = 13.75 *mm;
0803   const G4double hightGiunz4FinalCollIORT = 8.5 *mm;
0804   const G4double startAngleGiunz4FinalCollIORT = 0.*deg;
0805   const G4double spanningAngleGiunz4FinalCollIORT = 360.*deg;
0806   const G4double Giunz4FinalCollXPositionIORT = -771.5 *mm;
0807     
0808  
0809    
0810   solidGiunz4FinalCollIORT = new G4Tubs("Giunz4FinalCollIORT", innRadiusGiunz4FinalCollIORT, 
0811                     outRadiusGiunz4FinalCollIORT,
0812                     hightGiunz4FinalCollIORT, 
0813                     startAngleGiunz4FinalCollIORT, 
0814                     spanningAngleGiunz4FinalCollIORT);
0815 
0816   G4LogicalVolume* logGiunz4FinalCollIORT = new G4LogicalVolume(solidGiunz4FinalCollIORT, 
0817                                   Giunz4FinalCollMaterialIORT, "Giunz4FinalCollIORT", 0, 0, 0);
0818 
0819   physiGiunz4FinalCollIORT = new G4PVPlacement(G4Transform3D(rm5, G4ThreeVector((Giunz4FinalCollXPositionIORT),0.,0.)),
0820                        "Giunz4FinalCollIORT", logGiunz4FinalCollIORT, physicalTreatmentRoom, false, 0); 
0821 
0822   logGiunz4FinalCollIORT -> SetVisAttributes(blue); 
0823 
0824 
0825   
0826  // --------------------------------- //
0827   // Junction 3 FINAL COLLIMATOR IORT //
0828   // --------------------------------- //
0829    
0830   const G4double outRadiusGiunz3FinalCollIORT = 42. *mm;
0831   const G4double innRadiusGiunz3FinalCollIORT = 0. *mm;
0832   const G4double hightGiunz3FinalCollIORT = 4.25 *mm;
0833   const G4double startAngleGiunz3FinalCollIORT = 0.*deg;
0834   const G4double spanningAngleGiunz3FinalCollIORT = 360.*deg;
0835   const G4double Giunz3FinalCollXPositionIORT = -758.75 *mm;
0836     
0837      
0838   solidGiunz3FinalCollIORT = new G4Tubs("Giunz3FinalCollIORT", innRadiusGiunz3FinalCollIORT, 
0839                     outRadiusGiunz3FinalCollIORT,
0840                     hightGiunz3FinalCollIORT, 
0841                     startAngleGiunz3FinalCollIORT, 
0842                     spanningAngleGiunz3FinalCollIORT);
0843 
0844   G4LogicalVolume* logicsolidGiunz3FinalCollIORT = new G4LogicalVolume(solidGiunz3FinalCollIORT, 
0845                                   Giunz3FinalCollMaterialIORT, "Giunz3FinalCollIORT", 0, 0, 0);
0846 
0847   physiGiunz3FinalCollIORT = new G4PVPlacement(G4Transform3D(rm5, G4ThreeVector((Giunz3FinalCollXPositionIORT),0.,0.)),
0848                        "Giunz3FinalCollIORT", logicsolidGiunz3FinalCollIORT, physicalTreatmentRoom, false, 0); 
0849 
0850  logicsolidGiunz3FinalCollIORT -> SetVisAttributes(yellow);
0851  //  logicsolidGiunz3FinalCollIORT -> SetVisAttributes (G4VisAttributes::GetInvisible());
0852 
0853 
0854 
0855   // --------------------------------- //
0856   // Junction 3 FINAL COLLIMATOR IORT internal //
0857   // --------------------------------- //
0858    
0859  
0860      
0861   solidGiunz3FinalCollIntIORT = new G4Cons("Giunz3FinalCollIntIORT",0.*mm,13.75*mm,0.*mm,20.0*mm,4.25*mm,0.*deg,360.*deg);
0862 
0863   G4LogicalVolume* logicsolidGiunz3FinalCollIntIORT = new G4LogicalVolume(solidGiunz3FinalCollIntIORT, 
0864                                   Giunz3FinalCollMaterialIntIORT, "Giunz3FinalCollIntIORT", 0, 0, 0);
0865 
0866   physiGiunz3FinalCollIntIORT = new G4PVPlacement(0, G4ThreeVector(0.,0.,0.),"Giunz3FinalCollIntIORT", logicsolidGiunz3FinalCollIntIORT,physiGiunz3FinalCollIORT, false, 0); 
0867 
0868   logicsolidGiunz3FinalCollIntIORT -> SetVisAttributes(yellow); 
0869 }
0870 
0871 void Collimator40BeamLine::IortBeamLineFinalCollimator()
0872 {
0873 // -----------------------//
0874   // FINAL COLLIMATOR IORT  //
0875   //------------------------//
0876 
0877  // const G4double outRadiusFinalCollimatorIORT = 35. *mm;
0878  // const G4double innRadiusFinalCollimatorIORT = 30. *mm;
0879   const G4double hightFinalCollimatorIORT = 349.75 *mm;
0880   const G4double startAngleFinalCollimatorIORT = 0.*deg;
0881   const G4double spanningAngleFinalCollimatorIORT = 360.*deg;
0882   const G4double finalCollimatorXPositionIORT = -404.75 *mm;
0883 
0884   G4double phi6 = 90. *deg;     
0885 
0886             
0887    G4RotationMatrix rm6;               
0888    rm6.rotateY(phi6);
0889 
0890     
0891   solidFinalCollimatorIORT = new G4Tubs("FinalCollimatorIORT", innerRadiusFinalCollimatorIORT, 
0892                     OuterRadiusFinalCollimatorIORT,
0893                     hightFinalCollimatorIORT, 
0894                     startAngleFinalCollimatorIORT, 
0895                     spanningAngleFinalCollimatorIORT);
0896 
0897   G4LogicalVolume* logFinalCollimatorIORT = new G4LogicalVolume(solidFinalCollimatorIORT, 
0898                                   finalCollimatorMaterialIORT, "FinalCollimatorIORT", 0, 0, 0);
0899 
0900   physiFinalCollimatorIORT = new G4PVPlacement(G4Transform3D(rm6, G4ThreeVector((finalCollimatorXPositionIORT),0.,0.)),
0901                        "FinalCollimatorIORT", logFinalCollimatorIORT, physicalTreatmentRoom, false, 0); 
0902 
0903   //  logFinalCollimatorIORT -> SetVisAttributes(G4VisAttributes::GetInvisible()); 
0904   logFinalCollimatorIORT -> SetVisAttributes(green); 
0905 
0906 }
0907 
0908 /////////////////////////////////////////////////////////////////////////////
0909 /////////////////////////// MESSENGER ///////////////////////////////////////
0910 /////////////////////////////////////////////////////////////////////////////
0911 
0912 
0913 void Collimator40BeamLine::SetInnerRadiusFinalCollimatorIORT(G4double value)
0914 {
0915   solidFinalCollimatorIORT -> SetInnerRadius(value);
0916   G4RunManager::GetRunManager() -> GeometryHasBeenModified();
0917   G4cout<<"Inner Radius of the final collimator IORT is (mm):"
0918     << solidFinalCollimatorIORT -> GetInnerRadius()/mm
0919     << G4endl; 
0920 }
0921 
0922 /////////////////////////////////////////////////////////////////////////
0923 
0924 void Collimator40BeamLine::SetOuterRadiusFinalCollimatorIORT(G4double value)
0925 {
0926   solidFinalCollimatorIORT -> SetOuterRadius(value);
0927   G4RunManager::GetRunManager() -> GeometryHasBeenModified();
0928   G4cout<<"Outer Radius of the final collimator IORT is (mm):"
0929     << solidFinalCollimatorIORT -> GetOuterRadius()/mm
0930     << G4endl; 
0931 }
0932 
0933 /////////////////////////////////////////////////////////////////////////////
0934 
0935 
0936