LDMX Software
|
The basic premis of this filter is to add up all of the energy "lost" to the configured process. More...
#include <MidShowerNuclearBkgdFilter.h>
Public Member Functions | |
MidShowerNuclearBkgdFilter (const std::string &name, framework::config::Parameters ¶meters) | |
Class constructor. | |
~MidShowerNuclearBkgdFilter () | |
Class destructor. | |
std::vector< simcore::TYPE > | getTypes () override |
Get the types of actions this class can do. | |
void | BeginOfEventAction (const G4Event *event) override |
Reset the total energy going to the configured process. | |
void | stepping (const G4Step *step) override |
We follow the simulation along each step and check if any secondaries of the input process were created. | |
void | NewStage () override |
When using the PartialEnergySorter, the first time that a new stage begins is when all particles are now below the threshold. | |
Public Member Functions inherited from simcore::UserAction | |
UserAction (const std::string &name, framework::config::Parameters ¶meters) | |
Constructor. | |
virtual | ~UserAction ()=default |
Destructor. | |
virtual void | EndOfEventAction (const G4Event *) |
Method called at the end of every event. | |
virtual void | BeginOfRunAction (const G4Run *) |
Method called at the beginning of a run. | |
virtual void | EndOfRunAction (const G4Run *) |
Method called at the end of a run. | |
virtual void | PreUserTrackingAction (const G4Track *) |
Method called before the UserTrackingAction. | |
virtual void | PostUserTrackingAction (const G4Track *) |
Method called after the UserTrackingAction. | |
virtual G4ClassificationOfNewTrack | ClassifyNewTrack (const G4Track *, const G4ClassificationOfNewTrack &cl) |
Method called when a track is updated. | |
virtual void | PrepareNewEvent () |
Method called at the beginning of a new event. | |
Private Member Functions | |
bool | isOutsideCalorimeterRegion (const G4Step *step) const |
Checks if the passed step is outside of the CalorimeterRegion. | |
bool | isNuclearProcess (const G4VProcess *proc) const |
Checks if the passed process is any of the nuclear interactions. | |
void | save (const G4Track *track) const |
Helper to save the passed track. | |
void | AbortEvent (const std::string &reason) const |
Helper to abort an event with a message. | |
Private Attributes | |
double | threshold_ |
Minimum energy [MeV] that the process products need to have to keep the event. | |
std::vector< std::string > | nuclear_processes_ |
Processes to look for. | |
double | total_process_energy_ {0.} |
Total energy gone to the process in the current event. | |
Additional Inherited Members | |
Public Types inherited from simcore::UserAction | |
using | Factory = ::simcore::Factory< UserAction, std::shared_ptr< UserAction >, const std::string &, framework::config::Parameters & > |
factory for user actions | |
Protected Member Functions inherited from simcore::UserAction | |
UserEventInformation * | getEventInfo () const |
Get a handle to the event information. | |
const std::map< int, ldmx::SimParticle > & | getCurrentParticleMap () const |
Get the current particle map. | |
Protected Attributes inherited from simcore::UserAction | |
std::string | name_ {""} |
Name of the UserAction. | |
framework::config::Parameters | parameters_ |
The set of parameters used to configure this class. | |
The basic premis of this filter is to add up all of the energy "lost" to the configured process.
Whenever a particle makes a step and has secondaries within that step going to the input process, we add its change in energy to the running total for the event. When the PartialEnergySorter has run out of "high" energy particles to process (when NewStage is called) we check if the running total is high enough to keep the event.
Definition at line 29 of file MidShowerNuclearBkgdFilter.h.
biasing::MidShowerNuclearBkgdFilter::MidShowerNuclearBkgdFilter | ( | const std::string & | name, |
framework::config::Parameters & | parameters | ||
) |
Class constructor.
Retrieve the necessary configuration parameters
Definition at line 10 of file MidShowerNuclearBkgdFilter.cxx.
References framework::config::Parameters::getParameter(), nuclear_processes_, and threshold_.
|
inline |
|
private |
Helper to abort an event with a message.
Tells the RunManger to abort the current event after displaying the input message.
[in] | reason | reason for aborting the event |
Definition at line 101 of file MidShowerNuclearBkgdFilter.cxx.
Referenced by NewStage().
|
overridevirtual |
Reset the total energy going to the configured process.
[in] | event | not used |
Reimplemented from simcore::UserAction.
Definition at line 17 of file MidShowerNuclearBkgdFilter.cxx.
References total_process_energy_.
|
inlineoverridevirtual |
Get the types of actions this class can do.
Implements simcore::UserAction.
Definition at line 49 of file MidShowerNuclearBkgdFilter.h.
|
private |
Checks if the passed process is any of the nuclear interactions.
[in] | proc | G4VProcess* to check |
Definition at line 84 of file MidShowerNuclearBkgdFilter.cxx.
References nuclear_processes_.
Referenced by stepping().
|
private |
Checks if the passed step is outside of the CalorimeterRegion.
[in] | step | const G4Step to check |
Definition at line 74 of file MidShowerNuclearBkgdFilter.cxx.
Referenced by stepping().
|
overridevirtual |
When using the PartialEnergySorter, the first time that a new stage begins is when all particles are now below the threshold.
We take this opportunity to make sure that enough energy has gone to the products of the input process.
Reimplemented from simcore::UserAction.
Definition at line 61 of file MidShowerNuclearBkgdFilter.cxx.
References AbortEvent(), threshold_, and total_process_energy_.
|
private |
Helper to save the passed track.
[in] | track | G4Track to persist into output |
Definition at line 95 of file MidShowerNuclearBkgdFilter.cxx.
References simcore::UserTrackInformation::get(), and simcore::UserTrackInformation::setSaveFlag().
Referenced by stepping().
|
overridevirtual |
We follow the simulation along each step and check if any secondaries of the input process were created.
If they were created, we add the change in energy to the total energy "lost" to the input process.
[in] | step | current G4Step |
Reimplemented from simcore::UserAction.
Definition at line 29 of file MidShowerNuclearBkgdFilter.cxx.
References simcore::UserAction::getEventInfo(), isNuclearProcess(), isOutsideCalorimeterRegion(), save(), and total_process_energy_.
|
private |
Processes to look for.
Definition at line 147 of file MidShowerNuclearBkgdFilter.h.
Referenced by isNuclearProcess(), and MidShowerNuclearBkgdFilter().
|
private |
Minimum energy [MeV] that the process products need to have to keep the event.
Also used by PartialEnergySorter to determine which tracks should be processed first.
Parameter Name: 'threshold'
Definition at line 142 of file MidShowerNuclearBkgdFilter.h.
Referenced by MidShowerNuclearBkgdFilter(), and NewStage().
|
private |
Total energy gone to the process in the current event.
Reset to 0. in BeginOfEventAction
Definition at line 154 of file MidShowerNuclearBkgdFilter.h.
Referenced by BeginOfEventAction(), NewStage(), and stepping().