1 #include <G4UnitsTable.hh> 3 #include <G4TransportationManager.hh> 4 #include <G4Navigator.hh> 5 #include <G4ThreeVector.hh> 6 #include <G4VPhysicalVolume.hh> 7 #include <G4LogicalVolume.hh> 8 #include <G4Material.hh> 9 #include <G4VisExtent.hh> 10 #include <G4SystemOfUnits.hh> 11 #include <G4PhysicalConstants.hh> 13 #include <Randomize.hh> 28 : fKinematics(kine), fCount(count), fPosition(position), fTime(time) {
38 while (count > 0 && brake<1000) {
42 G4PrimaryVertex* vtx = evt->GetPrimaryVertex();
43 for (;vtx && vtx->GetNext(); vtx = vtx->GetNext());
62 if (!vtx) vtx = evt->GetPrimaryVertex();
63 else vtx = vtx->GetNext();
65 for (;vtx; vtx = vtx->GetNext()) {
72 vtx->SetUserInformation(vInfo);
77 <<
" x: " << vertex.x()/
cm <<
" cm" 78 <<
" y: " << vertex.y()/
cm <<
" cm" 79 <<
" z: " << vertex.z()/
cm <<
" cm");
80 vtx->SetPosition(vertex.x(), vertex.y(), vertex.z());
84 << vertex.t()/
ns <<
" ns");
85 vtx->SetT0(vertex.t());
static constexpr double cm
virtual ~PrimaryGenerator()
virtual bool ForcePosition()=0
GeneratorStatus
A status value that can be returned by GeneratePrimaryVertex.
EDepSim::VTimeGenerator * fTime
G4String GetName() const
Return the name of the generator.
virtual G4LorentzVector GetPosition()=0
Return the candidate position for the primary vertex.
PrimaryGenerator(EDepSim::VKinematicsGenerator *kine, EDepSim::VCountGenerator *count, EDepSim::VPositionGenerator *position, EDepSim::VTimeGenerator *time)
#define EDepSimVerbose(outStream)
virtual bool ForceTime()=0
Return true if this time should be forced for the primary vertex.
G4String GetName()
Return the name of this generator.
virtual double GetTime(const G4LorentzVector &vertex)=0
Return the time of the primary vertex.
virtual GeneratorStatus GeneratePrimaryVertex(G4Event *evt, const G4LorentzVector &position)=0
EDepSim::VPositionGenerator * fPosition
The generation failed and should be tried again.
EDepSim::VKinematicsGenerator * fKinematics
virtual void GeneratePrimaryVertex(G4Event *evt)
G4String GetName() const
Return the name of the generator.
EDepSim::VCountGenerator * fCount
G4String GetName() const
Return the name of the generator.
G4String GetName() const
Return the name of the generator.
void SetName(const G4String &name)