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