ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
BrachyDetectorConstructionTG186.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file BrachyDetectorConstructionTG186.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
33 //
34 // ****************************************
35 // * *
36 // * BrachyDetectorConstructionTG186.cc *
37 // * *
38 // ****************************************
39 //
40 //
41 #include "globals.hh"
42 #include "G4SystemOfUnits.hh"
44 #include "G4Sphere.hh"
45 #include "G4RunManager.hh"
46 #include "G4Box.hh"
47 #include "G4Tubs.hh"
48 #include "G4LogicalVolume.hh"
49 #include "G4ThreeVector.hh"
50 #include "G4PVPlacement.hh"
51 #include "G4Transform3D.hh"
52 #include "G4RotationMatrix.hh"
54 #include "BrachyMaterial.hh"
55 #include "G4VisAttributes.hh"
56 #include "G4Colour.hh"
57 
59  :
60  TG186capsule(0),TG186capsuleLog(0),
61  TG186capsulePhys(0),
62  TG186capsuleTip(0),TG186capsuleTipLog(0),
63  TG186capsuleTipPhys(0),
64  TG186iridiumCore(0),TG186iridiumCoreLog(0),
65  TG186iridiumCorePhys(0),
66  TG186cable(0),TG186cableLog(0),
67  TG186cablePhys(0),
68  TG186simpleCapsuleVisAtt(0),TG186simpleCapsuleTipVisAtt(0),TG186simpleIridiumVisAtt(0),
69  TG186simpleCableVisAtt(0)
70 {
71  pMat = new BrachyMaterial();
72 }
73 
75 {
76  delete pMat;
77 }
78 
80 {
81  G4Colour red (1.0, 0.0, 0.0) ;
82  G4Colour magenta (1.0, 0.0, 1.0) ;
83 
84  G4Material* capsuleMat = pMat -> GetMat("Stainless steel");
85  G4Material* iridiumMat = pMat -> GetMat("Iridium");
86 
87  // Capsule main body
88  TG186capsule = new G4Tubs("TG186-Capsule",0,0.5*mm,2.25*mm,0.*deg,360.*deg);
89  TG186capsuleLog = new G4LogicalVolume(TG186capsule,capsuleMat,"TG186-CapsuleLog");
91  G4ThreeVector(0,0,-0.4*mm),
92  "TG186-IridiumCapsulePhys",
94  mother,
95  false,
96  0, true);
97 
98  // Capsule tip
99  TG186capsuleTip = new G4Sphere("Tg186-CapsuleTipIridium",
100  0.*mm,
101  0.5*mm,
102  0.*deg,
103  360.*deg,
104  0.*deg,
105  90.*deg);
106 
108  capsuleMat,
109  "CapsuleTipIridumLog");
111  G4ThreeVector(0.,0.,1.85*mm),
112  "TG186-CapsuleTipIridiumPhys",
114  mother,
115  false,
116  0, true);
117 
118  TG186cable = new G4Tubs("TG186-cable",
119  0.*mm,
120  0.5*mm,
121  1.0*mm,
122  0.*deg,
123  360.*deg);
124 
126  capsuleMat,
127  "TG186-cableLog");
129  G4ThreeVector(0.,0.,-3.65*mm),
130  "TG186-CablePhys",
132  mother,
133  false,
134  0, true);
135 
136  // Iridium core
137  TG186iridiumCore = new G4Tubs("TG186-IrCore",0,0.30*mm,1.75*mm,0.*deg,360.*deg);
139  iridiumMat,
140  "TG186-IridiumCoreLog");
142  G4ThreeVector(0,0,0.4*mm),
143  "TG186-IridiumCorePhys",
146  false,
147  0, true);
148 
150  TG186simpleCapsuleVisAtt -> SetVisibility(true);
151  TG186simpleCapsuleVisAtt -> SetForceWireframe(true);
152  TG186capsuleLog -> SetVisAttributes(TG186simpleCapsuleVisAtt);
153 
155  TG186simpleCapsuleTipVisAtt -> SetVisibility(true);
156  TG186simpleCapsuleTipVisAtt -> SetForceSolid(true);
157  TG186capsuleTipLog -> SetVisAttributes(TG186simpleCapsuleTipVisAtt);
158 
160  TG186simpleIridiumVisAtt -> SetVisibility(true);
161  TG186simpleIridiumVisAtt -> SetForceWireframe(true);
162  TG186iridiumCoreLog -> SetVisAttributes(TG186simpleIridiumVisAtt);
163 
165  TG186simpleCableVisAtt -> SetVisibility(true);
166  TG186simpleCableVisAtt -> SetForceSolid(true);
167  TG186cableLog -> SetVisAttributes(TG186simpleCableVisAtt);
168 }
169 
171 {
172 
173  delete TG186simpleIridiumVisAtt;
175 
176  delete TG186iridiumCorePhys;
178 
179  delete TG186iridiumCore;
180  TG186iridiumCore = 0;
181 
182  delete TG186iridiumCoreLog;
183  TG186iridiumCoreLog = 0 ;
184 
187 
188  delete TG186capsuleTipPhys;
190 
191  delete TG186capsuleTip;
192  TG186capsuleTip = 0;
193 
194  delete TG186capsuleTipLog;
195  TG186capsuleTipLog = 0;
196 
197  delete TG186simpleCapsuleVisAtt;
199 
200  delete TG186capsulePhys;
201  TG186capsulePhys = 0;
202 
203  delete TG186capsule;
204  TG186capsule = 0;
205 
206  delete TG186capsuleLog;
207  TG186capsuleLog = 0;
208 
209  delete TG186cable;
210  TG186cable = 0;
211 
212  delete TG186cableLog;
213  TG186cableLog = 0;
214 
215  delete TG186cablePhys;
216  TG186cablePhys = 0;
217 
218  delete TG186simpleCableVisAtt;
220 
222 }