LDMX Software
UserEventInformation.h
1#ifndef SIMCORE_USEREVENTINFORMATION_H
2#define SIMCORE_USEREVENTINFORMATION_H
3
4#include "G4VUserEventInformation.hh"
5namespace simcore {
6
10class UserEventInformation : public G4VUserEventInformation {
11 public:
14
16 virtual ~UserEventInformation() = default;
17
19 void Print() const override;
20
23
26
32 void setDarkBremMaterialZ(double z) { db_material_z_ = z; }
33
42 double getDarkBremMaterialZ() const { return db_material_z_; }
43
49 void setWeight(double weight) { weight_ = weight; }
50
54 double getWeight() { return weight_; }
55
62 void incWeight(double step_weight) { weight_ *= step_weight; }
63
69
75 void addPNEnergy(double delta) { total_photonuclear_energy_ += delta; }
76
82 void addENEnergy(double delta) { total_electronuclear_energy_ += delta; }
83
88 double getPNEnergy() const { return total_photonuclear_energy_; }
89
94 double getENEnergy() const { return total_electronuclear_energy_; }
95
100 void lastStepWasPN(bool yes) { last_step_pn_ = yes; }
101
106 bool wasLastStepPN() const { return last_step_pn_; }
107
112 void lastStepWasEN(bool yes) { last_step_en_ = yes; }
113
118 bool wasLastStepEN() const { return last_step_en_; }
119
120 private:
123
131 double weight_{1.};
132
141
145 bool last_step_pn_{false};
146
155
159 bool last_step_en_{false};
160
167 double db_material_z_{-1.};
168};
169} // namespace simcore
170
171#endif // SIMCORE_USEREVENTINFORMATION_H
Encapsulates user defined information associated with a Geant4 event.
void setWeight(double weight)
Set the event weight.
void setDarkBremMaterialZ(double z)
Set the Z of the element in which the dark brem ocurred.
virtual ~UserEventInformation()=default
Destructor.
double total_electronuclear_energy_
The total energy that went into the electron-nuclear interaction.
UserEventInformation()=default
Constructor.
double getPNEnergy() const
Get the total energy that went PN.
void incBremCandidateCount()
Increment the number of brem candidates in an event.
void incWeight(double step_weight)
Increment the event weight by the input weight for an individual step.
bool wasLastStepPN() const
Was the last step a PN interaction?
void addENEnergy(double delta)
Add energy to the electronuclear running total.
void addPNEnergy(double delta)
Add energy to the photonuclear running total.
double getDarkBremMaterialZ() const
Get the Z of the element in which the dark brem ocurred.
int bremCandidateCount_
Total number of brem candidates in the event.
bool wasLastStepEN() const
Was the last step a EN interaction?
double total_photonuclear_energy_
The total energy that went into the photon-nuclear interaction.
void decBremCandidateCount()
Decrease the number of brem candidates in an event.
void lastStepWasPN(bool yes)
Tell us if last step was PN.
bool last_step_en_
Was the most recent step a electron-nuclear interaction?
double getENEnergy() const
Get the total energy that went EN.
void Print() const override
Print the information associated with the track.
double db_material_z_
atomic Z of the element in which dark brem occurred (-1 if didn't happen)
bool last_step_pn_
Was the most recent step a photon-nuclear interaction?
void lastStepWasEN(bool yes)
Tell us if last step was EN.