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
 
NtupleManager & ntuple_ {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 20 of file NuclearDQM.h.

Member Enumeration Documentation

◆ CompactEventType

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

Definition at line 54 of file NuclearDQM.h.

54 {
55 single_neutron = 0,
56 single_charged_kaon = 1,
57 single_neutral_kaon = 2,
58 two_neutrons = 3,
59 soft = 4,
60 other = 5,
61 };

◆ 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 27 of file NuclearDQM.h.

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

Constructor & Destructor Documentation

◆ NuclearDQM()

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

Definition at line 10 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 317 of file NuclearDQM.cxx.

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

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 244 of file NuclearDQM.cxx.

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

◆ 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 13 of file NuclearDQM.cxx.

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

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 21 of file NuclearDQM.cxx.

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

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

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

◆ 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 205 of file NuclearDQM.cxx.

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

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 152 of file NuclearDQM.h.

152 {
153 if (pdgCode > 1000000000) {
154 return ((pdgCode / 10) % 1000) <= 4;
155 }
156 return false;
157 }

Member Data Documentation

◆ count_light_ions_

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

Definition at line 161 of file NuclearDQM.h.

161{true};

◆ sim_particles_coll_name_

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

Definition at line 159 of file NuclearDQM.h.

◆ sim_particles_passname_

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

Definition at line 160 of file NuclearDQM.h.


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