LDMX Software
UserEventInformation.h
1#ifndef SIMCORE_USEREVENTINFORMATION_H
2#define SIMCORE_USEREVENTINFORMATION_H
3
4#include <vector>
5
6#include "G4VUserEventInformation.hh"
7#include "SimCore/Event/HepMC3GenEvent.h"
8
9namespace simcore {
10
14class UserEventInformation : public G4VUserEventInformation {
15 public:
18
20 virtual ~UserEventInformation() = default;
21
23 void Print() const override;
24
27
30
36 void setDarkBremMaterialZ(double z_) { db_material_z_ = z_; }
37
46 double getDarkBremMaterialZ() const { return db_material_z_; }
47
56
65
71 void setWeight(double weight) { weight_ = weight; }
72
76 double getWeight() { return weight_; }
77
84 void incWeight(double step_weight) { weight_ *= step_weight; }
85
91
97 void addPNEnergy(double delta) { total_photonuclear_energy_ += delta; }
98
104 void addENEnergy(double delta) { total_electronuclear_energy_ += delta; }
105
110 double getPNEnergy() const { return total_photonuclear_energy_; }
111
116 double getENEnergy() const { return total_electronuclear_energy_; }
117
122 void lastStepWasPN(bool yes) { last_step_pn_ = yes; }
123
128 bool wasLastStepPN() const { return last_step_pn_; }
129
134 void lastStepWasEN(bool yes) { last_step_en_ = yes; }
135
140 bool wasLastStepEN() const { return last_step_en_; }
141
142 void addHepMC3GenEvent(ldmx::HepMC3GenEvent event) {
143 hepmc3_events_.push_back(event);
144 }
145 std::vector<ldmx::HepMC3GenEvent> getHepMC3GenEvents() {
146 return hepmc3_events_;
147 }
148
149 private:
152
160 double weight_{1.};
161
170
174 bool last_step_pn_{false};
175
184
188 bool last_step_en_{false};
189
196 double db_material_z_{-1.};
197
203
207 std::vector<ldmx::HepMC3GenEvent> hepmc3_events_;
208};
209} // namespace simcore
210
211#endif // SIMCORE_USEREVENTINFORMATION_H
Encapsulates user defined information associated with a Geant4 event.
void setWeight(double weight)
Set the event weight.
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.
double getAPrimeConversionMaterialZ() const
Get the Z of the element in which the A' -> fcp conversion occurred.
double aprime_conversion_material_z_
atomic Z of the element in which A' -> fcp conversion occurred (-1 if conversion didn't happen)
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.
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.
int brem_candidate_count_
Total number of brem candidates in the event.
std::vector< ldmx::HepMC3GenEvent > hepmc3_events_
a collection of HepMC3 event records.
bool last_step_en_
Was the most recent step a electron-nuclear interaction?
double getENEnergy() const
Get the total energy that went EN.
void setAPrimeConversionMaterialZ(double z_)
Set the Z of the element in which the A' -> fcp conversion occurred.
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)
void setDarkBremMaterialZ(double z_)
Set the Z of the element in which the dark brem ocurred.
bool last_step_pn_
Was the most recent step a photon-nuclear interaction?
void lastStepWasEN(bool yes)
Tell us if last step was EN.
Dynamically loadable photonuclear models either from SimCore or external libraries implementing this ...