source: trunk/examples/advanced/brachytherapy/src/BrachyDetectorConstructionLeipzig.cc@ 1036

Last change on this file since 1036 was 807, checked in by garnier, 17 years ago

update

File size: 6.7 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.Guatelli
33//
34// *******************************************
35// * *
36// * BrachyDetectorConstructionLeipzig.cc *
37// * *
38// *******************************************
39//
40//
41// $Id: BrachyDetectorConstructionLeipzig.cc,v 1.10 2006/06/29 15:48:16 gunter Exp $
42// GEANT4 tag $Name: $
43//
44
45#include "globals.hh"
46#include "BrachyDetectorConstructionLeipzig.hh"
47#include "G4CSGSolid.hh"
48#include "G4Sphere.hh"
49#include "G4RunManager.hh"
50#include "G4Box.hh"
51#include "G4Tubs.hh"
52#include "G4LogicalVolume.hh"
53#include "G4ThreeVector.hh"
54#include "G4PVPlacement.hh"
55#include "G4Transform3D.hh"
56#include "G4RotationMatrix.hh"
57#include "G4TransportationManager.hh"
58#include "BrachyMaterial.hh"
59#include "G4VisAttributes.hh"
60#include "G4Colour.hh"
61
62// Leipzig Applicator ...
63
64BrachyDetectorConstructionLeipzig::BrachyDetectorConstructionLeipzig()
65 :
66 capsulePhys(0),
67 capsuleTipPhys(0),
68 iridiumCorePhys(0),
69 applicator1Phys(0),
70 applicator2Phys(0)
71{
72 pMaterial = new BrachyMaterial();
73}
74
75BrachyDetectorConstructionLeipzig::~BrachyDetectorConstructionLeipzig()
76{
77 delete pMaterial;
78}
79
80void BrachyDetectorConstructionLeipzig::ConstructLeipzig(G4VPhysicalVolume* mother)
81{
82 G4Colour red (1.0, 0.0, 0.0) ;
83 G4Colour lblue (0.0, 0.0, .75);
84
85 G4Material* capsuleMat = pMaterial -> GetMat("Stainless steel");
86 G4Material* iridium = pMaterial -> GetMat("Iridium");
87 G4Material* tungsten =pMaterial -> GetMat("Tungsten");
88
89 //Iridium source ...
90
91 G4Tubs* capsule = new G4Tubs("Capsule",0,0.55*mm,3.725*mm,0.*deg,360.*deg);
92 G4LogicalVolume* capsuleLog = new G4LogicalVolume(capsule,capsuleMat,"CapsuleLog");
93 capsulePhys = new G4PVPlacement(0,
94 G4ThreeVector(0,0,-1.975*mm),
95 "CapsulePhys",
96 capsuleLog,
97 mother, //mother volume: phantom
98 false,
99 0);
100
101 // Capsule tip
102 G4Sphere* capsuleTip = new G4Sphere("CapsuleTip",0.*mm,0.55*mm,0.*deg,360.*deg,0.*deg,90.*deg);
103 G4LogicalVolume* capsuleTipLog = new G4LogicalVolume(capsuleTip,capsuleMat,"CapsuleTipLog");
104 capsuleTipPhys = new G4PVPlacement(0,
105 G4ThreeVector(0.,0.,1.75*mm),
106 "CapsuleTipPhys",
107 capsuleTipLog,
108 mother,
109 false,
110 0);
111 // Iridium core
112
113 G4Tubs* iridiumCore = new G4Tubs("IrCore",0,0.30*mm,1.75*mm,0.*deg,360.*deg);
114 G4LogicalVolume* iridiumCoreLog = new G4LogicalVolume(iridiumCore,
115 iridium,
116 "IridiumCoreLog");
117 iridiumCorePhys = new G4PVPlacement(0,
118 G4ThreeVector(0.,0.,1.975*mm),
119 "IridiumCorePhys",
120 iridiumCoreLog,
121 capsulePhys,
122 false,
123 0);
124
125 //Leipzig Applicator is modelled with two different volumes
126
127 G4Tubs* applicator1 = new G4Tubs("Appl1",5*mm,10.5*mm,12*mm,0.*deg,360.*deg);
128 G4LogicalVolume* applicator1Log = new G4LogicalVolume(applicator1,tungsten,"Appl1Log");
129 applicator1Phys = new G4PVPlacement(0,
130 G4ThreeVector(0,0,4.0*mm),
131 "Appl1Phys",
132 applicator1Log,
133 mother,
134 false,
135 0);
136
137 G4Tubs* applicator2 = new G4Tubs("Appl2",0.55*mm,5.*mm,3.125*mm,0.*deg,360.*deg);
138 G4LogicalVolume* applicator2Log = new G4LogicalVolume(applicator2,tungsten,"Appl2");
139 applicator2Phys = new G4PVPlacement(0,
140 G4ThreeVector(0,0,-4.875*mm),
141 "Appl2Phys",
142 applicator2Log,
143 mother,
144 false,
145 0);
146
147 G4VisAttributes* simpleCapsuleVisAtt = new G4VisAttributes(red);
148 simpleCapsuleVisAtt -> SetVisibility(true);
149 simpleCapsuleVisAtt -> SetForceSolid(true);
150 capsuleLog -> SetVisAttributes(simpleCapsuleVisAtt);
151
152 G4VisAttributes* simpleCapsuleTipVisAtt = new G4VisAttributes(red);
153 simpleCapsuleTipVisAtt -> SetVisibility(true);
154 simpleCapsuleTipVisAtt -> SetForceSolid(true);
155 capsuleTipLog -> SetVisAttributes(simpleCapsuleTipVisAtt);
156
157 G4VisAttributes* applicatorVisAtt = new G4VisAttributes(lblue);
158 applicatorVisAtt -> SetVisibility(true);
159 applicatorVisAtt -> SetForceWireframe(true);
160 applicator1Log -> SetVisAttributes(applicatorVisAtt);
161 applicator2Log -> SetVisAttributes(applicatorVisAtt);
162}
Note: See TracBrowser for help on using the repository browser.