LDMX Software
PhotoNuclearTopologyFilters.h
1#ifndef PHOTONUCLEARTOPOLOGYFILTERS_H
2#define PHOTONUCLEARTOPOLOGYFILTERS_H
3
4/*~~~~~~~~~~~~~*/
5/* SimCore */
6/*~~~~~~~~~~~~~*/
8/*~~~~~~~~~~~~~~~*/
9/* Framework */
10/*~~~~~~~~~~~~~~~*/
11#include <G4Step.hh>
12
13#include "Framework/Configure/Parameters.h"
14// Forward declaration
15
16namespace biasing {
17
30 public:
37 PhotoNuclearTopologyFilter(const std::string& name,
39
42
50 void stepping(const G4Step* step) override;
51
52 virtual bool rejectEvent(const std::vector<G4Track*>& secondaries) const = 0;
53
55 std::vector<simcore::TYPE> getTypes() override {
56 return {simcore::TYPE::STEPPING};
57 }
58
59 protected:
70 constexpr bool isLightIon(const int pdgCode) const {
71 if (pdgCode > 1000000000) {
72 // Check if the atomic number is less than or equal to 4
73 return ((pdgCode / 10) % 1000) <= 4;
74 }
75 return false;
76 }
77
91 constexpr bool skipCountingParticle(const int pdgcode) const {
92 return !(pdgcode < 10000 || (count_light_ions_ && isLightIon(pdgcode)));
93 }
94
95 constexpr bool isNeutron(const int pdgID) const { return pdgID == 2112; }
96
97 bool count_light_ions_;
98 double hard_particle_threshold_;
99}; // PhotoNuclearTopologyFilter
100
102 public:
103 SingleNeutronFilter(const std::string& name,
105 : PhotoNuclearTopologyFilter{name, parameters} {}
106
107 bool rejectEvent(const std::vector<G4Track*>& secondaries) const override;
108};
109
111 public:
112 NothingHardFilter(const std::string& name,
114 : PhotoNuclearTopologyFilter{name, parameters} {}
115
116 bool rejectEvent(const std::vector<G4Track*>& secondaries) const override;
117};
118} // namespace biasing
119
120#endif /* PHOTONUCLEARTOPOLOGYFILTERS_H */
File holding UserAction prototype and supporting macro.
Abstract base class for a user action used to filter out photo-nuclear events that don't match the to...
PhotoNuclearTopologyFilter(const std::string &name, framework::config::Parameters &parameters)
Constructor.
void stepping(const G4Step *step) override
Callback that allows a user to take some actions at the end of a step.
constexpr bool isLightIon(const int pdgCode) const
Check if the PDG code corresponds to a light ion nucleus.
constexpr bool skipCountingParticle(const int pdgcode) const
Whether or not to include a particular particle type in any counting.
std::vector< simcore::TYPE > getTypes() override
Retrieve the type of actions this class defines.
~PhotoNuclearTopologyFilter()=default
Destructor.
Class encapsulating parameters for configuring a processor.
Definition Parameters.h:26
Interface that defines a user action.
Definition UserAction.h:46