164 mf::LogDebug(
"LArPandora") <<
" *** PFParticleAnalysis::beginJob() *** " << std::endl;
232 std::cout <<
" *** PFParticleAnalysis::analyze(...) *** " << std::endl;
292 std::cout <<
" Run: " <<
m_run << std::endl;
293 std::cout <<
" Event: " <<
m_event << std::endl;
311 std::cout <<
" PFParticles: " << particleVector.size() << std::endl;
313 if (particleVector.empty())
354 for (
unsigned int n = 0;
n < particleVector.size(); ++
n)
413 if (particlesToClusters.end() != cIter)
418 if (particlesToSpacePoints.end() != pIter)
423 if (particlesToHits.end() != hIter)
424 m_hits = hIter->second.size();
428 if (particlesToVertices.end() != vIter)
431 if (!vertexVector.empty())
434 std::cout <<
" Warning: Found particle with more than one associated vertex " << std::endl;
437 double xyz[3] = {0.0, 0.0, 0.0} ;
449 if (particlesToT0s.end() != t0Iter)
451 const T0Vector &t0Vector = t0Iter->second;
452 if (!t0Vector.empty())
455 std::cout <<
" Warning: Found particle with more than one associated T0 " << std::endl;
464 if (particlesToTracks.end() != trkIter)
467 if (!trackVector.empty())
470 std::cout <<
" Warning: Found particle with more than one associated track " << std::endl;
473 const auto &trackVtxPosition = track->
Vertex();
475 const auto &trackEndPosition = track->
End();
497 if (tracksToHits.end() != trkIter2)
504 if (particlesToShowers.end() != shwIter)
507 if (!showerVector.empty())
510 std::cout <<
" Warning: Found particle with more than one associated shower " << std::endl;
513 const TVector3 &showerVtxPosition = shower->
ShowerStart();
514 const TVector3 &showerVtxDirection = shower->
Direction();
531 if (showersToHits.end() != shwIter2)
static void BuildPFParticleHitMaps(const PFParticleVector &particleVector, const PFParticlesToSpacePoints &particlesToSpacePoints, const SpacePointsToHits &spacePointsToHits, PFParticlesToHits &particlesToHits, HitsToPFParticles &hitsToParticles, const DaughterMode daughterMode=kUseDaughters)
Build mapping between PFParticles and Hits using PFParticle/SpacePoint/Hit maps.
code to link reconstructed objects back to the MC truth information
void XYZ(double *xyz) const
Legacy method to access vertex position, preserved to avoid breaking code. Please try to use Vertex::...
const TVector3 & ShowerStart() const
bool m_printDebug
switch for print statements (TODO: use message service!)
static void BuildPFParticleMap(const PFParticleVector &particleVector, PFParticleMap &particleMap)
Build particle maps for reconstructed particles.
std::map< art::Ptr< recob::Hit >, art::Ptr< recob::PFParticle > > HitsToPFParticles
int NumDaughters() const
Returns the number of daughter particles flowing from this one.
static int GetParentNeutrino(const PFParticleMap &particleMap, const art::Ptr< recob::PFParticle > daughterParticle)
Return the parent neutrino PDG code (or zero for cosmics) for a given reconstructed particle...
std::map< art::Ptr< recob::PFParticle >, ClusterVector > PFParticlesToClusters
size_t Self() const
Returns the index of this particle.
const double & Time() const
std::map< art::Ptr< recob::Shower >, HitVector > ShowersToHits
std::vector< art::Ptr< recob::PFParticle > > PFParticleVector
size_t NumberTrajectoryPoints() const
Various functions related to the presence and the number of (valid) points.
Vector_t VertexDirection() const
Access to track direction at different points.
int PdgCode() const
Return the type of particle as a PDG ID.
std::map< art::Ptr< recob::Track >, HitVector > TracksToHits
PFParticleAnalysis(fhicl::ParameterSet const &pset)
Constructor.
std::vector< art::Ptr< recob::Track > > TrackVector
PFParticleAnalysis class.
std::map< int, art::Ptr< recob::PFParticle > > PFParticleMap
double Length(size_t p=0) const
Access to various track properties.
#define DEFINE_ART_MODULE(klass)
Provides recob::Track data product.
std::map< art::Ptr< recob::PFParticle >, T0Vector > PFParticlesToT0s
static void CollectShowers(const art::Event &evt, const std::string &label, ShowerVector &showerVector, PFParticlesToShowers &particlesToShowers)
Collect the reconstructed PFParticles and associated Showers from the ART event record.
T get(std::string const &key) const
Point_t const & Vertex() const
Access to track position at different points.
static void CollectVertices(const art::Event &evt, const std::string &label, VertexVector &vertexVector, PFParticlesToVertices &particlesToVertices)
Collect the reconstructed PFParticles and associated Vertices from the ART event record.
std::map< art::Ptr< recob::PFParticle >, VertexVector > PFParticlesToVertices
std::vector< art::Ptr< anab::T0 > > T0Vector
bool IsPrimary() const
Returns whether the particle is the root of the flow.
const TVector3 & Direction() const
void reconfigure(fhicl::ParameterSet const &pset)
EDAnalyzer(Table< Config > const &config)
std::map< art::Ptr< recob::PFParticle >, ShowerVector > PFParticlesToShowers
static void CollectTracks(const art::Event &evt, const std::string &label, TrackVector &trackVector, PFParticlesToTracks &particlesToTracks)
Collect the reconstructed PFParticles and associated Tracks from the ART event record.
static void CollectPFParticles(const art::Event &evt, const std::string &label, PFParticleVector &particleVector)
Collect the reconstructed PFParticles from the ART event record.
std::vector< art::Ptr< recob::Shower > > ShowerVector
std::map< art::Ptr< recob::PFParticle >, TrackVector > PFParticlesToTracks
std::map< art::Ptr< recob::PFParticle >, HitVector > PFParticlesToHits
T * make(ARGS...args) const
MaybeLogger_< ELseverityLevel::ELsev_success, false > LogDebug
Vector_t EndDirection() const
Access to track direction at different points.
EventNumber_t event() const
Point_t const & End() const
Access to track position at different points.
void analyze(const art::Event &evt)
std::map< art::Ptr< recob::PFParticle >, SpacePointVector > PFParticlesToSpacePoints
static int GetGeneration(const PFParticleMap &particleMap, const art::Ptr< recob::PFParticle > daughterParticle)
Return the generation of this particle (first generation if primary)
std::string m_showerLabel
static void CollectT0s(const art::Event &evt, const std::string &label, T0Vector &t0Vector, PFParticlesToT0s &particlesToT0s)
Collect a vector of T0s from the ART event record.
virtual ~PFParticleAnalysis()
Destructor.
helper function for LArPandoraInterface producer module
double m_trkstraightlength
static bool IsFinalState(const PFParticleMap &particleMap, const art::Ptr< recob::PFParticle > daughterParticle)
Determine whether a particle has been reconstructed as a final-state particle.
std::string m_particleLabel
std::vector< art::Ptr< recob::Vertex > > VertexVector