source: trunk/examples/advanced/brachytherapy/src/BrachyDetectorConstructionIr.cc @ 1337

Last change on this file since 1337 was 1337, checked in by garnier, 14 years ago

tag geant4.9.4 beta 1 + modifs locales

File size: 6.4 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:
32// S. Agostinelli, F. Foppiano, S. Garelli , M. Tropeano, S.Guatelli
33//
34//    ****************************************
35//    *                                      *
36//    *    BrachyDetectorConstructionIr.cc   *
37//    *                                      *
38//    ****************************************
39//
40// $Id: BrachyDetectorConstructionIr.cc,v 1.10 2006/06/29 15:48:13 gunter Exp $
41// GEANT4 tag $Name: geant4-09-04-beta-01 $
42//
43#include "globals.hh"
44#include "BrachyDetectorConstructionIr.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"
54#include "G4TransportationManager.hh"
55#include "BrachyMaterial.hh"
56#include "G4VisAttributes.hh"
57#include "G4Colour.hh"
58
59BrachyDetectorConstructionIr::BrachyDetectorConstructionIr()
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
72BrachyDetectorConstructionIr::~BrachyDetectorConstructionIr()
73{ 
74  delete pMat; 
75}
76
77void BrachyDetectorConstructionIr::ConstructIridium(G4VPhysicalVolume* mother)
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                                 "CapsulePhys",
91                                 capsuleLog,
92                                 mother,
93                                 false,
94                                 0);
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 
105  capsuleTipLog = new G4LogicalVolume(capsuleTip,
106                                      capsuleMat,
107                                      "CapsuleTipIridumLog");
108  capsuleTipPhys = new G4PVPlacement(0,
109                                     G4ThreeVector(0.,0.,1.75*mm),
110                                     "CapsuleTipIridiumPhys",
111                                     capsuleTipLog,
112                                     mother,
113                                     false,
114                                     0);
115
116  // Iridium core
117  iridiumCore = new G4Tubs("IrCore",0,0.30*mm,1.75*mm,0.*deg,360.*deg);
118  iridiumCoreLog = new G4LogicalVolume(iridiumCore,
119                                       iridiumMat,
120                                       "IridiumCoreLog");
121  iridiumCorePhys = new G4PVPlacement(0,
122                                      G4ThreeVector(),
123                                      "IridiumCorePhys",
124                                      iridiumCoreLog,
125                                      capsulePhys,
126                                      false,
127                                      0);
128
129  simpleCapsuleVisAtt = new G4VisAttributes(red);
130  simpleCapsuleVisAtt -> SetVisibility(true); 
131  simpleCapsuleVisAtt -> SetForceWireframe(true);
132  capsuleLog -> SetVisAttributes(simpleCapsuleVisAtt);
133
134  simpleCapsuleTipVisAtt = new G4VisAttributes(red);
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
145void BrachyDetectorConstructionIr::CleanIridium()
146{ 
147 
148  delete simpleIridiumVisAtt; 
149  simpleIridiumVisAtt = 0;
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; 
161  simpleCapsuleTipVisAtt = 0;
162 
163  delete capsuleTipPhys; 
164  capsuleTipPhys = 0;
165 
166  delete capsuleTip;
167  capsuleTip = 0;
168  delete capsuleTipLog; 
169  capsuleTipLog = 0;
170
171  delete simpleCapsuleVisAtt; 
172  simpleCapsuleVisAtt = 0;
173 
174  delete capsulePhys; 
175  capsulePhys = 0;
176 
177  delete capsule; 
178  capsule = 0;
179 
180  delete capsuleLog; 
181  capsuleLog = 0;
182}
Note: See TracBrowser for help on using the repository browser.