274 if(npfParticles == 0){
275 std::cout <<
"WARNING::No PfParticles found! Skipping event!" <<
std::endl;
283 auto recoParticles =
evt.getValidHandle<std::vector<recob::PFParticle>>(
fPFParticleTag);
285 for(
unsigned int i = 0; i < recoParticles->size(); i++){
318 if(thisTrack != 0x0){
345 if(calovector.size() != 3)
346 std::cerr <<
"WARNING::Calorimetry vector size for cosmic is = " << calovector.size() <<
std::endl;
348 for(
size_t k = 0;
k < calovector.size() &&
k<3;
k++){
349 int plane = calovector[
k].PlaneID().Plane;
350 if(plane < 0)
continue;
351 if(plane > 2)
continue;
360 std::cerr <<
"WARNING::PID vector size for primary is = " << pids.size() <<
std::endl;
362 for(
size_t k = 0;
k < pids.size() &&
k<3;
k++){
363 int plane = pids[
k].PlaneID().Plane;
364 if(plane < 0)
continue;
365 if(plane > 2)
continue;
380 else if(thisShower != 0x0){
396 std::cout <<
"INFO::Cosmic pfParticle is not track or shower. Skip!" <<
std::endl;
double fcosmicMomentumByRangeMuon[NMAXCOSMICPARTICLES]
std::string fParticleIDTag
const TVector3 & ShowerStart() const
std::vector< anab::ParticleID > GetRecoTrackPID(const recob::Track &track, art::Event const &evt, const std::string trackModule, const std::string pidModule) const
Get the PID from a given track.
double fcosmicPID_Chi2Kaon[NMAXCOSMICPARTICLES][3]
double fcosmicPhi[NMAXCOSMICPARTICLES]
bool IsBeamParticle(const recob::PFParticle &particle, art::Event const &evt, const std::string particleLabel) const
Use the pandora metadata to tell us if this is a beam particle or not.
protoana::ProtoDUNEPFParticleUtils pfpUtil
double fcosmicPID_Chi2Proton[NMAXCOSMICPARTICLES][3]
protoana::ProtoDUNETrackUtils trackUtil
std::vector< anab::T0 > GetPFParticleT0(const recob::PFParticle &particle, art::Event const &evt, std::string particleLabel) const
Get the T0(s) from a given PFParticle.
double fcosmicStartPosition[NMAXCOSMICPARTICLES][3]
double fcosmicPID_MinChi2[NMAXCOSMICPARTICLES][3]
int fiscosmicshower[NMAXCOSMICPARTICLES]
const recob::Shower * GetPFParticleShower(const recob::PFParticle &particle, art::Event const &evt, const std::string particleLabel, const std::string showerLabel) const
Get the shower associated to this particle. Returns a null pointer if not found.
double fcosmicOpeningAngle[NMAXCOSMICPARTICLES]
int fiscosmictrack[NMAXCOSMICPARTICLES]
const recob::TrackTrajectory & Trajectory() const
Access to the stored recob::TrackTrajectory.
std::vector< anab::Calorimetry > GetRecoTrackCalorimetry(const recob::Track &track, art::Event const &evt, const std::string trackModule, const std::string caloModule) const
Get the Calorimetry(s) from a given reco track.
double fcosmicPID_PIDA[NMAXCOSMICPARTICLES][3]
double fcosmicBDTScore[NMAXCOSMICPARTICLES]
const std::vector< const recob::Hit * > GetPFParticleHits(const recob::PFParticle &particle, art::Event const &evt, const std::string particleLabel) const
Get the hits associated to the PFParticle.
bool IsClearCosmic(const recob::PFParticle &particle, art::Event const &evt, const std::string particleLabel) const
Pandora tags and removes clear cosmics before slicing, so check if this particle is a clear cosmic...
int fcosmicIsClear[NMAXCOSMICPARTICLES]
double fcosmicKineticEnergy[NMAXCOSMICPARTICLES][3]
double fcosmicStartDirection[NMAXCOSMICPARTICLES][3]
int fcosmicShowerBestPlane[NMAXCOSMICPARTICLES]
const int NMAXCOSMICPARTICLES
double fcosmicLength[NMAXCOSMICPARTICLES]
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
double fcosmicT0[NMAXCOSMICPARTICLES]
double Length(size_t p=0) const
Access to various track properties.
double fMinimumTrackLength
double fcosmicMomentumByRangeProton[NMAXCOSMICPARTICLES]
double Theta() const
Access to spherical or geographical angles at vertex or at any point.
std::string fPFParticleTag
const recob::Track * GetPFParticleTrack(const recob::PFParticle &particle, art::Event const &evt, const std::string particleLabel, const std::string trackLabel) const
Get the track associated to this particle. Returns a null pointer if not found.
double fcosmicEndDirection[NMAXCOSMICPARTICLES][3]
double fcosmicTheta[NMAXCOSMICPARTICLES]
int fcosmicPID_Ndf[NMAXCOSMICPARTICLES][3]
double fcosmicPID_MissingE[NMAXCOSMICPARTICLES][3]
bool IsPrimary() const
Returns whether the particle is the root of the flow.
const TVector3 & Direction() const
double fcosmicEndPosition[NMAXCOSMICPARTICLES][3]
Vector_t EndDirection() const
Returns the direction of the trajectory at the last point.
double fcosmicPID_MissingEavg[NMAXCOSMICPARTICLES][3]
int fcosmicNHits[NMAXCOSMICPARTICLES]
Hierarchical representation of particle flow.
double fcosmicID[NMAXCOSMICPARTICLES]
Point_t const & End() const
Returns the position of the last valid point of the trajectory [cm].
double fcosmicPID_DeltaChi2[NMAXCOSMICPARTICLES][3]
unsigned int GetNumberPrimaryPFParticle(art::Event const &evt, const std::string particleLabel) const
Get the number of primary PFParticles.
double fcosmicPID_Chi2Muon[NMAXCOSMICPARTICLES][3]
double fcosmicTrkPitchC[NMAXCOSMICPARTICLES][3]
Vector_t StartDirection() const
Returns the direction of the trajectory at the first point.
Point_t const & Start() const
Returns the position of the first valid point of the trajectory [cm].
double fcosmicPID_Chi2Pion[NMAXCOSMICPARTICLES][3]
trkf::TrackMomentumCalculator trmom
double fcosmicRange[NMAXCOSMICPARTICLES][3]
float GetBeamCosmicScore(const recob::PFParticle &particle, art::Event const &evt, const std::string particleLabel) const
Access the BDT output used to decide if a slice is beam-like or cosmic-like.
Track from a non-cascading particle.A recob::Track consists of a recob::TrackTrajectory, plus additional members relevant for a "fitted" track:
double GetTrackMomentum(double trkrange, int pdg) const
std::string fCalorimetryTag
QTextStream & endl(QTextStream &s)
int fcosmicPID_Pdg[NMAXCOSMICPARTICLES][3]