16#ifndef _RMG_TRACK_OUTPUT_SCHEME_HH_
17#define _RMG_TRACK_OUTPUT_SCHEME_HH_
23#include "G4AnalysisManager.hh"
24#include "G4GenericMessenger.hh"
26#include "RMGVOutputScheme.hh"
49class RMGTrackOutputScheme :
public RMGVOutputScheme {
53 RMGTrackOutputScheme();
76 [[nodiscard]]
bool StoreAlways()
const override {
return fStoreAlways; }
81 throw std::logic_error(
"step output scheme has no detectors");
84 void AddParticleFilter(
const int pdg) { fFilterParticle.insert(pdg); }
85 void AddProcessFilter(
const std::string proc) { fFilterProcess.insert(proc); }
86 void SetEnergyFilter(
double energy) { fFilterEnergy = energy; }
87 void SetStoreStageID(
bool flag) { fStoreStageID = flag; }
91 std::unique_ptr<G4GenericMessenger> fMessenger;
92 void DefineCommands();
94 bool fStoreSinglePrecisionEnergy =
false;
95 bool fStoreSinglePrecisionPosition =
false;
96 bool fStoreAlways =
false;
97 bool fStoreOpticalPhotons =
false;
98 bool fStoreStageID =
false;
100 std::map<std::string, uint32_t> fProcessMap;
101 std::set<int> fStoredProcessIDs;
103 std::set<std::string> fFilterProcess;
104 std::set<int> fFilterParticle;
105 double fFilterEnergy = -1;
107 struct RMGTrackEntry {
120 double kinetic_energy;
124 std::vector<RMGTrackEntry> fTrackEntries;
void EndOfRunAction(const G4Run *) override
handles the storage of the process map.
Definition RMGTrackOutputScheme.cc:172
void TrackingActionPre(const G4Track *) override
Called in RMGTrackingAction::PreUserTrackingAction to collect information about the track before it i...
Definition RMGTrackOutputScheme.cc:63
void AssignOutputNames(G4AnalysisManager *) override
Sets the names of the output columns, invoked in RMGRunAction::SetupAnalysisManager.
Definition RMGTrackOutputScheme.cc:34
void StoreEvent(const G4Event *) override
Store the information from the event, invoked in RMGEventAction::EndOfEventAction.
Definition RMGTrackOutputScheme.cc:132
bool StoreAlways() const override
Invoked in RMGEventAction::EndOfEventAction and decides whether to always store this OutputScheme.
Definition RMGTrackOutputScheme.hh:76
void ClearBeforeEvent() override
Clears the event data and frees memory before the next event is processed.
Definition RMGTrackOutputScheme.cc:170