source: trunk/examples/extended/parallel/ExDiane/src/BrachyDetectorConstructionIr.cc @ 1285

Last change on this file since 1285 was 1230, checked in by garnier, 15 years ago

update to geant4.9.3

File size: 6.8 KB
Line 
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: S.Guatelli
32//
33//    ****************************************
34//    *                                      *
35//    *    BrachyDetectorConstructionIr.cc   *
36//    *                                      *
37//    ****************************************
38//
39// $Id: BrachyDetectorConstructionIr.cc,v 1.3 2006/06/29 17:32:56 gunter Exp $
40// GEANT4 tag $Name: geant4-09-03-cand-01 $
41//
42#include "globals.hh"
43#include "BrachyDetectorConstructionIr.hh"
44#include "G4CSGSolid.hh"
45#include "G4Sphere.hh"
46#include "G4MaterialPropertyVector.hh"
47#include "G4SDManager.hh"
48#include "G4SubtractionSolid.hh"
49#include "G4RunManager.hh"
50#include "G4MaterialPropertiesTable.hh"
51#include "G4Material.hh"
52#include "G4Box.hh"
53#include "G4Tubs.hh"
54#include "G4LogicalVolume.hh"
55#include "G4ThreeVector.hh"
56#include "G4PVPlacement.hh"
57#include "G4MaterialTable.hh"
58#include "Randomize.hh" 
59#include "G4RunManager.hh"
60#include "G4Element.hh"
61#include "G4ElementTable.hh"
62#include "G4PVParameterised.hh"
63#include "G4Transform3D.hh"
64#include "G4RotationMatrix.hh"
65#include "G4FieldManager.hh"
66#include "G4TransportationManager.hh"
67#include "G4UnionSolid.hh"
68#include "BrachyMaterial.hh"
69#include "G4VisAttributes.hh"
70#include "G4Colour.hh"
71
72BrachyDetectorConstructionIr::BrachyDetectorConstructionIr()
73 : capsule(0), capsuleLog(0), capsulePhys(0),
74   capsuleTip(0), capsuleTipLog(0), capsuleTipPhys(0),
75   iridiumCore(0), iridiumCoreLog(0), iridiumCorePhys(0),
76   simpleCapsuleVisAtt(0), simpleCapsuleTipVisAtt(0), simpleIridiumVisAtt(0)
77{
78  pMat = new BrachyMaterial();
79}
80
81BrachyDetectorConstructionIr::~BrachyDetectorConstructionIr()
82{ 
83  delete pMat; 
84}
85
86void BrachyDetectorConstructionIr::ConstructIridium(G4VPhysicalVolume* mother)
87{
88  G4Colour  red     (1.0, 0.0, 0.0) ;
89  G4Colour  magenta (1.0, 0.0, 1.0) ; 
90
91  G4Material* capsuleMat = pMat -> GetMat("Stainless steel");
92  G4Material* iridiumMat = pMat -> GetMat("Iridium");
93
94  // Capsule main body
95  capsule = new G4Tubs("Capsule",0,0.55*mm,3.725*mm,0.*deg,360.*deg);
96  capsuleLog = new G4LogicalVolume(capsule,capsuleMat,"CapsuleLog");
97  capsulePhys= new G4PVPlacement(0,
98                                 G4ThreeVector(0,0,-1.975*mm),
99                                 "CapsulePhys",
100                                 capsuleLog,
101                                 mother,
102                                 false,
103                                 0);
104
105  // Capsule tip
106  capsuleTip = new G4Sphere("CapsuleTipIridium",
107                            0.*mm,
108                            0.55*mm,
109                            0.*deg,
110                            360.*deg,
111                            0.*deg,
112                            90.*deg); 
113  capsuleTipLog = new G4LogicalVolume(capsuleTip,
114                                      capsuleMat,
115                                      "CapsuleTipIridumLog");
116  capsuleTipPhys = new G4PVPlacement(0,
117                                     G4ThreeVector(0.,0.,1.75*mm),
118                                     "CapsuleTipIridiumPhys",
119                                     capsuleTipLog,
120                                     mother,
121                                     false,
122                                     0);
123
124  // Iridium core
125
126  iridiumCore = new G4Tubs("IrCore",0,0.30*mm,1.75*mm,0.*deg,360.*deg);
127  iridiumCoreLog = new G4LogicalVolume(iridiumCore,
128                                       iridiumMat,
129                                       "IridiumCoreLog");
130  iridiumCorePhys = new G4PVPlacement(0,
131                                      G4ThreeVector(),
132                                      "IridiumCorePhys",
133                                      iridiumCoreLog,
134                                      capsulePhys,
135                                      false,
136                                      0);
137
138  simpleCapsuleVisAtt = new G4VisAttributes(red);
139  simpleCapsuleVisAtt -> SetVisibility(true); 
140  simpleCapsuleVisAtt -> SetForceWireframe(true);
141  capsuleLog -> SetVisAttributes(simpleCapsuleVisAtt);
142
143  simpleCapsuleTipVisAtt = new G4VisAttributes(red);
144  simpleCapsuleTipVisAtt -> SetVisibility(true); 
145  simpleCapsuleTipVisAtt -> SetForceSolid(true);
146  capsuleTipLog -> SetVisAttributes(simpleCapsuleTipVisAtt);
147
148  simpleIridiumVisAtt = new G4VisAttributes(magenta);
149  simpleIridiumVisAtt -> SetVisibility(true);
150  simpleIridiumVisAtt -> SetForceWireframe(true);
151  iridiumCoreLog -> SetVisAttributes(simpleIridiumVisAtt);
152}
153
154void BrachyDetectorConstructionIr::CleanIridium()
155{ 
156 
157  delete simpleIridiumVisAtt; 
158  simpleIridiumVisAtt = 0;
159 
160  delete iridiumCorePhys; 
161  iridiumCorePhys = 0;
162 
163  delete iridiumCore; 
164  iridiumCore = 0;
165 
166  delete iridiumCoreLog; 
167  iridiumCoreLog = 0 ;
168
169  delete simpleCapsuleTipVisAtt; 
170  simpleCapsuleTipVisAtt = 0;
171 
172  delete capsuleTipPhys; 
173  capsuleTipPhys = 0;
174 
175  delete capsuleTip;
176  capsuleTip = 0;
177  delete capsuleTipLog; 
178  capsuleTipLog = 0;
179
180  delete simpleCapsuleVisAtt; 
181  simpleCapsuleVisAtt = 0;
182 
183  delete capsulePhys; 
184  capsulePhys = 0;
185 
186  delete capsule; 
187  capsule = 0;
188 
189  delete capsuleLog; 
190  capsuleLog = 0;
191}
Note: See TracBrowser for help on using the repository browser.