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
53 void setWeight(double weight) { weight_ = weight; }
54
58 double getWeight() { return weight_; }
59
66 void incWeight(double step_weight) { weight_ *= step_weight; }
67
73
79 void addPNEnergy(double delta) { total_photonuclear_energy_ += delta; }
80
86 void addENEnergy(double delta) { total_electronuclear_energy_ += delta; }
87
92 double getPNEnergy() const { return total_photonuclear_energy_; }
93
98 double getENEnergy() const { return total_electronuclear_energy_; }
99
104 void lastStepWasPN(bool yes) { last_step_pn_ = yes; }
105
110 bool wasLastStepPN() const { return last_step_pn_; }
111
116 void lastStepWasEN(bool yes) { last_step_en_ = yes; }
117
122 bool wasLastStepEN() const { return last_step_en_; }
123
124 void addHepMC3GenEvent(ldmx::HepMC3GenEvent event) {
125 hepmc3_events_.push_back(event);
126 }
127 std::vector<ldmx::HepMC3GenEvent> getHepMC3GenEvents() {
128 return hepmc3_events_;
129 }
130
131 private:
134
142 double weight_{1.};
143
152
156 bool last_step_pn_{false};
157
166
170 bool last_step_en_{false};
171
178 double db_material_z_{-1.};
179
183 std::vector<ldmx::HepMC3GenEvent> hepmc3_events_;
184};
185} // namespace simcore
186
187#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.
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 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 ...