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
147 void setPNTargetZ(int z) { pn_target_z_ = z; }
148
156 int getPNTargetZ() const { return pn_target_z_; }
157
163 void setPNTargetA(int a) { pn_target_a_ = a; }
164
172 int getPNTargetA() const { return pn_target_a_; }
173
179 void setPNResampleCount(int count) { pn_resample_count_ = count; }
180
187
188 void addHepMC3GenEvent(ldmx::HepMC3GenEvent event) {
189 hepmc3_events_.push_back(event);
190 }
191 std::vector<ldmx::HepMC3GenEvent> getHepMC3GenEvents() {
192 return hepmc3_events_;
193 }
194
195 private:
198
206 double weight_{1.};
207
216
220 bool last_step_pn_{false};
221
230
234 bool last_step_en_{false};
235
242 double db_material_z_{-1.};
243
249
256
262
268
272 std::vector<ldmx::HepMC3GenEvent> hepmc3_events_;
273};
274} // namespace simcore
275
276#endif // SIMCORE_USEREVENTINFORMATION_H
Encapsulates user defined information associated with a Geant4 event.
void setWeight(double weight)
Set the event weight.
int getPNResampleCount() const
Get the number of resample attempts for photonuclear interactions.
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 setPNResampleCount(int count)
Set the number of resample attempts for photonuclear interactions.
void setPNTargetA(int a)
Set the A of the target nucleus in the photonuclear interaction.
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.
int getPNTargetZ() const
Get the Z of the target nucleus in the photonuclear interaction.
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.
void setPNTargetZ(int z)
Set the Z of the target nucleus in the photonuclear interaction.
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.
int pn_resample_count_
Number of resample attempts for photonuclear interactions (1 if no resampling, >1 if resampling occur...
int pn_target_z_
Atomic number (Z) of the target nucleus in the first photonuclear interaction (-1 if no PN interactio...
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?
int getPNTargetA() const
Get the A of the target nucleus in the photonuclear interaction.
void lastStepWasEN(bool yes)
Tell us if last step was EN.
int pn_target_a_
Mass number (A) of the target nucleus in the first photonuclear interaction (-1 if no PN interaction ...
Dynamically loadable photonuclear models either from SimCore or external libraries implementing this ...