[807] | 1 | // |
---|
| 2 | // ******************************************************************** |
---|
| 3 | // * License and Disclaimer * |
---|
| 4 | // * * |
---|
| 5 | // * The Geant4 software is copyright of the Copyright Holders of * |
---|
| 6 | // * the Geant4 Collaboration. It is provided under the terms and * |
---|
| 7 | // * conditions of the Geant4 Software License, included in the file * |
---|
| 8 | // * LICENSE and available at http://cern.ch/geant4/license . These * |
---|
| 9 | // * include a list of copyright holders. * |
---|
| 10 | // * * |
---|
| 11 | // * Neither the authors of this software system, nor their employing * |
---|
| 12 | // * institutes,nor the agencies providing financial support for this * |
---|
| 13 | // * work make any representation or warranty, express or implied, * |
---|
| 14 | // * regarding this software system or assume any liability for its * |
---|
| 15 | // * use. Please see the license in the file LICENSE and URL above * |
---|
| 16 | // * for the full disclaimer and the limitation of liability. * |
---|
| 17 | // * * |
---|
| 18 | // * This code implementation is the result of the scientific and * |
---|
| 19 | // * technical work of the GEANT4 collaboration. * |
---|
| 20 | // * By using, copying, modifying or distributing the software (or * |
---|
| 21 | // * any work based on the software) you agree to acknowledge its * |
---|
| 22 | // * use in resulting scientific publications, and indicate your * |
---|
| 23 | // * acceptance of all terms of the Geant4 Software license. * |
---|
| 24 | // ******************************************************************** |
---|
| 25 | // |
---|
| 26 | // |
---|
| 27 | // $Id: MedLinacHead.cc,v 1.3 2006/06/29 16:04:25 gunter Exp $ |
---|
| 28 | // |
---|
| 29 | // Code developed by: M. Piergentili |
---|
| 30 | // |
---|
| 31 | // |
---|
| 32 | //------------------------------ beam line along z axis--------------------- |
---|
| 33 | |
---|
| 34 | #include "MedLinacDetectorMessenger.hh" |
---|
| 35 | #include "MedLinacDetectorConstruction.hh" |
---|
| 36 | #include "MedLinacPhantomROGeometry.hh" |
---|
| 37 | #include "MedLinacPhantomSD.hh" |
---|
| 38 | #include "MedLinacVGeometryComponent.hh" |
---|
| 39 | #include "MedLinacHead.hh" |
---|
| 40 | |
---|
| 41 | #include "G4CSGSolid.hh" |
---|
| 42 | #include "G4RotationMatrix.hh" |
---|
| 43 | #include "G4Transform3D.hh" |
---|
| 44 | #include "G4Material.hh" |
---|
| 45 | #include "G4MaterialPropertiesTable.hh" |
---|
| 46 | #include "G4MaterialTable.hh" |
---|
| 47 | #include "G4MaterialPropertyVector.hh" |
---|
| 48 | #include "G4Element.hh" |
---|
| 49 | #include "G4ElementTable.hh" |
---|
| 50 | #include "G4Box.hh" |
---|
| 51 | #include "G4Cons.hh" |
---|
| 52 | #include "G4Tubs.hh" |
---|
| 53 | #include "G4LogicalVolume.hh" |
---|
| 54 | #include "G4ThreeVector.hh" |
---|
| 55 | #include "G4PVPlacement.hh" |
---|
| 56 | #include "G4PVParameterised.hh" |
---|
| 57 | #include "globals.hh" |
---|
| 58 | #include "G4SDManager.hh" |
---|
| 59 | #include "G4RunManager.hh" |
---|
| 60 | #include "Randomize.hh" |
---|
| 61 | #include "G4TransportationManager.hh" |
---|
| 62 | #include "G4UserLimits.hh" |
---|
| 63 | #include "G4GeometryManager.hh" |
---|
| 64 | #include "G4BooleanSolid.hh" |
---|
| 65 | #include "G4SubtractionSolid.hh" |
---|
| 66 | #include "G4VSolid.hh" |
---|
| 67 | #include "G4Region.hh" |
---|
| 68 | |
---|
| 69 | #include "G4PhysicalVolumeStore.hh" |
---|
| 70 | #include "G4LogicalVolumeStore.hh" |
---|
| 71 | #include "G4SolidStore.hh" |
---|
| 72 | #include "G4RegionStore.hh" |
---|
| 73 | |
---|
| 74 | #include "G4VisAttributes.hh" |
---|
| 75 | #include "G4Colour.hh" |
---|
| 76 | |
---|
| 77 | #include "G4ios.hh" |
---|
| 78 | |
---|
| 79 | MedLinacHead::MedLinacHead() |
---|
| 80 | : windowUp_log(0), UpperCollimator_log(0), |
---|
| 81 | collim_log(0), tracker_log(0), |
---|
| 82 | CylMinusCone_log(0),windowLow_log(0), |
---|
| 83 | Window_log(0),SignalPlate_log(0), |
---|
| 84 | Mirror_log(0),reticle_log(0), |
---|
| 85 | windowUp_phys(0), UpperCollimator_phys(0), |
---|
| 86 | CylMinusCone_phys(0), windowLow_phys(0), |
---|
| 87 | Window1_phys(0), SignalPlate1_phys(0), |
---|
| 88 | SignalPlate2_phys(0), Window2_phys(0), |
---|
| 89 | SignalPlate3_phys(0), SignalPlate4_phys(0), |
---|
| 90 | Window3_phys(0),Mirror_phys(0), |
---|
| 91 | reticle_phys(0), aLowerCollRegion(0),aUpperCollRegion(0) |
---|
| 92 | |
---|
| 93 | { |
---|
| 94 | aLowerCollRegion = new G4Region("PrimaryCollimatorLow"); |
---|
| 95 | aUpperCollRegion = new G4Region("PrimaryCollimatorUp"); |
---|
| 96 | } |
---|
| 97 | |
---|
| 98 | MedLinacHead::~MedLinacHead() |
---|
| 99 | {;} |
---|
| 100 | |
---|
| 101 | |
---|
| 102 | void MedLinacHead::ConstructComponent(G4VPhysicalVolume* world,G4VPhysicalVolume* vacuumBlock) |
---|
| 103 | { |
---|
| 104 | |
---|
| 105 | |
---|
| 106 | //G4GeometryManager::GetInstance()->OpenGeometry(); |
---|
| 107 | //G4PhysicalVolumeStore::GetInstance()->Clean(); |
---|
| 108 | //G4LogicalVolumeStore::GetInstance()->Clean(); |
---|
| 109 | //G4SolidStore::GetInstance()->Clean(); |
---|
| 110 | //G4RegionStore::GetInstance()->Clean(); // -> Segmentation fault (core dumped) |
---|
| 111 | |
---|
| 112 | |
---|
| 113 | // materials |
---|
| 114 | |
---|
| 115 | G4double a; // atomic mass |
---|
| 116 | G4double z; // atomic number |
---|
| 117 | G4double density; |
---|
| 118 | G4int ncomponents; |
---|
| 119 | //G4int natoms; |
---|
| 120 | G4String name; |
---|
| 121 | G4String symbol; |
---|
| 122 | G4double fractionmass; |
---|
| 123 | G4double massOfMole; |
---|
| 124 | G4double temperature; |
---|
| 125 | G4double pressure; |
---|
| 126 | |
---|
| 127 | |
---|
| 128 | //a = 207.19*g/mole; |
---|
| 129 | //density = 11.35*g/cm3; |
---|
| 130 | //G4Material* Pb = new G4Material(name="Lead", z=82., a, density); |
---|
| 131 | |
---|
| 132 | a = 14.00674*g/mole; |
---|
| 133 | G4Element* elN = new G4Element(name="Nitrogen" ,symbol="N", z=7., a); |
---|
| 134 | |
---|
| 135 | a = 16.00*g/mole; |
---|
| 136 | G4Element* elO = new G4Element(name="Oxygen",symbol="O", z=8., a); |
---|
| 137 | |
---|
| 138 | a = 1.00794*g/mole; |
---|
| 139 | G4Element* elH = new G4Element(name="Hydrogen",symbol="H", z=1., a); |
---|
| 140 | |
---|
| 141 | a = 12.011*g/mole; |
---|
| 142 | G4Element* elC = new G4Element(name="Carbon",symbol="C", z=6. , a ); |
---|
| 143 | |
---|
| 144 | density = 1.290*mg/cm3; |
---|
| 145 | G4Material* Air = new G4Material(name="Air",density, ncomponents=2); |
---|
| 146 | Air->AddElement(elN, fractionmass=70*perCent); |
---|
| 147 | Air->AddElement(elO, fractionmass=30*perCent); |
---|
| 148 | |
---|
| 149 | //density = 2.702*g/cm3; |
---|
| 150 | //a = 26.981539*g/mole; |
---|
| 151 | //G4Material* Al = new G4Material(name="Aluminium", z=13., a, density); |
---|
| 152 | |
---|
| 153 | //density = 8.960*g/cm3; |
---|
| 154 | //a = 63.55*g/mole; |
---|
| 155 | //G4Material* Cu = new G4Material(name="Copper" , z=29., a, density); |
---|
| 156 | |
---|
| 157 | //a = 47.88*g/mole; |
---|
| 158 | //density = 4.50*g/cm3; |
---|
| 159 | //Titanium = new G4Material("titanium" ,z = 22.,a,density); |
---|
| 160 | |
---|
| 161 | //density = 19.3*g/cm3; |
---|
| 162 | density = 18.*g/cm3; |
---|
| 163 | a = 183.85*g/mole; |
---|
| 164 | G4Material* W = new G4Material(name="Tungsten" , z=74., a, density); |
---|
| 165 | |
---|
| 166 | density = 1.848*g/cm3; |
---|
| 167 | a = 9.012182*g/mole; |
---|
| 168 | G4Material* Be = new G4Material(name="Beryllium" , z=4., a, density); |
---|
| 169 | |
---|
| 170 | |
---|
| 171 | density = 1.39*g/cm3; |
---|
| 172 | G4Material* Mylar = new G4Material(name="Mylar",density , ncomponents=3, kStateUndefined, 273.15*kelvin, 1.0*atmosphere ); |
---|
| 173 | Mylar->AddElement( elH, 4 ); |
---|
| 174 | Mylar->AddElement( elC, 5 ); |
---|
| 175 | Mylar->AddElement( elO, 2 ); |
---|
| 176 | |
---|
| 177 | density = 1.42*g/cm3; |
---|
| 178 | G4Material* Kapton = new G4Material(name="Kapton",density , ncomponents=4); |
---|
| 179 | Kapton->AddElement( elH, 02.6362 *perCent); |
---|
| 180 | Kapton->AddElement( elC, 69.1133 *perCent); |
---|
| 181 | Kapton->AddElement( elN, 07.3270 *perCent); |
---|
| 182 | Kapton->AddElement( elO, 20.9235 *perCent); |
---|
| 183 | |
---|
| 184 | |
---|
| 185 | massOfMole = 1.008*g/mole; |
---|
| 186 | density = 1.e-25*g/cm3; |
---|
| 187 | temperature = 2.73*kelvin; |
---|
| 188 | pressure = 3.e-18*pascal; |
---|
| 189 | G4Material* Vacuum = new G4Material("interGalactic", z=1.,massOfMole, |
---|
| 190 | density, kStateGas,temperature, pressure); |
---|
| 191 | |
---|
| 192 | |
---|
| 193 | |
---|
| 194 | //------------------------------ beam line along z axis-------SSD=100cm----------- |
---|
| 195 | |
---|
| 196 | //---------rotation matrix first collimator and filter-------- |
---|
| 197 | |
---|
| 198 | G4RotationMatrix* rotateMatrix=new G4RotationMatrix(); |
---|
| 199 | rotateMatrix->rotateX(180.0*deg); |
---|
| 200 | |
---|
| 201 | //---------rotation Mirror-------- |
---|
| 202 | |
---|
| 203 | G4RotationMatrix* rotateMirror=new G4RotationMatrix(); |
---|
| 204 | rotateMirror->rotateY(35.0*deg); |
---|
| 205 | |
---|
| 206 | //---------------colors---------- |
---|
| 207 | |
---|
| 208 | //G4Colour white (1.0, 1.0, 1.0); |
---|
| 209 | G4Colour grey (0.5, 0.5, 0.5); |
---|
| 210 | //G4Colour lgrey (.75, .75, .75); |
---|
| 211 | G4Colour red (1.0, 0.0, 0.0); |
---|
| 212 | //G4Colour blue (0.0, 0.0, 1.0); |
---|
| 213 | G4Colour cyan (0.0, 1.0, 1.0); |
---|
| 214 | G4Colour magenta (1.0, 0.0, 1.0); |
---|
| 215 | G4Colour yellow (1.0, 1.0, 0.0); |
---|
| 216 | //G4Colour lblue (0.20, .50, .85); |
---|
| 217 | |
---|
| 218 | //------------------------------------------------------ volumes |
---|
| 219 | |
---|
| 220 | //------------------------------ experimental hall (world volume) |
---|
| 221 | //------------------------------ beam line along z axis--------------------- |
---|
| 222 | //--------------------window upper------------------- |
---|
| 223 | |
---|
| 224 | G4double windowUpDim_x = 4.*cm; |
---|
| 225 | G4double windowUpDim_y = 4.*cm; |
---|
| 226 | G4double windowUpDim_z = 0.0125*cm; |
---|
| 227 | G4Box* windowUp_box = new G4Box("windowUp_box",windowUpDim_x,windowUpDim_y,windowUpDim_z); |
---|
| 228 | windowUp_log = new G4LogicalVolume(windowUp_box,Be,"windowUp_log",0,0,0); |
---|
| 229 | G4double windowUpPos_x = 0.0*m; |
---|
| 230 | G4double windowUpPos_y = 0.0*m; |
---|
| 231 | G4double windowUpPos_z = 123.5225*cm; |
---|
| 232 | windowUp_phys = new G4PVPlacement(0, |
---|
| 233 | G4ThreeVector(windowUpPos_x,windowUpPos_y,windowUpPos_z), |
---|
| 234 | "windowUp",windowUp_log,world,false,0); |
---|
| 235 | |
---|
| 236 | |
---|
| 237 | //-------------------- the first collimator upper---------------- |
---|
| 238 | |
---|
| 239 | |
---|
| 240 | G4double innerRadiusOfTheTubeEx = 1.0*cm; |
---|
| 241 | G4double outerRadiusOfTheTubeEx = 8.*cm; |
---|
| 242 | G4double hightOfTheTubeEx = 4.0*cm; |
---|
| 243 | G4double startAngleOfTheTubeEx = 0.*deg; |
---|
| 244 | G4double spanningAngleOfTheTubeEx = 360.*deg; |
---|
| 245 | G4Tubs* UpperCollimator = new G4Tubs("UpperCollimator",innerRadiusOfTheTubeEx, |
---|
| 246 | outerRadiusOfTheTubeEx,hightOfTheTubeEx, |
---|
| 247 | startAngleOfTheTubeEx,spanningAngleOfTheTubeEx); |
---|
| 248 | UpperCollimator_log = new G4LogicalVolume(UpperCollimator,W,"UpperCollimator_log",0,0,0); |
---|
| 249 | |
---|
| 250 | G4double UpperCollimatorPosX = 0.*cm; |
---|
| 251 | G4double UpperCollimatorPosY = 0.*cm; |
---|
| 252 | G4double UpperCollimatorPosZ = 2.645*cm; |
---|
| 253 | |
---|
| 254 | UpperCollimator_phys = new G4PVPlacement(0, |
---|
| 255 | G4ThreeVector(UpperCollimatorPosX,UpperCollimatorPosY, |
---|
| 256 | UpperCollimatorPosZ),"UpperCollimator", |
---|
| 257 | UpperCollimator_log,vacuumBlock,false,0); |
---|
| 258 | //-------------------- the first collimator lower---------------- |
---|
| 259 | |
---|
| 260 | G4double pRmin1 = 0.*cm; |
---|
| 261 | //G4double pRmax1 = 0.3352897*cm; |
---|
| 262 | G4double pRmax1 = 0.5*cm; |
---|
| 263 | G4double pRmin2 = 0.*cm; |
---|
| 264 | G4double pRmax2 = 1.7658592*cm; |
---|
| 265 | G4double hightOfTheCone =3.2*cm; |
---|
| 266 | G4double startAngleOfTheCone = 0.*deg; |
---|
| 267 | G4double spanningAngleOfTheCone = 360.*deg; |
---|
| 268 | |
---|
| 269 | G4Cons* collim_cone = new G4Cons("collim_cone",pRmin1,pRmax1,pRmin2, |
---|
| 270 | pRmax2,hightOfTheCone,startAngleOfTheCone, |
---|
| 271 | spanningAngleOfTheCone); |
---|
| 272 | collim_log = new G4LogicalVolume(collim_cone,Vacuum,"collim_log",0,0,0); |
---|
| 273 | |
---|
| 274 | |
---|
| 275 | G4double innerRadiusOfTheTube = 0.*cm; |
---|
| 276 | G4double outerRadiusOfTheTube = 8.*cm; |
---|
| 277 | G4double hightOfTheTube = 3.1*cm; |
---|
| 278 | G4double startAngleOfTheTube = 0.*deg; |
---|
| 279 | G4double spanningAngleOfTheTube = 360.*deg; |
---|
| 280 | G4Tubs* tracker_tube = new G4Tubs("tracker_tube",innerRadiusOfTheTube, |
---|
| 281 | outerRadiusOfTheTube,hightOfTheTube, |
---|
| 282 | startAngleOfTheTube,spanningAngleOfTheTube); |
---|
| 283 | tracker_log = new G4LogicalVolume(tracker_tube,W,"tracker_log",0,0,0); |
---|
| 284 | |
---|
| 285 | |
---|
| 286 | G4SubtractionSolid* CylMinusCone = new G4SubtractionSolid("Cyl-Cone", |
---|
| 287 | tracker_tube,collim_cone); |
---|
| 288 | CylMinusCone_log = new G4LogicalVolume(CylMinusCone,W,"CylminusCone_log",0,0,0); |
---|
| 289 | G4double CminusCPos_x = 0.*cm; |
---|
| 290 | G4double CminusCPos_y = 0.*cm; |
---|
| 291 | G4double CminusCPos_z = -4.455*cm; |
---|
| 292 | CylMinusCone_phys = new G4PVPlacement(rotateMatrix, |
---|
| 293 | G4ThreeVector(CminusCPos_x,CminusCPos_y,CminusCPos_z), |
---|
| 294 | "CylMinusCone",CylMinusCone_log,vacuumBlock,false,0); |
---|
| 295 | |
---|
| 296 | |
---|
| 297 | //delete collim_log; |
---|
| 298 | //delete tracker_log; |
---|
| 299 | //------------------window lower------------------- |
---|
| 300 | |
---|
| 301 | |
---|
| 302 | G4double windowLowDim_x = 4.*cm; |
---|
| 303 | G4double windowLowDim_y = 4.*cm; |
---|
| 304 | G4double windowLowDim_z = 0.0127*cm; |
---|
| 305 | G4Box* windowLow_box = new G4Box("windowLow_box",windowLowDim_x,windowLowDim_y,windowLowDim_z); |
---|
| 306 | |
---|
| 307 | windowLow_log = new G4LogicalVolume(windowLow_box,Be,"windowLow_log",0,0,0); |
---|
| 308 | |
---|
| 309 | G4double windowLowPos_x = 0.0*m; |
---|
| 310 | G4double windowLowPos_y = 0.0*m; |
---|
| 311 | G4double windowLowPos_z = 105.9873*cm; |
---|
| 312 | |
---|
| 313 | windowLow_phys = new G4PVPlacement(0, |
---|
| 314 | G4ThreeVector(windowLowPos_x,windowLowPos_y,windowLowPos_z), |
---|
| 315 | "windowLow",windowLow_log,world,false,0); |
---|
| 316 | |
---|
| 317 | |
---|
| 318 | //---------------Ion chamber------------------------ |
---|
| 319 | |
---|
| 320 | G4double innerRadiusOfTheIonChamber = 0.*cm; |
---|
| 321 | G4double outerRadiusOfTheIonChamber = 4.7625*cm; |
---|
| 322 | G4double hightOfTheWindows = 0.0127*cm; |
---|
| 323 | G4double hightOfTheSignalPlates = 0.00254*cm; |
---|
| 324 | G4double startAngleOfTheIonChamber = 0.*deg; |
---|
| 325 | G4double spanningAngleOfTheIonChamber = 360.*deg; |
---|
| 326 | G4double IonChamberPos_x = 0.0*cm; |
---|
| 327 | G4double IonChamberPos_y = 0.0*cm; |
---|
| 328 | |
---|
| 329 | |
---|
| 330 | G4Tubs* Window = new G4Tubs("Window",innerRadiusOfTheIonChamber, |
---|
| 331 | outerRadiusOfTheIonChamber,hightOfTheWindows, |
---|
| 332 | startAngleOfTheIonChamber,spanningAngleOfTheIonChamber); |
---|
| 333 | |
---|
| 334 | Window_log = new G4LogicalVolume(Window,Kapton,"Window_log",0,0,0); |
---|
| 335 | |
---|
| 336 | |
---|
| 337 | G4Tubs* SignalPlate = new G4Tubs("SignalPlate",innerRadiusOfTheIonChamber, |
---|
| 338 | outerRadiusOfTheIonChamber,hightOfTheSignalPlates, |
---|
| 339 | startAngleOfTheIonChamber,spanningAngleOfTheIonChamber); |
---|
| 340 | |
---|
| 341 | SignalPlate_log = new G4LogicalVolume(SignalPlate ,Kapton,"SignalPlate_log",0,0,0); |
---|
| 342 | |
---|
| 343 | //-----Ion chamber----window 1--------------------- |
---|
| 344 | |
---|
| 345 | G4double Window1Pos_z = 100.165*cm; |
---|
| 346 | Window1_phys = new G4PVPlacement(0, |
---|
| 347 | G4ThreeVector(IonChamberPos_x,IonChamberPos_y,Window1Pos_z), |
---|
| 348 | "Window",Window_log,world,false,0); |
---|
| 349 | |
---|
| 350 | //------Ion chamber---Signal Plate 1--------------------- |
---|
| 351 | |
---|
| 352 | G4double SignalPlate1Pos_z = 99.927*cm; |
---|
| 353 | SignalPlate1_phys = new G4PVPlacement(0, |
---|
| 354 | G4ThreeVector(IonChamberPos_x,IonChamberPos_y,SignalPlate1Pos_z), |
---|
| 355 | "SignalPlate",SignalPlate_log,world,false,0); |
---|
| 356 | |
---|
| 357 | //------Ion chamber---Signal Plate 2--------------------- |
---|
| 358 | |
---|
| 359 | G4double SignalPlate2Pos_z = 99.688*cm; |
---|
| 360 | SignalPlate2_phys = new G4PVPlacement(0, |
---|
| 361 | G4ThreeVector(IonChamberPos_x,IonChamberPos_y,SignalPlate2Pos_z), |
---|
| 362 | "SignalPlate",SignalPlate_log,world,false,0); |
---|
| 363 | |
---|
| 364 | //------Ion chamber---window 2--------------------- |
---|
| 365 | |
---|
| 366 | G4double Window2Pos_z = 99.45*cm; |
---|
| 367 | Window2_phys = new G4PVPlacement(0, |
---|
| 368 | G4ThreeVector(IonChamberPos_x,IonChamberPos_y,Window2Pos_z), |
---|
| 369 | "Window",Window_log,world,false,0); |
---|
| 370 | |
---|
| 371 | //------Ion chamber---Signal Plate 3--------------------- |
---|
| 372 | |
---|
| 373 | G4double SignalPlate3Pos_z = 99.212*cm; |
---|
| 374 | SignalPlate3_phys = new G4PVPlacement(0, |
---|
| 375 | G4ThreeVector(IonChamberPos_x,IonChamberPos_y,SignalPlate3Pos_z), |
---|
| 376 | "SignalPlate",SignalPlate_log,world,false,0); |
---|
| 377 | |
---|
| 378 | //------Ion chamber---Signal Plate 4--------------------- |
---|
| 379 | |
---|
| 380 | G4double SignalPlate4Pos_z = 98.973*cm; |
---|
| 381 | SignalPlate4_phys = new G4PVPlacement(0, |
---|
| 382 | G4ThreeVector(IonChamberPos_x,IonChamberPos_y,SignalPlate4Pos_z), |
---|
| 383 | "SignalPlate",SignalPlate_log,world,false,0); |
---|
| 384 | |
---|
| 385 | //------Ion chamber---window 3--------------------- |
---|
| 386 | |
---|
| 387 | G4double Window3Pos_z = 98.735*cm; |
---|
| 388 | Window3_phys = new G4PVPlacement(0, |
---|
| 389 | G4ThreeVector(IonChamberPos_x,IonChamberPos_y,Window3Pos_z), |
---|
| 390 | "Window",Window_log,world,false,0); |
---|
| 391 | |
---|
| 392 | |
---|
| 393 | //----------------Mirror--------------------------- |
---|
| 394 | |
---|
| 395 | G4double innerRadiusOfTheMirror = 0.*cm; |
---|
| 396 | G4double outerRadiusOfTheMirror = 6.*cm; |
---|
| 397 | G4double hightOfTheMirror = 0.00254*cm; |
---|
| 398 | G4double startAngleOfTheMirror = 0.*deg; |
---|
| 399 | G4double spanningAngleOfTheMirror = 360.*deg; |
---|
| 400 | G4Tubs* Mirror = new G4Tubs("Mirror",innerRadiusOfTheMirror, |
---|
| 401 | outerRadiusOfTheMirror,hightOfTheMirror, |
---|
| 402 | startAngleOfTheMirror,spanningAngleOfTheMirror); |
---|
| 403 | |
---|
| 404 | Mirror_log = new G4LogicalVolume(Mirror,Mylar,"Mirror_log",0,0,0); |
---|
| 405 | G4double MirrorPos_x = 0.0*cm; |
---|
| 406 | G4double MirrorPos_y = 0.0*cm; |
---|
| 407 | G4double MirrorPos_z = 93.0*cm; |
---|
| 408 | Mirror_phys = new G4PVPlacement(rotateMirror, |
---|
| 409 | G4ThreeVector(MirrorPos_x,MirrorPos_y,MirrorPos_z), |
---|
| 410 | "Mirror",Mirror_log,world,false,0); |
---|
| 411 | |
---|
| 412 | //----------------Light Field Reticle |
---|
| 413 | |
---|
| 414 | G4double reticleDim_x = 15.0*cm; |
---|
| 415 | G4double reticleDim_y = 15.0*cm; |
---|
| 416 | G4double reticleDim_z = 0.00508*cm; |
---|
| 417 | G4Box* reticle = new G4Box("reticle",reticleDim_x, |
---|
| 418 | reticleDim_y,reticleDim_z); |
---|
| 419 | reticle_log = new G4LogicalVolume(reticle, |
---|
| 420 | Mylar,"reticle_log",0,0,0); |
---|
| 421 | |
---|
| 422 | G4double reticlePos_x = 0.0*cm; |
---|
| 423 | G4double reticlePos_y = 0.0*cm; |
---|
| 424 | G4double reticlePos_z = 65.5*cm; |
---|
| 425 | reticle_phys = new G4PVPlacement(0, |
---|
| 426 | G4ThreeVector(reticlePos_x,reticlePos_y,reticlePos_z), |
---|
| 427 | "reticle",reticle_log,world,false,0); |
---|
| 428 | |
---|
| 429 | // Cuts by Regions |
---|
| 430 | |
---|
| 431 | |
---|
| 432 | //G4String regName[] = {"PrimaryCollimatorUp","PrimaryCollimatorLow"}; |
---|
| 433 | //G4Region* aUpperCollRegion = new G4Region(regName[0]); |
---|
| 434 | //G4Region* aLowerCollRegion = new G4Region(regName[1]); |
---|
| 435 | //UpperCollimator_log->SetRegion(aUpperCollRegion); |
---|
| 436 | //CylMinusCone_log->SetRegion(aLowerCollRegion); |
---|
| 437 | //aUpperCollRegion->AddRootLogicalVolume(UpperCollimator_log); |
---|
| 438 | //aLowerCollRegion->AddRootLogicalVolume(CylMinusCone_log); |
---|
| 439 | |
---|
| 440 | //G4String regName = "PrimaryCollimatorLow"; |
---|
| 441 | //G4Region* aLowerCollRegion = new G4Region(regName); |
---|
| 442 | CylMinusCone_log->SetRegion(aLowerCollRegion); |
---|
| 443 | aLowerCollRegion->AddRootLogicalVolume(CylMinusCone_log); |
---|
| 444 | |
---|
| 445 | //G4String regName1 = "PrimaryCollimatorUp"; |
---|
| 446 | //G4Region* aUpperCollRegion = new G4Region(regName1); |
---|
| 447 | UpperCollimator_log->SetRegion(aUpperCollRegion); |
---|
| 448 | aUpperCollRegion->AddRootLogicalVolume(UpperCollimator_log); |
---|
| 449 | |
---|
| 450 | //--------- Visualization attributes ------------------------------- |
---|
| 451 | |
---|
| 452 | G4VisAttributes* simpleTungstenWVisAtt= new G4VisAttributes(magenta); |
---|
| 453 | simpleTungstenWVisAtt->SetVisibility(true); |
---|
| 454 | simpleTungstenWVisAtt->SetForceWireframe(true); |
---|
| 455 | collim_log->SetVisAttributes(simpleTungstenWVisAtt); |
---|
| 456 | CylMinusCone_log->SetVisAttributes(simpleTungstenWVisAtt); |
---|
| 457 | UpperCollimator_log->SetVisAttributes(simpleTungstenWVisAtt); |
---|
| 458 | |
---|
| 459 | G4VisAttributes* simpleCopperSVisAtt= new G4VisAttributes(cyan); |
---|
| 460 | simpleCopperSVisAtt->SetVisibility(true); |
---|
| 461 | simpleCopperSVisAtt->SetForceSolid(true); |
---|
| 462 | |
---|
| 463 | G4VisAttributes* simpleBerylliumSVisAtt= new G4VisAttributes(red); |
---|
| 464 | simpleBerylliumSVisAtt->SetVisibility(true); |
---|
| 465 | simpleBerylliumSVisAtt->SetForceSolid(true); |
---|
| 466 | windowUp_log->SetVisAttributes(simpleBerylliumSVisAtt); |
---|
| 467 | windowLow_log->SetVisAttributes(simpleBerylliumSVisAtt); |
---|
| 468 | |
---|
| 469 | G4VisAttributes* simpleMylarVisAtt= new G4VisAttributes(grey); |
---|
| 470 | simpleMylarVisAtt->SetVisibility(true); |
---|
| 471 | simpleMylarVisAtt->SetForceSolid(true); |
---|
| 472 | Mirror_log->SetVisAttributes(simpleBerylliumSVisAtt); |
---|
| 473 | reticle_log->SetVisAttributes(simpleMylarVisAtt); |
---|
| 474 | |
---|
| 475 | |
---|
| 476 | G4VisAttributes* simpleKaptonVisAtt= new G4VisAttributes(yellow); |
---|
| 477 | simpleKaptonVisAtt->SetVisibility(true); |
---|
| 478 | simpleKaptonVisAtt->SetForceSolid(true); |
---|
| 479 | Window_log->SetVisAttributes(simpleKaptonVisAtt); |
---|
| 480 | SignalPlate_log->SetVisAttributes(simpleKaptonVisAtt); |
---|
| 481 | |
---|
| 482 | //if you want not to see mirror ...: |
---|
| 483 | |
---|
| 484 | //G4VisAttributes* simpleWorldVisAtt= new G4VisAttributes(white); |
---|
| 485 | //simpleWorldVisAtt->SetVisibility(false); |
---|
| 486 | //Mirror_log->SetVisAttributes(simpleWorldVisAtt); |
---|
| 487 | //CylMinusCone_log->SetVisAttributes(simpleWorldVisAtt); |
---|
| 488 | //UpperCollimator_log->SetVisAttributes(simpleWorldVisAtt); |
---|
| 489 | //windowUp_log->SetVisAttributes(simpleWorldVisAtt); |
---|
| 490 | //windowLow_log->SetVisAttributes(simpleWorldVisAtt); |
---|
| 491 | //Window_log->SetVisAttributes(simpleWorldVisAtt); |
---|
| 492 | //SignalPlate_log->SetVisAttributes(simpleWorldVisAtt); |
---|
| 493 | //reticle_log->SetVisAttributes(simpleWorldVisAtt); |
---|
| 494 | |
---|
| 495 | //layer1_log->SetVisAttributes(simpleWorldVisAtt); |
---|
| 496 | //layer2_log->SetVisAttributes(simpleWorldVisAtt); |
---|
| 497 | //layer3_log->SetVisAttributes(simpleWorldVisAtt); |
---|
| 498 | //layer4_log->SetVisAttributes(simpleWorldVisAtt); |
---|
| 499 | //layer5_log->SetVisAttributes(simpleWorldVisAtt); |
---|
| 500 | //layer6_log->SetVisAttributes(simpleWorldVisAtt); |
---|
| 501 | //layer7_log->SetVisAttributes(simpleWorldVisAtt); |
---|
| 502 | //layer8_log->SetVisAttributes(simpleWorldVisAtt); |
---|
| 503 | //layer9_log->SetVisAttributes(simpleWorldVisAtt); |
---|
| 504 | //layer10_log->SetVisAttributes(simpleWorldVisAtt); |
---|
| 505 | //layer11_log->SetVisAttributes(simpleWorldVisAtt); |
---|
| 506 | //layer12_log->SetVisAttributes(simpleWorldVisAtt); |
---|
| 507 | //layer13_log->SetVisAttributes(simpleWorldVisAtt); |
---|
| 508 | //layer14_log->SetVisAttributes(simpleWorldVisAtt); |
---|
| 509 | //layer15_log->SetVisAttributes(simpleWorldVisAtt); |
---|
| 510 | //layer16_log->SetVisAttributes(simpleWorldVisAtt); |
---|
| 511 | //layer17_log->SetVisAttributes(simpleWorldVisAtt); |
---|
| 512 | //layer18_log->SetVisAttributes(simpleWorldVisAtt); |
---|
| 513 | //layer19_log->SetVisAttributes(simpleWorldVisAtt); |
---|
| 514 | //layer21_log->SetVisAttributes(simpleWorldVisAtt); |
---|
| 515 | |
---|
| 516 | } |
---|
| 517 | |
---|
| 518 | void MedLinacHead::DestroyComponent() |
---|
| 519 | {;} |
---|