LDMX Software
|
The basic premis of this filter is to add up all of the energy "lost" to muons created within the calorimeters. More...
#include <MidShowerDiMuonBkgdFilter.h>
Public Member Functions | |
MidShowerDiMuonBkgdFilter (const std::string &name, framework::config::Parameters ¶meters) | |
Class constructor. | |
~MidShowerDiMuonBkgdFilter () | |
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 muons. | |
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. | |
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. | |
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 muons created within the calorimeters.
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 27 of file MidShowerDiMuonBkgdFilter.h.
biasing::MidShowerDiMuonBkgdFilter::MidShowerDiMuonBkgdFilter | ( | const std::string & | name, |
framework::config::Parameters & | parameters | ||
) |
Class constructor.
Retrieve the necessary configuration parameters
Definition at line 11 of file MidShowerDiMuonBkgdFilter.cxx.
References framework::config::Parameters::getParameter(), 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 103 of file MidShowerDiMuonBkgdFilter.cxx.
Referenced by NewStage().
|
overridevirtual |
Reset the total energy going to the muons.
[in] | event | not used |
Reimplemented from simcore::UserAction.
Definition at line 24 of file MidShowerDiMuonBkgdFilter.cxx.
References total_process_energy_.
|
inlineoverridevirtual |
Get the types of actions this class can do.
Implements simcore::UserAction.
Definition at line 47 of file MidShowerDiMuonBkgdFilter.h.
|
private |
Checks if the passed step is outside of the CalorimeterRegion.
[in] | step | const G4Step to check |
Definition at line 87 of file MidShowerDiMuonBkgdFilter.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 74 of file MidShowerDiMuonBkgdFilter.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 97 of file MidShowerDiMuonBkgdFilter.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 36 of file MidShowerDiMuonBkgdFilter.cxx.
References isOutsideCalorimeterRegion(), save(), and total_process_energy_.
|
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 130 of file MidShowerDiMuonBkgdFilter.h.
Referenced by MidShowerDiMuonBkgdFilter(), and NewStage().
|
private |
Total energy gone to the process in the current event.
Reset to 0. in BeginOfEventAction
Definition at line 137 of file MidShowerDiMuonBkgdFilter.h.
Referenced by BeginOfEventAction(), NewStage(), and stepping().