LDMX Software
PhotoNuclearDQM.h
1#ifndef DQM_PHOTONUCLEARDQM_H
2#define DQM_PHOTONUCLEARDQM_H
3
4/*~~~~~~~~~~~~~~~*/
5/* Framework */
6/*~~~~~~~~~~~~~~~*/
7#include "Framework/Configure/Parameters.h"
9#include "SimCore/Event/SimParticle.h"
10namespace dqm {
11
12// Forward declarations within the ldmx workspace
13class Event;
14class SimParticle;
15
17 // Classification schemes for PN events
18 enum class CompactEventType {
19 single_neutron = 0,
20 single_charged_kaon = 1,
21 single_neutral_kaon = 2,
22 two_neutrons = 3,
23 soft = 4,
24 other = 5,
25 };
26 enum class EventType {
27 nothing_hard = 0,
28 single_neutron = 1,
29 two_neutrons = 2,
30 three_or_more_neutrons = 3,
31 single_charged_pion = 4,
32 two_charged_pions = 5,
33 single_neutral_pion = 6,
34 single_charged_pion_and_nucleon = 7,
35 single_charged_pion_and_two_nucleons = 8,
36 two_charged_pions_and_nucleon = 9,
37 single_neutral_pion_and_nucleon = 10,
38 single_neutral_pion_and_two_nucleons = 11,
39 single_neutral_pion_charged_pion_and_nucleon = 12,
40 single_proton = 13,
41 two_protons = 14,
42 proton_neutron = 15,
43 klong = 16,
44 charged_kaon = 17,
45 kshort = 18,
46 exotics = 19,
47 multibody = 20,
48 };
49
50 public:
52 PhotoNuclearDQM(const std::string &name, framework::Process &process);
53
55 virtual ~PhotoNuclearDQM();
56
63 void configure(framework::config::Parameters &parameters) override;
64
70 void analyze(const framework::Event &event) override;
71
73 void onProcessStart() override;
74
75 private:
78 EventType classifyEvent(
79 const std::vector<const ldmx::SimParticle *> daughters, double threshold);
80
82 CompactEventType classifyCompactEvent(
83 const ldmx::SimParticle *pnGamma,
84 const std::vector<const ldmx::SimParticle *> daughters, double threshold);
85
89 void findRecoilProperties(const ldmx::SimParticle *recoil);
90
103 std::vector<const ldmx::SimParticle *> findDaughters(
104 const std::map<int, ldmx::SimParticle> &particleMap,
105 const ldmx::SimParticle *parent) const;
106
113 const std::vector<const ldmx::SimParticle *> &pnDaughters);
114
122 const ldmx::SimParticle *pnGamma,
123 const std::vector<const ldmx::SimParticle *> &pnDaughters, //
124 const EventType eventType);
125
126 public:
137 constexpr bool isLightIon(const int pdgCode) const {
138 if (pdgCode > 1000000000) {
139 // Check if the atomic number is less than or equal to 4
140 return ((pdgCode / 10) % 1000) <= 4;
141 }
142 return false;
143 }
144
145 bool verbose_;
146 bool count_light_ions_;
147};
148
149} // namespace dqm
150
151#endif // _DQM_ECAL_PN_H_
Base classes for all user event processing components to extend.
void findSubleadingKinematics(const ldmx::SimParticle *pnGamma, const std::vector< const ldmx::SimParticle * > &pnDaughters, const EventType eventType)
Fill histograms related to the kinematics and subleading particles for 1n, kaon, and 2n type events.
constexpr bool isLightIon(const int pdgCode) const
Check if the PDG code corresponds to a light ion.
std::vector< const ldmx::SimParticle * > findDaughters(const std::map< int, ldmx::SimParticle > &particleMap, const ldmx::SimParticle *parent) const
Find all daughter particles of a parent.
void analyze(const framework::Event &event) override
Process the event and create the histogram summaries.
EventType classifyEvent(const std::vector< const ldmx::SimParticle * > daughters, double threshold)
Method used to classify events.
void onProcessStart() override
Method executed before processing of events begins.
CompactEventType classifyCompactEvent(const ldmx::SimParticle *pnGamma, const std::vector< const ldmx::SimParticle * > daughters, double threshold)
Method used to classify events in a compact manner.
virtual ~PhotoNuclearDQM()
Destructor.
void findRecoilProperties(const ldmx::SimParticle *recoil)
Fill the recoil electron-histograms.
void findParticleKinematics(const std::vector< const ldmx::SimParticle * > &pnDaughters)
Fill histograms related to kinematics of PN products.
void configure(framework::config::Parameters &parameters) override
Configure this analyzer using the user specified parameters.
Base class for a module which does not produce a data product.
Implements an event buffer system for storing event data.
Definition Event.h:41
Class which represents the process under execution.
Definition Process.h:36
Class encapsulating parameters for configuring a processor.
Definition Parameters.h:27
Class representing a simulated particle.
Definition SimParticle.h:23