LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
lar_pandora::PFParticleMonitoring Class Reference

PFParticleMonitoring class. More...

Inheritance diagram for lar_pandora::PFParticleMonitoring:
art::EDAnalyzer art::detail::Analyzer art::detail::LegacyModule art::Observer art::ModuleBase

Public Types

using ModuleType = EDAnalyzer
 

Public Member Functions

 PFParticleMonitoring (fhicl::ParameterSet const &pset)
 Constructor. More...
 
virtual ~PFParticleMonitoring ()
 Destructor. More...
 
void beginJob ()
 
void endJob ()
 
void analyze (const art::Event &evt)
 
void reconfigure (fhicl::ParameterSet const &pset)
 
void doBeginJob (SharedResources const &resources)
 
void doEndJob ()
 
void doRespondToOpenInputFile (FileBlock const &fb)
 
void doRespondToCloseInputFile (FileBlock const &fb)
 
void doRespondToOpenOutputFiles (FileBlock const &fb)
 
void doRespondToCloseOutputFiles (FileBlock const &fb)
 
bool doBeginRun (RunPrincipal &rp, ModuleContext const &mc)
 
bool doEndRun (RunPrincipal &rp, ModuleContext const &mc)
 
bool doBeginSubRun (SubRunPrincipal &srp, ModuleContext const &mc)
 
bool doEndSubRun (SubRunPrincipal &srp, ModuleContext const &mc)
 
bool doEvent (EventPrincipal &ep, ModuleContext const &mc, std::atomic< std::size_t > &counts_run, std::atomic< std::size_t > &counts_passed, std::atomic< std::size_t > &counts_failed)
 
ModuleDescription const & moduleDescription () const
 
void setModuleDescription (ModuleDescription const &)
 
std::array< std::vector< ProductInfo >, NumBranchTypes > const & getConsumables () const
 
void sortConsumables (std::string const &current_process_name)
 
std::unique_ptr< Worker > makeWorker (WorkerParams const &wp)
 
template<typename T , BranchType BT>
ViewToken< T > consumesView (InputTag const &tag)
 
template<typename T , BranchType BT>
ViewToken< T > mayConsumeView (InputTag const &tag)
 

Protected Member Functions

std::string const & processName () const
 
bool wantAllEvents () const noexcept
 
bool wantEvent (ScheduleID id, Event const &e) const
 
Handle< TriggerResults > getTriggerResults (Event const &e) const
 
ConsumesCollector & consumesCollector ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > consumes (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > mayConsume (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 

Private Types

typedef std::set< art::Ptr< recob::PFParticle > > PFParticleSet
 
typedef std::set< art::Ptr< simb::MCParticle > > MCParticleSet
 
typedef std::set< art::Ptr< simb::MCTruth > > MCTruthSet
 

Private Member Functions

void BuildTrueNeutrinoHitMaps (const MCTruthToMCParticles &truthToParticles, const MCParticlesToHits &trueParticlesToHits, MCTruthToHits &trueNeutrinosToHits, HitsToMCTruth &trueHitsToNeutrinos) const
 Build mapping from true neutrinos to hits. More...
 
void BuildRecoNeutrinoHitMaps (const PFParticleMap &recoParticleMap, const PFParticlesToHits &recoParticlesToHits, PFParticlesToHits &recoNeutrinosToHits, HitsToPFParticles &recoHitsToNeutrinos) const
 Build mapping from reconstructed neutrinos to hits. More...
 
void GetRecoToTrueMatches (const PFParticlesToHits &recoNeutrinosToHits, const HitsToMCTruth &trueHitsToNeutrinos, MCTruthToPFParticles &matchedNeutrinos, MCTruthToHits &matchedNeutrinoHits) const
 Perform matching between true and reconstructed neutrino events. More...
 
void GetRecoToTrueMatches (const PFParticlesToHits &recoNeutrinosToHits, const HitsToMCTruth &trueHitsToNeutrinos, MCTruthToPFParticles &matchedNeutrinos, MCTruthToHits &matchedNeutrinoHits, PFParticleSet &recoVeto, MCTruthSet &trueVeto) const
 Perform matching between true and reconstructed neutrino events. More...
 
void GetRecoToTrueMatches (const PFParticlesToHits &recoParticlesToHits, const HitsToMCParticles &trueHitsToParticles, MCParticlesToPFParticles &matchedParticles, MCParticlesToHits &matchedHits) const
 Perform matching between true and reconstructed particles. More...
 
void GetRecoToTrueMatches (const PFParticlesToHits &recoParticlesToHits, const HitsToMCParticles &trueHitsToParticles, MCParticlesToPFParticles &matchedParticles, MCParticlesToHits &matchedHits, PFParticleSet &recoVeto, MCParticleSet &trueVeto) const
 Perform matching between true and reconstructed particles. More...
 
int CountHitsByType (const int view, const HitVector &hitVector) const
 Count the number of reconstructed hits in a given wire plane. More...
 
void GetStartAndEndPoints (const art::Ptr< simb::MCParticle > trueParticle, int &startT, int &endT) const
 Find the start and end points of the true particle in the active region of detector. More...
 
double GetLength (const art::Ptr< simb::MCParticle > trueParticle, const int startT, const int endT) const
 Find the length of the true particle trajectory through the active region of the detector. More...
 

Private Attributes

TTree * m_pRecoTree
 
int m_run
 
int m_event
 
int m_index
 
int m_nMCParticles
 
int m_nNeutrinoPfos
 
int m_nPrimaryPfos
 
int m_nDaughterPfos
 
int m_mcPdg
 
int m_mcNuPdg
 
int m_mcParentPdg
 
int m_mcPrimaryPdg
 
int m_mcIsNeutrino
 
int m_mcIsPrimary
 
int m_mcIsDecay
 
int m_mcIsCC
 
int m_pfoPdg
 
int m_pfoNuPdg
 
int m_pfoParentPdg
 
int m_pfoPrimaryPdg
 
int m_pfoIsNeutrino
 
int m_pfoIsPrimary
 
int m_pfoIsStitched
 
int m_pfoTrack
 
int m_pfoVertex
 
double m_pfoVtxX
 
double m_pfoVtxY
 
double m_pfoVtxZ
 
double m_pfoEndX
 
double m_pfoEndY
 
double m_pfoEndZ
 
double m_pfoDirX
 
double m_pfoDirY
 
double m_pfoDirZ
 
double m_pfoLength
 
double m_pfoStraightLength
 
int m_mcVertex
 
double m_mcVtxX
 
double m_mcVtxY
 
double m_mcVtxZ
 
double m_mcEndX
 
double m_mcEndY
 
double m_mcEndZ
 
double m_mcDirX
 
double m_mcDirY
 
double m_mcDirZ
 
double m_mcEnergy
 
double m_mcLength
 
double m_mcStraightLength
 
double m_completeness
 
double m_purity
 
int m_nMCHits
 
int m_nPfoHits
 
int m_nMatchedHits
 
int m_nMCHitsU
 
int m_nMCHitsV
 
int m_nMCHitsW
 
int m_nPfoHitsU
 
int m_nPfoHitsV
 
int m_nPfoHitsW
 
int m_nMatchedHitsU
 
int m_nMatchedHitsV
 
int m_nMatchedHitsW
 
int m_nTrueWithoutRecoHits
 True hits which don't belong to any reconstructed particle - "available". More...
 
int m_nRecoWithoutTrueHits
 Reconstructed hits which don't belong to any true particle - "missing". More...
 
double m_spacepointsMinX
 
double m_spacepointsMaxX
 
std::string m_hitfinderLabel
 
std::string m_trackLabel
 
std::string m_particleLabel
 
std::string m_backtrackerLabel
 
std::string m_geantModuleLabel
 
bool m_useDaughterPFParticles
 
bool m_useDaughterMCParticles
 
bool m_addDaughterPFParticles
 
bool m_addDaughterMCParticles
 
bool m_recursiveMatching
 
bool m_printDebug
 switch for print statements (TODO: use message service!) More...
 
bool m_disableRealDataCheck
 Whether to check if the input file contains real data before accessing MC information. More...
 

Detailed Description

PFParticleMonitoring class.

Definition at line 24 of file PFParticleMonitoring_module.cc.

Member Typedef Documentation

Definition at line 22 of file EDAnalyzer.h.

Constructor & Destructor Documentation

lar_pandora::PFParticleMonitoring::PFParticleMonitoring ( fhicl::ParameterSet const &  pset)

Constructor.

Parameters
pset

Definition at line 300 of file PFParticleMonitoring_module.cc.

References reconfigure().

301  : art::EDAnalyzer(pset)
302  {
303  this->reconfigure(pset);
304  }
void reconfigure(fhicl::ParameterSet const &pset)
lar_pandora::PFParticleMonitoring::~PFParticleMonitoring ( )
virtual

Destructor.

Definition at line 308 of file PFParticleMonitoring_module.cc.

308 {}

Member Function Documentation

void lar_pandora::PFParticleMonitoring::analyze ( const art::Event evt)

Definition at line 414 of file PFParticleMonitoring_module.cc.

References lar_pandora::LArPandoraHelper::BuildMCParticleHitMaps(), lar_pandora::LArPandoraHelper::BuildMCParticleMap(), lar_pandora::LArPandoraHelper::BuildPFParticleHitMaps(), lar_pandora::LArPandoraHelper::BuildPFParticleMap(), BuildRecoNeutrinoHitMaps(), BuildTrueNeutrinoHitMaps(), lar_pandora::LArPandoraHelper::CollectHits(), lar_pandora::LArPandoraHelper::CollectMCParticles(), lar_pandora::LArPandoraHelper::CollectPFParticles(), lar_pandora::LArPandoraHelper::CollectSpacePoints(), lar_pandora::LArPandoraHelper::CollectT0s(), lar_pandora::LArPandoraHelper::CollectTracks(), lar_pandora::LArPandoraHelper::CollectVertices(), CountHitsByType(), e, simb::MCParticle::E(), recob::Track::End(), art::EventID::event(), lar_pandora::LArPandoraHelper::GetFinalStateMCParticle(), lar_pandora::LArPandoraHelper::GetFinalStatePFParticle(), GetLength(), simb::MCTruth::GetNeutrino(), lar_pandora::LArPandoraHelper::GetParentMCParticle(), lar_pandora::LArPandoraHelper::GetParentNeutrino(), lar_pandora::LArPandoraHelper::GetParentPFParticle(), GetRecoToTrueMatches(), GetStartAndEndPoints(), art::Event::id(), lar_pandora::LArPandoraHelper::IsFinalState(), lar_pandora::LArPandoraHelper::IsNeutrino(), art::Event::isRealData(), lar_pandora::LArPandoraHelper::kAddDaughters, simb::kCC, lar_pandora::LArPandoraHelper::kIgnoreDaughters, geo::kU, lar_pandora::LArPandoraHelper::kUseDaughters, geo::kV, geo::kW, recob::Track::Length(), m_addDaughterMCParticles, m_addDaughterPFParticles, m_backtrackerLabel, m_completeness, m_disableRealDataCheck, m_event, m_geantModuleLabel, m_hitfinderLabel, m_index, m_mcDirX, m_mcDirY, m_mcDirZ, m_mcEndX, m_mcEndY, m_mcEndZ, m_mcEnergy, m_mcIsCC, m_mcIsDecay, m_mcIsNeutrino, m_mcIsPrimary, m_mcLength, m_mcNuPdg, m_mcParentPdg, m_mcPdg, m_mcPrimaryPdg, m_mcStraightLength, m_mcVertex, m_mcVtxX, m_mcVtxY, m_mcVtxZ, m_nDaughterPfos, m_nMatchedHits, m_nMatchedHitsU, m_nMatchedHitsV, m_nMatchedHitsW, m_nMCHits, m_nMCHitsU, m_nMCHitsV, m_nMCHitsW, m_nMCParticles, m_nNeutrinoPfos, m_nPfoHits, m_nPfoHitsU, m_nPfoHitsV, m_nPfoHitsW, m_nPrimaryPfos, m_nRecoWithoutTrueHits, m_nTrueWithoutRecoHits, m_particleLabel, m_pfoDirX, m_pfoDirY, m_pfoDirZ, m_pfoEndX, m_pfoEndY, m_pfoEndZ, m_pfoIsNeutrino, m_pfoIsPrimary, m_pfoIsStitched, m_pfoLength, m_pfoNuPdg, m_pfoParentPdg, m_pfoPdg, m_pfoPrimaryPdg, m_pfoStraightLength, m_pfoTrack, m_pfoVertex, m_pfoVtxX, m_pfoVtxY, m_pfoVtxZ, m_pRecoTree, m_printDebug, m_purity, m_run, m_spacepointsMaxX, m_spacepointsMinX, m_trackLabel, m_useDaughterMCParticles, m_useDaughterPFParticles, simb::MCTruth::NeutrinoSet(), simb::MCParticle::P(), recob::PFParticle::PdgCode(), simb::MCParticle::PdgCode(), simb::MCParticle::Process(), simb::MCParticle::Px(), simb::MCParticle::Py(), simb::MCParticle::Pz(), art::Event::run(), lar_pandora::LArPandoraHelper::SelectNeutrinoPFParticles(), recob::Track::Vertex(), recob::Track::VertexDirection(), simb::MCParticle::Vx(), simb::MCParticle::Vy(), simb::MCParticle::Vz(), X, recob::SpacePoint::XYZ(), and recob::Vertex::XYZ().

415  {
416  if (m_printDebug) std::cout << " *** PFParticleMonitoring::analyze(...) *** " << std::endl;
417 
418  m_run = evt.run();
419  m_event = evt.id().event();
420  m_index = 0;
421 
422  m_nMCParticles = 0;
423  m_nNeutrinoPfos = 0;
424  m_nPrimaryPfos = 0;
425  m_nDaughterPfos = 0;
426 
427  m_mcPdg = 0;
428  m_mcNuPdg = 0;
429  m_mcParentPdg = 0;
430  m_mcPrimaryPdg = 0;
431  m_mcIsNeutrino = 0;
432  m_mcIsPrimary = 0;
433  m_mcIsDecay = 0;
434  m_mcIsCC = 0;
435 
436  m_pfoPdg = 0;
437  m_pfoNuPdg = 0;
438  m_pfoParentPdg = 0;
439  m_pfoPrimaryPdg = 0;
440  m_pfoIsNeutrino = 0;
441  m_pfoIsPrimary = 0;
442  m_pfoIsStitched = 0;
443  m_pfoTrack = 0;
444  m_pfoVertex = 0;
445  m_pfoVtxX = 0.0;
446  m_pfoVtxY = 0.0;
447  m_pfoVtxZ = 0.0;
448  m_pfoEndX = 0.0;
449  m_pfoEndY = 0.0;
450  m_pfoEndZ = 0.0;
451  m_pfoDirX = 0.0;
452  m_pfoDirY = 0.0;
453  m_pfoDirZ = 0.0;
454  m_pfoLength = 0.0;
455  m_pfoStraightLength = 0.0;
456 
457  m_mcVertex = 0;
458  m_mcVtxX = 0.0;
459  m_mcVtxY = 0.0;
460  m_mcVtxZ = 0.0;
461  m_mcEndX = 0.0;
462  m_mcEndY = 0.0;
463  m_mcEndZ = 0.0;
464  m_mcDirX = 0.0;
465  m_mcDirY = 0.0;
466  m_mcDirZ = 0.0;
467  m_mcEnergy = 0.0;
468  m_mcLength = 0.0;
469  m_mcStraightLength = 0.0;
470 
471  m_completeness = 0.0;
472  m_purity = 0.0;
473 
474  m_nMCHits = 0;
475  m_nPfoHits = 0;
476  m_nMatchedHits = 0;
477  m_nMCHitsU = 0;
478  m_nMCHitsV = 0;
479  m_nMCHitsW = 0;
480  m_nPfoHitsU = 0;
481  m_nPfoHitsV = 0;
482  m_nPfoHitsW = 0;
483  m_nMatchedHitsU = 0;
484  m_nMatchedHitsV = 0;
485  m_nMatchedHitsW = 0;
486 
489 
490  m_spacepointsMinX = 0.0;
491  m_spacepointsMaxX = 0.0;
492 
493  if (m_printDebug) {
494  std::cout << " Run: " << m_run << std::endl;
495  std::cout << " Event: " << m_event << std::endl;
496  }
497 
498  // Collect Hits
499  // ============
500  HitVector hitVector;
502 
503  if (m_printDebug) std::cout << " Hits: " << hitVector.size() << std::endl;
504 
505  // Collect SpacePoints and SpacePoint <-> Hit Associations
506  // =======================================================
507  SpacePointVector spacePointVector;
508  SpacePointsToHits spacePointsToHits;
509  HitsToSpacePoints hitsToSpacePoints;
511  evt, m_particleLabel, spacePointVector, spacePointsToHits, hitsToSpacePoints);
512 
513  if (m_printDebug) std::cout << " SpacePoints: " << spacePointVector.size() << std::endl;
514 
515  // Collect Tracks and PFParticle <-> Track Associations
516  // ====================================================
517  TrackVector recoTrackVector;
518  PFParticlesToTracks recoParticlesToTracks;
519  LArPandoraHelper::CollectTracks(evt, m_trackLabel, recoTrackVector, recoParticlesToTracks);
520 
521  if (m_printDebug) std::cout << " Tracks: " << recoTrackVector.size() << std::endl;
522 
523  // Collect TOs and PFParticle <-> T0 Associations
524  // ==============================================
525  T0Vector t0Vector;
526  PFParticlesToT0s particlesToT0s;
527  LArPandoraHelper::CollectT0s(evt, m_particleLabel, t0Vector, particlesToT0s);
528 
529  // Collect Vertices and PFParticle <-> Vertex Associations
530  // =======================================================
531  VertexVector recoVertexVector;
532  PFParticlesToVertices recoParticlesToVertices;
534  evt, m_particleLabel, recoVertexVector, recoParticlesToVertices);
535 
536  if (m_printDebug) std::cout << " Vertices: " << recoVertexVector.size() << std::endl;
537 
538  // Collect PFParticles and match Reco Particles to Hits
539  // ====================================================
540  PFParticleVector recoParticleVector;
541  PFParticleVector recoNeutrinoVector;
542  PFParticlesToHits recoParticlesToHits;
543  HitsToPFParticles recoHitsToParticles;
544 
545  LArPandoraHelper::CollectPFParticles(evt, m_particleLabel, recoParticleVector);
546  LArPandoraHelper::SelectNeutrinoPFParticles(recoParticleVector, recoNeutrinoVector);
548  evt,
550  recoParticlesToHits,
551  recoHitsToParticles,
555 
556  if (m_printDebug) {
557  std::cout << " RecoNeutrinos: " << recoNeutrinoVector.size() << std::endl;
558  std::cout << " RecoParticles: " << recoParticleVector.size() << std::endl;
559  }
560 
561  // Collect MCParticles and match True Particles to Hits
562  // ====================================================
563  MCParticleVector trueParticleVector;
564  MCTruthToMCParticles truthToParticles;
565  MCParticlesToMCTruth particlesToTruth;
566  MCParticlesToHits trueParticlesToHits;
567  HitsToMCParticles trueHitsToParticles;
568 
569  if (m_disableRealDataCheck || !evt.isRealData()) {
572  evt, m_geantModuleLabel, truthToParticles, particlesToTruth);
573 
575  evt,
577  hitVector,
578  trueParticlesToHits,
579  trueHitsToParticles,
583 
584  if (trueHitsToParticles.empty()) {
585  if (m_backtrackerLabel.empty())
586  throw cet::exception("LArPandora") << " PFParticleMonitoring::analyze - no sim channels "
587  "found, backtracker module must be set in FHiCL "
588  << std::endl;
589 
591  evt,
595  trueParticlesToHits,
596  trueHitsToParticles,
600  }
601  }
602 
603  if (m_printDebug) {
604  std::cout << " TrueParticles: " << particlesToTruth.size() << std::endl;
605  std::cout << " TrueEvents: " << truthToParticles.size() << std::endl;
606  std::cout << " MatchedParticles: " << trueParticlesToHits.size() << std::endl;
607  }
608 
609  if (trueParticlesToHits.empty()) {
610  m_pRecoTree->Fill();
611  return;
612  }
613 
614  // Build Reco and True Particle Maps (for Parent/Daughter Navigation)
615  // =================================================================
616  MCParticleMap trueParticleMap;
617  PFParticleMap recoParticleMap;
618 
619  LArPandoraHelper::BuildMCParticleMap(trueParticleVector, trueParticleMap);
620  LArPandoraHelper::BuildPFParticleMap(recoParticleVector, recoParticleMap);
621 
622  m_nMCParticles = trueParticlesToHits.size();
623  m_nNeutrinoPfos = 0;
624  m_nPrimaryPfos = 0;
625  m_nDaughterPfos = 0;
626 
627  // Count reconstructed particles
628  for (PFParticleVector::const_iterator iter = recoParticleVector.begin(),
629  iterEnd = recoParticleVector.end();
630  iter != iterEnd;
631  ++iter) {
632  const art::Ptr<recob::PFParticle> recoParticle = *iter;
633 
634  if (LArPandoraHelper::IsNeutrino(recoParticle)) { m_nNeutrinoPfos++; }
635  else if (LArPandoraHelper::IsFinalState(recoParticleMap, recoParticle)) {
636  m_nPrimaryPfos++;
637  }
638  else {
639  m_nDaughterPfos++;
640  }
641  }
642 
643  // Match Reco Neutrinos to True Neutrinos
644  // ======================================
645  PFParticlesToHits recoNeutrinosToHits;
646  HitsToPFParticles recoHitsToNeutrinos;
647  HitsToMCTruth trueHitsToNeutrinos;
648  MCTruthToHits trueNeutrinosToHits;
650  recoParticleMap, recoParticlesToHits, recoNeutrinosToHits, recoHitsToNeutrinos);
652  truthToParticles, trueParticlesToHits, trueNeutrinosToHits, trueHitsToNeutrinos);
653 
654  MCTruthToPFParticles matchedNeutrinos;
655  MCTruthToHits matchedNeutrinoHits;
656  this->GetRecoToTrueMatches(
657  recoNeutrinosToHits, trueHitsToNeutrinos, matchedNeutrinos, matchedNeutrinoHits);
658 
659  for (MCTruthToHits::const_iterator iter = trueNeutrinosToHits.begin(),
660  iterEnd = trueNeutrinosToHits.end();
661  iter != iterEnd;
662  ++iter) {
663  const art::Ptr<simb::MCTruth> trueEvent = iter->first;
664  const HitVector& trueHitVector = iter->second;
665 
666  if (trueHitVector.empty()) continue;
667 
668  if (!trueEvent->NeutrinoSet()) continue;
669 
670  const simb::MCNeutrino trueNeutrino(trueEvent->GetNeutrino());
671  const simb::MCParticle trueParticle(trueNeutrino.Nu());
672 
673  m_mcIsCC = ((simb::kCC == trueNeutrino.CCNC()) ? 1 : 0);
674  m_mcPdg = trueParticle.PdgCode();
675  m_mcNuPdg = m_mcPdg;
676  m_mcParentPdg = 0;
677  m_mcPrimaryPdg = 0;
678  m_mcIsNeutrino = 1;
679  m_mcIsPrimary = 0;
680  m_mcIsDecay = 0;
681 
682  m_mcVertex = 1;
683  m_mcVtxX = trueParticle.Vx();
684  m_mcVtxY = trueParticle.Vy();
685  m_mcVtxZ = trueParticle.Vz();
686  m_mcEndX = m_mcVtxX;
687  m_mcEndY = m_mcVtxY;
688  m_mcEndZ = m_mcVtxZ;
689  m_mcDirX = trueParticle.Px() / trueParticle.P();
690  m_mcDirY = trueParticle.Py() / trueParticle.P();
691  m_mcDirZ = trueParticle.Pz() / trueParticle.P();
692  m_mcEnergy = trueParticle.E();
693  m_mcLength = 0.0;
694  m_mcStraightLength = 0.0;
695 
696  m_nMCHits = trueHitVector.size();
697  m_nMCHitsU = this->CountHitsByType(geo::kU, trueHitVector);
698  m_nMCHitsV = this->CountHitsByType(geo::kV, trueHitVector);
699  m_nMCHitsW = this->CountHitsByType(geo::kW, trueHitVector);
700 
701  m_pfoPdg = 0;
702  m_pfoNuPdg = 0;
703  m_pfoParentPdg = 0;
704  m_pfoPrimaryPdg = 0;
705  m_pfoIsNeutrino = 0;
706  m_pfoIsPrimary = 0;
707  m_pfoIsStitched = 0;
708  m_pfoTrack = 0;
709  m_pfoVertex = 0;
710  m_pfoVtxX = 0.0;
711  m_pfoVtxY = 0.0;
712  m_pfoVtxZ = 0.0;
713  m_pfoEndX = 0.0;
714  m_pfoEndY = 0.0;
715  m_pfoEndZ = 0.0;
716  m_pfoDirX = 0.0;
717  m_pfoDirY = 0.0;
718  m_pfoDirZ = 0.0;
719  m_pfoLength = 0.0;
720  m_pfoStraightLength = 0.0;
721 
722  m_nPfoHits = 0;
723  m_nPfoHitsU = 0;
724  m_nPfoHitsV = 0;
725  m_nPfoHitsW = 0;
726 
727  m_nMatchedHits = 0;
728  m_nMatchedHitsU = 0;
729  m_nMatchedHitsV = 0;
730  m_nMatchedHitsW = 0;
731 
734 
735  m_spacepointsMinX = 0.0;
736  m_spacepointsMaxX = 0.0;
737 
738  m_completeness = 0.0;
739  m_purity = 0.0;
740 
741  for (HitVector::const_iterator hIter1 = trueHitVector.begin(),
742  hIterEnd1 = trueHitVector.end();
743  hIter1 != hIterEnd1;
744  ++hIter1) {
745  if (recoHitsToNeutrinos.find(*hIter1) == recoHitsToNeutrinos.end())
747  }
748 
749  MCTruthToPFParticles::const_iterator pIter1 = matchedNeutrinos.find(trueEvent);
750  if (matchedNeutrinos.end() != pIter1) {
751  const art::Ptr<recob::PFParticle> recoParticle = pIter1->second;
752  m_pfoPdg = recoParticle->PdgCode();
755  m_pfoPrimaryPdg = 0;
756  m_pfoIsNeutrino = 1;
757  m_pfoIsPrimary = 0;
758 
759  if (!LArPandoraHelper::IsNeutrino(recoParticle))
760  std::cout << " Warning: Found neutrino with an invalid PDG code " << std::endl;
761 
762  PFParticlesToHits::const_iterator pIter2 = recoNeutrinosToHits.find(recoParticle);
763  if (recoParticlesToHits.end() != pIter2) {
764  const HitVector& recoHitVector = pIter2->second;
765 
766  for (HitVector::const_iterator hIter2 = recoHitVector.begin(),
767  hIterEnd2 = recoHitVector.end();
768  hIter2 != hIterEnd2;
769  ++hIter2) {
770  if (trueHitsToNeutrinos.find(*hIter2) == trueHitsToNeutrinos.end())
772  }
773 
774  MCTruthToHits::const_iterator pIter3 = matchedNeutrinoHits.find(trueEvent);
775  if (matchedNeutrinoHits.end() != pIter3) {
776  const HitVector& matchedHitVector = pIter3->second;
777 
778  m_nPfoHits = recoHitVector.size();
779  m_nPfoHitsU = this->CountHitsByType(geo::kU, recoHitVector);
780  m_nPfoHitsV = this->CountHitsByType(geo::kV, recoHitVector);
781  m_nPfoHitsW = this->CountHitsByType(geo::kW, recoHitVector);
782 
783  m_nMatchedHits = matchedHitVector.size();
784  m_nMatchedHitsU = this->CountHitsByType(geo::kU, matchedHitVector);
785  m_nMatchedHitsV = this->CountHitsByType(geo::kV, matchedHitVector);
786  m_nMatchedHitsW = this->CountHitsByType(geo::kW, matchedHitVector);
787 
789  recoParticlesToVertices.find(recoParticle);
790  if (recoParticlesToVertices.end() != pIter4) {
791  const VertexVector& vertexVector = pIter4->second;
792  if (!vertexVector.empty()) {
793  if (vertexVector.size() != 1 && m_printDebug)
794  std::cout << " Warning: Found particle with more than one associated vertex "
795  << std::endl;
796 
797  const art::Ptr<recob::Vertex> recoVertex = *(vertexVector.begin());
798  double xyz[3] = {0.0, 0.0, 0.0};
799  recoVertex->XYZ(xyz);
800 
801  m_pfoVertex = 1;
802  m_pfoVtxX = xyz[0];
803  m_pfoVtxY = xyz[1];
804  m_pfoVtxZ = xyz[2];
805  }
806  }
807  }
808  }
809  }
810 
811  m_purity =
812  ((m_nPfoHits == 0) ? 0.0 :
813  static_cast<double>(m_nMatchedHits) / static_cast<double>(m_nPfoHits));
815  ((m_nPfoHits == 0) ? 0.0 :
816  static_cast<double>(m_nMatchedHits) / static_cast<double>(m_nMCHits));
817 
818  if (m_printDebug)
819  std::cout << " MCNeutrino [" << m_index << "]"
820  << " trueNu=" << m_mcNuPdg << ", truePdg=" << m_mcPdg
821  << ", recoNu=" << m_pfoNuPdg << ", recoPdg=" << m_pfoPdg
822  << ", mcHits=" << m_nMCHits << ", pfoHits=" << m_nPfoHits
823  << ", matchedHits=" << m_nMatchedHits
824  << ", availableHits=" << m_nTrueWithoutRecoHits << std::endl;
825 
826  m_pRecoTree->Fill();
827  ++m_index; // Increment index number
828  }
829 
830  // Match Reco Particles to True Particles
831  // ======================================
832  MCParticlesToPFParticles matchedParticles;
833  MCParticlesToHits matchedParticleHits;
834  this->GetRecoToTrueMatches(
835  recoParticlesToHits, trueHitsToParticles, matchedParticles, matchedParticleHits);
836 
837  // Compare true and reconstructed particles
838  for (MCParticlesToHits::const_iterator iter = trueParticlesToHits.begin(),
839  iterEnd = trueParticlesToHits.end();
840  iter != iterEnd;
841  ++iter) {
842  const art::Ptr<simb::MCParticle> trueParticle = iter->first;
843  const HitVector& trueHitVector = iter->second;
844 
845  if (trueHitVector.empty()) continue;
846 
847  m_mcPdg = trueParticle->PdgCode();
848  m_mcNuPdg = 0;
849  m_mcParentPdg = 0;
850  m_mcPrimaryPdg = 0;
851  m_mcIsNeutrino = 0;
852  m_mcIsPrimary = 0;
853  m_mcIsDecay = 0;
854  m_mcIsCC = 0;
855 
856  m_pfoPdg = 0;
857  m_pfoNuPdg = 0;
858  m_pfoParentPdg = 0;
859  m_pfoPrimaryPdg = 0;
860  m_pfoIsNeutrino = 0;
861  m_pfoIsPrimary = 0;
862  m_pfoIsStitched = 0;
863  m_pfoTrack = 0;
864  m_pfoVertex = 0;
865  m_pfoVtxX = 0.0;
866  m_pfoVtxY = 0.0;
867  m_pfoVtxZ = 0.0;
868  m_pfoEndX = 0.0;
869  m_pfoEndY = 0.0;
870  m_pfoEndZ = 0.0;
871  m_pfoDirX = 0.0;
872  m_pfoDirY = 0.0;
873  m_pfoDirZ = 0.0;
874  m_pfoLength = 0.0;
875  m_pfoStraightLength = 0.0;
876 
877  m_mcVertex = 0;
878  m_mcVtxX = 0.0;
879  m_mcVtxY = 0.0;
880  m_mcVtxZ = 0.0;
881  m_mcEndX = 0.0;
882  m_mcEndY = 0.0;
883  m_mcEndZ = 0.0;
884  m_mcDirX = 0.0;
885  m_mcDirY = 0.0;
886  m_mcDirZ = 0.0;
887  m_mcEnergy = 0.0;
888  m_mcLength = 0.0;
889  m_mcStraightLength = 0.0;
890 
891  m_completeness = 0.0;
892  m_purity = 0.0;
893 
894  m_nMCHits = 0;
895  m_nMCHitsU = 0;
896  m_nMCHitsV = 0;
897  m_nMCHitsW = 0;
898 
899  m_nPfoHits = 0;
900  m_nPfoHitsU = 0;
901  m_nPfoHitsV = 0;
902  m_nPfoHitsW = 0;
903 
904  m_nMatchedHits = 0;
905  m_nMatchedHitsU = 0;
906  m_nMatchedHitsV = 0;
907  m_nMatchedHitsW = 0;
908 
911 
912  m_spacepointsMinX = 0.0;
913  m_spacepointsMaxX = 0.0;
914 
915  // Set true properties
916  try {
917  int startT(-1);
918  int endT(-1);
919  this->GetStartAndEndPoints(trueParticle, startT, endT);
920 
921  // vertex and end positions
922  m_mcVertex = 1;
923  m_mcVtxX = trueParticle->Vx(startT);
924  m_mcVtxY = trueParticle->Vy(startT);
925  m_mcVtxZ = trueParticle->Vz(startT);
926  m_mcEndX = trueParticle->Vx(endT);
927  m_mcEndY = trueParticle->Vy(endT);
928  m_mcEndZ = trueParticle->Vz(endT);
929 
930  const double dx(m_mcEndX - m_mcVtxX);
931  const double dy(m_mcEndY - m_mcVtxY);
932  const double dz(m_mcEndZ - m_mcVtxZ);
933 
934  m_mcStraightLength = std::sqrt(dx * dx + dy * dy + dz * dz);
935  m_mcLength = this->GetLength(trueParticle, startT, endT);
936 
937  // energy and momentum
938  const double Ptot(trueParticle->P(startT));
939 
940  if (Ptot > 0.0) {
941  m_mcDirX = trueParticle->Px(startT) / Ptot;
942  m_mcDirY = trueParticle->Py(startT) / Ptot;
943  m_mcDirZ = trueParticle->Pz(startT) / Ptot;
944  m_mcEnergy = trueParticle->E(startT);
945  }
946  }
947  catch (cet::exception& e) {
948  }
949 
950  // Get the true parent neutrino
951  MCParticlesToMCTruth::const_iterator nuIter = particlesToTruth.find(trueParticle);
952  if (particlesToTruth.end() == nuIter)
953  throw cet::exception("LArPandora") << " PFParticleMonitoring::analyze --- Found a true "
954  "particle without any ancestry information ";
955 
956  const art::Ptr<simb::MCTruth> trueEvent = nuIter->second;
957 
958  if (trueEvent->NeutrinoSet()) {
959  const simb::MCNeutrino neutrino(trueEvent->GetNeutrino());
960  m_mcNuPdg = neutrino.Nu().PdgCode();
961  m_mcIsCC = ((simb::kCC == neutrino.CCNC()) ? 1 : 0);
962  }
963 
964  // Get the true 'parent' and 'primary' particles
965  try {
966  const art::Ptr<simb::MCParticle> parentParticle(
967  LArPandoraHelper::GetParentMCParticle(trueParticleMap, trueParticle));
968  const art::Ptr<simb::MCParticle> primaryParticle(
969  LArPandoraHelper::GetFinalStateMCParticle(trueParticleMap, trueParticle));
970  m_mcParentPdg = ((parentParticle != trueParticle) ? parentParticle->PdgCode() : 0);
971  m_mcPrimaryPdg = primaryParticle->PdgCode();
972  m_mcIsPrimary = (primaryParticle == trueParticle);
973  m_mcIsDecay = ("Decay" == trueParticle->Process());
974  }
975  catch (cet::exception& e) {
976  }
977 
978  // Find min and max X positions of space points
979  bool foundSpacePoints(false);
980 
981  for (HitVector::const_iterator hIter1 = trueHitVector.begin(),
982  hIterEnd1 = trueHitVector.end();
983  hIter1 != hIterEnd1;
984  ++hIter1) {
985  const art::Ptr<recob::Hit> hit = *hIter1;
986 
987  HitsToSpacePoints::const_iterator hIter2 = hitsToSpacePoints.find(hit);
988  if (hitsToSpacePoints.end() == hIter2) continue;
989 
990  const art::Ptr<recob::SpacePoint> spacepoint = hIter2->second;
991  const double X(spacepoint->XYZ()[0]);
992 
993  if (!foundSpacePoints) {
996  foundSpacePoints = true;
997  }
998  else {
1000  m_spacepointsMaxX = std::max(m_spacepointsMaxX, X);
1001  }
1002  }
1003 
1004  // Count number of available hits
1005  for (HitVector::const_iterator hIter1 = trueHitVector.begin(),
1006  hIterEnd1 = trueHitVector.end();
1007  hIter1 != hIterEnd1;
1008  ++hIter1) {
1009  if (recoHitsToParticles.find(*hIter1) == recoHitsToParticles.end())
1011  }
1012 
1013  // Match true and reconstructed hits
1014  m_nMCHits = trueHitVector.size();
1015  m_nMCHitsU = this->CountHitsByType(geo::kU, trueHitVector);
1016  m_nMCHitsV = this->CountHitsByType(geo::kV, trueHitVector);
1017  m_nMCHitsW = this->CountHitsByType(geo::kW, trueHitVector);
1018 
1019  MCParticlesToPFParticles::const_iterator pIter1 = matchedParticles.find(trueParticle);
1020  if (matchedParticles.end() != pIter1) {
1021  const art::Ptr<recob::PFParticle> recoParticle = pIter1->second;
1022  m_pfoPdg = recoParticle->PdgCode();
1023  m_pfoNuPdg = LArPandoraHelper::GetParentNeutrino(recoParticleMap, recoParticle);
1024  m_pfoIsPrimary = LArPandoraHelper::IsFinalState(recoParticleMap, recoParticle);
1025 
1026  const art::Ptr<recob::PFParticle> parentParticle =
1027  LArPandoraHelper::GetParentPFParticle(recoParticleMap, recoParticle);
1028  m_pfoParentPdg = parentParticle->PdgCode();
1029 
1030  const art::Ptr<recob::PFParticle> primaryParticle =
1031  LArPandoraHelper::GetFinalStatePFParticle(recoParticleMap, recoParticle);
1032  m_pfoPrimaryPdg = primaryParticle->PdgCode();
1033 
1034  PFParticlesToHits::const_iterator pIter2 = recoParticlesToHits.find(recoParticle);
1035  if (recoParticlesToHits.end() == pIter2)
1036  throw cet::exception("LArPandora")
1037  << " PFParticleMonitoring::analyze --- Found a reco particle without any hits ";
1038 
1039  const HitVector& recoHitVector = pIter2->second;
1040 
1041  for (HitVector::const_iterator hIter2 = recoHitVector.begin(),
1042  hIterEnd2 = recoHitVector.end();
1043  hIter2 != hIterEnd2;
1044  ++hIter2) {
1045  if (trueHitsToParticles.find(*hIter2) == trueHitsToParticles.end())
1047  }
1048 
1049  MCParticlesToHits::const_iterator pIter3 = matchedParticleHits.find(trueParticle);
1050  if (matchedParticleHits.end() == pIter3)
1051  throw cet::exception("LArPandora") << " PFParticleMonitoring::analyze --- Found a "
1052  "matched true particle without matched hits ";
1053 
1054  const HitVector& matchedHitVector = pIter3->second;
1055 
1056  m_nPfoHits = recoHitVector.size();
1057  m_nPfoHitsU = this->CountHitsByType(geo::kU, recoHitVector);
1058  m_nPfoHitsV = this->CountHitsByType(geo::kV, recoHitVector);
1059  m_nPfoHitsW = this->CountHitsByType(geo::kW, recoHitVector);
1060 
1061  m_nMatchedHits = matchedHitVector.size();
1062  m_nMatchedHitsU = this->CountHitsByType(geo::kU, matchedHitVector);
1063  m_nMatchedHitsV = this->CountHitsByType(geo::kV, matchedHitVector);
1064  m_nMatchedHitsW = this->CountHitsByType(geo::kW, matchedHitVector);
1065 
1066  PFParticlesToVertices::const_iterator pIter4 = recoParticlesToVertices.find(recoParticle);
1067  if (recoParticlesToVertices.end() != pIter4) {
1068  const VertexVector& vertexVector = pIter4->second;
1069  if (!vertexVector.empty()) {
1070  if (vertexVector.size() != 1 && m_printDebug)
1071  std::cout << " Warning: Found particle with more than one associated vertex "
1072  << std::endl;
1073 
1074  const art::Ptr<recob::Vertex> recoVertex = *(vertexVector.begin());
1075  double xyz[3] = {0.0, 0.0, 0.0};
1076  recoVertex->XYZ(xyz);
1077 
1078  m_pfoVertex = 1;
1079  m_pfoVtxX = xyz[0];
1080  m_pfoVtxY = xyz[1];
1081  m_pfoVtxZ = xyz[2];
1082  }
1083  }
1084 
1085  PFParticlesToTracks::const_iterator pIter5 = recoParticlesToTracks.find(recoParticle);
1086  if (recoParticlesToTracks.end() != pIter5) {
1087  const TrackVector& trackVector = pIter5->second;
1088  if (!trackVector.empty()) {
1089  if (trackVector.size() != 1 && m_printDebug)
1090  std::cout << " Warning: Found particle with more than one associated track "
1091  << std::endl;
1092 
1093  const art::Ptr<recob::Track> recoTrack = *(trackVector.begin());
1094  const auto& vtxPosition = recoTrack->Vertex();
1095  const auto& endPosition = recoTrack->End();
1096  const auto& vtxDirection = recoTrack->VertexDirection();
1097 
1098  m_pfoTrack = 1;
1099  m_pfoVtxX = vtxPosition.x();
1100  m_pfoVtxY = vtxPosition.y();
1101  m_pfoVtxZ = vtxPosition.z();
1102  m_pfoEndX = endPosition.x();
1103  m_pfoEndY = endPosition.y();
1104  m_pfoEndZ = endPosition.z();
1105  m_pfoDirX = vtxDirection.x();
1106  m_pfoDirY = vtxDirection.y();
1107  m_pfoDirZ = vtxDirection.z();
1108  m_pfoStraightLength = (endPosition - vtxPosition).R();
1109  m_pfoLength = recoTrack->Length();
1110  }
1111  }
1112 
1113  m_pfoIsStitched = (particlesToT0s.end() != particlesToT0s.find(recoParticle));
1114  }
1115 
1116  m_purity =
1117  ((m_nPfoHits == 0) ? 0.0 :
1118  static_cast<double>(m_nMatchedHits) / static_cast<double>(m_nPfoHits));
1119  m_completeness =
1120  ((m_nPfoHits == 0) ? 0.0 :
1121  static_cast<double>(m_nMatchedHits) / static_cast<double>(m_nMCHits));
1122 
1123  if (m_printDebug)
1124  std::cout << " MCParticle [" << m_index << "]"
1125  << " trueNu=" << m_mcNuPdg << ", truePdg=" << m_mcPdg
1126  << ", recoNu=" << m_pfoNuPdg << ", recoPdg=" << m_pfoPdg
1127  << ", mcHits=" << m_nMCHits << ", pfoHits=" << m_nPfoHits
1128  << ", matchedHits=" << m_nMatchedHits
1129  << ", availableHits=" << m_nTrueWithoutRecoHits << std::endl;
1130 
1131  m_pRecoTree->Fill();
1132  ++m_index; // Increment index number
1133  }
1134  }
double E(const int i=0) const
Definition: MCParticle.h:234
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.
void XYZ(double *xyz) const
Legacy method to access vertex position, preserved to avoid breaking code. Please try to use Vertex::...
Definition: Vertex.cxx:34
std::map< art::Ptr< recob::Hit >, art::Ptr< simb::MCParticle > > HitsToMCParticles
int PdgCode() const
Definition: MCParticle.h:213
const simb::MCNeutrino & GetNeutrino() const
Definition: MCTruth.h:77
int CountHitsByType(const int view, const HitVector &hitVector) const
Count the number of reconstructed hits in a given wire plane.
static void BuildPFParticleMap(const PFParticleVector &particleVector, PFParticleMap &particleMap)
Build particle maps for reconstructed particles.
double Py(const int i=0) const
Definition: MCParticle.h:232
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...
void GetRecoToTrueMatches(const PFParticlesToHits &recoNeutrinosToHits, const HitsToMCTruth &trueHitsToNeutrinos, MCTruthToPFParticles &matchedNeutrinos, MCTruthToHits &matchedNeutrinoHits) const
Perform matching between true and reconstructed neutrino events.
static bool IsNeutrino(const art::Ptr< recob::PFParticle > particle)
Determine whether a particle has been reconstructed as a neutrino.
std::map< art::Ptr< simb::MCTruth >, HitVector > MCTruthToHits
Planes which measure V.
Definition: geo_types.h:136
std::map< art::Ptr< simb::MCParticle >, art::Ptr< simb::MCTruth > > MCParticlesToMCTruth
static art::Ptr< recob::PFParticle > GetFinalStatePFParticle(const PFParticleMap &particleMap, const art::Ptr< recob::PFParticle > daughterParticle)
Return the final-state parent particle by navigating up the chain of parent/daughter associations...
double Px(const int i=0) const
Definition: MCParticle.h:231
Vector_t VertexDirection() const
Access to track direction at different points.
Definition: Track.h:166
std::map< art::Ptr< simb::MCParticle >, art::Ptr< recob::PFParticle > > MCParticlesToPFParticles
int PdgCode() const
Return the type of particle as a PDG ID.
Definition: PFParticle.h:79
intermediate_table::const_iterator const_iterator
bool isRealData() const
Definition: Event.cc:53
std::string Process() const
Definition: MCParticle.h:216
static art::Ptr< recob::PFParticle > GetParentPFParticle(const PFParticleMap &particleMap, const art::Ptr< recob::PFParticle > daughterParticle)
Return the top-level parent particle by navigating up the chain of parent/daughter associations...
std::map< art::Ptr< recob::PFParticle >, TrackVector > PFParticlesToTracks
std::map< art::Ptr< recob::PFParticle >, VertexVector > PFParticlesToVertices
std::map< int, art::Ptr< recob::PFParticle > > PFParticleMap
void BuildTrueNeutrinoHitMaps(const MCTruthToMCParticles &truthToParticles, const MCParticlesToHits &trueParticlesToHits, MCTruthToHits &trueNeutrinosToHits, HitsToMCTruth &trueHitsToNeutrinos) const
Build mapping from true neutrinos to hits.
std::map< int, art::Ptr< simb::MCParticle > > MCParticleMap
static void CollectSpacePoints(const art::Event &evt, const std::string &label, SpacePointVector &spacePointVector, SpacePointsToHits &spacePointsToHits)
Collect the reconstructed SpacePoints and associated hits from the ART event record.
Planes which measure U.
Definition: geo_types.h:135
double GetLength(const art::Ptr< simb::MCParticle > trueParticle, const int startT, const int endT) const
Find the length of the true particle trajectory through the active region of the detector.
int m_nTrueWithoutRecoHits
True hits which don&#39;t belong to any reconstructed particle - "available".
std::map< art::Ptr< recob::PFParticle >, T0Vector > PFParticlesToT0s
std::map< art::Ptr< recob::Hit >, art::Ptr< simb::MCTruth > > HitsToMCTruth
double Length(size_t p=0) const
Access to various track properties.
Definition: Track.h:207
static art::Ptr< simb::MCParticle > GetParentMCParticle(const MCParticleMap &particleMap, const art::Ptr< simb::MCParticle > daughterParticle)
Return the top-level parent particle by navigating up the chain of parent/daughter associations...
void BuildRecoNeutrinoHitMaps(const PFParticleMap &recoParticleMap, const PFParticlesToHits &recoParticlesToHits, PFParticlesToHits &recoNeutrinosToHits, HitsToPFParticles &recoHitsToNeutrinos) const
Build mapping from reconstructed neutrinos to hits.
std::map< art::Ptr< simb::MCParticle >, HitVector > MCParticlesToHits
std::vector< art::Ptr< recob::PFParticle > > PFParticleVector
std::map< art::Ptr< simb::MCTruth >, MCParticleVector > MCTruthToMCParticles
std::map< art::Ptr< simb::MCTruth >, art::Ptr< recob::PFParticle > > MCTruthToPFParticles
double P(const int i=0) const
Definition: MCParticle.h:235
std::vector< art::Ptr< recob::SpacePoint > > SpacePointVector
std::map< art::Ptr< recob::PFParticle >, HitVector > PFParticlesToHits
Point_t const & Vertex() const
Access to track position at different points.
Definition: Track.h:158
bool m_printDebug
switch for print statements (TODO: use message service!)
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::Hit >, art::Ptr< recob::SpacePoint > > HitsToSpacePoints
std::vector< art::Ptr< simb::MCParticle > > MCParticleVector
const Double32_t * XYZ() const
Definition: SpacePoint.h:78
std::vector< art::Ptr< recob::Track > > TrackVector
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.
void GetStartAndEndPoints(const art::Ptr< simb::MCParticle > trueParticle, int &startT, int &endT) const
Find the start and end points of the true particle in the active region of detector.
static void CollectHits(const art::Event &evt, const std::string &label, HitVector &hitVector)
Collect the reconstructed Hits from the ART event record.
Detector simulation of raw signals on wires.
static void SelectNeutrinoPFParticles(const PFParticleVector &inputParticles, PFParticleVector &outputParticles)
Select reconstructed neutrino particles from a list of all reconstructed particles.
double Vx(const int i=0) const
Definition: MCParticle.h:222
std::vector< art::Ptr< recob::Hit > > HitVector
std::map< art::Ptr< recob::Hit >, art::Ptr< recob::PFParticle > > HitsToPFParticles
double Pz(const int i=0) const
Definition: MCParticle.h:233
double Vz(const int i=0) const
Definition: MCParticle.h:224
std::vector< art::Ptr< recob::Vertex > > VertexVector
EventNumber_t event() const
Definition: EventID.h:116
Point_t const & End() const
Access to track position at different points.
Definition: Track.h:159
Planes which measure W (third view for Bo, MicroBooNE, etc).
Definition: geo_types.h:137
bool NeutrinoSet() const
Definition: MCTruth.h:78
std::vector< art::Ptr< anab::T0 > > T0Vector
Float_t e
Definition: plot.C:35
RunNumber_t run() const
Definition: Event.cc:29
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.
static void BuildMCParticleHitMaps(const art::Event &evt, const HitVector &hitVector, const SimChannelVector &simChannelVector, HitsToTrackIDEs &hitsToTrackIDEs)
Collect the links from reconstructed hits to their true energy deposits.
Float_t X
Definition: plot.C:37
Event generator information.
Definition: MCNeutrino.h:18
static void CollectMCParticles(const art::Event &evt, const std::string &label, MCParticleVector &particleVector)
Collect a vector of MCParticle objects from the ART event record.
static art::Ptr< simb::MCParticle > GetFinalStateMCParticle(const MCParticleMap &particleMap, const art::Ptr< simb::MCParticle > daughterParticle)
Return the final-state parent particle by navigating up the chain of parent/daughter associations...
int m_nRecoWithoutTrueHits
Reconstructed hits which don&#39;t belong to any true particle - "missing".
EventID id() const
Definition: Event.cc:23
double Vy(const int i=0) const
Definition: MCParticle.h:223
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::map< art::Ptr< recob::SpacePoint >, art::Ptr< recob::Hit > > SpacePointsToHits
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
bool m_disableRealDataCheck
Whether to check if the input file contains real data before accessing MC information.
static void BuildMCParticleMap(const MCParticleVector &particleVector, MCParticleMap &particleMap)
Build particle maps for true particles.
void lar_pandora::PFParticleMonitoring::beginJob ( )
virtual

Reimplemented from art::EDAnalyzer.

Definition at line 332 of file PFParticleMonitoring_module.cc.

References m_completeness, m_event, m_index, m_mcDirX, m_mcDirY, m_mcDirZ, m_mcEndX, m_mcEndY, m_mcEndZ, m_mcEnergy, m_mcIsCC, m_mcIsDecay, m_mcIsNeutrino, m_mcIsPrimary, m_mcLength, m_mcNuPdg, m_mcParentPdg, m_mcPdg, m_mcPrimaryPdg, m_mcStraightLength, m_mcVertex, m_mcVtxX, m_mcVtxY, m_mcVtxZ, m_nDaughterPfos, m_nMatchedHits, m_nMatchedHitsU, m_nMatchedHitsV, m_nMatchedHitsW, m_nMCHits, m_nMCHitsU, m_nMCHitsV, m_nMCHitsW, m_nMCParticles, m_nNeutrinoPfos, m_nPfoHits, m_nPfoHitsU, m_nPfoHitsV, m_nPfoHitsW, m_nPrimaryPfos, m_nRecoWithoutTrueHits, m_nTrueWithoutRecoHits, m_pfoDirX, m_pfoDirY, m_pfoDirZ, m_pfoEndX, m_pfoEndY, m_pfoEndZ, m_pfoIsNeutrino, m_pfoIsPrimary, m_pfoIsStitched, m_pfoLength, m_pfoNuPdg, m_pfoParentPdg, m_pfoPdg, m_pfoPrimaryPdg, m_pfoStraightLength, m_pfoTrack, m_pfoVertex, m_pfoVtxX, m_pfoVtxY, m_pfoVtxZ, m_pRecoTree, m_purity, m_run, m_spacepointsMaxX, and m_spacepointsMinX.

333  {
334  mf::LogDebug("LArPandora") << " *** PFParticleMonitoring::beginJob() *** " << std::endl;
335 
336  //
338 
339  m_pRecoTree = tfs->make<TTree>("pandora", "LAr Reco vs True");
340  m_pRecoTree->Branch("run", &m_run, "run/I");
341  m_pRecoTree->Branch("event", &m_event, "event/I");
342  m_pRecoTree->Branch("index", &m_index, "index/I");
343  m_pRecoTree->Branch("nMCParticles", &m_nMCParticles, "nMCParticles/I");
344  m_pRecoTree->Branch("nNeutrinoPfos", &m_nNeutrinoPfos, "nNeutrinoPfos/I");
345  m_pRecoTree->Branch("nPrimaryPfos", &m_nPrimaryPfos, "nPrimaryPfos/I");
346  m_pRecoTree->Branch("nDaughterPfos", &m_nDaughterPfos, "nDaughterPfos/I");
347  m_pRecoTree->Branch("mcPdg", &m_mcPdg, "mcPdg/I");
348  m_pRecoTree->Branch("mcNuPdg", &m_mcNuPdg, "mcNuPdg/I");
349  m_pRecoTree->Branch("mcParentPdg", &m_mcParentPdg, "mcParentPdg/I");
350  m_pRecoTree->Branch("mcPrimaryPdg", &m_mcPrimaryPdg, "mcPrimaryPdg/I");
351  m_pRecoTree->Branch("mcIsNeutrino", &m_mcIsNeutrino, "mcIsNeutrino/I");
352  m_pRecoTree->Branch("mcIsPrimary", &m_mcIsPrimary, "mcIsPrimary/I");
353  m_pRecoTree->Branch("mcIsDecay", &m_mcIsDecay, "mcIsDecay/I");
354  m_pRecoTree->Branch("mcIsCC", &m_mcIsCC, "mcIsCC/I");
355  m_pRecoTree->Branch("pfoPdg", &m_pfoPdg, "pfoPdg/I");
356  m_pRecoTree->Branch("pfoNuPdg", &m_pfoNuPdg, "pfoNuPdg/I");
357  m_pRecoTree->Branch("pfoParentPdg", &m_pfoParentPdg, "pfoParentPdg/I");
358  m_pRecoTree->Branch("pfoPrimaryPdg", &m_pfoPrimaryPdg, "pfoPrimaryPdg/I");
359  m_pRecoTree->Branch("pfoIsNeutrino", &m_pfoIsNeutrino, "pfoIsNeutrino/I");
360  m_pRecoTree->Branch("pfoIsPrimary", &m_pfoIsPrimary, "pfoIsPrimary/I");
361  m_pRecoTree->Branch("pfoIsStitched", &m_pfoIsStitched, "pfoIsStitched/I");
362  m_pRecoTree->Branch("pfoTrack", &m_pfoTrack, "pfoTrack/I");
363  m_pRecoTree->Branch("pfoVertex", &m_pfoVertex, "pfoVertex/I");
364  m_pRecoTree->Branch("pfoVtxX", &m_pfoVtxX, "pfoVtxX/D");
365  m_pRecoTree->Branch("pfoVtxY", &m_pfoVtxY, "pfoVtxY/D");
366  m_pRecoTree->Branch("pfoVtxZ", &m_pfoVtxZ, "pfoVtxZ/D");
367  m_pRecoTree->Branch("pfoEndX", &m_pfoEndX, "pfoEndX/D");
368  m_pRecoTree->Branch("pfoEndY", &m_pfoEndY, "pfoEndY/D");
369  m_pRecoTree->Branch("pfoEndZ", &m_pfoEndZ, "pfoEndZ/D");
370  m_pRecoTree->Branch("pfoDirX", &m_pfoDirX, "pfoDirX/D");
371  m_pRecoTree->Branch("pfoDirY", &m_pfoDirY, "pfoDirY/D");
372  m_pRecoTree->Branch("pfoDirZ", &m_pfoDirZ, "pfoDirZ/D");
373  m_pRecoTree->Branch("pfoLength", &m_pfoLength, "pfoLength/D");
374  m_pRecoTree->Branch("pfoStraightLength", &m_pfoStraightLength, "pfoStraightLength/D");
375  m_pRecoTree->Branch("mcVertex", &m_mcVertex, "mcVertex/I");
376  m_pRecoTree->Branch("mcVtxX", &m_mcVtxX, "mcVtxX/D");
377  m_pRecoTree->Branch("mcVtxY", &m_mcVtxY, "mcVtxY/D");
378  m_pRecoTree->Branch("mcVtxZ", &m_mcVtxZ, "mcVtxZ/D");
379  m_pRecoTree->Branch("mcEndX", &m_mcEndX, "mcEndX/D");
380  m_pRecoTree->Branch("mcEndY", &m_mcEndY, "mcEndY/D");
381  m_pRecoTree->Branch("mcEndZ", &m_mcEndZ, "mcEndZ/D");
382  m_pRecoTree->Branch("mcDirX", &m_mcDirX, "mcDirX/D");
383  m_pRecoTree->Branch("mcDirY", &m_mcDirY, "mcDirY/D");
384  m_pRecoTree->Branch("mcDirZ", &m_mcDirZ, "mcDirZ/D");
385  m_pRecoTree->Branch("mcEnergy", &m_mcEnergy, "mcEnergy/D");
386  m_pRecoTree->Branch("mcLength", &m_mcLength, "mcLength/D");
387  m_pRecoTree->Branch("mcStraightLength", &m_mcStraightLength, "mcStraightLength/D");
388  m_pRecoTree->Branch("completeness", &m_completeness, "completeness/D");
389  m_pRecoTree->Branch("purity", &m_purity, "purity/D");
390  m_pRecoTree->Branch("nMCHits", &m_nMCHits, "nMCHits/I");
391  m_pRecoTree->Branch("nPfoHits", &m_nPfoHits, "nPfoHits/I");
392  m_pRecoTree->Branch("nMatchedHits", &m_nMatchedHits, "nMatchedHits/I");
393  m_pRecoTree->Branch("nMCHitsU", &m_nMCHitsU, "nMCHitsU/I");
394  m_pRecoTree->Branch("nMCHitsV", &m_nMCHitsV, "nMCHitsV/I");
395  m_pRecoTree->Branch("nMCHitsW", &m_nMCHitsW, "nMCHitsW/I");
396  m_pRecoTree->Branch("nPfoHitsU", &m_nPfoHitsU, "nPfoHitsU/I");
397  m_pRecoTree->Branch("nPfoHitsV", &m_nPfoHitsV, "nPfoHitsV/I");
398  m_pRecoTree->Branch("nPfoHitsW", &m_nPfoHitsW, "nPfoHitsW/I");
399  m_pRecoTree->Branch("nMatchedHitsU", &m_nMatchedHitsU, "nMatchedHitsU/I");
400  m_pRecoTree->Branch("nMatchedHitsV", &m_nMatchedHitsV, "nMatchedHitsV/I");
401  m_pRecoTree->Branch("nMatchedHitsW", &m_nMatchedHitsW, "nMatchedHitsW/I");
402  m_pRecoTree->Branch("nTrueWithoutRecoHits", &m_nTrueWithoutRecoHits, "nTrueWithoutRecoHits/I");
403  m_pRecoTree->Branch("nRecoWithoutTrueHits", &m_nRecoWithoutTrueHits, "nRecoWithoutTrueHits/I");
404  m_pRecoTree->Branch("spacepointsMinX", &m_spacepointsMinX, "spacepointsMinX/D");
405  m_pRecoTree->Branch("spacepointsMaxX", &m_spacepointsMaxX, "spacepointsMaxX/D");
406  }
int m_nTrueWithoutRecoHits
True hits which don&#39;t belong to any reconstructed particle - "available".
MaybeLogger_< ELseverityLevel::ELsev_success, false > LogDebug
int m_nRecoWithoutTrueHits
Reconstructed hits which don&#39;t belong to any true particle - "missing".
void lar_pandora::PFParticleMonitoring::BuildRecoNeutrinoHitMaps ( const PFParticleMap recoParticleMap,
const PFParticlesToHits recoParticlesToHits,
PFParticlesToHits recoNeutrinosToHits,
HitsToPFParticles recoHitsToNeutrinos 
) const
private

Build mapping from reconstructed neutrinos to hits.

Parameters
recoParticleMapthe input mapping from reconstructed particle and particle ID
recoParticlesToHitsthe input mapping from reconstructed particles to hits
recoNeutrinosToHitsthe output mapping from reconstructed particles to hits
recoHitsToNeutrinosthe output mapping from reconstructed hits to particles

Definition at line 1172 of file PFParticleMonitoring_module.cc.

References lar_pandora::LArPandoraHelper::GetParentPFParticle(), and lar_pandora::LArPandoraHelper::IsNeutrino().

Referenced by analyze().

1176  {
1177  for (PFParticleMap::const_iterator iter1 = recoParticleMap.begin(),
1178  iterEnd1 = recoParticleMap.end();
1179  iter1 != iterEnd1;
1180  ++iter1) {
1181  const art::Ptr<recob::PFParticle> recoParticle = iter1->second;
1182  const art::Ptr<recob::PFParticle> recoNeutrino =
1183  LArPandoraHelper::GetParentPFParticle(recoParticleMap, recoParticle);
1184 
1185  if (!LArPandoraHelper::IsNeutrino(recoNeutrino)) continue;
1186 
1187  const PFParticlesToHits::const_iterator iter2 = recoParticlesToHits.find(recoParticle);
1188  if (recoParticlesToHits.end() == iter2) continue;
1189 
1190  const HitVector& hitVector = iter2->second;
1191 
1192  for (HitVector::const_iterator iter3 = hitVector.begin(), iterEnd3 = hitVector.end();
1193  iter3 != iterEnd3;
1194  ++iter3) {
1195  const art::Ptr<recob::Hit> hit = *iter3;
1196  recoHitsToNeutrinos[hit] = recoNeutrino;
1197  recoNeutrinosToHits[recoNeutrino].push_back(hit);
1198  }
1199  }
1200  }
static bool IsNeutrino(const art::Ptr< recob::PFParticle > particle)
Determine whether a particle has been reconstructed as a neutrino.
intermediate_table::const_iterator const_iterator
static art::Ptr< recob::PFParticle > GetParentPFParticle(const PFParticleMap &particleMap, const art::Ptr< recob::PFParticle > daughterParticle)
Return the top-level parent particle by navigating up the chain of parent/daughter associations...
Detector simulation of raw signals on wires.
std::vector< art::Ptr< recob::Hit > > HitVector
void lar_pandora::PFParticleMonitoring::BuildTrueNeutrinoHitMaps ( const MCTruthToMCParticles truthToParticles,
const MCParticlesToHits trueParticlesToHits,
MCTruthToHits trueNeutrinosToHits,
HitsToMCTruth trueHitsToNeutrinos 
) const
private

Build mapping from true neutrinos to hits.

Parameters
truthToParticlesthe input mapping from true event to true particles
trueParticlesToHitsthe input mapping from true particles to hits
trueNeutrinosToHitsthe output mapping from trues event to hits
trueHitsToNeutrinosthe output mappign from hits to true events

Definition at line 1138 of file PFParticleMonitoring_module.cc.

Referenced by analyze().

1142  {
1143  for (MCTruthToMCParticles::const_iterator iter1 = truthToParticles.begin(),
1144  iterEnd1 = truthToParticles.end();
1145  iter1 != iterEnd1;
1146  ++iter1) {
1147  const art::Ptr<simb::MCTruth> trueNeutrino = iter1->first;
1148  const MCParticleVector& trueParticleVector = iter1->second;
1149 
1150  for (MCParticleVector::const_iterator iter2 = trueParticleVector.begin(),
1151  iterEnd2 = trueParticleVector.end();
1152  iter2 != iterEnd2;
1153  ++iter2) {
1154  const MCParticlesToHits::const_iterator iter3 = trueParticlesToHits.find(*iter2);
1155  if (trueParticlesToHits.end() == iter3) continue;
1156 
1157  const HitVector& hitVector = iter3->second;
1158 
1159  for (HitVector::const_iterator iter4 = hitVector.begin(), iterEnd4 = hitVector.end();
1160  iter4 != iterEnd4;
1161  ++iter4) {
1162  const art::Ptr<recob::Hit> hit = *iter4;
1163  trueHitsToNeutrinos[hit] = trueNeutrino;
1164  trueNeutrinosToHits[trueNeutrino].push_back(hit);
1165  }
1166  }
1167  }
1168  }
intermediate_table::const_iterator const_iterator
std::vector< art::Ptr< simb::MCParticle > > MCParticleVector
Detector simulation of raw signals on wires.
std::vector< art::Ptr< recob::Hit > > HitVector
template<typename T , BranchType BT>
ProductToken< T > art::ModuleBase::consumes ( InputTag const &  tag)
protectedinherited

Definition at line 61 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::consumes().

62  {
63  return collector_.consumes<T, BT>(tag);
64  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
ProductToken< T > consumes(InputTag const &)
ConsumesCollector & art::ModuleBase::consumesCollector ( )
protectedinherited

Definition at line 57 of file ModuleBase.cc.

References art::ModuleBase::collector_.

58  {
59  return collector_;
60  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
template<typename T , BranchType BT>
void art::ModuleBase::consumesMany ( )
protectedinherited

Definition at line 75 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::consumesMany().

76  {
77  collector_.consumesMany<T, BT>();
78  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::ModuleBase::consumesView ( InputTag const &  )
protectedinherited
template<typename T , BranchType BT>
ViewToken<T> art::ModuleBase::consumesView ( InputTag const &  tag)
inherited

Definition at line 68 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::consumesView().

69  {
70  return collector_.consumesView<T, BT>(tag);
71  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
ViewToken< Element > consumesView(InputTag const &)
int lar_pandora::PFParticleMonitoring::CountHitsByType ( const int  view,
const HitVector hitVector 
) const
private

Count the number of reconstructed hits in a given wire plane.

Parameters
viewthe wire plane ID
hitVectorthe input vector of reconstructed hits

Definition at line 1396 of file PFParticleMonitoring_module.cc.

References recob::Hit::View().

Referenced by analyze().

1397  {
1398  int nHits(0);
1399 
1400  for (HitVector::const_iterator iter = hitVector.begin(), iterEnd = hitVector.end();
1401  iter != iterEnd;
1402  ++iter) {
1403  const art::Ptr<recob::Hit> hit = *iter;
1404  if (hit->View() == view) ++nHits;
1405  }
1406 
1407  return nHits;
1408  }
geo::View_t View() const
View for the plane of the hit.
Definition: Hit.h:276
intermediate_table::const_iterator const_iterator
Detector simulation of raw signals on wires.
void art::detail::Analyzer::doBeginJob ( SharedResources const &  resources)
inherited

Definition at line 25 of file Analyzer.cc.

Referenced by art::detail::Analyzer::Analyzer().

26  {
27  setupQueues(resources);
28  ProcessingFrame const frame{ScheduleID{}};
29  beginJobWithFrame(frame);
30  }
virtual void beginJobWithFrame(ProcessingFrame const &)=0
virtual void setupQueues(SharedResources const &)=0
bool art::detail::Analyzer::doBeginRun ( RunPrincipal rp,
ModuleContext const &  mc 
)
inherited

Definition at line 68 of file Analyzer.cc.

References art::ModuleContext::scheduleID().

Referenced by art::detail::Analyzer::Analyzer().

69  {
70  ProcessingFrame const frame{mc.scheduleID()};
71  beginRunWithFrame(std::as_const(rp).makeRun(mc), frame);
72  return true;
73  }
virtual void beginRunWithFrame(Run const &, ProcessingFrame const &)=0
bool art::detail::Analyzer::doBeginSubRun ( SubRunPrincipal srp,
ModuleContext const &  mc 
)
inherited

Definition at line 84 of file Analyzer.cc.

References art::ModuleContext::scheduleID().

Referenced by art::detail::Analyzer::Analyzer().

85  {
86  ProcessingFrame const frame{mc.scheduleID()};
87  beginSubRunWithFrame(std::as_const(srp).makeSubRun(mc), frame);
88  return true;
89  }
virtual void beginSubRunWithFrame(SubRun const &, ProcessingFrame const &)=0
void art::detail::Analyzer::doEndJob ( )
inherited

Definition at line 33 of file Analyzer.cc.

Referenced by art::detail::Analyzer::Analyzer().

34  {
35  ProcessingFrame const frame{ScheduleID{}};
36  endJobWithFrame(frame);
37  }
virtual void endJobWithFrame(ProcessingFrame const &)=0
bool art::detail::Analyzer::doEndRun ( RunPrincipal rp,
ModuleContext const &  mc 
)
inherited

Definition at line 76 of file Analyzer.cc.

References art::ModuleContext::scheduleID().

Referenced by art::detail::Analyzer::Analyzer().

77  {
78  ProcessingFrame const frame{mc.scheduleID()};
79  endRunWithFrame(std::as_const(rp).makeRun(mc), frame);
80  return true;
81  }
virtual void endRunWithFrame(Run const &, ProcessingFrame const &)=0
bool art::detail::Analyzer::doEndSubRun ( SubRunPrincipal srp,
ModuleContext const &  mc 
)
inherited

Definition at line 92 of file Analyzer.cc.

References art::ModuleContext::scheduleID().

Referenced by art::detail::Analyzer::Analyzer().

93  {
94  ProcessingFrame const frame{mc.scheduleID()};
95  endSubRunWithFrame(std::as_const(srp).makeSubRun(mc), frame);
96  return true;
97  }
virtual void endSubRunWithFrame(SubRun const &, ProcessingFrame const &)=0
bool art::detail::Analyzer::doEvent ( EventPrincipal ep,
ModuleContext const &  mc,
std::atomic< std::size_t > &  counts_run,
std::atomic< std::size_t > &  counts_passed,
std::atomic< std::size_t > &  counts_failed 
)
inherited

Definition at line 100 of file Analyzer.cc.

References e, and art::ModuleContext::scheduleID().

Referenced by art::detail::Analyzer::Analyzer().

105  {
106  auto const e = std::as_const(ep).makeEvent(mc);
107  if (wantEvent(mc.scheduleID(), e)) {
108  ++counts_run;
109  ProcessingFrame const frame{mc.scheduleID()};
110  analyzeWithFrame(e, frame);
111  ++counts_passed;
112  }
113  return true;
114  }
bool wantEvent(ScheduleID id, Event const &e) const
Definition: Observer.cc:63
Float_t e
Definition: plot.C:35
virtual void analyzeWithFrame(Event const &, ProcessingFrame const &)=0
void art::detail::Analyzer::doRespondToCloseInputFile ( FileBlock const &  fb)
inherited

Definition at line 47 of file Analyzer.cc.

Referenced by art::detail::Analyzer::Analyzer().

48  {
49  ProcessingFrame const frame{ScheduleID{}};
51  }
TFile fb("Li6.root")
virtual void respondToCloseInputFileWithFrame(FileBlock const &, ProcessingFrame const &)=0
void art::detail::Analyzer::doRespondToCloseOutputFiles ( FileBlock const &  fb)
inherited

Definition at line 61 of file Analyzer.cc.

Referenced by art::detail::Analyzer::Analyzer().

62  {
63  ProcessingFrame const frame{ScheduleID{}};
65  }
virtual void respondToCloseOutputFilesWithFrame(FileBlock const &, ProcessingFrame const &)=0
TFile fb("Li6.root")
void art::detail::Analyzer::doRespondToOpenInputFile ( FileBlock const &  fb)
inherited

Definition at line 40 of file Analyzer.cc.

Referenced by art::detail::Analyzer::Analyzer().

41  {
42  ProcessingFrame const frame{ScheduleID{}};
44  }
TFile fb("Li6.root")
virtual void respondToOpenInputFileWithFrame(FileBlock const &, ProcessingFrame const &)=0
void art::detail::Analyzer::doRespondToOpenOutputFiles ( FileBlock const &  fb)
inherited

Definition at line 54 of file Analyzer.cc.

Referenced by art::detail::Analyzer::Analyzer().

55  {
56  ProcessingFrame const frame{ScheduleID{}};
58  }
virtual void respondToOpenOutputFilesWithFrame(FileBlock const &, ProcessingFrame const &)=0
TFile fb("Li6.root")
void lar_pandora::PFParticleMonitoring::endJob ( )
virtual

Reimplemented from art::EDAnalyzer.

Definition at line 410 of file PFParticleMonitoring_module.cc.

410 {}
std::array< std::vector< ProductInfo >, NumBranchTypes > const & art::ModuleBase::getConsumables ( ) const
inherited

Definition at line 43 of file ModuleBase.cc.

References art::ModuleBase::collector_, and art::ConsumesCollector::getConsumables().

44  {
45  return collector_.getConsumables();
46  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
std::array< std::vector< ProductInfo >, NumBranchTypes > const & getConsumables() const
double lar_pandora::PFParticleMonitoring::GetLength ( const art::Ptr< simb::MCParticle trueParticle,
const int  startT,
const int  endT 
) const
private

Find the length of the true particle trajectory through the active region of the detector.

Parameters
trueParticlethe input true particle
startTthe true start point
endTthe true end point

Definition at line 1440 of file PFParticleMonitoring_module.cc.

References simb::MCParticle::Vx(), simb::MCParticle::Vy(), and simb::MCParticle::Vz().

Referenced by analyze().

1443  {
1444  if (endT <= startT) return 0.0;
1445 
1446  double length(0.0);
1447 
1448  for (int nt = startT; nt < endT; ++nt) {
1449  const double dx(particle->Vx(nt + 1) - particle->Vx(nt));
1450  const double dy(particle->Vy(nt + 1) - particle->Vy(nt));
1451  const double dz(particle->Vz(nt + 1) - particle->Vz(nt));
1452  length += sqrt(dx * dx + dy * dy + dz * dz);
1453  }
1454 
1455  return length;
1456  }
void lar_pandora::PFParticleMonitoring::GetRecoToTrueMatches ( const PFParticlesToHits recoNeutrinosToHits,
const HitsToMCTruth trueHitsToNeutrinos,
MCTruthToPFParticles matchedNeutrinos,
MCTruthToHits matchedNeutrinoHits 
) const
private

Perform matching between true and reconstructed neutrino events.

Parameters
recoNeutrinosToHitsthe mapping from reconstructed neutrino events to hits
trueHitsToNeutrinosthe mapping from hits to true neutrino events
matchedNeutrinosthe output matches between reconstructed and true neutrinos
matchedNeutrinoHitsthe output matches between reconstructed neutrinos and hits

Definition at line 1204 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and GetRecoToTrueMatches().

1208  {
1209  PFParticleSet recoVeto;
1210  MCTruthSet trueVeto;
1211 
1212  this->GetRecoToTrueMatches(recoNeutrinosToHits,
1213  trueHitsToNeutrinos,
1214  matchedNeutrinos,
1215  matchedNeutrinoHits,
1216  recoVeto,
1217  trueVeto);
1218  }
void GetRecoToTrueMatches(const PFParticlesToHits &recoNeutrinosToHits, const HitsToMCTruth &trueHitsToNeutrinos, MCTruthToPFParticles &matchedNeutrinos, MCTruthToHits &matchedNeutrinoHits) const
Perform matching between true and reconstructed neutrino events.
std::set< art::Ptr< recob::PFParticle > > PFParticleSet
std::set< art::Ptr< simb::MCTruth > > MCTruthSet
void lar_pandora::PFParticleMonitoring::GetRecoToTrueMatches ( const PFParticlesToHits recoNeutrinosToHits,
const HitsToMCTruth trueHitsToNeutrinos,
MCTruthToPFParticles matchedNeutrinos,
MCTruthToHits matchedNeutrinoHits,
PFParticleSet recoVeto,
MCTruthSet trueVeto 
) const
private

Perform matching between true and reconstructed neutrino events.

Parameters
recoNeutrinosToHitsthe mapping from reconstructed neutrino events to hits
trueHitsToNeutrinosthe mapping from hits to true neutrino events
matchedNeutrinosthe output matches between reconstructed and true neutrinos
matchedNeutrinoHitsthe output matches between reconstructed neutrinos and hits
recoVetothe veto list for reconstructed particles
trueVetothe veto list for true particles

Definition at line 1222 of file PFParticleMonitoring_module.cc.

References GetRecoToTrueMatches(), and m_recursiveMatching.

1228  {
1229  bool foundMatches(false);
1230 
1231  for (PFParticlesToHits::const_iterator iter1 = recoNeutrinosToHits.begin(),
1232  iterEnd1 = recoNeutrinosToHits.end();
1233  iter1 != iterEnd1;
1234  ++iter1) {
1235  const art::Ptr<recob::PFParticle> recoNeutrino = iter1->first;
1236  if (vetoReco.count(recoNeutrino) > 0) continue;
1237 
1238  const HitVector& hitVector = iter1->second;
1239 
1240  MCTruthToHits truthContributionMap;
1241 
1242  for (HitVector::const_iterator iter2 = hitVector.begin(), iterEnd2 = hitVector.end();
1243  iter2 != iterEnd2;
1244  ++iter2) {
1245  const art::Ptr<recob::Hit> hit = *iter2;
1246 
1247  HitsToMCTruth::const_iterator iter3 = trueHitsToNeutrinos.find(hit);
1248  if (trueHitsToNeutrinos.end() == iter3) continue;
1249 
1250  const art::Ptr<simb::MCTruth> trueNeutrino = iter3->second;
1251  if (vetoTrue.count(trueNeutrino) > 0) continue;
1252 
1253  truthContributionMap[trueNeutrino].push_back(hit);
1254  }
1255 
1256  MCTruthToHits::const_iterator mIter = truthContributionMap.end();
1257 
1258  for (MCTruthToHits::const_iterator iter4 = truthContributionMap.begin(),
1259  iterEnd4 = truthContributionMap.end();
1260  iter4 != iterEnd4;
1261  ++iter4) {
1262  if ((truthContributionMap.end() == mIter) ||
1263  (iter4->second.size() > mIter->second.size())) {
1264  mIter = iter4;
1265  }
1266  }
1267 
1268  if (truthContributionMap.end() != mIter) {
1269  const art::Ptr<simb::MCTruth> trueNeutrino = mIter->first;
1270 
1271  MCTruthToHits::const_iterator iter5 = matchedNeutrinoHits.find(trueNeutrino);
1272 
1273  if ((matchedNeutrinoHits.end() == iter5) || (mIter->second.size() > iter5->second.size())) {
1274  matchedNeutrinos[trueNeutrino] = recoNeutrino;
1275  matchedNeutrinoHits[trueNeutrino] = mIter->second;
1276  foundMatches = true;
1277  }
1278  }
1279  }
1280 
1281  if (!foundMatches) return;
1282 
1283  for (MCTruthToPFParticles::const_iterator pIter = matchedNeutrinos.begin(),
1284  pIterEnd = matchedNeutrinos.end();
1285  pIter != pIterEnd;
1286  ++pIter) {
1287  vetoTrue.insert(pIter->first);
1288  vetoReco.insert(pIter->second);
1289  }
1290 
1291  if (m_recursiveMatching)
1292  this->GetRecoToTrueMatches(recoNeutrinosToHits,
1293  trueHitsToNeutrinos,
1294  matchedNeutrinos,
1295  matchedNeutrinoHits,
1296  vetoReco,
1297  vetoTrue);
1298  }
void GetRecoToTrueMatches(const PFParticlesToHits &recoNeutrinosToHits, const HitsToMCTruth &trueHitsToNeutrinos, MCTruthToPFParticles &matchedNeutrinos, MCTruthToHits &matchedNeutrinoHits) const
Perform matching between true and reconstructed neutrino events.
std::map< art::Ptr< simb::MCTruth >, HitVector > MCTruthToHits
intermediate_table::const_iterator const_iterator
Detector simulation of raw signals on wires.
std::vector< art::Ptr< recob::Hit > > HitVector
void lar_pandora::PFParticleMonitoring::GetRecoToTrueMatches ( const PFParticlesToHits recoParticlesToHits,
const HitsToMCParticles trueHitsToParticles,
MCParticlesToPFParticles matchedParticles,
MCParticlesToHits matchedHits 
) const
private

Perform matching between true and reconstructed particles.

Parameters
recoParticlesToHitsthe mapping from reconstructed particles to hits
trueHitsToParticlesthe mapping from hits to true particles
matchedParticlesthe output matches between reconstructed and true particles
matchedHitsthe output matches between reconstructed particles and hits
void lar_pandora::PFParticleMonitoring::GetRecoToTrueMatches ( const PFParticlesToHits recoParticlesToHits,
const HitsToMCParticles trueHitsToParticles,
MCParticlesToPFParticles matchedParticles,
MCParticlesToHits matchedHits,
PFParticleSet recoVeto,
MCParticleSet trueVeto 
) const
private

Perform matching between true and reconstructed particles.

Parameters
recoParticlesToHitsthe mapping from reconstructed particles to hits
trueHitsToParticlesthe mapping from hits to true particles
matchedParticlesthe output matches between reconstructed and true particles
matchedHitsthe output matches between reconstructed particles and hits
recoVetothe veto list for reconstructed particles
trueVetothe veto list for true particles
void lar_pandora::PFParticleMonitoring::GetStartAndEndPoints ( const art::Ptr< simb::MCParticle trueParticle,
int &  startT,
int &  endT 
) const
private

Find the start and end points of the true particle in the active region of detector.

Parameters
trueParticlethe input true particle
startTthe true start point
endTthe true end point

Definition at line 1412 of file PFParticleMonitoring_module.cc.

References simb::MCParticle::NumberTrajectoryPoints(), geo::GeometryCore::PositionToTPCptr(), simb::MCParticle::Vx(), simb::MCParticle::Vy(), and simb::MCParticle::Vz().

Referenced by analyze().

1415  {
1417 
1418  bool foundStartPosition(false);
1419 
1420  const int numTrajectoryPoints(static_cast<int>(particle->NumberTrajectoryPoints()));
1421 
1422  for (int nt = 0; nt < numTrajectoryPoints; ++nt) {
1423  geo::Point_t const pos{particle->Vx(nt), particle->Vy(nt), particle->Vz(nt)};
1424  if (theGeometry->PositionToTPCptr(pos) == nullptr) { continue; }
1425 
1426  // TODO: Apply fiducial cut due to readout window
1427 
1428  endT = nt;
1429  if (!foundStartPosition) {
1430  startT = endT;
1431  foundStartPosition = true;
1432  }
1433  }
1434 
1435  if (!foundStartPosition) throw cet::exception("LArPandora");
1436  }
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
Definition: geo_vectors.h:180
TPCGeo const * PositionToTPCptr(Point_t const &point) const
Returns the TPC at specified location.
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
Handle< TriggerResults > art::Observer::getTriggerResults ( Event const &  e) const
protectedinherited

Definition at line 75 of file Observer.cc.

References art::ProductRetriever::get(), and art::Observer::selectors_.

Referenced by art::OutputModule::doWriteEvent(), and art::Observer::wantAllEvents().

76  {
77  if (selectors_) {
78  return selectors_->getOneTriggerResults(e);
79  }
80 
81  // The following applies for cases where no SelectEvents entries
82  // exist.
83  Handle<TriggerResults> h;
84  if (e.get(empty_process_name, h)) {
85  return h;
86  }
87  return Handle<TriggerResults>{};
88  }
Float_t e
Definition: plot.C:35
std::optional< detail::ProcessAndEventSelectors > selectors_
Definition: Observer.h:79
std::unique_ptr< Worker > art::ModuleBase::makeWorker ( WorkerParams const &  wp)
inherited

Definition at line 37 of file ModuleBase.cc.

References art::ModuleBase::doMakeWorker(), and art::NumBranchTypes.

38  {
39  return doMakeWorker(wp);
40  }
virtual std::unique_ptr< Worker > doMakeWorker(WorkerParams const &wp)=0
template<typename T , BranchType BT>
ProductToken< T > art::ModuleBase::mayConsume ( InputTag const &  tag)
protectedinherited

Definition at line 82 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::mayConsume().

83  {
84  return collector_.mayConsume<T, BT>(tag);
85  }
ProductToken< T > mayConsume(InputTag const &)
ConsumesCollector collector_
Definition: ModuleBase.h:56
template<typename T , BranchType BT>
void art::ModuleBase::mayConsumeMany ( )
protectedinherited

Definition at line 96 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::mayConsumeMany().

97  {
98  collector_.mayConsumeMany<T, BT>();
99  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::ModuleBase::mayConsumeView ( InputTag const &  )
protectedinherited
template<typename T , BranchType BT>
ViewToken<T> art::ModuleBase::mayConsumeView ( InputTag const &  tag)
inherited

Definition at line 89 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::mayConsumeView().

90  {
91  return collector_.mayConsumeView<T, BT>(tag);
92  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
ViewToken< Element > mayConsumeView(InputTag const &)
ModuleDescription const & art::ModuleBase::moduleDescription ( ) const
inherited

Definition at line 13 of file ModuleBase.cc.

References art::errors::LogicError.

Referenced by art::OutputModule::doRespondToOpenInputFile(), art::OutputModule::doWriteEvent(), art::Modifier::fillProductDescriptions(), art::OutputModule::makePlugins_(), art::OutputWorker::OutputWorker(), reco::shower::LArPandoraModularShowerCreation::produce(), art::Modifier::registerProducts(), and art::OutputModule::registerProducts().

14  {
15  if (md_.has_value()) {
16  return *md_;
17  }
18 
20  "There was an error while calling moduleDescription().\n"}
21  << "The moduleDescription() base-class member function cannot be called\n"
22  "during module construction. To determine which module is "
23  "responsible\n"
24  "for calling it, find the '<module type>:<module "
25  "label>@Construction'\n"
26  "tag in the message prefix above. Please contact artists@fnal.gov\n"
27  "for guidance.\n";
28  }
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
std::optional< ModuleDescription > md_
Definition: ModuleBase.h:55
string const & art::Observer::processName ( ) const
protectedinherited

Definition at line 57 of file Observer.cc.

References art::Observer::process_name_.

Referenced by art::FileDumperOutput::printPrincipal().

58  {
59  return process_name_;
60  }
std::string process_name_
Definition: Observer.h:76
void lar_pandora::PFParticleMonitoring::reconfigure ( fhicl::ParameterSet const &  pset)

Definition at line 312 of file PFParticleMonitoring_module.cc.

References fhicl::ParameterSet::get(), m_addDaughterMCParticles, m_addDaughterPFParticles, m_backtrackerLabel, m_disableRealDataCheck, m_geantModuleLabel, m_hitfinderLabel, m_particleLabel, m_printDebug, m_recursiveMatching, m_trackLabel, m_useDaughterMCParticles, and m_useDaughterPFParticles.

Referenced by PFParticleMonitoring().

313  {
314  m_trackLabel = pset.get<std::string>("TrackModule", "pandoraTracks");
315  m_particleLabel = pset.get<std::string>("PFParticleModule", "pandora");
316  m_hitfinderLabel = pset.get<std::string>("HitFinderModule", "gaushit");
317  m_backtrackerLabel = pset.get<std::string>("BackTrackerModule", "gaushitTruthMatch");
318  m_geantModuleLabel = pset.get<std::string>("GeantModule", "largeant");
319 
320  m_useDaughterPFParticles = pset.get<bool>("UseDaughterPFParticles", false);
321  m_useDaughterMCParticles = pset.get<bool>("UseDaughterMCParticles", true);
322  m_addDaughterPFParticles = pset.get<bool>("AddDaughterPFParticles", true);
323  m_addDaughterMCParticles = pset.get<bool>("AddDaughterMCParticles", true);
324 
325  m_recursiveMatching = pset.get<bool>("RecursiveMatching", false);
326  m_printDebug = pset.get<bool>("PrintDebug", false);
327  m_disableRealDataCheck = pset.get<bool>("DisableRealDataCheck", false);
328  }
bool m_printDebug
switch for print statements (TODO: use message service!)
bool m_disableRealDataCheck
Whether to check if the input file contains real data before accessing MC information.
void art::ModuleBase::setModuleDescription ( ModuleDescription const &  md)
inherited

Definition at line 31 of file ModuleBase.cc.

References art::ModuleBase::md_.

32  {
33  md_ = md;
34  }
std::optional< ModuleDescription > md_
Definition: ModuleBase.h:55
void art::ModuleBase::sortConsumables ( std::string const &  current_process_name)
inherited

Definition at line 49 of file ModuleBase.cc.

References art::ModuleBase::collector_, and art::ConsumesCollector::sortConsumables().

50  {
51  // Now that we know we have seen all the consumes declarations,
52  // sort the results for fast lookup later.
53  collector_.sortConsumables(current_process_name);
54  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
void sortConsumables(std::string const &current_process_name)
bool art::Observer::wantAllEvents ( ) const
inlineprotectednoexceptinherited

Definition at line 31 of file Observer.h.

References e, art::Observer::getTriggerResults(), art::Observer::wantAllEvents_, and art::Observer::wantEvent().

32  {
33  return wantAllEvents_;
34  }
bool wantAllEvents_
Definition: Observer.h:75
bool art::Observer::wantEvent ( ScheduleID  id,
Event const &  e 
) const
protectedinherited

Definition at line 63 of file Observer.cc.

References art::Observer::rejectors_, art::Observer::selectors_, and art::Observer::wantAllEvents_.

Referenced by art::OutputModule::doEvent(), art::OutputModule::doWriteEvent(), and art::Observer::wantAllEvents().

64  {
65  if (wantAllEvents_) {
66  return true;
67  }
68  bool const select_event = selectors_ ? selectors_->matchEvent(id, e) : true;
69  bool const reject_event =
70  rejectors_ ? rejectors_->matchEvent(id, e) : false;
71  return select_event and not reject_event;
72  }
bool wantAllEvents_
Definition: Observer.h:75
std::optional< detail::ProcessAndEventSelectors > rejectors_
Definition: Observer.h:80
Float_t e
Definition: plot.C:35
std::optional< detail::ProcessAndEventSelectors > selectors_
Definition: Observer.h:79

Member Data Documentation

bool lar_pandora::PFParticleMonitoring::m_addDaughterMCParticles
private

Definition at line 256 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and reconfigure().

bool lar_pandora::PFParticleMonitoring::m_addDaughterPFParticles
private

Definition at line 255 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and reconfigure().

std::string lar_pandora::PFParticleMonitoring::m_backtrackerLabel
private

Definition at line 250 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and reconfigure().

double lar_pandora::PFParticleMonitoring::m_completeness
private

Definition at line 220 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and beginJob().

bool lar_pandora::PFParticleMonitoring::m_disableRealDataCheck
private

Whether to check if the input file contains real data before accessing MC information.

Definition at line 261 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and reconfigure().

int lar_pandora::PFParticleMonitoring::m_event
private

Definition at line 167 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and beginJob().

std::string lar_pandora::PFParticleMonitoring::m_geantModuleLabel
private

Definition at line 251 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and reconfigure().

std::string lar_pandora::PFParticleMonitoring::m_hitfinderLabel
private

Definition at line 247 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and reconfigure().

int lar_pandora::PFParticleMonitoring::m_index
private

Definition at line 168 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and beginJob().

double lar_pandora::PFParticleMonitoring::m_mcDirX
private

Definition at line 213 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and beginJob().

double lar_pandora::PFParticleMonitoring::m_mcDirY
private

Definition at line 214 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and beginJob().

double lar_pandora::PFParticleMonitoring::m_mcDirZ
private

Definition at line 215 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and beginJob().

double lar_pandora::PFParticleMonitoring::m_mcEndX
private

Definition at line 210 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and beginJob().

double lar_pandora::PFParticleMonitoring::m_mcEndY
private

Definition at line 211 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and beginJob().

double lar_pandora::PFParticleMonitoring::m_mcEndZ
private

Definition at line 212 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and beginJob().

double lar_pandora::PFParticleMonitoring::m_mcEnergy
private

Definition at line 216 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and beginJob().

int lar_pandora::PFParticleMonitoring::m_mcIsCC
private

Definition at line 182 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and beginJob().

int lar_pandora::PFParticleMonitoring::m_mcIsDecay
private

Definition at line 181 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and beginJob().

int lar_pandora::PFParticleMonitoring::m_mcIsNeutrino
private

Definition at line 179 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and beginJob().

int lar_pandora::PFParticleMonitoring::m_mcIsPrimary
private

Definition at line 180 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and beginJob().

double lar_pandora::PFParticleMonitoring::m_mcLength
private

Definition at line 217 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and beginJob().

int lar_pandora::PFParticleMonitoring::m_mcNuPdg
private

Definition at line 176 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and beginJob().

int lar_pandora::PFParticleMonitoring::m_mcParentPdg
private

Definition at line 177 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and beginJob().

int lar_pandora::PFParticleMonitoring::m_mcPdg
private

Definition at line 175 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and beginJob().

int lar_pandora::PFParticleMonitoring::m_mcPrimaryPdg
private

Definition at line 178 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and beginJob().

double lar_pandora::PFParticleMonitoring::m_mcStraightLength
private

Definition at line 218 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and beginJob().

int lar_pandora::PFParticleMonitoring::m_mcVertex
private

Definition at line 206 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and beginJob().

double lar_pandora::PFParticleMonitoring::m_mcVtxX
private

Definition at line 207 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and beginJob().

double lar_pandora::PFParticleMonitoring::m_mcVtxY
private

Definition at line 208 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and beginJob().

double lar_pandora::PFParticleMonitoring::m_mcVtxZ
private

Definition at line 209 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and beginJob().

int lar_pandora::PFParticleMonitoring::m_nDaughterPfos
private

Definition at line 173 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and beginJob().

int lar_pandora::PFParticleMonitoring::m_nMatchedHits
private

Definition at line 225 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and beginJob().

int lar_pandora::PFParticleMonitoring::m_nMatchedHitsU
private

Definition at line 235 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and beginJob().

int lar_pandora::PFParticleMonitoring::m_nMatchedHitsV
private

Definition at line 236 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and beginJob().

int lar_pandora::PFParticleMonitoring::m_nMatchedHitsW
private

Definition at line 237 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and beginJob().

int lar_pandora::PFParticleMonitoring::m_nMCHits
private

Definition at line 223 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and beginJob().

int lar_pandora::PFParticleMonitoring::m_nMCHitsU
private

Definition at line 227 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and beginJob().

int lar_pandora::PFParticleMonitoring::m_nMCHitsV
private

Definition at line 228 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and beginJob().

int lar_pandora::PFParticleMonitoring::m_nMCHitsW
private

Definition at line 229 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and beginJob().

int lar_pandora::PFParticleMonitoring::m_nMCParticles
private

Definition at line 170 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and beginJob().

int lar_pandora::PFParticleMonitoring::m_nNeutrinoPfos
private

Definition at line 171 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and beginJob().

int lar_pandora::PFParticleMonitoring::m_nPfoHits
private

Definition at line 224 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and beginJob().

int lar_pandora::PFParticleMonitoring::m_nPfoHitsU
private

Definition at line 231 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and beginJob().

int lar_pandora::PFParticleMonitoring::m_nPfoHitsV
private

Definition at line 232 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and beginJob().

int lar_pandora::PFParticleMonitoring::m_nPfoHitsW
private

Definition at line 233 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and beginJob().

int lar_pandora::PFParticleMonitoring::m_nPrimaryPfos
private

Definition at line 172 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and beginJob().

int lar_pandora::PFParticleMonitoring::m_nRecoWithoutTrueHits
private

Reconstructed hits which don't belong to any true particle - "missing".

Definition at line 242 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and beginJob().

int lar_pandora::PFParticleMonitoring::m_nTrueWithoutRecoHits
private

True hits which don't belong to any reconstructed particle - "available".

Definition at line 240 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and beginJob().

std::string lar_pandora::PFParticleMonitoring::m_particleLabel
private

Definition at line 249 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and reconfigure().

double lar_pandora::PFParticleMonitoring::m_pfoDirX
private

Definition at line 200 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and beginJob().

double lar_pandora::PFParticleMonitoring::m_pfoDirY
private

Definition at line 201 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and beginJob().

double lar_pandora::PFParticleMonitoring::m_pfoDirZ
private

Definition at line 202 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and beginJob().

double lar_pandora::PFParticleMonitoring::m_pfoEndX
private

Definition at line 197 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and beginJob().

double lar_pandora::PFParticleMonitoring::m_pfoEndY
private

Definition at line 198 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and beginJob().

double lar_pandora::PFParticleMonitoring::m_pfoEndZ
private

Definition at line 199 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and beginJob().

int lar_pandora::PFParticleMonitoring::m_pfoIsNeutrino
private

Definition at line 188 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and beginJob().

int lar_pandora::PFParticleMonitoring::m_pfoIsPrimary
private

Definition at line 189 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and beginJob().

int lar_pandora::PFParticleMonitoring::m_pfoIsStitched
private

Definition at line 190 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and beginJob().

double lar_pandora::PFParticleMonitoring::m_pfoLength
private

Definition at line 203 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and beginJob().

int lar_pandora::PFParticleMonitoring::m_pfoNuPdg
private

Definition at line 185 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and beginJob().

int lar_pandora::PFParticleMonitoring::m_pfoParentPdg
private

Definition at line 186 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and beginJob().

int lar_pandora::PFParticleMonitoring::m_pfoPdg
private

Definition at line 184 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and beginJob().

int lar_pandora::PFParticleMonitoring::m_pfoPrimaryPdg
private

Definition at line 187 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and beginJob().

double lar_pandora::PFParticleMonitoring::m_pfoStraightLength
private

Definition at line 204 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and beginJob().

int lar_pandora::PFParticleMonitoring::m_pfoTrack
private

Definition at line 192 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and beginJob().

int lar_pandora::PFParticleMonitoring::m_pfoVertex
private

Definition at line 193 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and beginJob().

double lar_pandora::PFParticleMonitoring::m_pfoVtxX
private

Definition at line 194 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and beginJob().

double lar_pandora::PFParticleMonitoring::m_pfoVtxY
private

Definition at line 195 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and beginJob().

double lar_pandora::PFParticleMonitoring::m_pfoVtxZ
private

Definition at line 196 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and beginJob().

TTree* lar_pandora::PFParticleMonitoring::m_pRecoTree
private

Definition at line 164 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and beginJob().

bool lar_pandora::PFParticleMonitoring::m_printDebug
private

switch for print statements (TODO: use message service!)

Definition at line 259 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and reconfigure().

double lar_pandora::PFParticleMonitoring::m_purity
private

Definition at line 221 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and beginJob().

bool lar_pandora::PFParticleMonitoring::m_recursiveMatching
private

Definition at line 258 of file PFParticleMonitoring_module.cc.

Referenced by GetRecoToTrueMatches(), and reconfigure().

int lar_pandora::PFParticleMonitoring::m_run
private

Definition at line 166 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and beginJob().

double lar_pandora::PFParticleMonitoring::m_spacepointsMaxX
private

Definition at line 245 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and beginJob().

double lar_pandora::PFParticleMonitoring::m_spacepointsMinX
private

Definition at line 244 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and beginJob().

std::string lar_pandora::PFParticleMonitoring::m_trackLabel
private

Definition at line 248 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and reconfigure().

bool lar_pandora::PFParticleMonitoring::m_useDaughterMCParticles
private

Definition at line 254 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and reconfigure().

bool lar_pandora::PFParticleMonitoring::m_useDaughterPFParticles
private

Definition at line 253 of file PFParticleMonitoring_module.cc.

Referenced by analyze(), and reconfigure().


The documentation for this class was generated from the following file: