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