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

#include <ML2WorldConstruction.hh>

Inheritance diagram for CML2WorldConstruction:
Collaboration diagram for CML2WorldConstruction:

Public Member Functions

 CML2WorldConstruction (void)
 
 ~CML2WorldConstruction (void)
 
G4VPhysicalVolumeConstruct ()
 
bool create (SInputData *inputData, bool bOnlyVisio)
 
G4int getNParticleBackScattered ()
 
G4int getNParticlePhaseSpace ()
 
G4int getTotalNumberOfEventsInPhantom ()
 
CML2AcceleratorConstructiongetCML2AcceleratorConstruction ()
 
bool newGeometry ()
 
bool getWorldCreated ()
 
void savePhantomData ()
 
void savePhaseSpaceData ()
 
CML2PhantomConstructiongetPhantomWorld ()
 
CML2AcceleratorConstructiongetAcceleratorWorld ()
 
void checkVolumeOverlap ()
 
G4bool getbOnlyVisio ()
 
- 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
 

Static Public Member Functions

static CML2WorldConstructionGetInstance (void)
 

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 73 of file ML2WorldConstruction.hh.

Constructor & Destructor Documentation

CML2WorldConstruction::CML2WorldConstruction ( void  )

Definition at line 46 of file ML2WorldConstruction.cc.

46  :acceleratorEnv(0),phantomEnv(0),PVWorld(0),phaseSpace(0),backScatteredPlane(0)
47 {
50  bWorldCreated=false;
51 }
static CML2AcceleratorConstruction * GetInstance(void)
static CML2PhantomConstruction * GetInstance(void)

Here is the call graph for this function:

Here is the caller graph for this function:

CML2WorldConstruction::~CML2WorldConstruction ( void  )

Definition at line 53 of file ML2WorldConstruction.cc.

54 {
55  delete PVWorld;
56  delete phantomEnv;
57  delete acceleratorEnv;
58  delete phaseSpace;
59  delete backScatteredPlane;
60 }

Member Function Documentation

void CML2WorldConstruction::checkVolumeOverlap ( )

Definition at line 122 of file ML2WorldConstruction.cc.

123 {
124  // loop inside all the daughters volumes
125  std::cout<< G4endl;
126  // bool bCheckOverlap;
127  // bCheckOverlap=false;
128 
129  int nSubWorlds, nSubWorlds2;
130  for (int i=0; i<(int) PVWorld->GetLogicalVolume()->GetNoDaughters(); i++)
131  {
132  PVWorld->GetLogicalVolume()->GetDaughter(i)->CheckOverlaps();
133  nSubWorlds=(int) PVWorld->GetLogicalVolume()->GetDaughter(i)->GetLogicalVolume()->GetNoDaughters();
134  for (int j=0; j<nSubWorlds; j++)
135  {
138  for (int k=0; k<nSubWorlds2; k++)
139  {
141  }
142  }
143  }
144  std::cout<< G4endl;
145 }
G4VPhysicalVolume * GetDaughter(const G4int i) const
typedef int(XMLCALL *XML_NotStandaloneHandler)(void *userData)
G4int GetNoDaughters() const
G4LogicalVolume * GetLogicalVolume() const
#define G4endl
Definition: G4ios.hh:61
virtual G4bool CheckOverlaps(G4int res=1000, G4double tol=0., G4bool verbose=true, G4int errMax=1)

Here is the call graph for this function:

Here is the caller graph for this function:

G4VPhysicalVolume * CML2WorldConstruction::Construct ( void  )
virtual

Implements G4VUserDetectorConstruction.

Definition at line 73 of file ML2WorldConstruction.cc.

74 {
75  return PVWorld;
76 }
bool CML2WorldConstruction::create ( SInputData inputData,
bool  bOnlyVisio 
)

Definition at line 78 of file ML2WorldConstruction.cc.

79 {
80  // create the world box
81  bOnlyVisio=bOV;
82  G4double halfSize=3000.*mm;
83  G4Material *Vacuum=G4NistManager::Instance()->FindOrBuildMaterial("G4_Galactic");
84  G4Box *worldB = new G4Box("worldG", halfSize, halfSize, halfSize);
85  G4LogicalVolume *worldLV = new G4LogicalVolume(worldB, Vacuum, "worldL", 0, 0, 0);
86  G4VisAttributes* simpleWorldVisAtt= new G4VisAttributes(G4Colour::Black());
87  simpleWorldVisAtt->SetVisibility(false);
88  // simpleWorldVisAtt->SetForceSolid(false);
89  worldLV->SetVisAttributes(simpleWorldVisAtt);
90  PVWorld= new G4PVPlacement(0, G4ThreeVector(0.,0.,0.), "worldPV", worldLV, 0, false, 0);
91 
92  // create the accelerator-world box
93  if (!acceleratorEnv->Construct(PVWorld, bOV))
94  {
95  std::cout <<"\n\n The macro file '"<<inputData->generalData.StartFileInputData<<"' refers to a not defined accelerator.\n"<< acceleratorEnv->getAcceleratorName()<<"\n\nSTOP\n\n" << G4endl;
96  return false;
97  }
98 
99  // create the phantom-world box
100  if (!phantomEnv->Construct(PVWorld, inputData->generalData.saving_in_ROG_Voxels_every_events, inputData->generalData.seed, inputData->generalData.ROGOutFile, inputData->generalData.bSaveROG, bOV))
101  {
102  std::cout <<"\n\n The macro file '"<<inputData->generalData.StartFileInputData<<"' refers to a not defined phantom.\n"<< phantomEnv->getPhantomName()<<"\n\nSTOP\n\n" << G4endl;
103  return false;
104  }
105 
106  // if the bSavePhaseSpace flag is true create a phase plane
107  if (inputData->generalData.bSavePhaseSpace)
108  {
109  phaseSpace=new CML2PhaseSpaces();
111  {inputData->generalData.centrePhaseSpace.setZ(acceleratorEnv->getZ_Value_PhaseSpaceBeforeJaws());}
113  }
114 
115  // create a killer plane to destroy the particles back scattered from the target
116  backScatteredPlane=new CML2PhaseSpaces();
117  backScatteredPlane->createPlane(acceleratorEnv->getPhysicalVolume(), "killerPlane", G4ThreeVector(0, 0, -50*mm), G4ThreeVector(200*mm, 200*mm, 1*mm));
118 
119  bWorldCreated=true;
120  return true;
121 }
G4ThreeVector centrePhaseSpace
G4Material * FindOrBuildMaterial(const G4String &name, G4bool isotopes=true, G4bool warning=false)
static constexpr double mm
Definition: G4SIunits.hh:115
G4int nMaxParticlesInRamPlanePhaseSpace
CLHEP::Hep3Vector G4ThreeVector
bool Construct(G4VPhysicalVolume *PVWorld, G4int saving_in_ROG_Voxels_every_events, G4int seed, G4String ROGOutFile, G4bool bSaveROG, G4bool bOnlyVisio)
Definition: G4Box.hh:64
G4VPhysicalVolume * getPhysicalVolume(void)
static G4NistManager * Instance()
static G4Colour Black()
Definition: G4Colour.hh:146
void setZ(double)
G4String StartFileInputData
G4bool bStopAtPhaseSpace
void SetVisibility(G4bool=true)
G4bool bForcePhaseSpaceBeforeJaws
G4bool bSavePhaseSpace
SPrimaryParticle primaryParticleData
bool Construct(G4VPhysicalVolume *PVWorld, G4bool bOnlyVisio)
SGeneralData generalData
int max_N_particles_in_PhSp_File
int saving_in_ROG_Voxels_every_events
G4ThreeVector halfSizePhaseSpace
G4String ROGOutFile
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
bool createPlane(G4VPhysicalVolume *PVWorld, G4String name, G4ThreeVector centre, G4ThreeVector halfSize)
void SetVisAttributes(const G4VisAttributes *pVA)
G4String PhaseSpaceOutFile

Here is the call graph for this function:

Here is the caller graph for this function:

CML2AcceleratorConstruction* CML2WorldConstruction::getAcceleratorWorld ( )
inline

Definition at line 92 of file ML2WorldConstruction.hh.

92 {return acceleratorEnv;}
G4bool CML2WorldConstruction::getbOnlyVisio ( )
inline

Definition at line 95 of file ML2WorldConstruction.hh.

95 {return bOnlyVisio;}
CML2AcceleratorConstruction* CML2WorldConstruction::getCML2AcceleratorConstruction ( )
inline

Definition at line 84 of file ML2WorldConstruction.hh.

84 {return acceleratorEnv;}

Here is the caller graph for this function:

CML2WorldConstruction * CML2WorldConstruction::GetInstance ( void  )
static

Definition at line 64 of file ML2WorldConstruction.cc.

65 {
66  if (instance == 0)
67  {
69  }
70  return instance;
71 }
static MCTruthManager * instance

Here is the call graph for this function:

Here is the caller graph for this function:

G4int CML2WorldConstruction::getNParticleBackScattered ( )
inline

Definition at line 81 of file ML2WorldConstruction.hh.

81 {return backScatteredPlane->getCML2SensDetNParticle();}
G4int getCML2SensDetNParticle()

Here is the call graph for this function:

G4int CML2WorldConstruction::getNParticlePhaseSpace ( )
inline

Definition at line 82 of file ML2WorldConstruction.hh.

82 {return phaseSpace->getCML2SensDetNParticle();}
G4int getCML2SensDetNParticle()

Here is the call graph for this function:

CML2PhantomConstruction* CML2WorldConstruction::getPhantomWorld ( )
inline

Definition at line 91 of file ML2WorldConstruction.hh.

91 {return phantomEnv;}
G4int CML2WorldConstruction::getTotalNumberOfEventsInPhantom ( )
inline

Definition at line 83 of file ML2WorldConstruction.hh.

83 {return phantomEnv->getTotalNumberOfEvents();}

Here is the call graph for this function:

bool CML2WorldConstruction::getWorldCreated ( )
inline

Definition at line 87 of file ML2WorldConstruction.hh.

87 {return bWorldCreated;}
bool CML2WorldConstruction::newGeometry ( )

Definition at line 146 of file ML2WorldConstruction.cc.

147 {
148  G4bool bNewRotation=false;
149  G4bool bNewCentre=false;
150  G4bool bNewGeometry=false;
151  bNewCentre=phantomEnv->applyNewCentre();
152  G4RotationMatrix *rmInv=acceleratorEnv->rotateAccelerator();
153  if (rmInv!=0)
154  {
156  bNewRotation=true;
157  }
158  if (bNewRotation || bNewCentre){bNewGeometry=true;}
159  return bNewGeometry;
160 }
bool G4bool
Definition: G4Types.hh:79
void setRotation(G4RotationMatrix *val)
static CML2PrimaryGenerationAction * GetInstance(void)
void applyNewCentre(G4ThreeVector val)

Here is the call graph for this function:

Here is the caller graph for this function:

void CML2WorldConstruction::savePhantomData ( )
inline

Definition at line 89 of file ML2WorldConstruction.hh.

89 {if (phantomEnv!=0){phantomEnv->saveData();}}

Here is the call graph for this function:

Here is the caller graph for this function:

void CML2WorldConstruction::savePhaseSpaceData ( )
inline

Definition at line 90 of file ML2WorldConstruction.hh.

90 {if (phaseSpace!=0){phaseSpace->save();}}

Here is the call graph for this function:

Here is the caller graph for this function:


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