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

Private Attributes

bool bWorldCreated
 
CML2AcceleratorConstructionacceleratorEnv
 
CML2PhantomConstructionphantomEnv
 
G4VPhysicalVolumePVWorld
 
CML2PhaseSpacesphaseSpace
 
CML2PhaseSpacesbackScatteredPlane
 
G4bool bOnlyVisio
 

Static Private Attributes

static CML2WorldConstructioninstance = 0
 

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::CML2WorldConstruction ( void  )

Definition at line 46 of file ML2WorldConstruction.cc.

47 {
50  bWorldCreated=false;
51 }
static CML2AcceleratorConstruction * GetInstance(void)
G4VPhysicalVolume * PVWorld
CML2PhantomConstruction * phantomEnv
CML2PhaseSpaces * phaseSpace
CML2PhaseSpaces * backScatteredPlane
CML2AcceleratorConstruction * acceleratorEnv
static CML2PhantomConstruction * GetInstance(void)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~CML2WorldConstruction()

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 }
G4VPhysicalVolume * PVWorld
CML2PhantomConstruction * phantomEnv
CML2PhaseSpaces * phaseSpace
CML2PhaseSpaces * backScatteredPlane
CML2AcceleratorConstruction * acceleratorEnv

Member Function Documentation

◆ checkVolumeOverlap()

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  {
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 }
G4int GetNoDaughters() const
G4VPhysicalVolume * PVWorld
#define G4endl
Definition: G4ios.hh:61
G4VPhysicalVolume * GetDaughter(const G4int i) const
G4LogicalVolume * GetLogicalVolume() const
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:

◆ Construct()

G4VPhysicalVolume * CML2WorldConstruction::Construct ( void  )
virtual

Implements G4VUserDetectorConstruction.

Definition at line 73 of file ML2WorldConstruction.cc.

74 {
75  return PVWorld;
76 }
G4VPhysicalVolume * PVWorld

◆ create()

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
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  {
113  }
114 
115  // create a killer plane to destroy the particles back scattered from the target
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)
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)
void SetVisibility(G4bool)
static G4NistManager * Instance()
static G4Colour Black()
Definition: G4Colour.hh:146
void setZ(double)
G4String StartFileInputData
G4VPhysicalVolume * PVWorld
CML2PhantomConstruction * phantomEnv
G4bool bStopAtPhaseSpace
G4bool bForcePhaseSpaceBeforeJaws
CML2PhaseSpaces * phaseSpace
CML2PhaseSpaces * backScatteredPlane
G4bool bSavePhaseSpace
SPrimaryParticle primaryParticleData
bool Construct(G4VPhysicalVolume *PVWorld, G4bool bOnlyVisio)
CML2AcceleratorConstruction * acceleratorEnv
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)
static const double mm
Definition: G4SIunits.hh:114
void SetVisAttributes(const G4VisAttributes *pVA)
G4String PhaseSpaceOutFile
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAcceleratorWorld()

CML2AcceleratorConstruction* CML2WorldConstruction::getAcceleratorWorld ( )
inline

Definition at line 92 of file ML2WorldConstruction.hh.

92 {return acceleratorEnv;}
CML2AcceleratorConstruction * acceleratorEnv
Here is the call graph for this function:

◆ getbOnlyVisio()

G4bool CML2WorldConstruction::getbOnlyVisio ( )
inline

Definition at line 95 of file ML2WorldConstruction.hh.

◆ getCML2AcceleratorConstruction()

CML2AcceleratorConstruction* CML2WorldConstruction::getCML2AcceleratorConstruction ( )
inline

Definition at line 84 of file ML2WorldConstruction.hh.

84 {return acceleratorEnv;}
CML2AcceleratorConstruction * acceleratorEnv
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetInstance()

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 CML2WorldConstruction * instance
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getNParticleBackScattered()

G4int CML2WorldConstruction::getNParticleBackScattered ( )
inline

Definition at line 81 of file ML2WorldConstruction.hh.

Here is the call graph for this function:

◆ getNParticlePhaseSpace()

G4int CML2WorldConstruction::getNParticlePhaseSpace ( )
inline

Definition at line 82 of file ML2WorldConstruction.hh.

G4int getCML2SensDetNParticle()
CML2PhaseSpaces * phaseSpace
Here is the call graph for this function:

◆ getPhantomWorld()

CML2PhantomConstruction* CML2WorldConstruction::getPhantomWorld ( )
inline

Definition at line 91 of file ML2WorldConstruction.hh.

91 {return phantomEnv;}
CML2PhantomConstruction * phantomEnv

◆ getTotalNumberOfEventsInPhantom()

G4int CML2WorldConstruction::getTotalNumberOfEventsInPhantom ( )
inline

Definition at line 83 of file ML2WorldConstruction.hh.

Here is the call graph for this function:

◆ getWorldCreated()

bool CML2WorldConstruction::getWorldCreated ( )
inline

Definition at line 87 of file ML2WorldConstruction.hh.

◆ newGeometry()

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();
153  if (rmInv!=0)
154  {
156  bNewRotation=true;
157  }
158  if (bNewRotation || bNewCentre){bNewGeometry=true;}
159  return bNewGeometry;
160 }
CML2PhantomConstruction * phantomEnv
bool G4bool
Definition: G4Types.hh:79
void setRotation(G4RotationMatrix *val)
CML2AcceleratorConstruction * acceleratorEnv
static CML2PrimaryGenerationAction * GetInstance(void)
void applyNewCentre(G4ThreeVector val)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ savePhantomData()

void CML2WorldConstruction::savePhantomData ( )
inline

Definition at line 89 of file ML2WorldConstruction.hh.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ savePhaseSpaceData()

void CML2WorldConstruction::savePhaseSpaceData ( )
inline

Definition at line 90 of file ML2WorldConstruction.hh.

90 {if (phaseSpace!=0){phaseSpace->save();}}
CML2PhaseSpaces * phaseSpace
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ acceleratorEnv

CML2AcceleratorConstruction* CML2WorldConstruction::acceleratorEnv
private

Definition at line 100 of file ML2WorldConstruction.hh.

◆ backScatteredPlane

CML2PhaseSpaces* CML2WorldConstruction::backScatteredPlane
private

Definition at line 104 of file ML2WorldConstruction.hh.

◆ bOnlyVisio

G4bool CML2WorldConstruction::bOnlyVisio
private

Definition at line 105 of file ML2WorldConstruction.hh.

◆ bWorldCreated

bool CML2WorldConstruction::bWorldCreated
private

Definition at line 99 of file ML2WorldConstruction.hh.

◆ instance

CML2WorldConstruction * CML2WorldConstruction::instance = 0
staticprivate

Definition at line 97 of file ML2WorldConstruction.hh.

◆ phantomEnv

CML2PhantomConstruction* CML2WorldConstruction::phantomEnv
private

Definition at line 101 of file ML2WorldConstruction.hh.

◆ phaseSpace

CML2PhaseSpaces* CML2WorldConstruction::phaseSpace
private

Definition at line 103 of file ML2WorldConstruction.hh.

◆ PVWorld

G4VPhysicalVolume* CML2WorldConstruction::PVWorld
private

Definition at line 102 of file ML2WorldConstruction.hh.


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