EDepSimPrimaryGenerator.hh
Go to the documentation of this file.
1 #ifndef EDepSim_PrimaryGenerator_hh_Seen
2 #define EDepSim_PrimaryGenerator_hh_Seen
3 
4 class G4Event;
5 #include <G4VPrimaryGenerator.hh>
6 
7 namespace EDepSim {class VKinematicsGenerator;}
8 namespace EDepSim {class VCountGenerator;}
9 namespace EDepSim {class VPositionGenerator;}
10 namespace EDepSim {class VTimeGenerator;}
11 
12 /// Generate one (or more) G4PrimaryVertex objects and add them to the
13 /// G4Event. This is used by the EDepSim::UserPrimaryGeneratorAction to generate
14 /// particles which will be tracked by the G4 simulation. This uses the
15 /// EDepSim::VKinematicsGenerator, ND20VCountGenerator, EDepSim::VPositionGenerator,
16 /// and EDepSim::VTimeGenerator classes to create the G4PrimaryVertexObjects. The
17 /// control of the EDepSim::PrimaryGenerator object is through the
18 /// EDepSim::UserPrimaryGeneratorMessenger class.
19 namespace EDepSim {class PrimaryGenerator;}
20 class EDepSim::PrimaryGenerator: public G4VPrimaryGenerator {
21 public:
26  virtual ~PrimaryGenerator();
27 
28  /// A pure virtual method to generate the actual primary particles which
29  /// must be implemented in each derived class.
30  virtual void GeneratePrimaryVertex(G4Event* evt);
31 
32  /// Return the name of this generator.
33  G4String GetName();
34 
35  /// Return the kinematics generator;
37  return fKinematics;
38  }
39 
40  /// Return the count generator.
42  return fCount;
43  }
44 
45  /// Return the position generator.
47  return fPosition;
48  }
49 
50  /// Return the time generator.
52  return fTime;
53  }
54 
55 private:
56  /// The kinematics generator that will return the primary particles being
57  /// simulated by this generator. The kinematics generator adds the
58  /// primary vertex to the G4Event along with the primary particles that
59  /// eminate from the vertex. The generator is passed a 4-vector position
60  /// which gives the position that EDepSim::VPrimaryGenerator would like an
61  /// interaction generated for. The kinematics generator can choose to
62  /// ignore this information and create the vertex at any location, but it
63  /// might be overriden by EDepSim::VPrimaryGenerator (depending on which
64  /// EDepSim::VVertexGenerator is used).
66 
67  /// The count generator determines the number of primary vertices that
68  /// will be added to a G4Event.
70 
71  /// The position generator picks candidate positions for the primary
72  /// vertices. The candidate vertices generated by the position generator
73  /// are passed to the kinematics generator as an advisory position. If
74  /// the position generator returns true from
75  /// EDepSim::VPositionGenerator::ForcePosition(), then the vertex from the
76  /// kinematics generator will be overridden by the EDepSim::VPrimaryGenerator.
78 
79  /// The time generator picks candidate times for the primary vertices.
80  /// The candidate times are passed to the kinematics generator as advisory
81  /// times. If the time generator returns true from
82  /// EDepSim::VTimeGenerator::ForceTime(), then the vertex from the kinematics
83  /// generator will be overridden by the EDepSim::VPrimaryGenerator.
85 };
86 #endif
const EDepSim::VCountGenerator * GetCountGenerator() const
Return the count generator.
const EDepSim::VPositionGenerator * GetPositionGenerator() const
Return the position generator.
EDepSim::VTimeGenerator * fTime
Construct a module from components.
Definition: TG4HitSegment.h:10
const EDepSim::VKinematicsGenerator * GetKinematicsGenerator() const
Return the kinematics generator;.
PrimaryGenerator(EDepSim::VKinematicsGenerator *kine, EDepSim::VCountGenerator *count, EDepSim::VPositionGenerator *position, EDepSim::VTimeGenerator *time)
G4String GetName()
Return the name of this generator.
const EDepSim::VTimeGenerator * GetTimeGenerator() const
Return the time generator.
EDepSim::VPositionGenerator * fPosition
TCEvent evt
Definition: DataStructs.cxx:7
EDepSim::VKinematicsGenerator * fKinematics
virtual void GeneratePrimaryVertex(G4Event *evt)
EDepSim::VCountGenerator * fCount