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);
142 Node(
MCHierarchy &hierarchy,
const pandora::MCParticle *pMCParticle,
const int tier = 1);
152 Node(
MCHierarchy &hierarchy,
const pandora::MCParticleList &mcParticleList,
const pandora::CaloHitList &caloHitList,
const int tier = 1);
164 bool IsReconstructable()
const;
172 void FillHierarchy(
const pandora::MCParticle *pRoot,
const FoldingParameters &foldParameters);
179 void FillFlat(
const pandora::MCParticle *pRoot);
186 const NodeVector &GetChildren()
const;
200 const pandora::MCParticle *GetLeadingMCParticle()
const;
207 const pandora::MCParticleList &GetMCParticles()
const;
214 const pandora::CaloHitList &GetCaloHits()
const;
221 int GetParticleId()
const;
228 int GetHierarchyTier()
const;
235 bool IsNeutrinoInduced()
const;
242 bool IsTestBeamParticle()
const;
249 bool IsCosmicRay()
const;
256 bool IsLeadingLepton()
const;
263 const std::string ToString(
const std::string &prefix)
const;
269 void SetLeadingLepton();
323 void FillHierarchy(
const pandora::MCParticleList &mcParticleList,
const pandora::CaloHitList &caloHitList,
const FoldingParameters &foldParameters);
334 void InterpretHierarchy(
const pandora::MCParticle *
const pRoot, pandora::MCParticleList &leadingParticles,
335 pandora::MCParticleList &childParticles,
const float cosAngleTolerance)
const;
342 const pandora::MCParticle *GetNeutrino()
const;
351 const NodeVector &GetInteractions(
const pandora::MCParticle *pRoot)
const;
358 void GetRootMCParticles(pandora::MCParticleList &rootMCParticles)
const;
366 void GetFlattenedNodes(
const pandora::MCParticle *
const pRoot, NodeVector &nodeVector)
const;
373 void RegisterNode(
const Node *pNode);
380 const std::string ToString()
const;
391 void CollectContinuations(
const pandora::MCParticle *pRoot, pandora::MCParticleList &continuingParticles,
392 pandora::MCParticleList &childParticles,
const float cosAngleTolerance)
const;
401 bool IsReconstructable(
const pandora::MCParticle *pMCParticle)
const;
410 bool IsReconstructable(
const pandora::CaloHitList &caloHits)
const;
451 Node(
const RecoHierarchy &hierarchy,
const pandora::PfoList &pfoList,
const pandora::CaloHitList &caloHitList);
464 void FillHierarchy(
const pandora::ParticleFlowObject *pRoot,
const FoldingParameters &foldParameters);
471 void FillFlat(
const pandora::ParticleFlowObject *pRoot);
478 const NodeVector &GetChildren()
const;
485 const pandora::PfoList &GetRecoParticles()
const;
492 const pandora::ParticleFlowObject *GetLeadingPfo()
const;
499 const pandora::CaloHitList &GetCaloHits()
const;
507 int GetParticleId()
const;
514 const std::string ToString(
const std::string &prefix)
const;
557 void FillHierarchy(
const pandora::PfoList &pfoList,
const FoldingParameters &foldParameters);
566 const NodeVector &GetInteractions(
const pandora::ParticleFlowObject *pRoot)
const;
573 void GetRootPfos(pandora::PfoList &rootPfos)
const;
581 void GetFlattenedNodes(
const pandora::ParticleFlowObject *
const pRoot, NodeVector &nodeVector)
const;
588 const pandora::ParticleFlowObject *GetNeutrino()
const;
595 const std::string ToString()
const;
674 float GetCompleteness(
const RecoHierarchy::Node *pReco,
const bool adcWeighted =
false)
const;
692 size_t GetNRecoMatches()
const;
701 bool IsQuality(
const QualityCuts &qualityCuts)
const;
713 float GetPurity(
const pandora::CaloHitVector &intersection,
const pandora::CaloHitList &recoHits,
const bool adcWeighted)
const;
724 float GetCompleteness(
const pandora::CaloHitVector &intersection,
const pandora::CaloHitList &mcHits,
const bool adcWeighted)
const;
770 const MCMatchesVector &GetMatches(
const pandora::MCParticle *
const pRoot)
const;
784 unsigned int GetNMCNodes(
const pandora::MCParticle *
const pRoot)
const;
793 unsigned int GetNNeutrinoMCNodes(
const pandora::MCParticle *
const pRoot)
const;
802 unsigned int GetNCosmicRayMCNodes(
const pandora::MCParticle *
const pRoot)
const;
811 unsigned int GetNTestBeamMCNodes(
const pandora::MCParticle *
const pRoot)
const;
832 void GetRootMCParticles(pandora::MCParticleList &rootMCParticles)
const;
865 static void FillMCHierarchy(
const pandora::MCParticleList &mcParticleList,
const pandora::CaloHitList &caloHitList,
886 typedef std::set<const pandora::ParticleFlowObject *>
PfoSet;
894 static void GetMCPrimaries(
const pandora::MCParticle *pRoot, MCParticleSet &primaries);
902 static void GetRecoPrimaries(
const pandora::ParticleFlowObject *pRoot, PfoSet &primaries);
917 return m_mcParticles;
931 return m_mainParticle;
959 return m_isLeadingLepton;
966 m_isLeadingLepton =
true;
989 return m_pMCParticle;
1003 return m_recoNodes.size();
1011 if (m_matches.find(pRoot) == m_matches.end())
1012 throw pandora::StatusCodeException(pandora::STATUS_CODE_NOT_FOUND);
1014 return m_matches.at(pRoot);
1021 return m_unmatchedReco;
1028 return m_mcHierarchy;
1035 return m_recoHierarchy;
1042 return m_qualityCuts;
1047 #endif // #ifndef LAR_HIERARCHY_HELPER_H static void GetRecoPrimaries(const pandora::ParticleFlowObject *pRoot, PfoSet &primaries)
Retrieves the primary PFOs from a list and returns the root (neutrino) for hierarchy, if it exists.
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 MCMatchesVector & GetMatches(const pandora::MCParticle *const pRoot) const
Retrieve the vector of matches (this will include null matches - i.e. MC nodes with no corresponding ...
const RecoHierarchy & GetRecoHierarchy() const
Retrieve the reco hierarchy used for the matching.
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.
const pandora::ParticleFlowObject * GetLeadingPfo() const
Retrieve the leading reco particle for this node.
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.
static void GetMCPrimaries(const pandora::MCParticle *pRoot, MCParticleSet &primaries)
Retrieves the primary MC particles from a list and returns the root (neutrino) for hierarchy...
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)
std::map< const pandora::ParticleFlowObject *, NodeVector > RecoNodeVectorMap
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.
bool m_isLeadingLepton
Whether or not this node is the leading lepton.
static void MatchHierarchies(MatchInfo &matchInfo)
Finds the matches between reconstructed and MC hierarchies.
pandora::CaloHitList m_caloHits
The list of calo hits of which this node is composed.
const MCHierarchy::Node * GetMC() const
Retrieve the MC node.
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.
std::vector< const Node * > NodeVector
Header file for the lar monte carlo particle helper helper class.
RecoNodeVectorMap m_interactions
Map from the root PFO (e.g. neutrino) to primaries.
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.
void Print(G4Element &ele)
NodeVector m_children
The child nodes of this nodea.
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.
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.
const pandora::ParticleFlowObject * m_mainPfo
The leading particle flow object for this node.
std::vector< MCMatches > MCMatchesVector
pandora::CaloHitList m_caloHits
The list of calo hits of which this node is composed.
const MCHierarchy & GetMCHierarchy() const
Retrieve the MC hierarchy used for the matching.
const MCHierarchy & m_mcHierarchy
The MC hierarchy for the matching procedure.
void SetLeadingLepton()
Tags the particle as the leading lepton.
const RecoHierarchy & m_recoHierarchy
The Reco hierarchy for the matching procedure.
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.
std::list< const Node * > NodeList
int m_nextNodeId
The ID to use for the next node.
const unsigned int m_minHits
the minimum number of primary good Hits
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.
MCNodeVectorMap m_interactions
Map from incident particles (e.g. neutrino) to primaries.
bool IsNeutrinoInduced() const
Check if this is a particle induced by a neutrino interaction.
std::map< const pandora::MCParticle *, MCMatchesVector > InteractionInfo
std::map< const pandora::MCParticle *, NodeVector > MCNodeVectorMap
bool IsTestBeamParticle() const
Check if this is a test beam particle.
std::set< const pandora::ParticleFlowObject * > PfoSet
const float m_minCompleteness
The minimum completeness for a match to be considered good.
std::map< const Node *, int > m_nodeToIdMap
A map from nodes to unique ids.
InteractionInfo m_matches
The map between an interaction and the vector of good matches from MC to reco.