Geant4 Cross Reference |
1 // 1 2 // ******************************************* 3 // * License and Disclaimer 4 // * 5 // * The Geant4 software is copyright of th 6 // * the Geant4 Collaboration. It is provided 7 // * conditions of the Geant4 Software License 8 // * LICENSE and available at http://cern.ch/ 9 // * include a list of copyright holders. 10 // * 11 // * Neither the authors of this software syst 12 // * institutes,nor the agencies providing fin 13 // * work make any representation or warran 14 // * regarding this software system or assum 15 // * use. Please see the license in the file 16 // * for the full disclaimer and the limitatio 17 // * 18 // * This code implementation is the result 19 // * technical work of the GEANT4 collaboratio 20 // * By using, copying, modifying or distri 21 // * any work based on the software) you ag 22 // * use in resulting scientific publicati 23 // * acceptance of all terms of the Geant4 Sof 24 // ******************************************* 25 // 26 // 27 // ------------------------------------------- 28 // GEANT 4 - Brachytherapy exa 29 // ------------------------------------------- 30 // 31 // Code developed by: 32 // D. Cutajar, A. Le 33 // 34 // **************************************** 35 // * 36 // * BrachyDetectorConstructionOncura6711. 37 // * 38 // **************************************** 39 // 40 // 41 // 42 #include "BrachyDetectorConstructionOncura6711 43 #include "globals.hh" 44 #include "G4SystemOfUnits.hh" 45 #include "G4Sphere.hh" 46 #include "G4RunManager.hh" 47 #include "G4Box.hh" 48 #include "G4Tubs.hh" 49 #include "G4LogicalVolume.hh" 50 #include "G4ThreeVector.hh" 51 #include "G4PVPlacement.hh" 52 #include "G4Transform3D.hh" 53 #include "G4RotationMatrix.hh" 54 #include "G4TransportationManager.hh" 55 #include "G4NistManager.hh" 56 #include "G4VisAttributes.hh" 57 #include "G4Colour.hh" 58 59 BrachyDetectorConstructionOncura6711::BrachyDe 60 : 61 fOncuraCapsule(nullptr), fOncuraCapsuleLog( 62 fOncuraCapsulePhys(nullptr), 63 fOncuraCapsuleTip1(nullptr), fOncuraCapsule 64 fOncuraCapsuleTip1Phys(nullptr), 65 fOncuraCapsuleTip2(nullptr), fOncuraCapsule 66 fOncuraCapsuleTip2Phys(nullptr), 67 fOncuraAirGap(nullptr), fOncuraAirGapLog(nu 68 fOncuraAirGapPhys(nullptr), 69 fOncuraSilverCore(nullptr), fOncuraSilverCo 70 fOncuraSilverCorePhys(nullptr), 71 fOncuraCapsuleShellVisAtt(nullptr), fOncura 72 fOncuraSilverCoreVisAtt(nullptr) 73 {} 74 75 void BrachyDetectorConstructionOncura6711::Con 76 { 77 G4Colour red (1.0, 0.0, 0.0) ; 78 G4Colour magenta (1.0, 0.0, 1.0) ; 79 80 G4NistManager* nist = G4NistManager::Instance( 81 G4Material* titanium = nist -> FindOrBuildMate 82 G4Material* air = nist -> FindOrBuildMaterial( 83 G4Material* silver = nist -> FindOrBuildMateri 84 85 //Capsule shell 86 fOncuraCapsule = new G4Tubs("OncuraCapsule",0, 87 fOncuraCapsuleLog = new G4LogicalVolume(fOncur 88 fOncuraCapsulePhys = new G4PVPlacement(nullptr 89 "OncuraCapsulePhys", fOncura 90 mother, false, 0, true); 91 92 //Capsule tips 93 fOncuraCapsuleTip1 = new G4Sphere("OncuraCapsu 94 fOncuraCapsuleTip1Log = new G4LogicalVolume(fO 95 fOncuraCapsuleTip1Phys = new G4PVPlacement(nul 96 "OncuraCapsuleTip1Phys", fOncu 97 mother, false, 98 0, true); 99 100 fOncuraCapsuleTip2 = new G4Sphere("OncuraCapsu 101 fOncuraCapsuleTip2Log = new G4LogicalVolume(fO 102 fOncuraCapsuleTip2Phys = new G4PVPlacement(nul 103 "OncuraCapsuleTip2Phys", fOncu 104 mother, false, 105 0, true); 106 107 //Air gap 108 fOncuraAirGap = new G4Tubs("OncuraAirGap",0,0. 109 fOncuraAirGapLog = new G4LogicalVolume(fOncura 110 fOncuraAirGapPhys = new G4PVPlacement(nullptr, 111 "OncuraAirGapP 112 fOncuraCapsule 113 0, true); 114 115 //Silver core 116 fOncuraSilverCore = new G4Tubs("OncuraSilverCo 117 fOncuraSilverCoreLog = new G4LogicalVolume(fOn 118 fOncuraSilverCorePhys = new G4PVPlacement(null 119 "OncuraSilverCorePhys", fOncur 120 fOncuraAirGapP 121 0, true); 122 123 fOncuraCapsuleShellVisAtt = new G4VisAttribute 124 fOncuraCapsuleShellVisAtt -> SetVisibility(tru 125 fOncuraCapsuleShellVisAtt -> SetForceWireframe 126 fOncuraCapsuleLog -> SetVisAttributes(fOncuraC 127 128 fOncuraCapsuleTipVisAtt = new G4VisAttributes( 129 fOncuraCapsuleTipVisAtt -> SetVisibility(true) 130 fOncuraCapsuleTipVisAtt -> SetForceSolid(true) 131 fOncuraCapsuleTip1Log -> SetVisAttributes(fOnc 132 fOncuraCapsuleTip2Log -> SetVisAttributes(fOnc 133 134 fOncuraSilverCoreVisAtt = new G4VisAttributes( 135 fOncuraSilverCoreVisAtt -> SetVisibility(true) 136 fOncuraSilverCoreVisAtt -> SetForceSolid(true) 137 fOncuraSilverCoreLog -> SetVisAttributes(fOncu 138 } 139 140 void BrachyDetectorConstructionOncura6711::Cle 141 { 142 delete fOncuraSilverCoreVisAtt; 143 fOncuraSilverCoreVisAtt = nullptr; 144 145 delete fOncuraCapsuleTipVisAtt; 146 fOncuraCapsuleTipVisAtt = nullptr; 147 148 delete fOncuraCapsuleShellVisAtt; 149 fOncuraCapsuleShellVisAtt = nullptr; 150 151 delete fOncuraSilverCorePhys; 152 fOncuraSilverCorePhys = nullptr; 153 154 delete fOncuraSilverCoreLog; 155 fOncuraSilverCoreLog = nullptr; 156 157 delete fOncuraSilverCore; 158 fOncuraSilverCore = nullptr; 159 160 delete fOncuraAirGapPhys; 161 fOncuraAirGapPhys = nullptr; 162 163 delete fOncuraAirGapLog; 164 fOncuraAirGapLog = nullptr; 165 166 delete fOncuraAirGap; 167 fOncuraAirGap = nullptr; 168 169 delete fOncuraCapsuleTip2Phys; 170 fOncuraCapsuleTip2Phys = nullptr; 171 172 delete fOncuraCapsuleTip2Log; 173 fOncuraCapsuleTip2Log = nullptr; 174 175 delete fOncuraCapsuleTip2; 176 fOncuraCapsuleTip2 = nullptr; 177 178 delete fOncuraCapsuleTip1Phys; 179 fOncuraCapsuleTip1Phys = nullptr; 180 181 delete fOncuraCapsuleTip1Log; 182 fOncuraCapsuleTip1Log = nullptr; 183 184 delete fOncuraCapsuleTip1; 185 fOncuraCapsuleTip1 = nullptr; 186 187 delete fOncuraCapsulePhys; 188 fOncuraCapsulePhys = nullptr; 189 190 delete fOncuraCapsuleLog; 191 fOncuraCapsuleLog = nullptr; 192 193 delete fOncuraCapsule; 194 fOncuraCapsule = nullptr; 195 196 G4RunManager::GetRunManager() -> GeometryHasB 197 } 198