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, &particleMap.at(trackID)};
41 if (particleMap.find(1) != particleMap.end()) {
42 return {1, &(particleMap.at(1))};
49 return {134217729, &(particleMap.at(134217729))};
54 const std::map<int, ldmx::SimParticle>& particleMap) {
56 double bremEnergy = -9999.0;
57 for (
const auto& [trackID, particle] : particleMap) {
59 if (particle.getEnergy() > bremEnergy
60 && particle.getVertex()[2] > -5.0 &&
61 particle.getVertex()[2] <
63 && particle.getPdgID() == 22) {
64 bremTrackID = trackID;
65 bremEnergy = particle.getEnergy();
68 if (bremTrackID != -1 && bremEnergy != -9999.0) {
69 return {bremTrackID, &particleMap.at(bremTrackID)};
82 const std::map<int, ldmx::SimParticle>& particleMap) {
84 if (particleMap.find(daughter_id) != std::end(particleMap)) {
85 const auto daughter{particleMap.at(daughter_id)};
86 const auto process_type{daughter.getProcessType()};
87 if (process_type == ldmx::SimParticle::ProcessType::photonNuclear) {
97 const std::map<int, ldmx::SimParticle>& particleMap,
100 for (
auto recoil_daughter_id : recoil_daughters) {
102 if (particleMap.find(recoil_daughter_id) != std::end(particleMap)) {
103 auto recoil_daughter{particleMap.at(recoil_daughter_id)};
105 if (recoil_daughter.getPdgID() == 22) {
107 if (recoil_daughter.getEnergy() >= energyThreshold) {
110 return &particleMap.at(recoil_daughter_id);
std::tuple< int, const ldmx::SimParticle * > getBremPhoton(const std::map< int, ldmx::SimParticle > &particleMap)
Find and return the sim particle associated with the brem photon, if any.
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.