223 if (
m_printDebug) std::cout <<
" *** PFParticleAnalysis::analyze(...) *** " << std::endl;
282 std::cout <<
" Run: " <<
m_run << std::endl;
283 std::cout <<
" Event: " <<
m_event << std::endl;
301 if (
m_printDebug) std::cout <<
" PFParticles: " << particleVector.size() << std::endl;
303 if (particleVector.empty()) {
343 for (
unsigned int n = 0; n < particleVector.size(); ++n) {
344 const art::Ptr<recob::PFParticle> particle = particleVector.at(n);
347 m_self = particle->Self();
350 m_parent = (particle->IsPrimary() ? -1 : particle->Parent());
400 PFParticlesToClusters::const_iterator cIter = particlesToClusters.find(particle);
401 if (particlesToClusters.end() != cIter)
m_clusters = cIter->second.size();
404 PFParticlesToSpacePoints::const_iterator pIter = particlesToSpacePoints.find(particle);
405 if (particlesToSpacePoints.end() != pIter)
m_spacepoints = pIter->second.size();
408 PFParticlesToHits::const_iterator hIter = particlesToHits.find(particle);
409 if (particlesToHits.end() != hIter)
m_hits = hIter->second.size();
412 PFParticlesToVertices::const_iterator vIter = particlesToVertices.find(particle);
413 if (particlesToVertices.end() != vIter) {
415 if (!vertexVector.empty()) {
417 std::cout <<
" Warning: Found particle with more than one associated vertex "
420 const art::Ptr<recob::Vertex> vertex = *(vertexVector.begin());
421 double xyz[3] = {0.0, 0.0, 0.0};
432 PFParticlesToT0s::const_iterator t0Iter = particlesToT0s.find(particle);
433 if (particlesToT0s.end() != t0Iter) {
434 const T0Vector& t0Vector = t0Iter->second;
435 if (!t0Vector.empty()) {
437 std::cout <<
" Warning: Found particle with more than one associated T0 " << std::endl;
439 const art::Ptr<anab::T0> t0 = *(t0Vector.begin());
445 PFParticlesToTracks::const_iterator trkIter = particlesToTracks.find(particle);
446 if (particlesToTracks.end() != trkIter) {
448 if (!trackVector.empty()) {
450 std::cout <<
" Warning: Found particle with more than one associated track "
453 const art::Ptr<recob::Track> track = *(trackVector.begin());
454 const auto& trackVtxPosition = track->Vertex();
455 const auto& trackVtxDirection = track->VertexDirection();
456 const auto& trackEndPosition = track->End();
457 const auto& trackEndDirection = track->EndDirection();
477 TracksToHits::const_iterator trkIter2 = tracksToHits.find(track);
478 if (tracksToHits.end() != trkIter2)
m_trackhits = trkIter2->second.size();
483 PFParticlesToShowers::const_iterator shwIter = particlesToShowers.find(particle);
484 if (particlesToShowers.end() != shwIter) {
486 if (!showerVector.empty()) {
488 std::cout <<
" Warning: Found particle with more than one associated shower "
491 const art::Ptr<recob::Shower>
shower = *(showerVector.begin());
492 const TVector3& showerVtxPosition =
shower->ShowerStart();
493 const TVector3& showerVtxDirection =
shower->Direction();
509 ShowersToHits::const_iterator shwIter2 = showersToHits.find(
shower);
510 if (showersToHits.end() != shwIter2)
m_showerhits = shwIter2->second.size();
515 std::cout <<
" PFParticle [" << n <<
"] Primary=" <<
m_primary
521 <<
", Hits=" <<
m_hits <<
") " << std::endl;
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.
PFParticleAnalysis(fhicl::ParameterSet const &pset)
Constructor.
void reconfigure(fhicl::ParameterSet const &pset)
bool m_printDebug
switch for print statements (TODO: use message service!)