LDMX Software
PartialEnergySorter.h
1#ifndef BIASING_UTILITY_PARTIALENERGYSORTER_H
2#define BIASING_UTILITY_PARTIALENERGYSORTER_H
3
4/*~~~~~~~~~~~~~~~~*/
5/* C++ StdLib */
6/*~~~~~~~~~~~~~~~~*/
7#include <string>
8
9/*~~~~~~~~~~~~~*/
10/* SimCore */
11/*~~~~~~~~~~~~~*/
12#include "SimCore/UserAction.h"
13
14// Forward declarations
15class G4Step;
16
17namespace biasing {
18namespace utility {
19
42 public:
49 PartialEnergySorter(const std::string& name,
51
54
65 void BeginOfEventAction(const G4Event* event) override;
66
84 G4ClassificationOfNewTrack ClassifyNewTrack(
85 const G4Track* aTrack,
86 const G4ClassificationOfNewTrack& currentTrackClass) override;
87
98 void stepping(const G4Step* step) override;
99
101 std::vector<simcore::TYPE> getTypes() override {
102 return {simcore::TYPE::STEPPING, simcore::TYPE::STACKING,
103 simcore::TYPE::EVENT};
104 }
105
131 void NewStage() override {
139 below_threshold_ = true;
140 }
141
142 private:
145
148
149}; // PartialEnergySorter
150
151} // namespace utility
152} // namespace biasing
153
154#endif // BIASING_UTILITY_PARTIALENERGYSORTER_H
A simulation action that makes sure that all particles above a certain threshold are processed first.
bool below_threshold_
Are we simulating below the threshold yet?
void NewStage() override
Flag that we are now going below threshold.
std::vector< simcore::TYPE > getTypes() override
Retrieve the type of actions this class defines.
double threshold_
Minimum Kinetic Energy [MeV] we want to simulate first.
G4ClassificationOfNewTrack ClassifyNewTrack(const G4Track *aTrack, const G4ClassificationOfNewTrack &currentTrackClass) override
Classify a "new" track.
void stepping(const G4Step *step) override
Checks if a particle steps from above the threshold to below it.
void BeginOfEventAction(const G4Event *event) override
At the beginning of a new event, we reset the counter for the number of particles above the energy th...
Class encapsulating parameters for configuring a processor.
Definition Parameters.h:27
Interface that defines a user action.
Definition UserAction.h:42