All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TrueParticleHelpers.cxx
Go to the documentation of this file.
2 
3 #include "sbnanaobj/StandardRecord/Proxy/SRProxy.h"
4 
5 namespace ana{
6 
7  bool IsPrimary(const caf::SRTrueParticleProxy& p) {
8  return p.start_process == caf::kG4primary;
9  }
10 
11  bool HasBraggPeak(const caf::SRTrueParticleProxy& p) {
12  // check contained, id, & end process (stopping-only)
13  return p.contained &&
14  ( abs(p.pdg) == 13 || abs(p.pdg) == 2212 ||
15  abs(p.pdg) == 211 || abs(p.pdg) == 321 ) &&
16  ( p.end_process == caf::kG4CoupledTransportation ||
17  p.end_process == caf::kG4FastScintillation ||
18  p.end_process == caf::kG4Decay ||
19  p.end_process == caf::kG4muMinusCaptureAtRest );
20  }
21 
22  bool IsGenie(const caf::SRTrueParticleProxy& p) {
23  return p.gstatus != caf::kNotGenie;
24  }
25 
26  bool IsStable(const caf::SRTrueParticleProxy& p) {
27  // non-genie particles are stable, otherwise check with genie
28  return ( p.gstatus == caf::kNotGenie || p.gstatus == caf::kIStStableFinalState);
29  }
30 
31 }
pdgs p
Definition: selectors.fcl:22
bool IsGenie(const caf::SRTrueParticleProxy &p)
Whether this particle was generated by genie (as opposed to geant or corsika)
process_name opflashCryoW ana
bool IsPrimary(const caf::SRTrueParticleProxy &p)
Whether this is a primary particle or generated by a secondary interaction.
T abs(T value)
bool IsStable(const caf::SRTrueParticleProxy &p)
Whether this is a stable particle as generated by genie.
Not a genie particle.
Definition: SREnums.h:151
bool HasBraggPeak(const caf::SRTrueParticleProxy &p)
Whether this particle should have a bragg peak in the detector.