Geant4  10.02.p03
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
 

Private Attributes

G4int detectorChoice
 
BrachyFactoryfactory
 
G4BoxWorld
 
G4LogicalVolumeWorldLog
 
G4VPhysicalVolumeWorldPhys
 
G4BoxPhantom
 
G4LogicalVolumePhantomLog
 
G4VPhysicalVolumePhantomPhys
 
G4MaterialphantomAbsorberMaterial
 
G4double phantomSizeX
 
G4double phantomSizeY
 
G4double phantomSizeZ
 
G4double worldSizeX
 
G4double worldSizeY
 
G4double worldSizeZ
 
BrachyDetectorMessengerdetectorMessenger
 
BrachyMaterialpMaterial
 

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::BrachyDetectorConstruction ( )

Definition at line 62 of file BrachyDetectorConstruction.cc.

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

◆ ~BrachyDetectorConstruction()

BrachyDetectorConstruction::~BrachyDetectorConstruction ( )

Definition at line 90 of file BrachyDetectorConstruction.cc.

91 {
92  delete pMaterial;
93  delete factory;
94  delete detectorMessenger;
95 }
BrachyDetectorMessenger * detectorMessenger

Member Function Documentation

◆ Construct()

G4VPhysicalVolume * BrachyDetectorConstruction::Construct ( void  )
virtual

Implements G4VUserDetectorConstruction.

Definition at line 97 of file BrachyDetectorConstruction.cc.

98 {
99  pMaterial -> DefineMaterials();
100 
101  // Model the phantom (water box)
103 
104  // Model the source in the phantom
105  factory -> CreateSource(PhantomPhys);
106 
107  return WorldPhys;
108 }
Here is the call graph for this function:

◆ ConstructPhantom()

void BrachyDetectorConstruction::ConstructPhantom ( )

Definition at line 154 of file BrachyDetectorConstruction.cc.

155 {
156  // Model the water phantom
157 
158  // Define the light blue color
159  G4Colour lblue (0.0, 0.0, .75);
160 
161  G4Material* air = pMaterial -> GetMat("Air") ;
162  G4Material* water = pMaterial -> GetMat("Water");
163 
164  // World volume
165  World = new G4Box("World",worldSizeX,worldSizeY,worldSizeZ);
166  WorldLog = new G4LogicalVolume(World,air,"WorldLog",0,0,0);
167  WorldPhys = new G4PVPlacement(0,G4ThreeVector(),"WorldPhys",WorldLog,0,false,0);
168 
169  // Water Box
171 
172  // Logical volume
173  PhantomLog = new G4LogicalVolume(Phantom,water,"PhantomLog",0,0,0);
174 
175  // Physical volume
176  PhantomPhys = new G4PVPlacement(0,G4ThreeVector(), // Position: rotation and translation
177  "PhantomPhys", // Name
178  PhantomLog, // Associated logical volume
179  WorldPhys, // Mother volume
180  false,0);
181  WorldLog -> SetVisAttributes (G4VisAttributes::Invisible);
182 
183  // Visualization attributes of the phantom
184  G4VisAttributes* simpleBoxVisAtt = new G4VisAttributes(lblue);
185  simpleBoxVisAtt -> SetVisibility(true);
186  simpleBoxVisAtt -> SetForceWireframe(true);
187  PhantomLog -> SetVisAttributes(simpleBoxVisAtt);
188 }
CLHEP::Hep3Vector G4ThreeVector
Definition: G4Box.hh:64
static const G4VisAttributes Invisible
Here is the caller graph for this function:

◆ PrintDetectorParameters()

void BrachyDetectorConstruction::PrintDetectorParameters ( )

Definition at line 190 of file BrachyDetectorConstruction.cc.

191 {
192  G4cout << "----------------" << G4endl
193  << "the phantom is a water box whose size is: " << G4endl
194  << phantomSizeX *2./cm
195  << " cm * "
196  << phantomSizeY *2./cm
197  << " cm * "
198  << phantomSizeZ *2./cm
199  << " cm" << G4endl
200  << "The phantom is made of "
201  << phantomAbsorberMaterial -> GetName() <<G4endl
202  << "the source is at the center of the phantom" << G4endl
203  << "----------------"
204  << G4endl;
205 }
static const double cm
Definition: G4SIunits.hh:118
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
Here is the caller graph for this function:

◆ SelectBrachytherapicSeed()

void BrachyDetectorConstruction::SelectBrachytherapicSeed ( G4String  val)

Definition at line 141 of file BrachyDetectorConstruction.cc.

142 {
143  if (val == "Iodium") detectorChoice = 1;
144  else{
145  if(val=="Leipzig") detectorChoice = 2;
146  else{
147  if(val=="Iridium") detectorChoice = 3;
148  else G4cout << val << "is not available!!!!" <<G4endl;
149  }
150  }
151  G4cout << "Now the source is " << val << G4endl;
152 }
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61

◆ SetPhantomMaterial()

void BrachyDetectorConstruction::SetPhantomMaterial ( G4String  materialChoice)

Definition at line 207 of file BrachyDetectorConstruction.cc.

208 {
209  // It is possible to change the material of the phantom
210  // interactively
211 
212  // Search the material by its name
213  G4Material* pttoMaterial = G4Material::GetMaterial(materialChoice);
214 
215  if (pttoMaterial)
216  {
217  phantomAbsorberMaterial = pttoMaterial;
218  PhantomLog -> SetMaterial(pttoMaterial);
220  } else
221  { G4cout << "WARNING: material '" << materialChoice << "' not available!" << G4endl;}
222 }
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
Definition: G4Material.cc:604
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
def SetMaterial(material_name)
Definition: EmPlot.py:25
Here is the call graph for this function:

◆ SwitchBrachytherapicSeed()

void BrachyDetectorConstruction::SwitchBrachytherapicSeed ( )

Definition at line 110 of file BrachyDetectorConstruction.cc.

111 {
112  // Change the source in the water phantom
113  factory -> CleanSource();
114  G4cout << "Old Source is deleted ..." << G4endl;
115  delete factory;
116 
117  switch(detectorChoice)
118  {
119  case 1:
120  factory = new BrachyFactoryI();
121  break;
122  case 2:
124  break;
125  case 3:
126  factory = new BrachyFactoryIr();
127  break;
128  default:
129  factory = new BrachyFactoryIr();
130  break;
131  }
132 
133  factory -> CreateSource(PhantomPhys);
134  G4cout << "... New source is created ..." << G4endl;
135 
136  // Notify run manager that the new geometry has been built
138  G4cout << "... Geometry is notified .... THAT'S IT!!!!!" << G4endl;
139 }
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:

Member Data Documentation

◆ detectorChoice

G4int BrachyDetectorConstruction::detectorChoice
private

Definition at line 66 of file BrachyDetectorConstruction.hh.

◆ detectorMessenger

BrachyDetectorMessenger* BrachyDetectorConstruction::detectorMessenger
private

Definition at line 86 of file BrachyDetectorConstruction.hh.

◆ factory

BrachyFactory* BrachyDetectorConstruction::factory
private

Definition at line 67 of file BrachyDetectorConstruction.hh.

◆ Phantom

G4Box* BrachyDetectorConstruction::Phantom
private

Definition at line 75 of file BrachyDetectorConstruction.hh.

◆ phantomAbsorberMaterial

G4Material* BrachyDetectorConstruction::phantomAbsorberMaterial
private

Definition at line 78 of file BrachyDetectorConstruction.hh.

◆ PhantomLog

G4LogicalVolume* BrachyDetectorConstruction::PhantomLog
private

Definition at line 76 of file BrachyDetectorConstruction.hh.

◆ PhantomPhys

G4VPhysicalVolume* BrachyDetectorConstruction::PhantomPhys
private

Definition at line 77 of file BrachyDetectorConstruction.hh.

◆ phantomSizeX

G4double BrachyDetectorConstruction::phantomSizeX
private

Definition at line 80 of file BrachyDetectorConstruction.hh.

◆ phantomSizeY

G4double BrachyDetectorConstruction::phantomSizeY
private

Definition at line 81 of file BrachyDetectorConstruction.hh.

◆ phantomSizeZ

G4double BrachyDetectorConstruction::phantomSizeZ
private

Definition at line 82 of file BrachyDetectorConstruction.hh.

◆ pMaterial

BrachyMaterial* BrachyDetectorConstruction::pMaterial
private

Definition at line 87 of file BrachyDetectorConstruction.hh.

◆ World

G4Box* BrachyDetectorConstruction::World
private

Definition at line 70 of file BrachyDetectorConstruction.hh.

◆ WorldLog

G4LogicalVolume* BrachyDetectorConstruction::WorldLog
private

Definition at line 71 of file BrachyDetectorConstruction.hh.

◆ WorldPhys

G4VPhysicalVolume* BrachyDetectorConstruction::WorldPhys
private

Definition at line 72 of file BrachyDetectorConstruction.hh.

◆ worldSizeX

G4double BrachyDetectorConstruction::worldSizeX
private

Definition at line 83 of file BrachyDetectorConstruction.hh.

◆ worldSizeY

G4double BrachyDetectorConstruction::worldSizeY
private

Definition at line 84 of file BrachyDetectorConstruction.hh.

◆ worldSizeZ

G4double BrachyDetectorConstruction::worldSizeZ
private

Definition at line 85 of file BrachyDetectorConstruction.hh.


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