remage
Simulation framework for HPGe-based experiments
 
Loading...
Searching...
No Matches
RMGParticleFilterScheme.hh
1// Copyright (C) 2025 Eric Esch <https://orcid.org/0009-0000-4920-9313>
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_PARTICLE_FILTER_SCHEME_HH_
17#define _RMG_PARTICLE_FILTER_SCHEME_HH_
18
19#include <optional>
20#include <set>
21
22#include "G4GenericMessenger.hh"
23
24#include "RMGVOutputScheme.hh"
25
36class RMGParticleFilterScheme : public RMGVOutputScheme {
37
38 public:
39
40 RMGParticleFilterScheme();
41
50 std::optional<G4ClassificationOfNewTrack> StackingActionClassify(const G4Track*, int) override;
51
53 void AddParticle(int pdg) { fParticles.insert(pdg); }
54
61 void AddKeepVolume(std::string name);
62
69 void AddKillVolume(std::string name);
70
77 void AddKeepProcess(std::string name);
78
85 void AddKillProcess(std::string name);
86
87 private:
88
89 std::unique_ptr<G4GenericMessenger> fMessenger;
90 void DefineCommands();
91
92 std::set<int> fParticles;
93 std::set<std::string> fKeepVolumes;
94 std::set<std::string> fKillVolumes;
95 std::set<std::string> fKeepProcesses;
96 std::set<std::string> fKillProcesses;
97};
98
99#endif
100
101// vim: tabstop=2 shiftwidth=2 expandtab
std::optional< G4ClassificationOfNewTrack > StackingActionClassify(const G4Track *, int) override
Wraps G4UserStackingAction::StackingActionClassify.
Definition RMGParticleFilterScheme.cc:75
void AddKeepVolume(std::string name)
Add a physical volume, by name, to the volumes in which the filter will not be applied.
Definition RMGParticleFilterScheme.cc:27
void AddKeepProcess(std::string name)
Add a physics process by name. This will only keep the specified particles when they were created by ...
Definition RMGParticleFilterScheme.cc:63
void AddKillProcess(std::string name)
Add a physics process by name. This will apply the filter only to particles created by this process.
Definition RMGParticleFilterScheme.cc:51
void AddParticle(int pdg)
Add a particle, identified by its PDG code, to the list of particles to kill.
Definition RMGParticleFilterScheme.hh:53
void AddKillVolume(std::string name)
Add a physical volume, by name, to the volumes in which the filter will be applied.
Definition RMGParticleFilterScheme.cc:39