ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
BrachyDetectorConstructionOncura6711.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file BrachyDetectorConstructionOncura6711.cc
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 // --------------------------------------------------------------
28 // GEANT 4 - Brachytherapy example
29 // --------------------------------------------------------------
30 //
31 // Code developed by:
32 // D. Cutajar, A. Le
33 //
34 // ********************************************
35 // * *
36 // * BrachyDetectorConstructionOncura6711.cc *
37 // * *
38 // ********************************************
39 //
40 //
41 //
42 #include "globals.hh"
43 #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"
55 #include "BrachyMaterial.hh"
56 #include "G4VisAttributes.hh"
57 #include "G4Colour.hh"
58 
60  :
61  OncuraCapsule(0),OncuraCapsuleLog(0),
62  OncuraCapsulePhys(0),
63  OncuraCapsuleTip1(0),OncuraCapsuleTip1Log(0),
64  OncuraCapsuleTip1Phys(0),
65  OncuraCapsuleTip2(0),OncuraCapsuleTip2Log(0),
66  OncuraCapsuleTip2Phys(0),
67  OncuraAirGap(0),OncuraAirGapLog(0),
68  OncuraAirGapPhys(0),
69  OncuraSilverCore(0), OncuraSilverCoreLog(0),
70  OncuraSilverCorePhys(0),
71  OncuraCapsuleShellVisAtt(0),OncuraCapsuleTipVisAtt(0),
72  OncuraSilverCoreVisAtt(0)
73 {
74  pMat = new BrachyMaterial();
75 }
76 
78 {
79  delete pMat;
80 }
81 
83 {
84 G4Colour red (1.0, 0.0, 0.0) ;
85 G4Colour magenta (1.0, 0.0, 1.0) ;
86 
87 G4Material* titaniumMat = pMat -> GetMat("titanium");
88 G4Material* airMat = pMat -> GetMat("Air");
89 G4Material* silverMat = pMat -> GetMat("Silver");
90 
91 //Capsule shell
92 OncuraCapsule = new G4Tubs("OncuraCapsule",0,0.4*mm,1.875*mm,0.*deg,360.*deg);
93 OncuraCapsuleLog = new G4LogicalVolume(OncuraCapsule,titaniumMat,"OncuraCapsuleLog", 0,0,0);
95  "OncuraCapsulePhys", OncuraCapsuleLog,
96  mother, false,
97  0, true);
98 
99 //Capsule tips
100 OncuraCapsuleTip1 = new G4Sphere("OncuraCapsuleTip1", 0, 0.4*mm, 0., 360*deg, 0., 90*deg);
101 OncuraCapsuleTip1Log = new G4LogicalVolume(OncuraCapsuleTip1, titaniumMat, "OncuraCapsuleTip1Log",0,0,0);
103  "OncuraCapsuleTip1Phys", OncuraCapsuleTip1Log,
104  mother, false,
105  0, true);
106 
107 OncuraCapsuleTip2 = new G4Sphere("OncuraCapsuleTip2", 0, 0.4*mm, 0., 360*deg, 90*deg, 90*deg);
108 OncuraCapsuleTip2Log = new G4LogicalVolume(OncuraCapsuleTip2, titaniumMat, "OncuraCapsuleTip2Log",0,0,0);
110  "OncuraCapsuleTip2Phys", OncuraCapsuleTip2Log,
111  mother, false,
112  0, true);
113 
114 //Airgap
115 OncuraAirGap = new G4Tubs("OncuraAirGap",0,0.33*mm,1.825*mm,0.*deg,360.*deg);
116 OncuraAirGapLog = new G4LogicalVolume(OncuraAirGap, airMat, "OncuraAirGapLog");
118  "OncuraAirGapPhys", OncuraAirGapLog,
119  OncuraCapsulePhys, false,
120  0, true);
121 
122 //Silver core
123 OncuraSilverCore = new G4Tubs("OncuraSilverCore",0,0.25*mm,1.4*mm,0.*deg,360.*deg);
124 OncuraSilverCoreLog = new G4LogicalVolume(OncuraSilverCore, silverMat, "silverCoreLog");
126  "OncuraSilverCorePhys", OncuraSilverCoreLog,
127  OncuraAirGapPhys, false,
128  0, true);
129 
131 OncuraCapsuleShellVisAtt -> SetVisibility(true);
132 OncuraCapsuleShellVisAtt -> SetForceWireframe(true);
133 OncuraCapsuleLog -> SetVisAttributes(OncuraCapsuleShellVisAtt);
134 
136 OncuraCapsuleTipVisAtt -> SetVisibility(true);
137 OncuraCapsuleTipVisAtt -> SetForceSolid(true);
138 OncuraCapsuleTip1Log -> SetVisAttributes(OncuraCapsuleTipVisAtt);
139 OncuraCapsuleTip2Log -> SetVisAttributes(OncuraCapsuleTipVisAtt);
140 
142 OncuraSilverCoreVisAtt -> SetVisibility(true);
143 OncuraSilverCoreVisAtt -> SetForceSolid(true);
144 OncuraSilverCoreLog -> SetVisAttributes(OncuraSilverCoreVisAtt);
145 
146 }
147 
149 {
150  delete OncuraSilverCoreVisAtt;
152 
153  delete OncuraCapsuleTipVisAtt;
155 
158 
159  delete OncuraSilverCorePhys;
161 
162  delete OncuraSilverCoreLog;
164 
165  delete OncuraSilverCore;
166  OncuraSilverCore = 0;
167 
168  delete OncuraAirGapPhys;
169  OncuraAirGapPhys = 0;
170 
171  delete OncuraAirGapLog;
172  OncuraAirGapLog = 0;
173 
174  delete OncuraAirGap;
175  OncuraAirGap = 0;
176 
177  delete OncuraCapsuleTip2Phys;
179 
180  delete OncuraCapsuleTip2Log;
182 
183  delete OncuraCapsuleTip2;
184  OncuraCapsuleTip2 = 0;
185 
186  delete OncuraCapsuleTip1Phys;
188 
189  delete OncuraCapsuleTip1Log;
191 
192  delete OncuraCapsuleTip1;
193  OncuraCapsuleTip1 = 0;
194 
195  delete OncuraCapsulePhys;
196  OncuraCapsulePhys = 0;
197 
198  delete OncuraCapsuleLog;
199  OncuraCapsuleLog = 0;
200 
201  delete OncuraCapsule;
202  OncuraCapsule = 0;
203 
205 }