28std::tuple<int, const ldmx::SimParticle *>
getRecoil(
29 const std::map<int, ldmx::SimParticle> &particleMap) {
31 for (
const auto &[trackID, particle] : particleMap) {
32 if (particle.getPdgID() == 11 and
33 particle.getProcessType() ==
34 ldmx::SimParticle::ProcessType::eDarkBrem) {
35 return {trackID, &particle};
41 if (particleMap.find(1) != particleMap.end()) {
42 return {1, &(particleMap.at(1))};
49 return {134217729, &(particleMap.at(134217729))};
59 const std::map<int, ldmx::SimParticle> &particleMap) {
61 if (particleMap.find(daughter_id) != std::end(particleMap)) {
62 const auto daughter{particleMap.at(daughter_id)};
63 const auto process_type{daughter.getProcessType()};
64 if (process_type == ldmx::SimParticle::ProcessType::photonNuclear) {
74 const std::map<int, ldmx::SimParticle> &particleMap,
77 for (
auto recoil_daughter_id : recoil_daughters) {
79 if (particleMap.find(recoil_daughter_id) != std::end(particleMap)) {
80 auto recoil_daughter{particleMap.at(recoil_daughter_id)};
82 if (recoil_daughter.getPdgID() == 22) {
84 if (recoil_daughter.getEnergy() >= energyThreshold) {
87 return &particleMap.at(recoil_daughter_id);
const ldmx::SimParticle * getPNGamma(const std::map< int, ldmx::SimParticle > &particleMap, const ldmx::SimParticle *recoil, const float &energyThreshold)
Get a pointer to the sim particle associated with the photon that underwent a photo-nuclear reaction.
std::tuple< int, const ldmx::SimParticle * > getRecoil(const std::map< int, ldmx::SimParticle > &particleMap)
Find and return the sim particle associated with the recoil electron.
Class representing a simulated particle.
std::vector< int > getDaughters() const
Get a vector containing the track IDs of all daughter particles.