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

#include <ML2PhantomConstruction.hh>

Public Member Functions

 CML2PhantomConstruction (void)
 
 ~CML2PhantomConstruction (void)
 
bool Construct (G4VPhysicalVolume *PVWorld, G4int saving_in_ROG_Voxels_every_events, G4int seed, G4String ROGOutFile, G4bool bSaveROG, G4bool bOnlyVisio)
 
G4int getTotalNumberOfEvents ()
 
G4String getPhantomName ()
 
void setPhantomName (G4String val)
 
void setPhantomFileName (G4String val)
 
void setNewName ()
 
void setNewName (G4String val)
 
void applyNewCentre (G4ThreeVector val)
 
bool applyNewCentre ()
 
void saveData ()
 
void addNewCentre (G4ThreeVector val)
 
void writeInfo ()
 
G4String getCurrentTranslationString ()
 
void resetSensDet ()
 

Static Public Member Functions

static CML2PhantomConstructionGetInstance (void)
 

Detailed Description

Definition at line 60 of file ML2PhantomConstruction.hh.

Constructor & Destructor Documentation

CML2PhantomConstruction::CML2PhantomConstruction ( void  )

Definition at line 47 of file ML2PhantomConstruction.cc.

47  : PVPhmWorld(0), sensDet(0)
48 {
49  phantomContstructionMessenger=new CML2PhantomConstructionMessenger(this);
50  idCurrentCentre=0;
51 }

Here is the caller graph for this function:

CML2PhantomConstruction::~CML2PhantomConstruction ( void  )

Definition at line 53 of file ML2PhantomConstruction.cc.

54 {
55  if (phantomName=="fullWater")
56  {
57  delete Ph_fullWater;
58  }
59  else if (phantomName=="boxInBox")
60  {
61  delete Ph_BoxInBox;
62  }
63 }

Member Function Documentation

void CML2PhantomConstruction::addNewCentre ( G4ThreeVector  val)
inline

Definition at line 79 of file ML2PhantomConstruction.hh.

79 {centre.push_back(val);}

Here is the caller graph for this function:

void CML2PhantomConstruction::applyNewCentre ( G4ThreeVector  val)

Definition at line 208 of file ML2PhantomConstruction.cc.

209 {
210  if (sensDet!=0)
211  {
212  currentCentre=ctr;
214  PVPhmWorld->SetTranslation(ctr);
216  sensDet->resetVoxelsSingle();
219  }
220 }
void GeometryHasBeenModified(G4bool prop=true)
G4VPhysicalVolume * GetDaughter(const G4int i) const
void SetTranslation(const G4ThreeVector &v)
G4VReadOutGeometry * GetROgeometry() const
static G4GeometryManager * GetInstance()
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:79
G4LogicalVolume * GetLogicalVolume() const
void OpenGeometry(G4VPhysicalVolume *vol=0)
G4bool CloseGeometry(G4bool pOptimise=true, G4bool verbose=false, G4VPhysicalVolume *vol=0)
G4VPhysicalVolume * GetROWorld() const

Here is the call graph for this function:

Here is the caller graph for this function:

bool CML2PhantomConstruction::applyNewCentre ( )

Definition at line 191 of file ML2PhantomConstruction.cc.

192 {
193  if (idCurrentCentre <(int) centre.size())
194  {
195  currentCentre=centre[idCurrentCentre];
196  applyNewCentre(currentCentre);
197  idCurrentCentre++;
198  return true;
199  }
200  return false;
201 }
bool CML2PhantomConstruction::Construct ( G4VPhysicalVolume PVWorld,
G4int  saving_in_ROG_Voxels_every_events,
G4int  seed,
G4String  ROGOutFile,
G4bool  bSaveROG,
G4bool  bOnlyVisio 
)

Definition at line 107 of file ML2PhantomConstruction.cc.

110 {
111  idVolumeName=0;
112  bOnlyVisio=bOV;
113 // a call to select the right phantom
114  if(design())
115  {
116  phantomContstructionMessenger->SetReferenceWorld(bOV); // create the phantom-world box
117  G4Material *Vacuum=G4NistManager::Instance()->FindOrBuildMaterial("G4_Galactic");
118 
119  G4Box *phmWorldB = new G4Box("phmWorldG", halfPhantomInsideSize.getX(), halfPhantomInsideSize.getY(), halfPhantomInsideSize.getZ());
120  G4LogicalVolume *phmWorldLV = new G4LogicalVolume(phmWorldB, Vacuum, "phmWorldL", 0, 0, 0);
121  G4VisAttributes* simpleAlSVisAtt= new G4VisAttributes(G4Colour::White());
122  simpleAlSVisAtt->SetVisibility(false);
123 // simpleAlSVisAtt->SetForceWireframe(false);
124  phmWorldLV->SetVisAttributes(simpleAlSVisAtt);
125 
126 
127  PVPhmWorld= new G4PVPlacement(0, G4ThreeVector(0.,0.,0.), "phmWorldPV", phmWorldLV, PVWorld, false, 0);
128 
129  // create the actual phantom
130  if (phantomName=="fullWater")
131  {
132  Ph_fullWater->Construct(PVPhmWorld, saving_in_ROG_Voxels_every_events, seed, ROGOutFile, bSaveROG);
133  sensDet=Ph_fullWater->getSensDet();
134  createPhysicalVolumeNamesList(Ph_fullWater->getPhysicalVolume());
135  Ph_fullWater->writeInfo();
136  }
137  else if (phantomName=="boxInBox")
138  {
139  Ph_BoxInBox->Construct(PVPhmWorld, saving_in_ROG_Voxels_every_events, seed, ROGOutFile, bSaveROG);
140  sensDet=Ph_BoxInBox->getSensDet();
141  createPhysicalVolumeNamesList(Ph_BoxInBox->getPhysicalVolume());
142  Ph_BoxInBox->writeInfo();
143  }
144  // I create the data base volumeName-volumeID in the sensitive detector
145 
146  sensDet->setVolumeNameIdLink(volumeNameIdLink);
147  }
148  else
149  {
150  return false;
151  }
152  return true;
153 }
CML2SDWithVoxels * getSensDet()
void setVolumeNameIdLink(std::vector< SvolumeNameId > volNameIdLink)
G4Material * FindOrBuildMaterial(const G4String &name, G4bool isotopes=true, G4bool warning=false)
CLHEP::Hep3Vector G4ThreeVector
Definition: G4Box.hh:64
double getY() const
G4VPhysicalVolume * getPhysicalVolume()
static G4NistManager * Instance()
double getX() const
long seed
Definition: chem4.cc:68
void SetVisibility(G4bool=true)
G4VPhysicalVolume * getPhysicalVolume()
CML2SDWithVoxels * getSensDet()
bool Construct(G4VPhysicalVolume *PVWorld, G4int saving_in_ROG_Voxels_every_events, G4int seed, G4String ROGOutFile, G4bool bSaveROG)
double getZ() const
bool Construct(G4VPhysicalVolume *PVWorld, G4int saving_in_ROG_Voxels_every_events, G4int seed, G4String ROGOutFile, G4bool bSaveROG)
static G4Colour White()
Definition: G4Colour.hh:143

Here is the call graph for this function:

Here is the caller graph for this function:

G4String CML2PhantomConstruction::getCurrentTranslationString ( )

Definition at line 221 of file ML2PhantomConstruction.cc.

222 {
223  char cT[5];
224  G4int cTI;
225  G4String translationName;
226  cTI=(G4int)((currentCentre.getX()/mm));
227  sprintf(cT,"%d",cTI);
228  translationName="_TrX"+G4String(cT)+"_";
229  cTI=(G4int)((currentCentre.getY()/mm));
230  sprintf(cT,"%d",cTI);
231  translationName+="Y"+G4String(cT)+"_";
232  cTI=(G4int)((currentCentre.getZ()/mm));
233  sprintf(cT,"%d",cTI);
234  translationName+="Z"+G4String(cT);
235  return translationName;
236 }
static constexpr double mm
Definition: G4SIunits.hh:115
double getY() const
int G4int
Definition: G4Types.hh:78
double getX() const
double getZ() const

Here is the call graph for this function:

Here is the caller graph for this function:

CML2PhantomConstruction * CML2PhantomConstruction::GetInstance ( void  )
static

Definition at line 67 of file ML2PhantomConstruction.cc.

68 {
69  if (instance == 0)
70  {
72 
73  }
74  return instance;
75 }
static MCTruthManager * instance

Here is the call graph for this function:

Here is the caller graph for this function:

G4String CML2PhantomConstruction::getPhantomName ( )
inline

Definition at line 68 of file ML2PhantomConstruction.hh.

68 {return phantomName;}

Here is the caller graph for this function:

G4int CML2PhantomConstruction::getTotalNumberOfEvents ( )

Definition at line 98 of file ML2PhantomConstruction.cc.

99 {
100  if (phantomName=="fullWater")
101  {return Ph_fullWater->getTotalNumberOfEvents();}
102  else if (phantomName=="boxInBox")
103  {return Ph_BoxInBox->getTotalNumberOfEvents();}
104  return 0;
105 }
G4int getTotalNumberOfEvents()
G4int getTotalNumberOfEvents()

Here is the call graph for this function:

Here is the caller graph for this function:

void CML2PhantomConstruction::resetSensDet ( )
inline

Definition at line 83 of file ML2PhantomConstruction.hh.

83 {sensDet->resetVoxelsSingle();}

Here is the call graph for this function:

Here is the caller graph for this function:

void CML2PhantomConstruction::saveData ( )
inline

Definition at line 77 of file ML2PhantomConstruction.hh.

77 {sensDet->save();}

Here is the call graph for this function:

Here is the caller graph for this function:

void CML2PhantomConstruction::setNewName ( )
inline

Definition at line 71 of file ML2PhantomConstruction.hh.

71 {sensDet->setFullOutFileDataSingle("");}
void setFullOutFileDataSingle(G4String val)

Here is the call graph for this function:

Here is the caller graph for this function:

void CML2PhantomConstruction::setNewName ( G4String  val)
inline

Definition at line 72 of file ML2PhantomConstruction.hh.

72 {sensDet->setFullOutFileDataSingle(val);}
void setFullOutFileDataSingle(G4String val)

Here is the call graph for this function:

void CML2PhantomConstruction::setPhantomFileName ( G4String  val)
inline

Definition at line 70 of file ML2PhantomConstruction.hh.

70 {PhantomFileName =val;}

Here is the caller graph for this function:

void CML2PhantomConstruction::setPhantomName ( G4String  val)
inline

Definition at line 69 of file ML2PhantomConstruction.hh.

69 {phantomName=val;}

Here is the caller graph for this function:

void CML2PhantomConstruction::writeInfo ( )

Definition at line 202 of file ML2PhantomConstruction.cc.

203 {
204  if (!bOnlyVisio)
205  {std::cout <<"Actual centre: "<<idCurrentCentre<<"/"<<centre.size() <<" "<< G4endl;}
206  std::cout <<"Phantom and its ROG centre: " << currentCentre<< G4endl;
207 }
#define G4endl
Definition: G4ios.hh:61

Here is the caller graph for this function:


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