LDMX Software
dqm::NuclearDQM Class Reference

Base class for nuclear interaction DQM analyzers. More...

#include <NuclearDQM.h>

Public Types

enum class  EventType {
  nothing_hard = 0 , single_neutron = 1 , two_neutrons = 2 , three_or_more_neutrons = 3 ,
  single_charged_pion = 4 , two_charged_pions = 5 , single_neutral_pion = 6 , single_charged_pion_and_nucleon = 7 ,
  single_charged_pion_and_two_nucleons = 8 , two_charged_pions_and_nucleon = 9 , single_neutral_pion_and_nucleon = 10 , single_neutral_pion_and_two_nucleons = 11 ,
  single_neutral_pion_charged_pion_and_nucleon = 12 , single_proton = 13 , two_protons = 14 , proton_neutron = 15 ,
  klong = 16 , charged_kaon = 17 , kshort = 18 , exotics = 19 ,
  multibody = 20
}
 Classification of PN/EN events by the hard particles produced above a kinetic-energy threshold. More...
 
enum class  CompactEventType {
  single_neutron = 0 , single_charged_kaon = 1 , single_neutral_kaon = 2 , two_neutrons = 3 ,
  soft = 4 , other = 5
}
 Compact classification focusing on very-high-energy single particles. More...
 

Public Member Functions

 NuclearDQM (const std::string &name, framework::Process &process)
 
void configure (framework::config::Parameters &parameters) override
 Read common configuration parameters: sim_particles_coll_name, sim_particles_passname, count_light_ions.
 
- Public Member Functions inherited from framework::Analyzer
 Analyzer (const std::string &name, Process &process)
 Class constructor.
 
virtual void process (Event &event) final
 Processing an event for an Analyzer is calling analyze.
 
virtual void beforeNewRun (ldmx::RunHeader &run_header) final
 Don't allow Analyzers to add parameters to the run header.
 
virtual void analyze (const Event &event)=0
 Process the event and make histograms or summaries.
 
- Public Member Functions inherited from framework::EventProcessor
 DECLARE_FACTORY (EventProcessor, EventProcessor *, const std::string &, Process &)
 declare that we have a factory for this class
 
 EventProcessor (const std::string &name, Process &process)
 Class constructor.
 
virtual ~EventProcessor ()=default
 Class destructor.
 
virtual void onNewRun (const ldmx::RunHeader &run_header)
 Callback for the EventProcessor to take any necessary action when the run being processed changes.
 
virtual void onFileOpen (EventFile &event_file)
 Callback for the EventProcessor to take any necessary action when a new event input ROOT file is opened.
 
virtual void onFileClose (EventFile &event_file)
 Callback for the EventProcessor to take any necessary action when a event input ROOT file is closed.
 
virtual void onProcessStart ()
 Callback for the EventProcessor to take any necessary action when the processing of events starts, such as creating histograms.
 
virtual void onProcessEnd ()
 Callback for the EventProcessor to take any necessary action when the processing of events finishes, such as calculating job-summary quantities.
 
template<class T >
const T & getCondition (const std::string &condition_name)
 Access a conditions object for the current event.
 
TDirectory * getHistoDirectory ()
 Access/create a directory in the histogram file for this event processor to create histograms and analysis tuples.
 
void setStorageHint (framework::StorageControl::Hint hint)
 Mark the current event as having the given storage control hint from this module_.
 
void setStorageHint (framework::StorageControl::Hint hint, const std::string &purposeString)
 Mark the current event as having the given storage control hint from this module and the given purpose string.
 
int getLogFrequency () const
 Get the current logging frequency from the process.
 
int getRunNumber () const
 Get the run number from the process.
 
std::string getName () const
 Get the processor name.
 
void createHistograms (const std::vector< framework::config::Parameters > &histos)
 Internal function which is used to create histograms passed from the python configuration @parma histos vector of Parameters that configure histograms to create.
 

Protected Member Functions

std::vector< const ldmx::SimParticle * > findDaughters (const std::map< int, ldmx::SimParticle > &particleMap, const ldmx::SimParticle *parent, int require_process_type=-1) const
 Return daughters of parent that pass PDG-based filtering:
 
void findParticleKinematics (const std::vector< const ldmx::SimParticle * > &daughters, const std::string &prefix)
 Fill kinematic histograms for the nuclear interaction products.
 
void findExtendedKinematics (const std::vector< const ldmx::SimParticle * > &daughters, const std::string &prefix)
 Fill extended kinematic histograms for EN interactions: hardest_pi_ke/theta (π± only), hardest_pi0_ke/theta, {prefix}_proton_mult, {prefix}_charged_pion_mult, {prefix}_neutral_pion_mult, leading_particle_type.
 
void findSubleadingKinematics (const ldmx::SimParticle *initiator, const std::vector< const ldmx::SimParticle * > &daughters, EventType eventType)
 Fill subleading-kinematics histograms for 1n, 2n, charged-kaon and neutral-kaon event types.
 
EventType classifyEvent (const std::vector< const ldmx::SimParticle * > &daughters, double threshold)
 Classify the event by the number and type of hard daughters above threshold [MeV] of kinetic energy.
 
CompactEventType classifyCompactEvent (const ldmx::SimParticle *initiator, const std::vector< const ldmx::SimParticle * > &daughters, double threshold)
 Compact classification: looks for a single particle carrying >= 80% of the initiator energy, or two neutrons each above threshold [MeV].
 
constexpr bool isLightIon (int pdgCode) const
 Return true if pdgCode is a light ion (Z <= 4).
 
- Protected Member Functions inherited from framework::EventProcessor
void abortEvent ()
 Abort the event immediately.
 

Protected Attributes

std::string sim_particles_coll_name_
 
std::string sim_particles_passname_
 
bool count_light_ions_ {true}
 
- Protected Attributes inherited from framework::EventProcessor
HistogramPool histograms_
 helper object for making and filling histograms
 
NtupleManagerntuple_ {NtupleManager::getInstance()}
 Manager for any ntuples.
 
logging::logger the_log_
 The logger for this EventProcessor.
 

Detailed Description

Base class for nuclear interaction DQM analyzers.

Provides shared event classification, daughter finding, and kinematics methods reused by PhotoNuclearDQM and ElectroNuclearDQM.

Definition at line 24 of file NuclearDQM.h.

Member Enumeration Documentation

◆ CompactEventType

Compact classification focusing on very-high-energy single particles.

Definition at line 58 of file NuclearDQM.h.

58 {
59 single_neutron = 0,
60 single_charged_kaon = 1,
61 single_neutral_kaon = 2,
62 two_neutrons = 3,
63 soft = 4,
64 other = 5,
65 };

◆ EventType

enum class dqm::NuclearDQM::EventType
strong

Classification of PN/EN events by the hard particles produced above a kinetic-energy threshold.

Neutral pions are a separate category from charged pions throughout.

Definition at line 31 of file NuclearDQM.h.

31 {
32 nothing_hard = 0,
33 single_neutron = 1,
34 two_neutrons = 2,
35 three_or_more_neutrons = 3,
36 single_charged_pion = 4,
37 two_charged_pions = 5,
38 single_neutral_pion = 6,
39 single_charged_pion_and_nucleon = 7,
40 single_charged_pion_and_two_nucleons = 8,
41 two_charged_pions_and_nucleon = 9,
42 single_neutral_pion_and_nucleon = 10,
43 single_neutral_pion_and_two_nucleons = 11,
44 single_neutral_pion_charged_pion_and_nucleon = 12,
45 single_proton = 13,
46 two_protons = 14,
47 proton_neutron = 15,
48 klong = 16,
49 charged_kaon = 17,
50 kshort = 18,
51 exotics = 19,
52 multibody = 20,
53 };

Constructor & Destructor Documentation

◆ NuclearDQM()

dqm::NuclearDQM::NuclearDQM ( const std::string & name,
framework::Process & process )

Definition at line 6 of file NuclearDQM.cxx.

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.

Member Function Documentation

◆ classifyCompactEvent()

NuclearDQM::CompactEventType dqm::NuclearDQM::classifyCompactEvent ( const ldmx::SimParticle * initiator,
const std::vector< const ldmx::SimParticle * > & daughters,
double threshold )
protected

Compact classification: looks for a single particle carrying >= 80% of the initiator energy, or two neutrons each above threshold [MeV].

Definition at line 313 of file NuclearDQM.cxx.

315 {
316 short n{0}, n_t{0}, k0l{0}, kp{0}, k0s{0}, soft{0};
317
318 for (const auto& daughter : daughters) {
319 auto ke{daughter->getEnergy() - daughter->getMass()};
320 auto pdg_id{std::abs(daughter->getPdgID())};
321
322 if (ke < 500) {
323 soft++;
324 continue;
325 }
326
327 if (ke >= 0.8 * initiator->getEnergy()) {
328 if (pdg_id == 2112)
329 n++;
330 else if (pdg_id == 130)
331 k0l++;
332 else if (pdg_id == 321)
333 kp++;
334 else if (pdg_id == 310)
335 k0s++;
336 continue;
337 }
338
339 if (pdg_id == 2112 && ke > threshold) n_t++;
340 }
341
342 int neutral_kaons{k0l + k0s};
343 if (n != 0) return CompactEventType::single_neutron;
344 if (kp != 0) return CompactEventType::single_charged_kaon;
345 if (neutral_kaons != 0) return CompactEventType::single_neutral_kaon;
346 if (n_t == 2) return CompactEventType::two_neutrons;
347 if (soft == static_cast<short>(daughters.size()))
348 return CompactEventType::soft;
349 return CompactEventType::other;
350}
double getEnergy() const
Get the energy of this particle [MeV].
Definition SimParticle.h:73

References ldmx::SimParticle::getEnergy().

◆ classifyEvent()

NuclearDQM::EventType dqm::NuclearDQM::classifyEvent ( const std::vector< const ldmx::SimParticle * > & daughters,
double threshold )
protected

Classify the event by the number and type of hard daughters above threshold [MeV] of kinetic energy.

Assumes daughters sorted by KE.

Definition at line 240 of file NuclearDQM.cxx.

241 {
242 short n{0}, p{0}, pi{0}, pi0{0}, exotic{0}, k0l{0}, kp{0}, k0s{0};
243
244 for (const auto& daughter : daughters) {
245 auto ke{daughter->getEnergy() - daughter->getMass()};
246 // daughters are sorted by KE descending; stop when below threshold
247 if (ke <= threshold) break;
248
249 auto pdg_id{std::abs(daughter->getPdgID())};
250 if (pdg_id == 2112)
251 n++;
252 else if (pdg_id == 2212)
253 p++;
254 else if (pdg_id == 211)
255 pi++;
256 else if (pdg_id == 111)
257 pi0++;
258 else if (pdg_id == 130)
259 k0l++;
260 else if (pdg_id == 321)
261 kp++;
262 else if (pdg_id == 310)
263 k0s++;
264 else
265 exotic++;
266 }
267
268 int kaons{k0l + kp + k0s};
269 int nucleons{n + p};
270 int pions{pi + pi0};
271 int count{nucleons + pions + exotic + kaons};
272
273 if (count == 0) return EventType::nothing_hard;
274
275 if (count == 1) {
276 if (n == 1) return EventType::single_neutron;
277 if (p == 1) return EventType::single_proton;
278 if (pi0 == 1) return EventType::single_neutral_pion;
279 if (pi == 1) return EventType::single_charged_pion;
280 }
281 if (count == 2) {
282 if (n == 2) return EventType::two_neutrons;
283 if (n == 1 && p == 1) return EventType::proton_neutron;
284 if (p == 2) return EventType::two_protons;
285 if (pi == 2) return EventType::two_charged_pions;
286 if (pi == 1 && nucleons == 1)
287 return EventType::single_charged_pion_and_nucleon;
288 if (pi0 == 1 && nucleons == 1)
289 return EventType::single_neutral_pion_and_nucleon;
290 }
291 if (count == 3) {
292 if (pi == 1 && nucleons == 2)
293 return EventType::single_charged_pion_and_two_nucleons;
294 if (pi == 2 && nucleons == 1)
295 return EventType::two_charged_pions_and_nucleon;
296 if (pi0 == 1 && nucleons == 2)
297 return EventType::single_neutral_pion_and_two_nucleons;
298 if (pi0 == 1 && nucleons == 1 && pi == 1)
299 return EventType::single_neutral_pion_charged_pion_and_nucleon;
300 }
301 if (count >= 3 && count == n) return EventType::three_or_more_neutrons;
302
303 if (kaons == 1) {
304 if (k0l == 1) return EventType::klong;
305 if (kp == 1) return EventType::charged_kaon;
306 if (k0s == 1) return EventType::kshort;
307 }
308 if (exotic == count && count != 0) return EventType::exotics;
309
310 return EventType::multibody;
311}

◆ configure()

void dqm::NuclearDQM::configure ( framework::config::Parameters & parameters)
overridevirtual

Read common configuration parameters: sim_particles_coll_name, sim_particles_passname, count_light_ions.

Reimplemented from framework::EventProcessor.

Reimplemented in dqm::PhotoNuclearDQM.

Definition at line 9 of file NuclearDQM.cxx.

9 {
10 count_light_ions_ = parameters.get<bool>("count_light_ions", true);
11 sim_particles_coll_name_ =
12 parameters.get<std::string>("sim_particles_coll_name", "SimParticles");
13 sim_particles_passname_ =
14 parameters.get<std::string>("sim_particles_passname", "");
15}
const T & get(const std::string &name) const
Retrieve the parameter of the given name.
Definition Parameters.h:78

References framework::config::Parameters::get().

◆ findDaughters()

std::vector< const ldmx::SimParticle * > dqm::NuclearDQM::findDaughters ( const std::map< int, ldmx::SimParticle > & particleMap,
const ldmx::SimParticle * parent,
int require_process_type = -1 ) const
protected

Return daughters of parent that pass PDG-based filtering:

  • must be in the particle map
  • not photons (PDG 22)
  • not heavy nuclei (PDG > 10000) unless count_light_ions_ is true and the ion has Z <= 4

If require_process_type >= 0, only daughters whose processType matches are kept. Pass -1 (default) to disable process-type filtering.

Results are sorted by kinetic energy in descending order.

Definition at line 17 of file NuclearDQM.cxx.

19 {
20 std::vector<const ldmx::SimParticle*> daughters;
21
22 for (const auto& daughter_track_id : parent->getDaughters()) {
23 if (particleMap.count(daughter_track_id) == 0) continue;
24
25 auto daughter{&(particleMap.at(daughter_track_id))};
26
27 if (require_process_type >= 0 &&
28 daughter->getProcessType() != require_process_type)
29 continue;
30
31 auto pdg_id{daughter->getPdgID()};
32 if (pdg_id == 22 ||
33 (pdg_id > 10000 && (!count_light_ions_ || !isLightIon(pdg_id))))
34 continue;
35
36 daughters.push_back(daughter);
37 }
38
39 std::sort(daughters.begin(), daughters.end(),
40 [](const auto& lhs, const auto& rhs) {
41 return (lhs->getEnergy() - lhs->getMass()) >
42 (rhs->getEnergy() - rhs->getMass());
43 });
44
45 return daughters;
46}
constexpr bool isLightIon(int pdgCode) const
Return true if pdgCode is a light ion (Z <= 4).
Definition NuclearDQM.h:156
std::vector< int > getDaughters() const
Get a vector containing the track IDs of all daughter particles.

References ldmx::SimParticle::getDaughters().

◆ findExtendedKinematics()

void dqm::NuclearDQM::findExtendedKinematics ( const std::vector< const ldmx::SimParticle * > & daughters,
const std::string & prefix )
protected

Fill extended kinematic histograms for EN interactions: hardest_pi_ke/theta (π± only), hardest_pi0_ke/theta, {prefix}_proton_mult, {prefix}_charged_pion_mult, {prefix}_neutral_pion_mult, leading_particle_type.

leading_particle_type bins: 0=π±+X, 1=π⁰+X, 2=K±+X, 3=KS/KL+X, 4=p+X, 5=n+X, 6=other+X

Definition at line 109 of file NuclearDQM.cxx.

111 {
112 // EN-specific kinematics: pi± and pi0 tracked separately, plus proton
113 // multiplicity, leading-particle-type summary, and all the generic
114 // hardest-particle quantities that findParticleKinematics would provide
115 // for PN (so EN does not need to call findParticleKinematics at all).
116 double hardest_ke{-1}, hardest_theta{-1};
117 double hardest_n_ke{-1}, hardest_n_theta{-1};
118 double hardest_p_ke{-1}, hardest_p_theta{-1};
119 double hardest_pi0_ke{-1}, hardest_pi0_theta{-1};
120 double total_ke{0}, total_neutron_ke{0};
121 int neutron_multiplicity{0};
122 int proton_multiplicity{0};
123 int charged_pion_multiplicity{0};
124 int neutral_pion_multiplicity{0};
125
126 for (const auto* daughter : daughters) {
127 auto pdg_id{daughter->getPdgID()};
128 double ke{daughter->getEnergy() - daughter->getMass()};
129 total_ke += ke;
130
131 std::vector<double> vec{daughter->getMomentum()};
132 ROOT::Math::XYZVector pvec(vec[0], vec[1], vec[2]);
133 auto theta{pvec.Theta() * (180 / 3.14159)};
134
135 if (hardest_ke < ke) {
136 hardest_ke = ke;
137 hardest_theta = theta;
138 }
139
140 if (pdg_id == 2112) {
141 neutron_multiplicity++;
142 total_neutron_ke += ke;
143 if (hardest_n_ke < ke) {
144 hardest_n_ke = ke;
145 hardest_n_theta = theta;
146 }
147 } else if (pdg_id == 2212) {
148 proton_multiplicity++;
149 if (hardest_p_ke < ke) {
150 hardest_p_ke = ke;
151 hardest_p_theta = theta;
152 }
153 } else if (std::abs(pdg_id) == 211) {
154 charged_pion_multiplicity++;
155 } else if (pdg_id == 111) {
156 neutral_pion_multiplicity++;
157 if (hardest_pi0_ke < ke) {
158 hardest_pi0_ke = ke;
159 hardest_pi0_theta = theta;
160 }
161 }
162 }
163
164 // Leading-particle-type histogram:
165 // bins: 0=pi±+X, 1=pi0+X, 2=K±+X, 3=KS/KL+X, 4=p+X, 5=n+X, 6=other+X
166 if (!daughters.empty()) {
167 auto leading_pdg{std::abs(daughters[0]->getPdgID())};
168 int leading_type{6};
169 if (leading_pdg == 211)
170 leading_type = 0;
171 else if (leading_pdg == 111)
172 leading_type = 1;
173 else if (leading_pdg == 321)
174 leading_type = 2;
175 else if (leading_pdg == 130 || leading_pdg == 310)
176 leading_type = 3;
177 else if (leading_pdg == 2212)
178 leading_type = 4;
179 else if (leading_pdg == 2112)
180 leading_type = 5;
181 histograms_.fill("leading_particle_type", leading_type);
182 }
183
184 histograms_.fill("hardest_ke", hardest_ke);
185 histograms_.fill("hardest_theta", hardest_theta);
186 histograms_.fill("h_ke_h_theta", hardest_ke, hardest_theta);
187 histograms_.fill("hardest_n_ke", hardest_n_ke);
188 histograms_.fill("hardest_n_theta", hardest_n_theta);
189 histograms_.fill("hardest_p_ke", hardest_p_ke);
190 histograms_.fill("hardest_p_theta", hardest_p_theta);
191 histograms_.fill("hardest_pi0_ke", hardest_pi0_ke);
192 histograms_.fill("hardest_pi0_theta", hardest_pi0_theta);
193 histograms_.fill(prefix + "_neutron_mult", neutron_multiplicity);
194 histograms_.fill(prefix + "_proton_mult", proton_multiplicity);
195 histograms_.fill(prefix + "_charged_pion_mult", charged_pion_multiplicity);
196 histograms_.fill(prefix + "_neutral_pion_mult", neutral_pion_multiplicity);
197 histograms_.fill(prefix + "_total_ke", total_ke);
198 histograms_.fill(prefix + "_total_neutron_ke", total_neutron_ke);
199}
HistogramPool histograms_
helper object for making and filling histograms
void fill(const std::string &name, const T &val)
Fill a 1D histogram.

◆ findParticleKinematics()

void dqm::NuclearDQM::findParticleKinematics ( const std::vector< const ldmx::SimParticle * > & daughters,
const std::string & prefix )
protected

Fill kinematic histograms for the nuclear interaction products.

Generic (no-prefix) histograms filled: hardest_ke, hardest_theta, h_ke_h_theta, hardest_p_ke, hardest_p_theta, hardest_n_ke, hardest_n_theta, hardest_pi_ke, hardest_pi_theta, (charged pions only) hardest_pi0_ke, hardest_pi0_theta (neutral pions separately)

Prefixed histograms filled (using prefix, e.g. "pn" or "en"): {prefix}_neutron_mult, {prefix}_proton_mult, {prefix}_charged_pion_mult, {prefix}_neutral_pion_mult, {prefix}_total_ke, {prefix}_total_neutron_ke

Definition at line 48 of file NuclearDQM.cxx.

50 {
51 double hardest_ke{-1}, hardest_theta{-1};
52 double hardest_proton_ke{-1}, hardest_proton_theta{-1};
53 double hardest_neutron_ke{-1}, hardest_neutron_theta{-1};
54 double hardest_pion_ke{-1}, hardest_pion_theta{-1};
55 double total_ke{0};
56 double total_neutron_ke{0};
57 int neutron_multiplicity{0};
58
59 for (const auto* daughter : daughters) {
60 auto pdg_id{daughter->getPdgID()};
61 double ke{daughter->getEnergy() - daughter->getMass()};
62 total_ke += ke;
63
64 std::vector<double> vec{daughter->getMomentum()};
65 ROOT::Math::XYZVector pvec(vec[0], vec[1], vec[2]);
66 auto theta{pvec.Theta() * (180 / 3.14159)};
67
68 if (hardest_ke < ke) {
69 hardest_ke = ke;
70 hardest_theta = theta;
71 }
72
73 if (pdg_id == 2112) {
74 total_neutron_ke += ke;
75 neutron_multiplicity++;
76 if (hardest_neutron_ke < ke) {
77 hardest_neutron_ke = ke;
78 hardest_neutron_theta = theta;
79 }
80 }
81
82 if (pdg_id == 2212 && hardest_proton_ke < ke) {
83 hardest_proton_ke = ke;
84 hardest_proton_theta = theta;
85 }
86
87 // charged and neutral pions grouped together, matching original PN logic
88 if ((std::abs(pdg_id) == 211 || pdg_id == 111) && hardest_pion_ke < ke) {
89 hardest_pion_ke = ke;
90 hardest_pion_theta = theta;
91 }
92 }
93
94 histograms_.fill("hardest_ke", hardest_ke);
95 histograms_.fill("hardest_theta", hardest_theta);
96 histograms_.fill("h_ke_h_theta", hardest_ke, hardest_theta);
97 histograms_.fill("hardest_p_ke", hardest_proton_ke);
98 histograms_.fill("hardest_p_theta", hardest_proton_theta);
99 histograms_.fill("hardest_n_ke", hardest_neutron_ke);
100 histograms_.fill("hardest_n_theta", hardest_neutron_theta);
101 histograms_.fill("hardest_pi_ke", hardest_pion_ke);
102 histograms_.fill("hardest_pi_theta", hardest_pion_theta);
103
104 histograms_.fill(prefix + "_neutron_mult", neutron_multiplicity);
105 histograms_.fill(prefix + "_total_ke", total_ke);
106 histograms_.fill(prefix + "_total_neutron_ke", total_neutron_ke);
107}

◆ findSubleadingKinematics()

void dqm::NuclearDQM::findSubleadingKinematics ( const ldmx::SimParticle * initiator,
const std::vector< const ldmx::SimParticle * > & daughters,
EventType eventType )
protected

Fill subleading-kinematics histograms for 1n, 2n, charged-kaon and neutral-kaon event types.

Assumes daughters are sorted by KE descending.

initiator is the particle that underwent the nuclear reaction (pn gamma or en electron); its energy is the reference for fractions.

Definition at line 201 of file NuclearDQM.cxx.

204 {
205 // Note: assumes daughters is sorted by kinetic energy descending
206
207 double subleading_ke{-9999};
208 double n_energy{-9999}, energy_diff{-9999}, energy_frac{-9999};
209
210 n_energy = daughters[0]->getEnergy() - daughters[0]->getMass();
211 if (daughters.size() > 1) {
212 subleading_ke = daughters[1]->getEnergy() - daughters[1]->getMass();
213 }
214 energy_diff = initiator->getEnergy() - n_energy;
215 energy_frac = n_energy / initiator->getEnergy();
216
217 if (eventType == EventType::single_neutron) {
218 histograms_.fill("1n_ke:2nd_h_ke", n_energy, subleading_ke);
219 histograms_.fill("1n_neutron_energy", n_energy);
220 histograms_.fill("1n_energy_diff", energy_diff);
221 histograms_.fill("1n_energy_frac", energy_frac);
222 } else if (eventType == EventType::two_neutrons) {
223 histograms_.fill("2n_n2_energy", subleading_ke);
224 auto energy_frac2n = (n_energy + subleading_ke) / initiator->getEnergy();
225 histograms_.fill("2n_energy_frac", energy_frac2n);
226 histograms_.fill("2n_energy_other", initiator->getEnergy() - energy_frac2n);
227 } else if (eventType == EventType::charged_kaon) {
228 histograms_.fill("1kp_ke:2nd_h_ke", n_energy, subleading_ke);
229 histograms_.fill("1kp_energy", n_energy);
230 histograms_.fill("1kp_energy_diff", energy_diff);
231 histograms_.fill("1kp_energy_frac", energy_frac);
232 } else if (eventType == EventType::klong || eventType == EventType::kshort) {
233 histograms_.fill("1k0_ke:2nd_h_ke", n_energy, subleading_ke);
234 histograms_.fill("1k0_energy", n_energy);
235 histograms_.fill("1k0_energy_diff", energy_diff);
236 histograms_.fill("1k0_energy_frac", energy_frac);
237 }
238}

References ldmx::SimParticle::getEnergy().

◆ isLightIon()

bool dqm::NuclearDQM::isLightIon ( int pdgCode) const
inlineconstexprprotected

Return true if pdgCode is a light ion (Z <= 4).

Nuclear PDG code convention: +-10LZZZAAAI

Definition at line 156 of file NuclearDQM.h.

156 {
157 if (pdgCode > 1000000000) {
158 return ((pdgCode / 10) % 1000) <= 4;
159 }
160 return false;
161 }

Member Data Documentation

◆ count_light_ions_

bool dqm::NuclearDQM::count_light_ions_ {true}
protected

Definition at line 165 of file NuclearDQM.h.

165{true};

◆ sim_particles_coll_name_

std::string dqm::NuclearDQM::sim_particles_coll_name_
protected

Definition at line 163 of file NuclearDQM.h.

◆ sim_particles_passname_

std::string dqm::NuclearDQM::sim_particles_passname_
protected

Definition at line 164 of file NuclearDQM.h.


The documentation for this class was generated from the following files: