LDMX Software
|
This class is meant to filter for events that produce a dark brem occuring within the ECal and producing an A' of a minimum energy threshold [MeV]. More...
#include <EcalDarkBremFilter.h>
Public Member Functions | |
EcalDarkBremFilter (const std::string &name, framework::config::Parameters ¶meters) | |
Class constructor. | |
~EcalDarkBremFilter () | |
Class destructor. | |
std::vector< simcore::TYPE > | getTypes () override |
Get the types of actions this class can do. | |
void | BeginOfEventAction (const G4Event *event) override |
Reset flag on if A' has been found. | |
G4ClassificationOfNewTrack | ClassifyNewTrack (const G4Track *aTrack, const G4ClassificationOfNewTrack ¤tTrackClass) override |
We return the classification of the track done by the PartialEnergySorter, but we can check here if the A' has been created above the required energy. | |
void | NewStage () override |
When using the PartialEnergySorter, the first time that a new stage begins is when all particles are now below the threshold. | |
void | PostUserTrackingAction (const G4Track *track) override |
Make sure A' is saved. | |
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 | stepping (const G4Step *) |
Method called after each simulation step. | |
virtual void | PrepareNewEvent () |
Method called at the beginning of a new event. | |
Private Member Functions | |
bool | inDesiredVolume (const G4Track *) const |
Check if input volume is in the desired volume name. | |
void | AbortEvent (const std::string &reason) const |
Helper to abort an event with a message. | |
Private Attributes | |
double | threshold_ |
Minimum energy [MeV] that the A' should have to keep the event. | |
std::vector< G4LogicalVolume * > | volumes_ |
The volumes that the filter will be applied to. | |
bool | foundAp_ |
Have we found the A' yet? | |
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. | |
This class is meant to filter for events that produce a dark brem occuring within the ECal and producing an A' of a minimum energy threshold [MeV].
Definition at line 46 of file EcalDarkBremFilter.h.
EcalDarkBremFilter::EcalDarkBremFilter | ( | const std::string & | name, |
framework::config::Parameters & | parameters | ||
) |
Class constructor.
Retrieve the necessary configuration parameters
Definition at line 19 of file EcalDarkBremFilter.cxx.
References framework::config::Parameters::getParameter(), threshold_, and volumes_.
|
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 132 of file EcalDarkBremFilter.cxx.
Referenced by ClassifyNewTrack(), NewStage(), and PostUserTrackingAction().
|
overridevirtual |
Reset flag on if A' has been found.
event | unused |
Reimplemented from simcore::UserAction.
Definition at line 48 of file EcalDarkBremFilter.cxx.
References foundAp_.
|
overridevirtual |
We return the classification of the track done by the PartialEnergySorter, but we can check here if the A' has been created above the required energy.
Checks a new track for being an A' above threshold_ if it is an A', sets the foundAp_ member
aTrack | The Geant4 track. |
currentTrackClass | The current track classification. |
Reimplemented from simcore::UserAction.
Definition at line 61 of file EcalDarkBremFilter.cxx.
References AbortEvent(), foundAp_, and threshold_.
|
inlineoverridevirtual |
Get the types of actions this class can do.
Implements simcore::UserAction.
Definition at line 66 of file EcalDarkBremFilter.h.
|
private |
Check if input volume is in the desired volume name.
pointer | to track to check |
Comparing the pointers to logical volumes isn't very robust. TODO find a better way to do this
Definition at line 118 of file EcalDarkBremFilter.cxx.
References volumes_.
Referenced by PostUserTrackingAction().
|
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 the A' has been found.
Reimplemented from simcore::UserAction.
Definition at line 85 of file EcalDarkBremFilter.cxx.
References AbortEvent(), and foundAp_.
|
overridevirtual |
Make sure A' is saved.
If passed track is A', set save status to true Aborts event if A' does not originate in desired volume. This is the last check that the event needs to pass to be kept.
track | G4Track to check if it is an A' |
Reimplemented from simcore::UserAction.
Definition at line 91 of file EcalDarkBremFilter.cxx.
References AbortEvent(), simcore::UserTrackInformation::get(), inDesiredVolume(), and simcore::UserTrackInformation::setSaveFlag().
|
private |
Have we found the A' yet?
Reset to false in BeginOfEventAction
Definition at line 159 of file EcalDarkBremFilter.h.
Referenced by BeginOfEventAction(), ClassifyNewTrack(), and NewStage().
|
private |
Minimum energy [MeV] that the A' should have to keep the event.
Also used by PartialEnergySorter to determine which tracks should be processed first.
Parameter Name: 'threshold'
Definition at line 147 of file EcalDarkBremFilter.h.
Referenced by ClassifyNewTrack(), and EcalDarkBremFilter().
|
private |
The volumes that the filter will be applied to.
Definition at line 152 of file EcalDarkBremFilter.h.
Referenced by EcalDarkBremFilter(), and inDesiredVolume().