remage
Simulation framework for HPGe-based experiments
 
Loading...
Searching...
No Matches
RMGStagingScheme.hh
1// Copyright (C) 2025 Manuel Huber <https://orcid.org/0009-0000-5212-2999>
2//
3// This program is free software: you can redistribute it and/or modify it under
4// the terms of the GNU Lesser General Public License as published by the Free
5// Software Foundation, either version 3 of the License, or (at your option) any
6// later version.
7//
8// This program is distributed in the hope that it will be useful, but WITHOUT
9// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
10// FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
11// details.
12//
13// You should have received a copy of the GNU Lesser General Public License
14// along with this program. If not, see <https://www.gnu.org/licenses/>.
15
16#ifndef _RMG_STAGING_SCHEME_HH_
17#define _RMG_STAGING_SCHEME_HH_
18
19#include <memory>
20#include <optional>
21#include <set>
22#include <string>
23#include <vector>
24
25#include "G4GenericMessenger.hh"
26
27#include "RMGVOutputScheme.hh"
28
29class G4Step;
30
32class RMGStagingScheme : public RMGVOutputScheme {
33
34 public:
35
36 RMGStagingScheme();
37
41 std::optional<G4ClassificationOfNewTrack> StackingActionClassify(const G4Track*, int) override;
42
44 void SteppingAction(const G4Step*) override;
45
49 void SetElectronVolumeSafety(double safety) { fElectronVolumeSafety = safety; }
50
52 void AddElectronVolumeName(std::string volume) { fElectronVolumeNames.insert(volume); }
53
59 fElectronMaxEnergyThresholdForStacking = energy;
60 }
61
69 fElectronMinEnergyThresholdForStacking = energy;
70 }
71
72 private:
73
74 std::unique_ptr<G4GenericMessenger> fElectronStagingMessengers;
75 std::unique_ptr<G4GenericMessenger> fOpticalPhotonStagingMessengers;
76
77
78 void DefineCommands();
79
80 std::optional<G4ClassificationOfNewTrack> Classify_OpticalPhoton(const G4Track* aTrack) const;
81 std::optional<G4ClassificationOfNewTrack> Classify_ElectronLike(const G4Track* aTrack) const;
82
83 bool fDeferOpticalPhotonsToWaitingStage = false;
84
85 bool fDeferElectronsToWaitingStage = false;
86 bool fDeferPositronsToWaitingStage = false;
87 double fElectronMaxEnergyThresholdForStacking = -1;
88 double fElectronMinEnergyThresholdForStacking = -1;
89 bool fSuspendElectronsOnEnergyDrop = false;
90 double fElectronVolumeSafety = 0;
91
92 std::set<std::string> fElectronVolumeNames;
93};
94
95#endif
96
97// vim: tabstop=2 shiftwidth=2 expandtab
void SetElectronMaxEnergyThresholdForStacking(double energy)
Set the maximum kinetic energy for e- tracks to be considered for staging.
Definition RMGStagingScheme.hh:58
void SetElectronVolumeSafety(double safety)
Set the minimum distance to a Germanium detector surface for an electron to be staged.
Definition RMGStagingScheme.hh:49
void SetElectronMinEnergyThresholdForStacking(double energy)
Set the minimum kinetic energy for e- tracks to be considered for staging.
Definition RMGStagingScheme.hh:68
std::optional< G4ClassificationOfNewTrack > StackingActionClassify(const G4Track *, int) override
Wraps G4UserStackingAction::StackingActionClassify.
Definition RMGStagingScheme.cc:27
void SteppingAction(const G4Step *) override
Evaluate optional stepping-time suspension criteria for configured particles.
Definition RMGStagingScheme.cc:46
void AddElectronVolumeName(std::string volume)
Add a volume name in which electron staging is active.
Definition RMGStagingScheme.hh:52