Geant4  10.03.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
BrachyDetectorConstruction Class Reference

#include <BrachyDetectorConstruction.hh>

Inheritance diagram for BrachyDetectorConstruction:
Collaboration diagram for BrachyDetectorConstruction:

Public Member Functions

 BrachyDetectorConstruction ()
 
 ~BrachyDetectorConstruction ()
 
G4VPhysicalVolumeConstruct ()
 
void SwitchBrachytherapicSeed ()
 
void SelectBrachytherapicSeed (G4String val)
 
void ConstructPhantom ()
 
void PrintDetectorParameters ()
 
void SetPhantomMaterial (G4String)
 
- Public Member Functions inherited from G4VUserDetectorConstruction
 G4VUserDetectorConstruction ()
 
virtual ~G4VUserDetectorConstruction ()
 
virtual void ConstructSDandField ()
 
virtual void CloneSD ()
 
virtual void CloneF ()
 
void RegisterParallelWorld (G4VUserParallelWorld *)
 
G4int ConstructParallelGeometries ()
 
void ConstructParallelSD ()
 
G4int GetNumberOfParallelWorld () const
 
G4VUserParallelWorldGetParallelWorld (G4int i) const
 

Additional Inherited Members

- Protected Member Functions inherited from G4VUserDetectorConstruction
void SetSensitiveDetector (const G4String &logVolName, G4VSensitiveDetector *aSD, G4bool multi=false)
 
void SetSensitiveDetector (G4LogicalVolume *logVol, G4VSensitiveDetector *aSD)
 

Detailed Description

Definition at line 49 of file BrachyDetectorConstruction.hh.

Constructor & Destructor Documentation

BrachyDetectorConstruction::BrachyDetectorConstruction ( )

Definition at line 63 of file BrachyDetectorConstruction.cc.

63  :
64  detectorChoice(0), factory(0),
65  World(0), WorldLog(0), WorldPhys(0),
66  Phantom(0), PhantomLog(0), PhantomPhys(0),
67  phantomAbsorberMaterial(0)
68 {
69  // Define half size of the phantom along the x, y, z axis
70  phantomSizeX = 15.*cm;
71  phantomSizeY = 15.*cm;
72  phantomSizeZ = 15.*cm;
73 
74  // Define the sizes of the World volume containing the phantom
75  worldSizeX = 4.0*m;
76  worldSizeY = 4.0*m;
77  worldSizeZ = 4.0*m;
78 
79  // Define the messenger of the Detector component
80  // It is possible to modify geometrical parameters through UI
81  detectorMessenger = new BrachyDetectorMessenger(this);
82 
83  // Define the Flexi source as default source modelled in the geometry
84  factory = new BrachyFactoryFlexi();
85 
86  // BrachyMaterial defined the all the materials necessary
87  // for the experimental set-up
88  pMaterial = new BrachyMaterial();
89 }
static constexpr double m
Definition: G4SIunits.hh:129
static constexpr double cm
Definition: G4SIunits.hh:119
BrachyDetectorConstruction::~BrachyDetectorConstruction ( )

Definition at line 91 of file BrachyDetectorConstruction.cc.

92 {
93  delete pMaterial;
94  delete factory;
95  delete detectorMessenger;
96 }

Member Function Documentation

G4VPhysicalVolume * BrachyDetectorConstruction::Construct ( void  )
virtual

Implements G4VUserDetectorConstruction.

Definition at line 98 of file BrachyDetectorConstruction.cc.

99 {
100  pMaterial -> DefineMaterials();
101 
102  // Model the phantom (water box)
104 
105  // Model the source in the phantom
106  factory -> CreateSource(PhantomPhys);
107 
108  return WorldPhys;
109 }

Here is the call graph for this function:

void BrachyDetectorConstruction::ConstructPhantom ( )

Definition at line 161 of file BrachyDetectorConstruction.cc.

162 {
163  // Model the water phantom
164 
165  // Define the light blue color
166  G4Colour lblue (0.0, 0.0, .75);
167 
168  G4Material* air = pMaterial -> GetMat("Air") ;
169  G4Material* water = pMaterial -> GetMat("Water");
170 
171  // World volume
172  World = new G4Box("World",worldSizeX,worldSizeY,worldSizeZ);
173  WorldLog = new G4LogicalVolume(World,air,"WorldLog",0,0,0);
174  WorldPhys = new G4PVPlacement(0,G4ThreeVector(),"WorldPhys",WorldLog,0,false,0);
175 
176  // Water Box
177  Phantom = new G4Box("Phantom",phantomSizeX,phantomSizeY,phantomSizeZ);
178 
179  // Logical volume
180  PhantomLog = new G4LogicalVolume(Phantom,water,"PhantomLog",0,0,0);
181 
182  // Physical volume
183  PhantomPhys = new G4PVPlacement(0,G4ThreeVector(), // Position: rotation and translation
184  "PhantomPhys", // Name
185  PhantomLog, // Associated logical volume
186  WorldPhys, // Mother volume
187  false,0);
188  WorldLog -> SetVisAttributes (G4VisAttributes::GetInvisible());
189 
190  // Visualization attributes of the phantom
191  G4VisAttributes* simpleBoxVisAtt = new G4VisAttributes(lblue);
192  simpleBoxVisAtt -> SetVisibility(true);
193  simpleBoxVisAtt -> SetForceWireframe(true);
194  PhantomLog -> SetVisAttributes(simpleBoxVisAtt);
195 }
CLHEP::Hep3Vector G4ThreeVector
Definition: G4Box.hh:64
static const G4VisAttributes & GetInvisible()

Here is the call graph for this function:

Here is the caller graph for this function:

void BrachyDetectorConstruction::PrintDetectorParameters ( )

Definition at line 197 of file BrachyDetectorConstruction.cc.

198 {
199  G4cout << "----------------" << G4endl
200  << "the phantom is a water box whose size is: " << G4endl
201  << phantomSizeX *2./cm
202  << " cm * "
203  << phantomSizeY *2./cm
204  << " cm * "
205  << phantomSizeZ *2./cm
206  << " cm" << G4endl
207  << "The phantom is made of "
208  << phantomAbsorberMaterial -> GetName() <<G4endl
209  << "the source is at the center of the phantom" << G4endl
210  << "----------------"
211  << G4endl;
212 }
G4GLOB_DLL std::ostream G4cout
static constexpr double cm
Definition: G4SIunits.hh:119
#define G4endl
Definition: G4ios.hh:61

Here is the caller graph for this function:

void BrachyDetectorConstruction::SelectBrachytherapicSeed ( G4String  val)

Definition at line 145 of file BrachyDetectorConstruction.cc.

146 {
147  if (val == "Iodine") detectorChoice = 1;
148  else{
149  if(val=="Leipzig") detectorChoice = 2;
150  else{
151  if(val=="TG186") detectorChoice = 3;
152  else{
153  if(val=="Flexi") detectorChoice = 4;
154  else G4cout << val << "is not available!!!!" <<G4endl;
155  }
156  }
157  }
158  G4cout << "Now the source is " << val << G4endl;
159 }
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
void BrachyDetectorConstruction::SetPhantomMaterial ( G4String  materialChoice)

Definition at line 214 of file BrachyDetectorConstruction.cc.

215 {
216  // It is possible to change the material of the phantom
217  // interactively
218 
219  // Search the material by its name
220  G4Material* pttoMaterial = G4Material::GetMaterial(materialChoice);
221 
222  if (pttoMaterial)
223  {
224  phantomAbsorberMaterial = pttoMaterial;
225  PhantomLog -> SetMaterial(pttoMaterial);
227  } else
228  { G4cout << "WARNING: material '" << materialChoice << "' not available!" << G4endl;}
229 }
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
Definition: G4Material.cc:602
G4GLOB_DLL std::ostream G4cout
def SetMaterial
Definition: EmPlot.py:25
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

void BrachyDetectorConstruction::SwitchBrachytherapicSeed ( )

Definition at line 111 of file BrachyDetectorConstruction.cc.

112 {
113  // Change the source in the water phantom
114  factory -> CleanSource();
115  G4cout << "Old Source is deleted ..." << G4endl;
116  delete factory;
117 
118  switch(detectorChoice)
119  {
120  case 1:
121  factory = new BrachyFactoryI();
122  break;
123  case 2:
124  factory = new BrachyFactoryLeipzig();
125  break;
126  case 3:
127  factory = new BrachyFactoryTG186();
128  break;
129  case 4:
130  factory = new BrachyFactoryFlexi();
131  break;
132  default:
133  factory = new BrachyFactoryFlexi();
134  break;
135  }
136 
137  factory -> CreateSource(PhantomPhys);
138  G4cout << "... New source is created ..." << G4endl;
139 
140  // Notify run manager that the new geometry has been built
142  G4cout << "... Geometry is notified .... THAT'S IT!!!!!" << G4endl;
143 }
G4GLOB_DLL std::ostream G4cout
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:79
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:


The documentation for this class was generated from the following files: