LDMX Software
PhotoNuclearDQM.h
1#ifndef DQM_PHOTONUCLEARDQM_H
2#define DQM_PHOTONUCLEARDQM_H
3
4#include <Math/Vector3D.h>
5
6#include <algorithm>
7
8#include "Framework/Configure/Parameters.h"
9#include "Framework/Event.h"
11#include "SimCore/Event/SimParticle.h"
12#include "TH1F.h"
13#include "TH2F.h"
14#include "Tools/AnalysisUtils.h"
15
16namespace dqm {
17
18// Forward declarations within the ldmx workspace
19class Event;
20class SimParticle;
21
23 // Classification schemes for PN events
24 enum class CompactEventType {
25 single_neutron = 0,
26 single_charged_kaon = 1,
27 single_neutral_kaon = 2,
28 two_neutrons = 3,
29 soft = 4,
30 other = 5,
31 };
32 enum class EventType {
33 nothing_hard = 0,
34 single_neutron = 1,
35 two_neutrons = 2,
36 three_or_more_neutrons = 3,
37 single_charged_pion = 4,
38 two_charged_pions = 5,
39 single_neutral_pion = 6,
40 single_charged_pion_and_nucleon = 7,
41 single_charged_pion_and_two_nucleons = 8,
42 two_charged_pions_and_nucleon = 9,
43 single_neutral_pion_and_nucleon = 10,
44 single_neutral_pion_and_two_nucleons = 11,
45 single_neutral_pion_charged_pion_and_nucleon = 12,
46 single_proton = 13,
47 two_protons = 14,
48 proton_neutron = 15,
49 klong = 16,
50 charged_kaon = 17,
51 kshort = 18,
52 exotics = 19,
53 multibody = 20,
54 };
55
56 public:
58 PhotoNuclearDQM(const std::string &name, framework::Process &process);
59
61 virtual ~PhotoNuclearDQM() = default;
62
69 void configure(framework::config::Parameters &parameters) override;
70
76 void analyze(const framework::Event &event) override;
77
78 private:
81 EventType classifyEvent(
82 const std::vector<const ldmx::SimParticle *> daughters, double threshold);
83
84 std::string sim_particles_passname_;
85
87 CompactEventType classifyCompactEvent(
88 const ldmx::SimParticle *pnGamma,
89 const std::vector<const ldmx::SimParticle *> daughters, double threshold);
90
94 void findRecoilProperties(const ldmx::SimParticle *recoil);
95
108 std::vector<const ldmx::SimParticle *> findDaughters(
109 const std::map<int, ldmx::SimParticle> &particleMap,
110 const ldmx::SimParticle *parent) const;
111
118 const std::vector<const ldmx::SimParticle *> &pnDaughters);
119
127 const ldmx::SimParticle *pnGamma,
128 const std::vector<const ldmx::SimParticle *> &pnDaughters, //
129 const EventType eventType);
130
131 public:
142 constexpr bool isLightIon(const int pdgCode) const {
143 if (pdgCode > 1000000000) {
144 // Check if the atomic number is less than or equal to 4
145 return ((pdgCode / 10) % 1000) <= 4;
146 }
147 return false;
148 }
149
150 bool count_light_ions_;
151};
152
153} // namespace dqm
154
155#endif // _DQM_ECAL_PN_H_
Collection of utility functions useful for analysis.
Base classes for all user event processing components to extend.
Class implementing an event buffer system for storing event data.
PhotoNuclearDQM(const std::string &name, framework::Process &process)
Constructor.
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.
CompactEventType classifyCompactEvent(const ldmx::SimParticle *pnGamma, const std::vector< const ldmx::SimParticle * > daughters, double threshold)
Method used to classify events in a compact manner.
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.
virtual ~PhotoNuclearDQM()=default
Destructor.
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.
virtual void process(Event &event) final
Processing an event for an Analyzer is calling analyze.
Implements an event buffer system for storing event data.
Definition Event.h:42
Class which represents the process under execution.
Definition Process.h:36
Class encapsulating parameters for configuring a processor.
Definition Parameters.h:29
Class representing a simulated particle.
Definition SimParticle.h:23