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

#include <ML2PhaseSpaces.hh>

Public Member Functions

 CML2PhaseSpaces ()
 
 ~CML2PhaseSpaces (void)
 
bool createPlane (G4VPhysicalVolume *PVWorld, G4String name, G4ThreeVector centre, G4ThreeVector halfSize)
 
bool createPlane (G4int idSD_Type, G4int max_N_particles_in_PhSp_File, G4int seed, G4int nMaxParticlesInRamPhaseSpace, G4VPhysicalVolume *PVWorld, G4String name, G4String PhaseSpaceOutFile, G4bool bSavePhaseSpace, G4bool bStopAtPhaseSpace, G4ThreeVector centre, G4ThreeVector halfSize, SPrimaryParticle *primaryParticleData, G4double accTargetZPosition)
 
G4int getCML2SensDetNParticle ()
 
CML2SDWithParticlegetCML2SensitiveDetectorParticle ()
 
void save ()
 

Detailed Description

Definition at line 58 of file ML2PhaseSpaces.hh.

Constructor & Destructor Documentation

CML2PhaseSpaces::CML2PhaseSpaces ( )

Definition at line 47 of file ML2PhaseSpaces.cc.

47  :sensDetParticle(0)
48 {}
CML2PhaseSpaces::~CML2PhaseSpaces ( void  )

Definition at line 50 of file ML2PhaseSpaces.cc.

51 {}

Member Function Documentation

bool CML2PhaseSpaces::createPlane ( G4VPhysicalVolume PVWorld,
G4String  name,
G4ThreeVector  centre,
G4ThreeVector  halfSize 
)

Definition at line 53 of file ML2PhaseSpaces.cc.

References G4SDManager::AddNewDetector(), G4NistManager::FindOrBuildMaterial(), G4SDManager::GetSDMpointer(), CLHEP::Hep3Vector::getX(), CLHEP::Hep3Vector::getY(), CLHEP::Hep3Vector::getZ(), G4NistManager::Instance(), G4VisAttributes::SetForceSolid(), and G4VisAttributes::SetVisibility().

Referenced by CML2WorldConstruction::create().

54 {
55  // constructor for killer plane
56  bool bCreated=false;
58  G4Box *box;
59  G4LogicalVolume *logVol;
60  box = new G4Box("KBox", halfSize.getX(), halfSize.getY(), halfSize.getZ());
61  logVol = new G4LogicalVolume(box, Vacum, name+"KLV", 0, 0, 0);
62  phVol= new G4PVPlacement(0, centre, name+"KPV", logVol, PVWorld, false, 0);
63 
64  G4Colour color(0.,1.,1.,0.5);
65  G4VisAttributes* simplePhSpVisAtt= new G4VisAttributes(color);
66  simplePhSpVisAtt->SetVisibility(true);
67  simplePhSpVisAtt->SetForceSolid(true);
68  logVol->SetVisAttributes(simplePhSpVisAtt);
69 
70 
71  sensDetParticle=new CML2SDWithParticle();
73  SDManager->AddNewDetector(sensDetParticle);
74  logVol->SetSensitiveDetector(sensDetParticle);
75  bCreated=true;
76  return bCreated;
77 }
G4Material * FindOrBuildMaterial(const G4String &name, G4bool isotopes=true, G4bool warning=false)
Definition: G4Box.hh:63
void SetVisibility(G4bool)
double getY() const
void SetForceSolid(G4bool)
static G4NistManager * Instance()
double getX() const
void AddNewDetector(G4VSensitiveDetector *aSD)
Definition: G4SDManager.cc:67
static G4SDManager * GetSDMpointer()
Definition: G4SDManager.cc:40
double getZ() const
bool CML2PhaseSpaces::createPlane ( G4int  idSD_Type,
G4int  max_N_particles_in_PhSp_File,
G4int  seed,
G4int  nMaxParticlesInRamPhaseSpace,
G4VPhysicalVolume PVWorld,
G4String  name,
G4String  PhaseSpaceOutFile,
G4bool  bSavePhaseSpace,
G4bool  bStopAtPhaseSpace,
G4ThreeVector  centre,
G4ThreeVector  halfSize,
SPrimaryParticle primaryParticleData,
G4double  accTargetZPosition 
)

Definition at line 79 of file ML2PhaseSpaces.cc.

References G4SDManager::AddNewDetector(), G4NistManager::FindOrBuildMaterial(), G4SDManager::GetSDMpointer(), CLHEP::Hep3Vector::getX(), CLHEP::Hep3Vector::getY(), CLHEP::Hep3Vector::getZ(), G4NistManager::Instance(), G4VisAttributes::SetForceSolid(), G4VisAttributes::SetVisibility(), and G4Colour::Yellow().

80 {
81  // constructor for phase space plane
82  bool bCreated=false;
84  G4Box *box;
85  G4LogicalVolume *logVol;
86  box = new G4Box(name+"Box", halfSize.getX(), halfSize.getY(), halfSize.getZ());
87  logVol = new G4LogicalVolume(box, Vacum, name+"LV", 0, 0, 0);
88  phVol= new G4PVPlacement(0, centre, name+"PV", logVol, PVWorld, false, 0);
89 
90  G4VisAttributes* simplePhSpVisAtt= new G4VisAttributes(G4Colour::Yellow());
91  simplePhSpVisAtt->SetVisibility(true);
92  simplePhSpVisAtt->SetForceSolid(true);
93  logVol->SetVisAttributes(simplePhSpVisAtt);
94 
95  sensDetParticle=new CML2SDWithParticle(idSD_Type, max_N_particles_in_PhSp_File, seed, nMaxParticlesInRamPhaseSpace, name, PhaseSpaceOutFile, bSavePhaseSpace, bStopAtPhaseSpace, primaryParticleData, accTargetZPosition);
97  SDManager->AddNewDetector(sensDetParticle);
98  logVol->SetSensitiveDetector(sensDetParticle);
99  bCreated=true;
100  return bCreated;
101 }
G4Material * FindOrBuildMaterial(const G4String &name, G4bool isotopes=true, G4bool warning=false)
Definition: G4Box.hh:63
void SetVisibility(G4bool)
double getY() const
void SetForceSolid(G4bool)
static G4NistManager * Instance()
double getX() const
void AddNewDetector(G4VSensitiveDetector *aSD)
Definition: G4SDManager.cc:67
static G4SDManager * GetSDMpointer()
Definition: G4SDManager.cc:40
double getZ() const
static G4Colour Yellow()
Definition: G4Colour.hh:153
G4int CML2PhaseSpaces::getCML2SensDetNParticle ( )
inline
CML2SDWithParticle* CML2PhaseSpaces::getCML2SensitiveDetectorParticle ( )
inline

Definition at line 66 of file ML2PhaseSpaces.hh.

References CML2SDWithParticle::getCML2SensitiveDetectorParticle().

66 {return sensDetParticle->getCML2SensitiveDetectorParticle();}
CML2SDWithParticle * getCML2SensitiveDetectorParticle()
void CML2PhaseSpaces::save ( )
inline

Definition at line 67 of file ML2PhaseSpaces.hh.

References CML2SDWithParticle::save().

Referenced by CML2WorldConstruction::savePhaseSpaceData().

67 {sensDetParticle->save();}

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