8 #ifndef LAR_HIERARCHY_HELPER_H 9 #define LAR_HIERARCHY_HELPER_H 1 11 #include "Pandora/PandoraInternal.h" 13 #include "Helpers/MCParticleHelper.h" 79 QualityCuts(
const float minPurity,
const float minCompleteness);
115 ReconstructabilityCriteria(
const unsigned int minHits,
const unsigned int minHitsForGoodView,
const unsigned int minGoodViews,
116 const bool removeNeutrons);
141 Node(
MCHierarchy &hierarchy,
const pandora::MCParticle *pMCParticle,
const int tier = 1);
151 Node(
MCHierarchy &hierarchy,
const pandora::MCParticleList &mcParticleList,
const pandora::CaloHitList &caloHitList,
const int tier = 1);
163 bool IsReconstructable()
const;
171 void FillHierarchy(
const pandora::MCParticle *pRoot,
const FoldingParameters &foldParameters);
178 void FillFlat(
const pandora::MCParticle *pRoot);
185 const NodeVector &GetChildren()
const;
199 const pandora::MCParticle *GetLeadingMCParticle()
const;
206 const pandora::MCParticleList &GetMCParticles()
const;
213 const pandora::CaloHitList &GetCaloHits()
const;
220 int GetParticleId()
const;
227 int GetHierarchyTier()
const;
234 bool IsNeutrinoInduced()
const;
241 bool IsTestBeamParticle()
const;
248 bool IsCosmicRay()
const;
255 bool IsLeadingLepton()
const;
268 void SetLeadingLepton();
322 void FillHierarchy(
const pandora::MCParticleList &mcParticleList,
const pandora::CaloHitList &caloHitList,
const FoldingParameters &foldParameters);
333 void InterpretHierarchy(
const pandora::MCParticle *
const pRoot, pandora::MCParticleList &leadingParticles,
334 pandora::MCParticleList &childParticles,
const float cosAngleTolerance)
const;
341 const pandora::MCParticle *GetNeutrino()
const;
348 const NodeVector &GetRootNodes()
const;
355 void GetFlattenedNodes(NodeVector &nodeVector)
const;
362 void RegisterNode(
const Node *pNode);
376 bool IsNeutrinoHierarchy()
const;
383 bool IsTestBeamHierarchy()
const;
394 void CollectContinuations(
const pandora::MCParticle *pRoot, pandora::MCParticleList &continuingParticles,
395 pandora::MCParticleList &childParticles,
const float cosAngleTolerance)
const;
404 bool IsReconstructable(
const pandora::MCParticle *pMCParticle)
const;
413 bool IsReconstructable(
const pandora::CaloHitList &caloHits)
const;
454 Node(
const RecoHierarchy &hierarchy,
const pandora::PfoList &pfoList,
const pandora::CaloHitList &caloHitList);
467 void FillHierarchy(
const pandora::ParticleFlowObject *pRoot,
const FoldingParameters &foldParameters);
474 void FillFlat(
const pandora::ParticleFlowObject *pRoot);
481 const NodeVector &GetChildren()
const;
488 const pandora::PfoList &GetRecoParticles()
const;
495 const pandora::CaloHitList &GetCaloHits()
const;
503 int GetParticleId()
const;
552 void FillHierarchy(
const pandora::PfoList &pfoList,
const FoldingParameters &foldParameters);
559 const NodeVector &GetRootNodes()
const;
566 void GetFlattenedNodes(NodeVector &nodeVector)
const;
573 const pandora::ParticleFlowObject *GetNeutrino()
const;
660 float GetCompleteness(
const RecoHierarchy::Node *pReco,
const bool adcWeighted =
false)
const;
678 size_t GetNRecoMatches()
const;
687 bool IsQuality(
const QualityCuts &qualityCuts)
const;
699 float GetPurity(
const pandora::CaloHitVector &intersection,
const pandora::CaloHitList &recoHits,
const bool adcWeighted)
const;
710 float GetCompleteness(
const pandora::CaloHitVector &intersection,
const pandora::CaloHitList &mcHits,
const bool adcWeighted)
const;
750 const MCMatchesVector &GetMatches()
const;
762 const pandora::MCParticle *GetMCNeutrino()
const;
769 const pandora::ParticleFlowObject *GetRecoNeutrino()
const;
776 unsigned int GetNMCNodes()
const;
783 unsigned int GetNNeutrinoMCNodes()
const;
790 unsigned int GetNCosmicRayMCNodes()
const;
797 unsigned int GetNTestBeamMCNodes()
const;
835 static void FillMCHierarchy(
const pandora::MCParticleList &mcParticleList,
const pandora::CaloHitList &caloHitList,
858 typedef std::set<const pandora::ParticleFlowObject *>
PfoSet;
868 static const pandora::MCParticle *
GetMCPrimaries(
const pandora::MCParticleList &mcParticleList, MCParticleSet &primaries);
878 static const pandora::ParticleFlowObject *
GetRecoPrimaries(
const pandora::PfoList &pfoList, PfoSet &primaries);
893 return m_mcParticles;
907 return m_mainParticle;
935 return m_isLeadingLepton;
942 m_isLeadingLepton =
true;
964 return m_pNeutrino !=
nullptr;
971 return m_pNeutrino ==
nullptr;
1002 return m_pMCParticle;
1016 return m_recoNodes.size();
1031 return m_unmatchedReco;
1038 return m_pMCNeutrino;
1045 return m_pRecoNeutrino;
1052 return m_qualityCuts;
1057 #endif // #ifndef LAR_HIERARCHY_HELPER_H const pandora::MCParticle * m_pNeutrino
The incident neutrino, if it exists.
MCMatchesVector m_matches
The vector of good matches from MC to reco.
MCMatchesVector m_goodMatches
The vector of good matches - above threshold one reco to one MC matches.
const unsigned int m_minHitsForGoodView
the minimum number of Hits for a good view
std::set< const pandora::MCParticle * > MCParticleSet
FoldingParameters()
Default constructor.
Header file for the pfo helper class.
const MCHierarchy::Node * m_pMCParticle
MC node associated with any matches.
const NodeVector & GetChildren() const
Return the vector of children for this node.
bool m_foldToTier
Whether or not to apply folding based on particle tier.
int m_tier
If folding to a tier, the tier to be combined with its child particles.
RecoHierarchy::NodeVector m_recoNodes
Matched reco nodes.
std::vector< const Node * > NodeVector
pandora::IntVector m_sharedHits
Number of shared hits for each match.
int m_pdg
The PDG code of the leading MC particle for this node.
std::map< const pandora::MCParticle *, pandora::CaloHitList > m_mcToHitsMap
The map between MC particles and calo hits.
const RecoHierarchy & m_hierarchy
The parent reco hierarchy.
const RecoHierarchy::NodeVector & GetRecoMatches() const
Retrieve the vector of matched reco nodes.
int m_pdg
The particle ID (track = muon, shower = electron)
QualityCuts m_qualityCuts
The quality cuts to be applied to matches.
std::vector< int > IntVector
size_t GetNRecoMatches() const
Get the number of reco nodes matched (both above and below quality cut thresholds) to the MC node...
const pandora::CaloHitList & GetCaloHits() const
Retrieve the CaloHits associated with this node.
static void MatchHierarchies(const MCHierarchy &mcHierarchy, const RecoHierarchy &recoHierarchy, MatchInfo &matchInfo)
Finds the matches between reconstructed and MC hierarchies.
const pandora::ParticleFlowObject * m_pNeutrino
The incident neutrino, if it exists.
bool m_isLeadingLepton
Whether or not this node is the leading lepton.
static const pandora::ParticleFlowObject * GetRecoPrimaries(const pandora::PfoList &pfoList, PfoSet &primaries)
Retrieves the primary PFOs from a list and returns the root (neutrino) for hierarchy, if it exists.
pandora::CaloHitList m_caloHits
The list of calo hits of which this node is composed.
const MCHierarchy::Node * GetMC() const
Retrieve the MC node.
const MCMatchesVector & GetMatches() const
Retrieve the vector of matches (this will include null matches - i.e. MC nodes with no corresponding ...
bool IsNeutrinoHierarchy() const
Check if this is a neutrino hierarchy.
static void FillRecoHierarchy(const pandora::PfoList &pfoList, const FoldingParameters &foldParameters, RecoHierarchy &hierarchy)
Fill a reconstructed hierarchy based on the specified folding criteria (see RecoHierarchy::FillHierar...
const pandora::MCParticle * GetLeadingMCParticle() const
Retrieve the leading MC particle associated with this node.
const NodeVector & GetRootNodes() const
Retrieve the root nodes in this hierarchy.
std::vector< const Node * > NodeVector
Header file for the lar monte carlo particle helper helper class.
const pandora::MCParticle * GetNeutrino() const
Retrieve the neutrino at the root of the hierarchy if it exists.
const float m_minPurity
The minimum purity for a match to be considered good.
NodeVector m_children
The child nodes of this node.
ReconstructabilityCriteria class.
bool IsCosmicRay() const
Check if this is a cosmic ray particle.
std::list< const Node * > NodeList
int GetParticleId() const
Retrieve the PDG code for the leading particle in this node.
pandora::PfoList m_pfos
The list of PFOs of which this node is composed.
float m_cosAngleTolerance
Cosine of the maximum angle at which topologies can be considered continuous.
NodeVector m_rootNodes
The leading nodes (e.g. primary particles, cosmic rays, ...)
NodeVector m_children
The child nodes of this node.
LArHierarchyHelper class.
const QualityCuts & GetQualityCuts() const
Retrieve the quality cuts for matching.
bool IsLeadingLepton() const
Returns whether or not this particle is the leading lepton in the event.
bool m_foldDynamic
Whether or not to use process and topological information to make folding decisions.
const RecoHierarchy::NodeVector & GetUnmatchedReco() const
Retrieve the vector of unmatched reco nodes.
ReconstructabilityCriteria m_recoCriteria
The criteria used to determine if the node is reconstructable.
const NodeVector & GetChildren() const
Return the vector of children for this node.
bool m_foldToLeadingShowers
Whether or not to fold shower children to the leading shower particle.
const pandora::ParticleFlowObject * GetNeutrino() const
Retrieve the neutrino at the root of the hierarchy if it exists.
MCHierarchy & m_hierarchy
The parent MC hierarchy.
const bool m_removeNeutrons
whether to remove neutrons and their downstream particles
int GetHierarchyTier() const
Retrieve the hierarchy tier of this node.
const pandora::MCParticle * m_mainParticle
The leading MC particle for this node.
std::vector< MCMatches > MCMatchesVector
const pandora::MCParticle * GetMCNeutrino() const
Retrieve the parent MC neutrino if it exists.
pandora::CaloHitList m_caloHits
The list of calo hits of which this node is composed.
MCMatchesVector m_aboveThresholdMatches
The vector of matches that pass quality but with multiple reco matches to the MC. ...
void SetLeadingLepton()
Tags the particle as the leading lepton.
static void FillMCHierarchy(const pandora::MCParticleList &mcParticleList, const pandora::CaloHitList &caloHitList, const FoldingParameters &foldParameters, MCHierarchy &hierarchy)
Fill an MC hierarchy based on the specified folding criteria (see MCHierarchy::FillHierarchy for deta...
pandora::MCParticleList m_mcParticles
The list of MC particles of which this node is composed.
MCHierarchy::NodeVector m_unmatchedMC
The vector of unmatched MC nodes.
std::list< const Node * > NodeList
const NodeVector & GetRootNodes() const
Retrieve the root nodes in this hierarchy.
bool IsTestBeamHierarchy() const
Check if this is a test beam hierarchy.
int m_nextNodeId
The ID to use for the next node.
const unsigned int m_minHits
the minimum number of primary good Hits
MCMatchesVector m_subThresholdMatches
The vector of matches that don't pass quality cuts.
RecoHierarchy::NodeVector m_unmatchedReco
The vector of unmatched reco nodes.
int m_tier
The hierarchy tier for this node.
const unsigned int m_minGoodViews
the minimum number of primary good views
const pandora::MCParticleList & GetMCParticles() const
Retrieve the MC particles associated with this node.
bool IsNeutrinoInduced() const
Check if this is a particle induced by a neutrino interaction.
const pandora::MCParticle * m_pMCNeutrino
The parent neutrino if it exists.
bool IsTestBeamParticle() const
Check if this is a test beam particle.
const pandora::ParticleFlowObject * GetRecoNeutrino() const
Retrieve the parent reco neutrino if it exists.
std::set< const pandora::ParticleFlowObject * > PfoSet
const pandora::ParticleFlowObject * m_pRecoNeutrino
The parent neutrino if it exists.
const float m_minCompleteness
The minimum completeness for a match to be considered good.
static const pandora::MCParticle * GetMCPrimaries(const pandora::MCParticleList &mcParticleList, MCParticleSet &primaries)
Retrieves the primary MC particles from a list and returns the root (neutrino) for hierarchy...
std::map< const Node *, int > m_nodeToIdMap
A map from nodes to unique ids.
NodeVector m_rootNodes
The leading nodes (e.g. primary particles, cosmic rays, ...)