Geant4  10.03.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
BrachyDetectorConstructionTG186.cc
Go to the documentation of this file.
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 // $Id: BrachyDetectorConstructionTG186.cc 69765 2013-05-14 10:11:22Z gcosmo $
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  TG186capsule(0),TG186capsuleLog(0),
62  TG186capsulePhys(0),
63  TG186capsuleTip(0),TG186capsuleTipLog(0),
64  TG186capsuleTipPhys(0),
65  TG186iridiumCore(0),TG186iridiumCoreLog(0),
66  TG186iridiumCorePhys(0),
67  TG186cable(0),TG186cableLog(0),
68  TG186cablePhys(0),
69  TG186simpleCapsuleVisAtt(0),TG186simpleCapsuleTipVisAtt(0),TG186simpleIridiumVisAtt(0),
70  TG186simpleCableVisAtt(0)
71 {
72  pMat = new BrachyMaterial();
73 }
74 
76 {
77  delete pMat;
78 }
79 
81 {
82  G4Colour red (1.0, 0.0, 0.0) ;
83  G4Colour magenta (1.0, 0.0, 1.0) ;
84 
85  G4Material* capsuleMat = pMat -> GetMat("Stainless steel");
86  G4Material* iridiumMat = pMat -> GetMat("Iridium");
87 
88  // Capsule main body
89  TG186capsule = new G4Tubs("TG186-Capsule",0,0.5*mm,2.25*mm,0.*deg,360.*deg);
90  TG186capsuleLog = new G4LogicalVolume(TG186capsule,capsuleMat,"TG186-CapsuleLog");
91  TG186capsulePhys = new G4PVPlacement(0,
92  G4ThreeVector(0,0,-0.4*mm),
93  "TG186-IridiumCapsulePhys",
94  TG186capsuleLog,
95  mother,
96  false,
97  0, true);
98 
99  // Capsule tip
100  TG186capsuleTip = new G4Sphere("Tg186-CapsuleTipIridium",
101  0.*mm,
102  0.5*mm,
103  0.*deg,
104  360.*deg,
105  0.*deg,
106  90.*deg);
107 
108  TG186capsuleTipLog = new G4LogicalVolume(TG186capsuleTip,
109  capsuleMat,
110  "CapsuleTipIridumLog");
111  TG186capsuleTipPhys = new G4PVPlacement(0,
112  G4ThreeVector(0.,0.,1.85*mm),
113  "TG186-CapsuleTipIridiumPhys",
114  TG186capsuleTipLog,
115  mother,
116  false,
117  0, true);
118 
119  TG186cable = new G4Tubs("TG186-cable",
120  0.*mm,
121  0.5*mm,
122  1.0*mm,
123  0.*deg,
124  360.*deg);
125 
126  TG186cableLog = new G4LogicalVolume(TG186cable,
127  capsuleMat,
128  "TG186-cableLog");
129  TG186cablePhys = new G4PVPlacement(0,
130  G4ThreeVector(0.,0.,-3.65*mm),
131  "TG186-CablePhys",
132  TG186cableLog,
133  mother,
134  false,
135  0, true);
136 
137  // Iridium core
138  TG186iridiumCore = new G4Tubs("TG186-IrCore",0,0.30*mm,1.75*mm,0.*deg,360.*deg);
139  TG186iridiumCoreLog = new G4LogicalVolume(TG186iridiumCore,
140  iridiumMat,
141  "TG186-IridiumCoreLog");
142  TG186iridiumCorePhys = new G4PVPlacement(0,
143  G4ThreeVector(0,0,0.4*mm),
144  "TG186-IridiumCorePhys",
145  TG186iridiumCoreLog,
146  TG186capsulePhys,
147  false,
148  0, true);
149 
150  TG186simpleCapsuleVisAtt = new G4VisAttributes(red);
151  TG186simpleCapsuleVisAtt -> SetVisibility(true);
152  TG186simpleCapsuleVisAtt -> SetForceWireframe(true);
153  TG186capsuleLog -> SetVisAttributes(TG186simpleCapsuleVisAtt);
154 
155  TG186simpleCapsuleTipVisAtt = new G4VisAttributes(red);
156  TG186simpleCapsuleTipVisAtt -> SetVisibility(true);
157  TG186simpleCapsuleTipVisAtt -> SetForceSolid(true);
158  TG186capsuleTipLog -> SetVisAttributes(TG186simpleCapsuleTipVisAtt);
159 
160  TG186simpleIridiumVisAtt = new G4VisAttributes(magenta);
161  TG186simpleIridiumVisAtt -> SetVisibility(true);
162  TG186simpleIridiumVisAtt -> SetForceWireframe(true);
163  TG186iridiumCoreLog -> SetVisAttributes(TG186simpleIridiumVisAtt);
164 
165  TG186simpleCableVisAtt = new G4VisAttributes(red);
166  TG186simpleCableVisAtt -> SetVisibility(true);
167  TG186simpleCableVisAtt -> SetForceSolid(true);
168  TG186cableLog -> SetVisAttributes(TG186simpleCableVisAtt);
169 }
170 
172 {
173 
174  delete TG186simpleIridiumVisAtt;
175  TG186simpleIridiumVisAtt = 0;
176 
177  delete TG186iridiumCorePhys;
178  TG186iridiumCorePhys = 0;
179 
180  delete TG186iridiumCore;
181  TG186iridiumCore = 0;
182 
183  delete TG186iridiumCoreLog;
184  TG186iridiumCoreLog = 0 ;
185 
186  delete TG186simpleCapsuleTipVisAtt;
187  TG186simpleCapsuleTipVisAtt = 0;
188 
189  delete TG186capsuleTipPhys;
190  TG186capsuleTipPhys = 0;
191 
192  delete TG186capsuleTip;
193  TG186capsuleTip = 0;
194 
195  delete TG186capsuleTipLog;
196  TG186capsuleTipLog = 0;
197 
198  delete TG186simpleCapsuleVisAtt;
199  TG186simpleCapsuleVisAtt = 0;
200 
201  delete TG186capsulePhys;
202  TG186capsulePhys = 0;
203 
204  delete TG186capsule;
205  TG186capsule = 0;
206 
207  delete TG186capsuleLog;
208  TG186capsuleLog = 0;
209 
210  delete TG186cable;
211  TG186cable = 0;
212 
213  delete TG186cableLog;
214  TG186cableLog = 0;
215 
216  delete TG186cablePhys;
217  TG186cablePhys = 0;
218 
219  delete TG186simpleCableVisAtt;
220  TG186simpleCableVisAtt = 0;
221 
223 }
static constexpr double mm
Definition: G4SIunits.hh:115
Definition: test07.cc:36
CLHEP::Hep3Vector G4ThreeVector
Definition: G4Tubs.hh:85
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:79
static constexpr double deg
Definition: G4SIunits.hh:152