Geant4  10.02.p01
BrachyDetectorConstructionIr.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 // S. Agostinelli, F. Foppiano, S. Garelli , M. Tropeano, S.Guatelli
33 //
34 // ****************************************
35 // * *
36 // * BrachyDetectorConstructionIr.cc *
37 // * *
38 // ****************************************
39 //
40 // $Id: BrachyDetectorConstructionIr.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  capsule(0),capsuleLog(0),
62  capsulePhys(0),
63  capsuleTip(0),capsuleTipLog(0),
64  capsuleTipPhys(0),
65  iridiumCore(0),iridiumCoreLog(0),
66  iridiumCorePhys(0),
67  simpleCapsuleVisAtt(0),simpleCapsuleTipVisAtt(0),simpleIridiumVisAtt(0)
68 {
69  pMat = new BrachyMaterial();
70 }
71 
73 {
74  delete pMat;
75 }
76 
78 {
79  G4Colour red (1.0, 0.0, 0.0) ;
80  G4Colour magenta (1.0, 0.0, 1.0) ;
81 
82  G4Material* capsuleMat = pMat -> GetMat("Stainless steel");
83  G4Material* iridiumMat = pMat -> GetMat("Iridium");
84 
85  // Capsule main body
86  capsule = new G4Tubs("Capsule",0,0.55*mm,3.725*mm,0.*deg,360.*deg);
87  capsuleLog = new G4LogicalVolume(capsule,capsuleMat,"CapsuleLog");
88  capsulePhys = new G4PVPlacement(0,
89  G4ThreeVector(0,0,-1.975*mm),
90  "IridiumCapsulePhys",
91  capsuleLog,
92  mother,
93  false,
94  0, true);
95 
96  // Capsule tip
97  capsuleTip = new G4Sphere("CapsuleTipIridium",
98  0.*mm,
99  0.55*mm,
100  0.*deg,
101  360.*deg,
102  0.*deg,
103  90.*deg);
104 
106  capsuleMat,
107  "CapsuleTipIridumLog");
109  G4ThreeVector(0.,0.,1.75*mm),
110  "CapsuleTipIridiumPhys",
112  mother,
113  false,
114  0, true);
115 
116  // Iridium core
117  iridiumCore = new G4Tubs("IrCore",0,0.30*mm,1.75*mm,0.*deg,360.*deg);
119  iridiumMat,
120  "IridiumCoreLog");
122  G4ThreeVector(),
123  "IridiumCorePhys",
125  capsulePhys,
126  false,
127  0, true);
128 
130  simpleCapsuleVisAtt -> SetVisibility(true);
131  simpleCapsuleVisAtt -> SetForceWireframe(true);
132  capsuleLog -> SetVisAttributes(simpleCapsuleVisAtt);
133 
135  simpleCapsuleTipVisAtt -> SetVisibility(true);
136  simpleCapsuleTipVisAtt -> SetForceSolid(true);
137  capsuleTipLog -> SetVisAttributes(simpleCapsuleTipVisAtt);
138 
139  simpleIridiumVisAtt = new G4VisAttributes(magenta);
140  simpleIridiumVisAtt -> SetVisibility(true);
141  simpleIridiumVisAtt -> SetForceWireframe(true);
142  iridiumCoreLog -> SetVisAttributes(simpleIridiumVisAtt);
143 }
144 
146 {
147 
148  delete simpleIridiumVisAtt;
150 
151  delete iridiumCorePhys;
152  iridiumCorePhys = 0;
153 
154  delete iridiumCore;
155  iridiumCore = 0;
156 
157  delete iridiumCoreLog;
158  iridiumCoreLog = 0 ;
159 
160  delete simpleCapsuleTipVisAtt;
162 
163  delete capsuleTipPhys;
164  capsuleTipPhys = 0;
165 
166  delete capsuleTip;
167  capsuleTip = 0;
168  delete capsuleTipLog;
169  capsuleTipLog = 0;
170 
171  delete simpleCapsuleVisAtt;
173 
174  delete capsulePhys;
175  capsulePhys = 0;
176 
177  delete capsule;
178  capsule = 0;
179 
180  delete capsuleLog;
181  capsuleLog = 0;
182 
184 }
Definition: test07.cc:36
CLHEP::Hep3Vector G4ThreeVector
Definition: G4Tubs.hh:85
static const double deg
Definition: G4SIunits.hh:151
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:79
static const double mm
Definition: G4SIunits.hh:114
void ConstructIridium(G4VPhysicalVolume *)