LDMX Software
MidShowerNuclearBkgdFilter.h
1#ifndef BIASING_MIDSHOWERBKGDFILTER_H_
2#define BIASING_MIDSHOWERBKGDFILTER_H_
3
4/*~~~~~~~~~~~~*/
5/* SimCore */
6/*~~~~~~~~~~~~*/
7#include "SimCore/UserAction.h"
8
10class G4VProcess;
11
12namespace biasing {
13
30 public:
36 MidShowerNuclearBkgdFilter(const std::string& name,
38
43
49 std::vector<simcore::TYPE> getTypes() override {
50 return {simcore::TYPE::STACKING, simcore::TYPE::STEPPING,
51 simcore::TYPE::EVENT};
52 }
53
59 void BeginOfEventAction(const G4Event* event) override;
60
77 void stepping(const G4Step* step) override;
78
91 void NewStage() override;
92
93 private:
100 bool isOutsideCalorimeterRegion(const G4Step* step) const;
101
110 bool isNuclearProcess(const G4VProcess* proc) const;
111
120 void save(const G4Track* track) const;
121
130 void AbortEvent(const std::string& reason) const;
131
132 private:
143
147 std::vector<std::string> nuclear_processes_;
148
155
156}; // MidShowerNuclearBkgdFilter
157} // namespace biasing
158
159#endif // BIASING_MIDSHOWERBKGDFILTER_H__
The basic premis of this filter is to add up all of the energy "lost" to the configured process.
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.
void BeginOfEventAction(const G4Event *event) override
Reset the total energy going to the configured process.
bool isOutsideCalorimeterRegion(const G4Step *step) const
Checks if the passed step is outside of the CalorimeterRegion.
std::vector< simcore::TYPE > getTypes() override
Get the types of actions this class can do.
void NewStage() override
When using the PartialEnergySorter, the first time that a new stage begins is when all particles are ...
bool isNuclearProcess(const G4VProcess *proc) const
Checks if the passed process is any of the nuclear interactions.
void stepping(const G4Step *step) override
We follow the simulation along each step and check if any secondaries of the input process were creat...
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_
Total energy gone to the process in the current event.
Class encapsulating parameters for configuring a processor.
Definition Parameters.h:27
Interface that defines a user action.
Definition UserAction.h:42