LDMX Software
PhotoNuclearTopologyFilters.h
1#ifndef PHOTONUCLEARTOPOLOGYFILTERS_H
2#define PHOTONUCLEARTOPOLOGYFILTERS_H
3
4/*~~~~~~~~~~~~~*/
5/* SimCore */
6/*~~~~~~~~~~~~~*/
7#include "SimCore/UserAction.h"
8#include "SimCore/UserTrackInformation.h"
9/*~~~~~~~~~~~~~~~*/
10/* Framework */
11/*~~~~~~~~~~~~~~~*/
12#include <G4RunManager.hh>
13#include <G4Step.hh>
14
15#include "Framework/Configure/Parameters.h"
16// Forward declaration
17
18namespace biasing {
19
32 public:
39 PhotoNuclearTopologyFilter(const std::string& name,
41
44
52 void stepping(const G4Step* step) override;
53
54 virtual bool rejectEvent(const std::vector<G4Track*>& secondaries) const = 0;
55
57 std::vector<simcore::TYPE> getTypes() override {
58 return {simcore::TYPE::STEPPING};
59 }
60
61 protected:
72 constexpr bool isLightIon(const int pdgCode) const {
73 if (pdgCode > 1000000000) {
74 // Check if the atomic number is less than or equal to 4
75 return ((pdgCode / 10) % 1000) <= 4;
76 }
77 return false;
78 }
79
93 constexpr bool skipCountingParticle(const int pdgcode) const {
94 return !(pdgcode < 10000 || (count_light_ions_ && isLightIon(pdgcode)));
95 }
96
97 constexpr bool isNeutron(const int pdgID) const { return pdgID == 2112; }
98
99 bool count_light_ions_;
100 double hard_particle_threshold_;
101}; // PhotoNuclearTopologyFilter
102
104 public:
105 SingleNeutronFilter(const std::string& name,
107 : PhotoNuclearTopologyFilter{name, parameters} {}
108
109 bool rejectEvent(const std::vector<G4Track*>& secondaries) const override;
110};
111
113 public:
114 NothingHardFilter(const std::string& name,
116 : PhotoNuclearTopologyFilter{name, parameters} {}
117
118 bool rejectEvent(const std::vector<G4Track*>& secondaries) const override;
119};
120} // namespace biasing
121
122#endif /* PHOTONUCLEARTOPOLOGYFILTERS_H */
Abstract base class for a user action used to filter out photo-nuclear events that don't match the to...
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:27
Interface that defines a user action.
Definition UserAction.h:42