source: trunk/examples/extended/parallel/ExDiane/src/BrachyDetectorConstructionI.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: 7.9 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//    *    BrachyDetectorConstructionI.cc     *
36//    *                                      *
37//    ****************************************
38//
39// $Id: BrachyDetectorConstructionI.cc,v 1.3 2006/06/29 17:32:54 gunter Exp $
40// GEANT4 tag $Name: geant4-09-04-beta-01 $
41//
42#include "globals.hh"
43#include "BrachyDetectorConstructionI.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
72BrachyDetectorConstructionI::BrachyDetectorConstructionI()
73: defaultTub(0), defaultTubLog(0), defaultTubPhys(0),
74  capsule(0), capsuleLog(0), capsulePhys(0),
75  capsuleTip(0), capsuleTipLog(0),capsuleTipPhys1(0), 
76  capsuleTipPhys2(0), iodiumCore(0), iodiumCoreLog(0),
77  iodiumCorePhys(0), marker(0), markerLog(0), markerPhys(0)
78{ 
79  pMaterial = new BrachyMaterial();
80}
81
82BrachyDetectorConstructionI::~BrachyDetectorConstructionI()
83{ 
84  delete pMaterial; 
85}
86
87void BrachyDetectorConstructionI::ConstructIodium(G4VPhysicalVolume* mother)
88{
89  // source Bebig Isoseed I-125 ...
90
91  //Get materials for source construction ...
92  G4Material* titanium = pMaterial -> GetMat("titanium");
93  G4Material* air = pMaterial -> GetMat("Air");
94  G4Material* iodium = pMaterial -> GetMat("Iodium");
95  G4Material* gold = pMaterial -> GetMat("gold");
96
97  G4Colour  red     (1.0, 0.0, 0.0) ;
98  G4Colour  magenta (1.0, 0.0, 1.0) ; 
99  G4Colour  lblue   (0.0, 0.0, .75);
100
101  defaultTub = new G4Tubs("DefaultTub",0.*mm,0.40*mm,1.84*mm,0.*deg,360.*deg);
102  defaultTubLog = new G4LogicalVolume(defaultTub,air,"DefaultTub_Log");
103  defaultTubPhys = new G4PVPlacement(0,
104                                      G4ThreeVector(),
105                                      "defaultTub_Phys",
106                                      defaultTubLog,
107                                      mother,
108                                      false,
109                                      0); 
110  //  Capsule main body ...
111
112  G4double capsuleR = 0.35*mm;
113  capsule = new G4Tubs("Capsule", capsuleR,0.40*mm,1.84*mm,0.*deg,360.*deg);
114  capsuleLog = new G4LogicalVolume(capsule,titanium,"CapsuleLog");
115  capsulePhys = new G4PVPlacement(0,
116                                  G4ThreeVector(),
117                                  "CapsulePhys",
118                                  capsuleLog,
119                                  defaultTubPhys,
120                                  false,
121                                  0);
122  // Capsule tips
123
124  capsuleTip = new G4Sphere("CapsuleTip",
125                            0.*mm,
126                            0.40*mm,
127                            0.*deg,
128                            360.*deg,
129                            0.*deg,
130                            90.*deg);
131  capsuleTipLog = new G4LogicalVolume(capsuleTip,titanium,"CapsuleTipLog");
132  capsuleTipPhys1 = new G4PVPlacement(0,
133                                      G4ThreeVector(0.,0.,1.84*mm),
134                                      "CapsuleTipPhys1",
135                                      capsuleTipLog,
136                                      mother,
137                                      false,
138                                      0);
139
140  G4RotationMatrix* rotateMatrix = new G4RotationMatrix();
141  rotateMatrix -> rotateX(180.0*deg);
142  capsuleTipPhys2 = new G4PVPlacement(rotateMatrix, 
143                                      G4ThreeVector(0,0,-1.84*mm),
144                                      "CapsuleTipPhys2",
145                                      capsuleTipLog,
146                                      mother,
147                                      false,
148                                      0);
149 
150  // radiactive core ...
151  iodiumCore = new G4Tubs("ICore",0.085*mm,0.35*mm,1.75*mm,0.*deg,360.*deg);
152  iodiumCoreLog = new G4LogicalVolume(iodiumCore,iodium,"iodiumCoreLog");
153  iodiumCorePhys = new G4PVPlacement(0,
154                                     G4ThreeVector(0.,0.,0.),
155                                     "iodiumCorePhys",
156                                     iodiumCoreLog,
157                                     defaultTubPhys,
158                                     false,
159                                     0);
160  // golden marker
161  marker = new G4Tubs("GoldenMarker",0.*mm,0.085*mm,1.75*mm,0.*deg,360.*deg);
162  markerLog = new G4LogicalVolume(marker,gold,"MarkerLog");
163  markerPhys = new G4PVPlacement(0,
164                                 G4ThreeVector(0.,0.,0.),
165                                 "MarkerPhys",
166                                 markerLog,
167                                 defaultTubPhys,
168                                 false,
169                                 0);
170  // Visual attributes ...
171  G4VisAttributes* simpleMarkerVisAtt = new G4VisAttributes(lblue);
172  simpleMarkerVisAtt -> SetVisibility(true);
173  simpleMarkerVisAtt -> SetForceSolid(true);
174  markerLog -> SetVisAttributes(simpleMarkerVisAtt); 
175
176  G4VisAttributes* simpleiodiumVisAtt = new G4VisAttributes(magenta);
177  simpleiodiumVisAtt -> SetVisibility(true);
178  simpleiodiumVisAtt -> SetForceWireframe(true);
179  iodiumCoreLog -> SetVisAttributes(simpleiodiumVisAtt);
180
181  G4VisAttributes* simpleCapsuleVisAtt = new G4VisAttributes(red);
182  simpleCapsuleVisAtt -> SetVisibility(true); 
183  simpleCapsuleVisAtt -> SetForceWireframe(true);
184  capsuleLog -> SetVisAttributes(simpleCapsuleVisAtt);
185
186  G4VisAttributes* simpleCapsuleTipVisAtt = new G4VisAttributes(red);
187  simpleCapsuleTipVisAtt -> SetVisibility(true); 
188  simpleCapsuleTipVisAtt -> SetForceSolid(true);
189  capsuleTipLog -> SetVisAttributes(simpleCapsuleTipVisAtt);
190}
Note: See TracBrowser for help on using the repository browser.