EDepSimVertexInfo.hh
Go to the documentation of this file.
1 #ifndef EDepSim_VertexInfo_hh_seen
2 #define EDepSim_VertexInfo_hh_seen
3 
4 #include <G4VUserPrimaryVertexInformation.hh>
5 #include <globals.hh>
6 
7 class G4PrimaryVertex;
8 
9 /// Hold information that is associated with each primary vertex. This holds
10 /// the particle reaction code that generated the vertex, the name of the
11 /// generator that created the vertex, and internal information from the
12 /// kinematics generator about the physics that generated the vertex.
13 namespace EDepSim {class VertexInfo;}
14 class EDepSim::VertexInfo : public G4VUserPrimaryVertexInformation {
15 public:
16  explicit VertexInfo();
17  virtual ~VertexInfo();
18 
19  /// Set the generator name. This is set in EDepSim::PrimaryGenerator after
20  /// the vertex is generated so it should not be set when the vertex is
21  /// created in a kinematics generator.
22  void SetName(const G4String& name) {fName = name;}
23 
24  /// Get the generator name. The name has the format of
25  /// <kine>:<count>@<pos>-<time> where <kine> is the kinematics generator,
26  /// <count> is the count generator, <pos> is the position generator, and
27  /// <time> is the time generator.
28  G4String GetName() const {return fName;}
29 
30  /// Set reaction that created this vertex. This is defined by each
31  /// kinematics generator.
32  /// \todo We need to define a standard format for the reaction names.
33  void SetReaction(const G4String& r) {fReaction = r;}
34 
35  /// Get the reaction code that created this vertex.
36  const G4String& GetReaction() const {return fReaction;}
37 
38  /// Set the file that this vertex came from.
39  void SetFilename(const G4String& f) {fFilename = f;}
40 
41  /// Get the file that this vertex came from.
42  const G4String& GetFilename() {return fFilename;}
43 
44  /// Set the index of the interaction within the input interaction file.
46 
47  /// Get the index of the interaction within the input interaction file.
49 
50  /// Set the cross section for the reaction that created this vertex. This
51  /// should be in normal HEP units.
52  void SetCrossSection(double xs) {fCrossSection = xs;}
53 
54  /// Get the cross section for the reaction that created this vertex.
55  double GetCrossSection() const {return fCrossSection;}
56 
57  /// Set the differential cross section for the kinematics that created
58  /// this vertex. This should be in normal HEP units.
59  void SetDiffCrossSection(double xs) {fDiffCrossSection = xs;}
60 
61  /// Get the differential cross section for the kinematics of the reaction
62  /// that created this vertex.
63  double GetDiffCrossSection() const {return fDiffCrossSection;}
64 
65  /// Set the weight for the vertex. This is used if the generator is using
66  /// a weighted sample (e.g. over sampling the high energy part of the
67  /// neutrino spectrum smooth out the distributions).
68  void SetWeight(double w) {fWeight = w;}
69 
70  /// Get the weight of the vertex. This will be one if it's not filled.
71  double GetWeight() const {return fWeight;}
72 
73  /// Set the probability of the interaction that created this vertex. This
74  /// includes the effect of the cross section, path length through the
75  /// material, etc.
76  void SetProbability(double p) {fProbability = p;}
77 
78  /// Get the probability of the interaction.
79  double GetProbability() const {return fProbability;}
80 
81  /// Return the informational vertices that are associated with this event.
82  /// These vertices usually contain information associated with the primary
83  /// interaction, such as the incoming neutrino and nucleon.
84  virtual const G4PrimaryVertex* GetInformationalVertex(int i = 0) const;
85 
86  /// Add an informational vertex to this event.
87  virtual void AddInformationalVertex(G4PrimaryVertex* vtx);
88 
89  /// Return the number of informational vertices.
90  virtual int GetNumberOfInformationalVertex() const;
91 
92  /// Required by G4UserPrimaryVertexInformation.
93  void Print() const {};
94 
95 private:
96  /// The generator name.
97  G4String fName;
98 
99  /// The reaction code as defined by the kinematics generator.
100  G4String fReaction;
101 
102  /// The list of informational vertices associated with this primary
103  /// vertex.
104  G4PrimaryVertex* fInformationalVertex;
105 
106  /// The file that this vertex came from.
107  G4String fFilename;
108 
109  /// The index of the interaction in the input neutrino file.
111 
112  /// The total cross section of the interaction creating this vertex. This
113  /// is zero if it's not filled.
115 
116  /// The differential cross section of the interaction kinematics creating
117  /// this vertex. This is zero if it's not filled.
119 
120  /// The weight for the interaction creating this vertex. This is one if
121  /// it's not filled.
122  double fWeight;
123 
124  /// The overall probability of this interaction given the cross sections,
125  /// path lengths through materials, &c). This is one if it is not filled.
126  double fProbability;
127 };
128 #endif
static QCString name
Definition: declinfo.cpp:673
void SetFilename(const G4String &f)
Set the file that this vertex came from.
double GetProbability() const
Get the probability of the interaction.
G4String fFilename
The file that this vertex came from.
G4String fName
The generator name.
void SetCrossSection(double xs)
virtual void AddInformationalVertex(G4PrimaryVertex *vtx)
Add an informational vertex to this event.
void SetWeight(double w)
double GetWeight() const
Get the weight of the vertex. This will be one if it&#39;s not filled.
const G4String & GetReaction() const
Get the reaction code that created this vertex.
G4String fReaction
The reaction code as defined by the kinematics generator.
int fInteractionNumber
The index of the interaction in the input neutrino file.
Construct a module from components.
Definition: TG4HitSegment.h:10
p
Definition: test.py:223
int GetInteractionNumber() const
Get the index of the interaction within the input interaction file.
void SetDiffCrossSection(double xs)
const G4String & GetFilename()
Get the file that this vertex came from.
void SetProbability(double p)
G4PrimaryVertex * fInformationalVertex
void SetInteractionNumber(int i)
Set the index of the interaction within the input interaction file.
virtual int GetNumberOfInformationalVertex() const
Return the number of informational vertices.
double GetDiffCrossSection() const
virtual const G4PrimaryVertex * GetInformationalVertex(int i=0) const
void Print() const
Required by G4UserPrimaryVertexInformation.
G4String GetName() const
double GetCrossSection() const
Get the cross section for the reaction that created this vertex.
void SetReaction(const G4String &r)
void SetName(const G4String &name)