254 if(npfParticles == 0){
255 std::cout <<
"WARNING::No PfParticles found! Skipping event!" <<
std::endl;
263 auto recoParticles =
evt.getValidHandle<std::vector<recob::PFParticle>>(
fPFParticleTag);
265 for(
unsigned int i = 0; i < recoParticles->size(); i++){
298 if(thisTrack != 0x0){
325 if(calovector.size() != 3)
326 std::cerr <<
"WARNING::Calorimetry vector size for cosmic is = " << calovector.size() <<
std::endl;
328 for(
size_t k = 0;
k < calovector.size() &&
k<3;
k++){
329 int plane = calovector[
k].PlaneID().Plane;
330 if(plane < 0)
continue;
331 if(plane > 2)
continue;
340 std::cerr <<
"WARNING::PID vector size for primary is = " << pids.size() <<
std::endl;
342 for(
size_t k = 0;
k < pids.size() &&
k<3;
k++){
343 int plane = pids[
k].PlaneID().Plane;
344 if(plane < 0)
continue;
345 if(plane > 2)
continue;
360 else if(thisShower != 0x0){
376 std::cout <<
"INFO::Cosmic pfParticle is not track or shower. Skip!" <<
std::endl;
double fcosmicTrkPitchC[NMAXCOSMICPARTICLES][3]
double fcosmicMomentumByRangeMuon[NMAXCOSMICPARTICLES]
int fiscosmicshower[NMAXCOSMICPARTICLES]
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.
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.
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 fcosmicID[NMAXCOSMICPARTICLES]
double fcosmicStartDirection[NMAXCOSMICPARTICLES][3]
const int NMAXCOSMICPARTICLES
double fcosmicPID_Chi2Kaon[NMAXCOSMICPARTICLES][3]
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.
std::string fParticleIDTag
std::string fCalorimetryTag
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_MissingE[NMAXCOSMICPARTICLES][3]
double fcosmicPID_PIDA[NMAXCOSMICPARTICLES][3]
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.
protoana::ProtoDUNETrackUtils trackUtil
double fcosmicEndDirection[NMAXCOSMICPARTICLES][3]
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...
double fcosmicPID_Chi2Pion[NMAXCOSMICPARTICLES][3]
std::string fPFParticleTag
double fcosmicPID_Chi2Proton[NMAXCOSMICPARTICLES][3]
double fcosmicBDTScore[NMAXCOSMICPARTICLES]
double fcosmicStartPosition[NMAXCOSMICPARTICLES][3]
double fcosmicOpeningAngle[NMAXCOSMICPARTICLES]
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
int fcosmicShowerBestPlane[NMAXCOSMICPARTICLES]
double fcosmicPhi[NMAXCOSMICPARTICLES]
double Length(size_t p=0) const
Access to various track properties.
protoana::ProtoDUNEPFParticleUtils pfpUtil
double Theta() const
Access to spherical or geographical angles at vertex or at any point.
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 fcosmicPID_DeltaChi2[NMAXCOSMICPARTICLES][3]
int fcosmicNHits[NMAXCOSMICPARTICLES]
int fiscosmictrack[NMAXCOSMICPARTICLES]
double fcosmicPID_MissingEavg[NMAXCOSMICPARTICLES][3]
double fcosmicRange[NMAXCOSMICPARTICLES][3]
bool IsPrimary() const
Returns whether the particle is the root of the flow.
const TVector3 & Direction() const
double fcosmicKineticEnergy[NMAXCOSMICPARTICLES][3]
double fcosmicMomentumByRangeProton[NMAXCOSMICPARTICLES]
double fcosmicEndPosition[NMAXCOSMICPARTICLES][3]
Vector_t EndDirection() const
Returns the direction of the trajectory at the last point.
double fcosmicLength[NMAXCOSMICPARTICLES]
Hierarchical representation of particle flow.
trkf::TrackMomentumCalculator trmom
double fcosmicPID_Chi2Muon[NMAXCOSMICPARTICLES][3]
Point_t const & End() const
Returns the position of the last valid point of the trajectory [cm].
double fMinimumTrackLength
int fcosmicIsClear[NMAXCOSMICPARTICLES]
double fcosmicTheta[NMAXCOSMICPARTICLES]
double fcosmicT0[NMAXCOSMICPARTICLES]
unsigned int GetNumberPrimaryPFParticle(art::Event const &evt, const std::string particleLabel) const
Get the number of primary PFParticles.
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].
int fcosmicPID_Pdg[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 fcosmicPID_MinChi2[NMAXCOSMICPARTICLES][3]
double GetTrackMomentum(double trkrange, int pdg) const
QTextStream & endl(QTextStream &s)
int fcosmicPID_Ndf[NMAXCOSMICPARTICLES][3]