Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
BrachyDetectorConstruction Class Reference

#include <BrachyDetectorConstruction.hh>

Inheritance diagram for BrachyDetectorConstruction:
G4VUserDetectorConstruction

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 62 of file BrachyDetectorConstruction.cc.

References python.hepunit::cm, and python.hepunit::m.

62  :
63  detectorChoice(0), factory(0),
64  World(0), WorldLog(0), WorldPhys(0),
65  Phantom(0), PhantomLog(0), PhantomPhys(0),
66  phantomAbsorberMaterial(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
80  detectorMessenger = new BrachyDetectorMessenger(this);
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 }
BrachyDetectorConstruction::~BrachyDetectorConstruction ( )

Definition at line 90 of file BrachyDetectorConstruction.cc.

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

Member Function Documentation

G4VPhysicalVolume * BrachyDetectorConstruction::Construct ( void  )
virtual

Implements G4VUserDetectorConstruction.

Definition at line 97 of file BrachyDetectorConstruction.cc.

References ConstructPhantom().

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

Definition at line 154 of file BrachyDetectorConstruction.cc.

References G4VisAttributes::Invisible.

Referenced by Construct().

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
170  Phantom = new G4Box("Phantom",phantomSizeX,phantomSizeY,phantomSizeZ);
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:63
static const G4VisAttributes Invisible
void BrachyDetectorConstruction::PrintDetectorParameters ( )

Definition at line 190 of file BrachyDetectorConstruction.cc.

References python.hepunit::cm, G4cout, and G4endl.

Referenced by SetPhantomMaterial().

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 }
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
void BrachyDetectorConstruction::SelectBrachytherapicSeed ( G4String  val)

Definition at line 141 of file BrachyDetectorConstruction.cc.

References G4cout, and G4endl.

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
void BrachyDetectorConstruction::SetPhantomMaterial ( G4String  materialChoice)

Definition at line 207 of file BrachyDetectorConstruction.cc.

References G4cout, G4endl, G4Material::GetMaterial(), PrintDetectorParameters(), and EmPlot::SetMaterial().

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:578
G4GLOB_DLL std::ostream G4cout
def SetMaterial
Definition: EmPlot.py:25
#define G4endl
Definition: G4ios.hh:61
void BrachyDetectorConstruction::SwitchBrachytherapicSeed ( )

Definition at line 110 of file BrachyDetectorConstruction.cc.

References G4cout, G4endl, and G4RunManager::GetRunManager().

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:
123  factory = new BrachyFactoryLeipzig();
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
137  G4RunManager::GetRunManager() -> GeometryHasBeenModified();
138  G4cout << "... Geometry is notified .... THAT'S IT!!!!!" << G4endl;
139 }
G4GLOB_DLL std::ostream G4cout
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:74
#define G4endl
Definition: G4ios.hh:61

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