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/PhotonuclearInteraction.h"
12#include "SimCore/Event/SimParticle.h"
13#include "TH1F.h"
14#include "TH2F.h"
15#include "Tools/AnalysisUtils.h"
16
17namespace dqm {
18
19// Forward declarations within the ldmx workspace
20class Event;
21class SimParticle;
22
24 // Classification schemes for PN events
25 enum class CompactEventType {
26 single_neutron = 0,
27 single_charged_kaon = 1,
28 single_neutral_kaon = 2,
29 two_neutrons = 3,
30 soft = 4,
31 other = 5,
32 };
33 enum class EventType {
34 nothing_hard = 0,
35 single_neutron = 1,
36 two_neutrons = 2,
37 three_or_more_neutrons = 3,
38 single_charged_pion = 4,
39 two_charged_pions = 5,
40 single_neutral_pion = 6,
41 single_charged_pion_and_nucleon = 7,
42 single_charged_pion_and_two_nucleons = 8,
43 two_charged_pions_and_nucleon = 9,
44 single_neutral_pion_and_nucleon = 10,
45 single_neutral_pion_and_two_nucleons = 11,
46 single_neutral_pion_charged_pion_and_nucleon = 12,
47 single_proton = 13,
48 two_protons = 14,
49 proton_neutron = 15,
50 klong = 16,
51 charged_kaon = 17,
52 kshort = 18,
53 exotics = 19,
54 multibody = 20,
55 };
56
57 public:
59 PhotoNuclearDQM(const std::string &name, framework::Process &process);
60
62 virtual ~PhotoNuclearDQM() = default;
63
70 void configure(framework::config::Parameters &parameters) override;
71
77 void analyze(const framework::Event &event) override;
78
79 private:
82 EventType classifyEvent(
83 const std::vector<const ldmx::SimParticle *> daughters, double threshold);
84
85 std::string sim_particles_coll_name_;
86 std::string sim_particles_passname_;
87
88 std::string pn_collection_name_;
89 std::string pn_pass_name_;
90
92 CompactEventType classifyCompactEvent(
93 const ldmx::SimParticle *pnGamma,
94 const std::vector<const ldmx::SimParticle *> daughters, double threshold);
95
99 void findRecoilProperties(const ldmx::SimParticle *recoil);
100
113 std::vector<const ldmx::SimParticle *> findDaughters(
114 const std::map<int, ldmx::SimParticle> &particleMap,
115 const ldmx::SimParticle *parent) const;
116
123 const std::vector<const ldmx::SimParticle *> &pnDaughters);
124
132 const ldmx::SimParticle *pnGamma,
133 const std::vector<const ldmx::SimParticle *> &pnDaughters, //
134 const EventType eventType);
135
145
146 public:
157 constexpr bool isLightIon(const int pdgCode) const {
158 if (pdgCode > 1000000000) {
159 // Check if the atomic number is less than or equal to 4
160 return ((pdgCode / 10) % 1000) <= 4;
161 }
162 return false;
163 }
164
165 bool count_light_ions_;
166};
167
168} // namespace dqm
169
170#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.
void analyzeInteractionDetails(const framework::Event &event)
Analyze detailed photonuclear interaction tracking data.
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:37
Class encapsulating parameters for configuring a processor.
Definition Parameters.h:29
Class representing a simulated particle.
Definition SimParticle.h:24