LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
|
MCHierarchy class. More...
#include "LArHierarchyHelper.h"
Classes | |
class | Node |
Node class. More... | |
class | ReconstructabilityCriteria |
ReconstructabilityCriteria class. More... | |
Public Types | |
typedef std::vector< const Node * > | NodeVector |
typedef std::list< const Node * > | NodeList |
typedef std::map< const pandora::MCParticle *, NodeVector > | MCNodeVectorMap |
Public Member Functions | |
MCHierarchy () | |
Default constructor. More... | |
MCHierarchy (const ReconstructabilityCriteria &recoCriteria) | |
Construct a new MCHierarchy object using specified reconstructability criteria. More... | |
virtual | ~MCHierarchy () |
Destructor. More... | |
void | FillHierarchy (const pandora::MCParticleList &mcParticleList, const pandora::CaloHitList &caloHitList, const FoldingParameters &foldParameters) |
Creates an MC hierarchy representation. Without folding this will be a mirror image of the standard MCParticle relationships. However, with folding options selected the hierarchy structure will group together MC particles into nodes based on the folding requirements. More... | |
void | InterpretHierarchy (const pandora::MCParticle *const pRoot, pandora::MCParticleList &leadingParticles, pandora::MCParticleList &childParticles, const float cosAngleTolerance) const |
Interpret the hierarchy below a particular particle to determine if and how it should be folded. Folded particles are added to the leadingParticles list and child particles are added to the childParticles list. More... | |
const pandora::MCParticle * | GetNeutrino () const |
Retrieve the neutrino at the root of the hierarchy if it exists. More... | |
const NodeVector & | GetInteractions (const pandora::MCParticle *pRoot) const |
Retrieve the root nodes in this hierarchy. More... | |
void | GetRootMCParticles (pandora::MCParticleList &rootMCParticles) const |
Retrieve the root MC particles of the interaction hierarchies. More... | |
void | GetFlattenedNodes (const pandora::MCParticle *const pRoot, NodeVector &nodeVector) const |
Retrieve a flat vector of the ndoes in the hierarchy. More... | |
void | RegisterNode (const Node *pNode) |
Register a node with the hierarchy. More... | |
const std::string | ToString () const |
Produce a string representation of the hierarchy. More... | |
Private Member Functions | |
void | CollectContinuations (const pandora::MCParticle *pRoot, pandora::MCParticleList &continuingParticles, pandora::MCParticleList &childParticles, const float cosAngleTolerance) const |
Identify downstream particles that represent continuations of the parent particle from a reconstruction perspective. More... | |
bool | IsReconstructable (const pandora::MCParticle *pMCParticle) const |
Checks if an individual particle meets reconstructability criteria. More... | |
bool | IsReconstructable (const pandora::CaloHitList &caloHits) const |
Checks if a set of hits meet reconstructability criteria. More... | |
Private Attributes | |
MCNodeVectorMap | m_interactions |
Map from incident particles (e.g. neutrino) to primaries. More... | |
ReconstructabilityCriteria | m_recoCriteria |
The criteria used to determine if the node is reconstructable. More... | |
std::map< const pandora::MCParticle *, pandora::CaloHitList > | m_mcToHitsMap |
The map between MC particles and calo hits. More... | |
std::map< const Node *, int > | m_nodeToIdMap |
A map from nodes to unique ids. More... | |
int | m_nextNodeId |
The ID to use for the next node. More... | |
MCHierarchy class.
Definition at line 88 of file LArHierarchyHelper.h.
typedef std::map<const pandora::MCParticle *, NodeVector> lar_content::LArHierarchyHelper::MCHierarchy::MCNodeVectorMap |
Definition at line 127 of file LArHierarchyHelper.h.
typedef std::list<const Node *> lar_content::LArHierarchyHelper::MCHierarchy::NodeList |
Definition at line 126 of file LArHierarchyHelper.h.
typedef std::vector<const Node *> lar_content::LArHierarchyHelper::MCHierarchy::NodeVector |
Definition at line 124 of file LArHierarchyHelper.h.
lar_content::LArHierarchyHelper::MCHierarchy::MCHierarchy | ( | ) |
Default constructor.
Definition at line 78 of file LArHierarchyHelper.cc.
lar_content::LArHierarchyHelper::MCHierarchy::MCHierarchy | ( | const ReconstructabilityCriteria & | recoCriteria | ) |
Construct a new MCHierarchy object using specified reconstructability criteria.
recoCriteria | The reconstructability criteria to be applied |
Definition at line 85 of file LArHierarchyHelper.cc.
|
virtual |
Destructor.
Definition at line 93 of file LArHierarchyHelper.cc.
References m_interactions.
|
private |
Identify downstream particles that represent continuations of the parent particle from a reconstruction perspective.
pRoot | The root MC particle |
continuingParticles | An output list of the particles identified as continuations |
childParticles | An output list of the particles identified as child particles given any continuations |
cosAngleTolerance | The cosine of the maximum angle for which trajectories are considered continuous |
Definition at line 377 of file LArHierarchyHelper.cc.
References lar_content::LArMCParticleHelper::AreTopologicallyContinuous(), lar_content::LArMCParticleHelper::IsElasticScatter(), lar_content::LArMCParticleHelper::IsInelasticScatter(), m_recoCriteria, lar_content::LArHierarchyHelper::MCHierarchy::ReconstructabilityCriteria::m_removeNeutrons, and lar_content::MC_PROC_N_CAPTURE.
Referenced by InterpretHierarchy().
void lar_content::LArHierarchyHelper::MCHierarchy::FillHierarchy | ( | const pandora::MCParticleList & | mcParticleList, |
const pandora::CaloHitList & | caloHitList, | ||
const FoldingParameters & | foldParameters | ||
) |
Creates an MC hierarchy representation. Without folding this will be a mirror image of the standard MCParticle relationships. However, with folding options selected the hierarchy structure will group together MC particles into nodes based on the folding requirements.
If only folding back to primaries, the hierarchy will be relatively flat, with a top-level neutrino or test beam particle, if appropriate, and then a set of leaf nodes, one for each primary particles also containing the MC particles (and corresponding hits) from daughter particles.
If only folding back to leading shower particles, the hierarchy will largely mirror the standard MCParticle hierarchy, but, when a shower particle is reached (for this purpose an electron or photon), this particle and all daughter particles will be represented by a single leaf node.
If folding back to both primary and leading shower particles the hierarchy will again be rather flat, but in this case, if a primary track-like particle (i.e. not an electron or photon) has a downstream shower particle then all downstream particles above the shower-like particle will be folded into the primary node, but a new, daughter leaf node will be created for the shower-like particle and all of its daughters, and a parent-child relationship will be formed between the primary node and shower node.
mcParticleList | The list of MC particles with which to fill the hierarchy |
caloHitList | The list of hits with which to fill the hierarchy |
foldParameters | The folding parameters to use for the hierarchy |
Definition at line 106 of file LArHierarchyHelper.cc.
References util::abs(), lar_content::LArMCParticleHelper::GetAllDescendentMCParticles(), lar_content::LArHierarchyHelper::MCHierarchy::Node::GetLeadingMCParticle(), lar_content::LArHierarchyHelper::GetMCPrimaries(), InterpretHierarchy(), lar_content::LArHierarchyHelper::FoldingParameters::m_cosAngleTolerance, lar_content::LArHierarchyHelper::FoldingParameters::m_foldDynamic, lar_content::LArHierarchyHelper::FoldingParameters::m_foldToLeadingShowers, lar_content::LArHierarchyHelper::FoldingParameters::m_foldToTier, m_interactions, m_mcToHitsMap, m_recoCriteria, lar_content::LArHierarchyHelper::MCHierarchy::ReconstructabilityCriteria::m_removeNeutrons, lar_content::LArHierarchyHelper::FoldingParameters::m_tier, lar_content::LArHierarchyHelper::MCHierarchy::Node::SetLeadingLepton(), and lar_content::LArMCParticleHelper::SortByMomentum().
Referenced by lar_content::LArHierarchyHelper::FillMCHierarchy().
void lar_content::LArHierarchyHelper::MCHierarchy::GetFlattenedNodes | ( | const pandora::MCParticle *const | pRoot, |
NodeVector & | nodeVector | ||
) | const |
Retrieve a flat vector of the ndoes in the hierarchy.
pRoot | The root MC particle for an interaction |
nodeVector | The output vector for the nodes in the hierarchy in breadth first order |
Definition at line 442 of file LArHierarchyHelper.cc.
References m_interactions.
Referenced by lar_content::LArHierarchyHelper::MatchInfo::Match(), and lar_content::HierarchyMonitoringAlgorithm::Run().
const LArHierarchyHelper::MCHierarchy::NodeVector & lar_content::LArHierarchyHelper::MCHierarchy::GetInteractions | ( | const pandora::MCParticle * | pRoot | ) | const |
Retrieve the root nodes in this hierarchy.
pRoot | The root of the interaction hierarchy |
Definition at line 269 of file LArHierarchyHelper.cc.
References m_interactions.
const pandora::MCParticle* lar_content::LArHierarchyHelper::MCHierarchy::GetNeutrino | ( | ) | const |
Retrieve the neutrino at the root of the hierarchy if it exists.
void lar_content::LArHierarchyHelper::MCHierarchy::GetRootMCParticles | ( | pandora::MCParticleList & | rootMCParticles | ) | const |
Retrieve the root MC particles of the interaction hierarchies.
rootMCParticles | The output list of root MC particles |
Definition at line 279 of file LArHierarchyHelper.cc.
References m_interactions.
Referenced by lar_content::LArHierarchyHelper::MatchInfo::Match(), lar_content::LArHierarchyHelper::MatchInfo::Print(), and lar_content::HierarchyMonitoringAlgorithm::Run().
void lar_content::LArHierarchyHelper::MCHierarchy::InterpretHierarchy | ( | const pandora::MCParticle *const | pRoot, |
pandora::MCParticleList & | leadingParticles, | ||
pandora::MCParticleList & | childParticles, | ||
const float | cosAngleTolerance | ||
) | const |
Interpret the hierarchy below a particular particle to determine if and how it should be folded. Folded particles are added to the leadingParticles list and child particles are added to the childParticles list.
pRoot | The root of the hierarchy to interpret |
leadingParticles | The output list of particles that should be folded into the root particle |
childParticles | The output list of particles that should be considered children of the folded particle |
cosAngleTolerance | The cosine of the maximum angle for which trajectories are considered continuous |
Definition at line 287 of file LArHierarchyHelper.cc.
References lar_content::LArMCParticleHelper::AreTopologicallyContinuous(), CollectContinuations(), lar_content::LArMCParticleHelper::GetAllDescendentMCParticles(), lar_content::LArMCParticleHelper::IsElasticScatter(), lar_content::LArMCParticleHelper::IsInelasticScatter(), IsReconstructable(), m_mcToHitsMap, m_recoCriteria, lar_content::LArHierarchyHelper::MCHierarchy::ReconstructabilityCriteria::m_removeNeutrons, and lar_content::MC_PROC_N_CAPTURE.
Referenced by FillHierarchy().
|
private |
Checks if an individual particle meets reconstructability criteria.
pMCParticle | The MC particle to assess |
Definition at line 492 of file LArHierarchyHelper.cc.
References m_mcToHitsMap, lar_content::LArHierarchyHelper::MCHierarchy::ReconstructabilityCriteria::m_minGoodViews, lar_content::LArHierarchyHelper::MCHierarchy::ReconstructabilityCriteria::m_minHits, lar_content::LArHierarchyHelper::MCHierarchy::ReconstructabilityCriteria::m_minHitsForGoodView, m_recoCriteria, lar_content::LArHierarchyHelper::MCHierarchy::Node::Node(), and lar_content::LArMCParticleHelper::SortByMomentum().
Referenced by InterpretHierarchy().
|
private |
Checks if a set of hits meet reconstructability criteria.
caloHits | The calo hits to assess |
void lar_content::LArHierarchyHelper::MCHierarchy::RegisterNode | ( | const Node * | pNode | ) |
Register a node with the hierarchy.
pNode | The node to register |
Definition at line 464 of file LArHierarchyHelper.cc.
References m_nextNodeId, and m_nodeToIdMap.
const std::string lar_content::LArHierarchyHelper::MCHierarchy::ToString | ( | ) | const |
Produce a string representation of the hierarchy.
Definition at line 472 of file LArHierarchyHelper.cc.
References m_interactions, and util::to_string().
Referenced by lar_content::HierarchyMonitoringAlgorithm::Run().
|
private |
Map from incident particles (e.g. neutrino) to primaries.
Definition at line 412 of file LArHierarchyHelper.h.
Referenced by FillHierarchy(), lar_content::LArHierarchyHelper::RecoHierarchy::FillHierarchy(), GetFlattenedNodes(), lar_content::LArHierarchyHelper::RecoHierarchy::GetFlattenedNodes(), GetInteractions(), lar_content::LArHierarchyHelper::RecoHierarchy::GetInteractions(), GetRootMCParticles(), lar_content::LArHierarchyHelper::RecoHierarchy::GetRootPfos(), ToString(), lar_content::LArHierarchyHelper::RecoHierarchy::ToString(), ~MCHierarchy(), and lar_content::LArHierarchyHelper::RecoHierarchy::~RecoHierarchy().
|
private |
The map between MC particles and calo hits.
Definition at line 414 of file LArHierarchyHelper.h.
Referenced by FillHierarchy(), InterpretHierarchy(), and IsReconstructable().
|
private |
The ID to use for the next node.
Definition at line 416 of file LArHierarchyHelper.h.
Referenced by RegisterNode().
|
private |
A map from nodes to unique ids.
Definition at line 415 of file LArHierarchyHelper.h.
Referenced by RegisterNode().
|
private |
The criteria used to determine if the node is reconstructable.
Definition at line 413 of file LArHierarchyHelper.h.
Referenced by CollectContinuations(), FillHierarchy(), InterpretHierarchy(), and IsReconstructable().