LDMX Software
Public Member Functions | Private Attributes | List of all members
simcore::UserEventInformation Class Reference

Encapsulates user defined information associated with a Geant4 event. More...

#include <UserEventInformation.h>

Public Member Functions

 UserEventInformation ()=default
 Constructor.
 
virtual ~UserEventInformation ()=default
 Destructor.
 
void Print () const override
 Print the information associated with the track.
 
void incBremCandidateCount ()
 Increment the number of brem candidates in an event.
 
void decBremCandidateCount ()
 Decrease the number of brem candidates in an event.
 
void setDarkBremMaterialZ (double z)
 Set the Z of the element in which the dark brem ocurred.
 
double getDarkBremMaterialZ () const
 Get the Z of the element in which the dark brem ocurred.
 
void setWeight (double weight)
 Set the event weight.
 
double getWeight ()
 
void incWeight (double step_weight)
 Increment the event weight by the input weight for an individual step.
 
int bremCandidateCount ()
 
void addPNEnergy (double delta)
 Add energy to the photonuclear running total.
 
void addENEnergy (double delta)
 Add energy to the electronuclear running total.
 
double getPNEnergy () const
 Get the total energy that went PN.
 
double getENEnergy () const
 Get the total energy that went EN.
 
void lastStepWasPN (bool yes)
 Tell us if last step was PN.
 
bool wasLastStepPN () const
 Was the last step a PN interaction?
 
void lastStepWasEN (bool yes)
 Tell us if last step was EN.
 
bool wasLastStepEN () const
 Was the last step a EN interaction?
 

Private Attributes

int bremCandidateCount_ {0}
 Total number of brem candidates in the event.
 
double weight_ {1.}
 The event weight.
 
double total_photonuclear_energy_ {0.}
 The total energy that went into the photon-nuclear interaction.
 
bool last_step_pn_ {false}
 Was the most recent step a photon-nuclear interaction?
 
double total_electronuclear_energy_ {0.}
 The total energy that went into the electron-nuclear interaction.
 
bool last_step_en_ {false}
 Was the most recent step a electron-nuclear interaction?
 
double db_material_z_ {-1.}
 atomic Z of the element in which dark brem occurred (-1 if didn't happen)
 

Detailed Description

Encapsulates user defined information associated with a Geant4 event.

Definition at line 10 of file UserEventInformation.h.

Member Function Documentation

◆ addENEnergy()

void simcore::UserEventInformation::addENEnergy ( double  delta)
inline

Add energy to the electronuclear running total.

Parameters
[in]deltaenergy to add to the total

Definition at line 82 of file UserEventInformation.h.

double total_electronuclear_energy_
The total energy that went into the electron-nuclear interaction.

References total_electronuclear_energy_.

◆ addPNEnergy()

void simcore::UserEventInformation::addPNEnergy ( double  delta)
inline

Add energy to the photonuclear running total.

Parameters
[in]deltaenergy to add to the total

Definition at line 75 of file UserEventInformation.h.

double total_photonuclear_energy_
The total energy that went into the photon-nuclear interaction.

References total_photonuclear_energy_.

◆ bremCandidateCount()

int simcore::UserEventInformation::bremCandidateCount ( )
inline
Returns
The total number of brem candidates that this event contains.

Definition at line 68 of file UserEventInformation.h.

68{ return bremCandidateCount_; }
int bremCandidateCount_
Total number of brem candidates in the event.

References bremCandidateCount_.

◆ decBremCandidateCount()

void simcore::UserEventInformation::decBremCandidateCount ( )
inline

Decrease the number of brem candidates in an event.

Definition at line 25 of file UserEventInformation.h.

25{ bremCandidateCount_ -= 1; }

References bremCandidateCount_.

Referenced by biasing::TargetProcessFilter::stepping().

◆ getDarkBremMaterialZ()

double simcore::UserEventInformation::getDarkBremMaterialZ ( ) const
inline

Get the Z of the element in which the dark brem ocurred.

Note
This will return -1 if no dark brem ocurred within this event.
Parameters
[in]zatomic Z of element in which the dark brem ocurred

Definition at line 42 of file UserEventInformation.h.

42{ return db_material_z_; }
double db_material_z_
atomic Z of the element in which dark brem occurred (-1 if didn't happen)

References db_material_z_.

◆ getENEnergy()

double simcore::UserEventInformation::getENEnergy ( ) const
inline

Get the total energy that went EN.

Returns
total simulated energy that went EN in this event

Definition at line 94 of file UserEventInformation.h.

References total_electronuclear_energy_.

◆ getPNEnergy()

double simcore::UserEventInformation::getPNEnergy ( ) const
inline

Get the total energy that went PN.

Returns
total simulated energy that went PN in this event

Definition at line 88 of file UserEventInformation.h.

References total_photonuclear_energy_.

◆ getWeight()

double simcore::UserEventInformation::getWeight ( )
inline
Returns
The event weight

Definition at line 54 of file UserEventInformation.h.

54{ return weight_; }

References weight_.

◆ incBremCandidateCount()

void simcore::UserEventInformation::incBremCandidateCount ( )
inline

Increment the number of brem candidates in an event.

Definition at line 22 of file UserEventInformation.h.

22{ bremCandidateCount_ += 1; }

References bremCandidateCount_.

Referenced by biasing::DeepEcalProcessFilter::stepping(), and biasing::TargetBremFilter::stepping().

◆ incWeight()

void simcore::UserEventInformation::incWeight ( double  step_weight)
inline

Increment the event weight by the input weight for an individual step.

Parameters
[in]step_weightweight of an individual step

Definition at line 62 of file UserEventInformation.h.

62{ weight_ *= step_weight; }

References weight_.

Referenced by simcore::g4user::SteppingAction::UserSteppingAction().

◆ lastStepWasEN()

void simcore::UserEventInformation::lastStepWasEN ( bool  yes)
inline

Tell us if last step was EN.

Parameters
[in]yestrue if it was

Definition at line 112 of file UserEventInformation.h.

112{ last_step_en_ = yes; }
bool last_step_en_
Was the most recent step a electron-nuclear interaction?

References last_step_en_.

◆ lastStepWasPN()

void simcore::UserEventInformation::lastStepWasPN ( bool  yes)
inline

Tell us if last step was PN.

Parameters
[in]yestrue if it was

Definition at line 100 of file UserEventInformation.h.

100{ last_step_pn_ = yes; }
bool last_step_pn_
Was the most recent step a photon-nuclear interaction?

References last_step_pn_.

◆ Print()

void simcore::UserEventInformation::Print ( ) const
override

Print the information associated with the track.

Definition at line 10 of file UserEventInformation.cxx.

10 {
11 std::cout << "Event weight: " << weight_ << "\n"
12 << "Brem candidate count: " << bremCandidateCount_ << "\n"
13 << "E_{PN} = " << total_photonuclear_energy_ << " MeV "
14 << "E_{EN} = " << total_electronuclear_energy_ << " MeV"
15 << std::endl;
16}

References bremCandidateCount_, total_electronuclear_energy_, total_photonuclear_energy_, and weight_.

◆ setDarkBremMaterialZ()

void simcore::UserEventInformation::setDarkBremMaterialZ ( double  z)
inline

Set the Z of the element in which the dark brem ocurred.

Parameters
[in]zatomic Z of element in which the dark brem ocurred

Definition at line 32 of file UserEventInformation.h.

32{ db_material_z_ = z; }

References db_material_z_.

◆ setWeight()

void simcore::UserEventInformation::setWeight ( double  weight)
inline

Set the event weight.

Parameters
[in]weightthe event weight

Definition at line 49 of file UserEventInformation.h.

49{ weight_ = weight; }

References weight_.

◆ wasLastStepEN()

bool simcore::UserEventInformation::wasLastStepEN ( ) const
inline

Was the last step a EN interaction?

Returns
true if it was

Definition at line 118 of file UserEventInformation.h.

118{ return last_step_en_; }

References last_step_en_.

◆ wasLastStepPN()

bool simcore::UserEventInformation::wasLastStepPN ( ) const
inline

Was the last step a PN interaction?

Returns
true if it was

Definition at line 106 of file UserEventInformation.h.

106{ return last_step_pn_; }

References last_step_pn_.

Member Data Documentation

◆ bremCandidateCount_

int simcore::UserEventInformation::bremCandidateCount_ {0}
private

Total number of brem candidates in the event.

Definition at line 122 of file UserEventInformation.h.

122{0};

Referenced by bremCandidateCount(), decBremCandidateCount(), incBremCandidateCount(), and Print().

◆ db_material_z_

double simcore::UserEventInformation::db_material_z_ {-1.}
private

atomic Z of the element in which dark brem occurred (-1 if didn't happen)

The default is -1. and so will provide unphysical results if the dark brem did not occur within the event in question.

Definition at line 167 of file UserEventInformation.h.

167{-1.};

Referenced by getDarkBremMaterialZ(), and setDarkBremMaterialZ().

◆ last_step_en_

bool simcore::UserEventInformation::last_step_en_ {false}
private

Was the most recent step a electron-nuclear interaction?

Definition at line 159 of file UserEventInformation.h.

159{false};

Referenced by lastStepWasEN(), and wasLastStepEN().

◆ last_step_pn_

bool simcore::UserEventInformation::last_step_pn_ {false}
private

Was the most recent step a photon-nuclear interaction?

Definition at line 145 of file UserEventInformation.h.

145{false};

Referenced by lastStepWasPN(), and wasLastStepPN().

◆ total_electronuclear_energy_

double simcore::UserEventInformation::total_electronuclear_energy_ {0.}
private

The total energy that went into the electron-nuclear interaction.

Note
The action TrackNuclearEnergy relies on the assumption that this running total starts at 0, so the value of this member variable should always be 0 at construction.

Definition at line 154 of file UserEventInformation.h.

154{0.};

Referenced by addENEnergy(), getENEnergy(), and Print().

◆ total_photonuclear_energy_

double simcore::UserEventInformation::total_photonuclear_energy_ {0.}
private

The total energy that went into the photon-nuclear interaction.

Note
The action TrackNuclearEnergy relies on the assumption that this running total starts at 0, so the value of this member variable should always be 0 at construction.

Definition at line 140 of file UserEventInformation.h.

140{0.};

Referenced by addPNEnergy(), getPNEnergy(), and Print().

◆ weight_

double simcore::UserEventInformation::weight_ {1.}
private

The event weight.

Note
The action WeightByStep relies on the assumption that this weight starts at 1, so the value of this member variable should always be 1.

Definition at line 131 of file UserEventInformation.h.

131{1.};

Referenced by getWeight(), incWeight(), Print(), and setWeight().


The documentation for this class was generated from the following files: