Virtual output scheme interface. More...
#include <RMGVOutputScheme.hh>

Public Member Functions | |
| virtual void | AssignOutputNames (G4AnalysisManager *) |
| Initialize ntuple column names for this output scheme. | |
| virtual void | ClearBeforeEvent () |
| Clear any event-specific data. | |
| virtual bool | ShouldDiscardEvent (const G4Event *) |
| Decide whether to discard the current event. | |
| virtual bool | StoreAlways () const |
| Indicates whether the output scheme always stores event data. | |
| virtual void | StoreEvent (const G4Event *) |
| Store the event data. | |
| virtual std::optional< G4ClassificationOfNewTrack > | StackingActionClassify (const G4Track *, const int) |
| Hook for classifying new tracks during the stacking phase. | |
| virtual std::optional< bool > | StackingActionNewStage (const int) |
| Hook for transitioning to a new stacking stage. | |
| virtual void | TrackingActionPre (const G4Track *) |
| Hook called before tracking a new particle. | |
| virtual void | TrackingActionPost (const G4Track *) |
| Hook called after tracking a new particle. | |
| virtual void | SteppingAction (const G4Step *) |
| Hook called after each step. | |
| virtual void | EndOfRunAction (const G4Run *) |
| Perform final actions at the end of a run. | |
| void | SetNtuplePerDetector (bool ntuple_per_det) |
| Specify whether to create separate ntuples for each detector. | |
| void | SetNtupleUseVolumeName (bool use_vol_name) |
| Specify whether to use the physical volume name for naming ntuples. | |
| void | SetEventIDOffset (int offset) |
Static Public Attributes | |
| static std::string | fUIDKeyFormatString = "det{:03}" |
Protected Member Functions | |
| virtual std::string | GetNtupleName (RMGDetectorMetadata det) const |
| virtual std::string | GetNtupleNameFlat () const |
| void | CreateNtupleFOrDColumn (G4AnalysisManager *ana_man, int nt, std::string name, bool use_float) |
| void | FillNtupleFOrDColumn (G4AnalysisManager *ana_man, int nt, int col, double val, bool use_float) |
| int | GetEventIDForStorage (const G4Event *evt) const |
Protected Attributes | |
| bool | fNtuplePerDetector = true |
| bool | fNtupleUseVolumeName = false |
| int | fEventIDOffset = 0 |
Virtual output scheme interface.
This abstract class defines the interface for output schemes that transform and store hit-level simulation data into persistent storage (e.g. ntuples). It provides virtual methods for setting output names, clearing event data, storing event information, and for hooking into various Geant4 user actions (e.g. stacking, tracking, etc.).
|
inlinevirtual |
Initialize ntuple column names for this output scheme.
This function is called during run initialization to create and assign output column names for the analysis manager.
Reimplemented in RMGGeomBenchOutputScheme, RMGGermaniumOutputScheme, RMGOpticalOutputScheme, RMGScintillatorOutputScheme, RMGTrackOutputScheme, and RMGVertexOutputScheme.
|
inlinevirtual |
Clear any event-specific data.
Called before processing a new event, this function should clear any stored data from the previous event.
Reimplemented in RMGTrackOutputScheme.
|
inlinevirtual |
Perform final actions at the end of a run.
This function can be used by derived output schemes to finalize or write remaining data.
Reimplemented in RMGGermaniumOutputScheme, and RMGTrackOutputScheme.
|
inline |
Specify whether to create separate ntuples for each detector.
| ntuple_per_det | True to assign one ntuple per detector; false to use a single shared ntuple per output scheme type. |
|
inline |
Specify whether to use the physical volume name for naming ntuples.
| use_vol_name | True to use the volume name; false to use the naming scheme based on the detector uid. |
|
inlinevirtual |
Decide whether to discard the current event.
This function is called at the end of each event. It can be used to filter out events that do not meet specified criteria.
Reimplemented in RMGGermaniumOutputScheme, RMGIsotopeFilterScheme, and RMGScintillatorOutputScheme.
|
inlinevirtual |
Hook for classifying new tracks during the stacking phase.
This method allows the output scheme to classify tracks in the stacking action, e.g. to discard or temporarily hold them.
aTrack is the pointer to the G4Track being classified. stage is the current stage index in the stacking process.
Reimplemented in RMGGermaniumOutputScheme, RMGIsotopeFilterScheme, RMGParticleFilterScheme, and RMGVolumeDistanceStacker.
|
inlinevirtual |
Hook for transitioning to a new stacking stage.
Output schemes can use this method to determine whether waiting tracks should be cleared as the stacking process advances to a new stage.
stage is the new stacking stage index.
Reimplemented in RMGGermaniumOutputScheme, and RMGIsotopeFilterScheme.
|
inlinevirtual |
Hook called after each step.
Output schemes may use this to record any step-specific information required for output.
Reimplemented in RMGGeometryCheckOutputScheme.
|
inlinenodiscardvirtual |
Indicates whether the output scheme always stores event data.
Useful for output schemes that should always write out information regardless of filtering criteria defined by any output scheme in RMGVOutputScheme::ShouldDiscardEvent.
Reimplemented in RMGGeomBenchOutputScheme, RMGTrackOutputScheme, and RMGVertexOutputScheme.
|
inlinevirtual |
Store the event data.
This function is invoked at the end of an event to store the output data in the persistent file. Derived classes should implement how event data is recorded.
Reimplemented in RMGGermaniumOutputScheme, RMGOpticalOutputScheme, RMGScintillatorOutputScheme, RMGTrackOutputScheme, and RMGVertexOutputScheme.
|
inlinevirtual |
Hook called after tracking a new particle.
Output schemes may use this to record any track-specific information required for output.
Reimplemented in RMGGeometryCheckOutputScheme.
|
inlinevirtual |
Hook called before tracking a new particle.
Output schemes may use this to record any track-specific information required for output.
Reimplemented in RMGGeometryCheckOutputScheme, RMGIsotopeFilterScheme, and RMGTrackOutputScheme.