![]() |
LArSoft
v10_06_00
Liquid Argon Software toolkit - https://larsoft.org/
|
DLCheatHierarchyTool to calculate variables related to the initial shower region. More...
#include "DLCheatHierarchyTool.h"
Public Types | |
typedef std::map< const pandora::ParticleFlowObject *, const pandora::MCParticle * > | PfoToMCParticleMap |
typedef std::map< const pandora::ParticleFlowObject *, std::pair< const pandora::ParticleFlowObject *, int > > | ChildToParentPfoMap |
Public Member Functions | |
DLCheatHierarchyTool () | |
Default constructor. More... | |
pandora::StatusCode | Run (const PfoToMCParticleMap &pfoToMCParticleMap, const ChildToParentPfoMap &childToParentPfoMap, const HierarchyPfo &parentPfo, const HierarchyPfo &childPfo, bool &isTrueLink, bool &trueParentOrientation, bool &trueChildOrientation) |
pandora::StatusCode | Run (const PfoToMCParticleMap &pfoToMCParticleMap, const ChildToParentPfoMap &childToParentPfoMap, const pandora::ParticleFlowObject *const pNeutrinoPfo, const HierarchyPfo &childPfo, bool &isTrueLink, bool &trueChildOrientation) |
void | FillHierarchyMap (const pandora::Algorithm *const pAlgorithm, PfoToMCParticleMap &pfoToMCParticleMap, ChildToParentPfoMap &childToParentPfoMap) const |
Determine the true child -> parent pfo visible matches, filling the pfo->MCParticle matching map in the process. More... | |
pandora::StatusCode | IsNeutronChild (const pandora::ParticleFlowObject *const pPfo, const PfoToMCParticleMap &pfoToMCParticleMap, bool &isNeutronChild) const |
Whether the true invisible parent of a particle is a neutron. More... | |
Private Types | |
typedef std::map< const pandora::MCParticle *, const pandora::MCParticle * > | MCToMCMap |
Private Member Functions | |
pandora::StatusCode | ReadSettings (const pandora::TiXmlHandle xmlHandle) |
bool | IsUpstreamTrueVertex (const PfoToMCParticleMap &pfoToMCParticleMap, const pandora::ParticleFlowObject *const pPfo, const pandora::CartesianVector &upstreamVertex, const pandora::CartesianVector &downstreamVertex) |
Whether the true startpoint of the particle is in the upstream position (i.e. the endpoint closest to the neutrino vertex) More... | |
bool | GetMCParticleList (const pandora::Algorithm *const pAlgorithm, const pandora::MCParticleList *&pMCParticleList) const |
Get the MCParticle list from Pandora. More... | |
bool | GetNeutrinoPfo (const pandora::Algorithm *const pAlgorithm, const pandora::ParticleFlowObject *&pNeutrinoPfo) const |
Get the neutrino pfo. More... | |
void | MatchPFParticles (const pandora::Algorithm *const pAlgorithm, PfoToMCParticleMap &pfoToMCParticleMap) const |
Perform the pfo->MCParticle matching, folding back EM shower hierarchies. More... | |
float | GetNSpacepoints (const pandora::ParticleFlowObject *const pPfo) const |
Get the number of 3D hits owned by a pfo. More... | |
bool | IsEMParticle (const pandora::MCParticle *const pMCParticle) const |
Whether a MCParticle is an electron or photon. More... | |
const pandora::MCParticle * | GetLeadEMParticle (const pandora::MCParticle *const pMCParticle) const |
Get the leading EM Particle in an EM MCParticle hierarchy. More... | |
float | SumEnergy (const pandora::CaloHitList &caloHitList) const |
Sum the 'energy' of the W hits in an input CaloHitList. More... | |
void | GetVisibleMCHierarchy (const PfoToMCParticleMap &pfoToMCParticleMap, MCToMCMap &childToParentMCMap) const |
Determine the true child->parent MCParticle visible matches. More... | |
void | GetVisiblePfoHierarchy (const pandora::ParticleFlowObject *const pNeutrinoPfo, const PfoToMCParticleMap &pfoToMCParticleMap, const MCToMCMap &childToParentMCMap, ChildToParentPfoMap &childToParentPfoMap) const |
Determine the true child->parent pfo visible matches. More... | |
void | BuildSplitHierarchy (const std::pair< const pandora::MCParticle *, pandora::PfoList > &splitPfo, ChildToParentPfoMap &childToParentPfoMap) const |
Determine the 'internal' hierachy of reconstructed particles that match to the same MCParticle i.e. split particles. More... | |
float | GetClosestDistance (const pandora::ParticleFlowObject *const pPfo1, const pandora::ParticleFlowObject *const pPfo2) const |
Determine the closest distance between two pfos. More... | |
const pandora::ParticleFlowObject * | BestParentInSplitHierarchy (const pandora::ParticleFlowObject *const pChildPfo, const pandora::PfoList &splitParticle) const |
In cases in which the true parent pfo is ambiguous (because the parent particle has been split), find the best parent based on proximity. More... | |
void | AssignGeneration (const pandora::ParticleFlowObject *const pParentPfo, const int generationToFind, ChildToParentPfoMap &childToParentPfoMap) const |
Find the children of an input parent pfo in the ChildToParentPfoMap, and assign their generation. More... | |
Private Attributes | |
std::string | m_mcParticleListName |
the MCParticle list name More... | |
std::string | m_neutrinoPfoListName |
the neutrino pfo list name More... | |
pandora::StringVector | m_pfoListNames |
the vector of pfo list names More... | |
DLCheatHierarchyTool to calculate variables related to the initial shower region.
Definition at line 25 of file DLCheatHierarchyTool.h.
typedef std::map<const pandora::ParticleFlowObject *, std::pair<const pandora::ParticleFlowObject *, int> > lar_dl_content::DLCheatHierarchyTool::ChildToParentPfoMap |
Definition at line 29 of file DLCheatHierarchyTool.h.
|
private |
Definition at line 66 of file DLCheatHierarchyTool.h.
typedef std::map<const pandora::ParticleFlowObject *, const pandora::MCParticle *> lar_dl_content::DLCheatHierarchyTool::PfoToMCParticleMap |
Definition at line 28 of file DLCheatHierarchyTool.h.
lar_dl_content::DLCheatHierarchyTool::DLCheatHierarchyTool | ( | ) |
Default constructor.
Definition at line 26 of file DLCheatHierarchyTool.cc.
|
private |
Find the children of an input parent pfo in the ChildToParentPfoMap, and assign their generation.
pParentPfo | a pointer to the parent pfo |
generationToFind | the generation to assign |
childToParentPfoMap | the true child->parent pfo visible match map to modify |
Definition at line 521 of file DLCheatHierarchyTool.cc.
Referenced by GetVisiblePfoHierarchy().
|
private |
In cases in which the true parent pfo is ambiguous (because the parent particle has been split), find the best parent based on proximity.
pChildPfo | a pointer to the child particle |
splitParticle | the list of pfos forming the split particle |
Definition at line 494 of file DLCheatHierarchyTool.cc.
References GetClosestDistance().
Referenced by GetVisiblePfoHierarchy().
|
private |
Determine the 'internal' hierachy of reconstructed particles that match to the same MCParticle i.e. split particles.
splitPfo | the (MCParticle, list of matched pfos) pair |
childToParentPfoMap | the true child->parent pfo visible match map to fill |
Definition at line 433 of file DLCheatHierarchyTool.cc.
References GetClosestDistance().
Referenced by GetVisiblePfoHierarchy().
void lar_dl_content::DLCheatHierarchyTool::FillHierarchyMap | ( | const pandora::Algorithm *const | pAlgorithm, |
PfoToMCParticleMap & | pfoToMCParticleMap, | ||
ChildToParentPfoMap & | childToParentPfoMap | ||
) | const |
Determine the true child -> parent pfo visible matches, filling the pfo->MCParticle matching map in the process.
pAlgorithm | a pointer to the pandora algorithm |
pfoToMCParticleMap | the pfo->MCParticle matching map to fill |
childToParentPfoMap | the pfo->(parentPfo, generation) map to fill |
Definition at line 120 of file DLCheatHierarchyTool.cc.
References GetMCParticleList(), GetNeutrinoPfo(), GetVisibleMCHierarchy(), GetVisiblePfoHierarchy(), and MatchPFParticles().
Referenced by lar_dl_content::DLNeutrinoHierarchyAlgorithm::Run().
|
private |
Determine the closest distance between two pfos.
pPfo1 | a pointer to one pfo |
pPfo2 | a pointer to the other pfo |
Definition at line 483 of file DLCheatHierarchyTool.cc.
Referenced by BestParentInSplitHierarchy(), and BuildSplitHierarchy().
|
private |
Get the leading EM Particle in an EM MCParticle hierarchy.
pMCParticle | a pointer to the input EM MCParticle |
Definition at line 286 of file DLCheatHierarchyTool.cc.
References IsEMParticle().
Referenced by MatchPFParticles().
|
private |
Get the MCParticle list from Pandora.
pAlgorithm | a pointer to the pandora algorithm |
pMCParticleList | a pointer to the MCParticle list |
Definition at line 149 of file DLCheatHierarchyTool.cc.
References m_mcParticleListName.
Referenced by FillHierarchyMap().
|
private |
Get the neutrino pfo.
pAlgorithm | a pointer to the pandora algorithm |
pNeutrinoPfo | a pointer to the neutrino pfo |
Definition at line 162 of file DLCheatHierarchyTool.cc.
References m_neutrinoPfoListName.
Referenced by FillHierarchyMap().
|
private |
Get the number of 3D hits owned by a pfo.
pPfo | a pointer to the input pfo |
Definition at line 264 of file DLCheatHierarchyTool.cc.
Referenced by MatchPFParticles().
|
private |
Determine the true child->parent MCParticle visible matches.
pfoToMCParticleMap | the pfo->MCParticle matching map |
childToParentMCMap | the true child->parent MCParticle visible match map to fill |
Definition at line 330 of file DLCheatHierarchyTool.cc.
Referenced by FillHierarchyMap().
|
private |
Determine the true child->parent pfo visible matches.
pNeutrinoPfo | a pointer to the neutrino pfo |
pfoToMCParticleMap | the pfo->MCParticle matching map |
childToParentMCMap | the true child->parent MCParticle visible match map |
childToParentPfoMap | the true child->parent pfo visible match map to fill |
Definition at line 370 of file DLCheatHierarchyTool.cc.
References AssignGeneration(), BestParentInSplitHierarchy(), and BuildSplitHierarchy().
Referenced by FillHierarchyMap().
|
private |
Whether a MCParticle is an electron or photon.
pMCParticle | a pointer to the input MCParticle |
Definition at line 279 of file DLCheatHierarchyTool.cc.
References util::abs().
Referenced by GetLeadEMParticle(), and MatchPFParticles().
StatusCode lar_dl_content::DLCheatHierarchyTool::IsNeutronChild | ( | const pandora::ParticleFlowObject *const | pPfo, |
const PfoToMCParticleMap & | pfoToMCParticleMap, | ||
bool & | isNeutronChild | ||
) | const |
Whether the true invisible parent of a particle is a neutron.
pPfo | a pointer to the input pfo |
pfoToMCParticleMap | the pfo->MCParticle matching map |
isNeutronChild | the boolean to fill |
Definition at line 86 of file DLCheatHierarchyTool.cc.
Referenced by lar_dl_content::DLNeutrinoHierarchyAlgorithm::BuildPandoraHierarchy().
|
private |
Whether the true startpoint of the particle is in the upstream position (i.e. the endpoint closest to the neutrino vertex)
pfoToMCParticleMap | the pfo->MCParticle matching map |
pPfo | a pointer to the input pfo |
upstreamVertex | the upstream endpoint |
downstreamVertex | the downstream endpoint |
Definition at line 107 of file DLCheatHierarchyTool.cc.
Referenced by Run().
|
private |
Perform the pfo->MCParticle matching, folding back EM shower hierarchies.
pAlgorithm | a pointer to the pandora algorithm |
pfoToMCParticleMap | the pfo->MCParticle matching map |
Definition at line 183 of file DLCheatHierarchyTool.cc.
References f, GetLeadEMParticle(), GetNSpacepoints(), IsEMParticle(), m_pfoListNames, and SumEnergy().
Referenced by FillHierarchyMap().
|
private |
Definition at line 540 of file DLCheatHierarchyTool.cc.
References m_mcParticleListName, m_neutrinoPfoListName, and m_pfoListNames.
StatusCode lar_dl_content::DLCheatHierarchyTool::Run | ( | const PfoToMCParticleMap & | pfoToMCParticleMap, |
const ChildToParentPfoMap & | childToParentPfoMap, | ||
const HierarchyPfo & | parentPfo, | ||
const HierarchyPfo & | childPfo, | ||
bool & | isTrueLink, | ||
bool & | trueParentOrientation, | ||
bool & | trueChildOrientation | ||
) |
Definition at line 35 of file DLCheatHierarchyTool.cc.
References lar_dl_content::HierarchyPfo::GetDownstreamPoint(), lar_dl_content::HierarchyPfo::GetPfo(), lar_dl_content::ExtremalPoint::GetPosition(), lar_dl_content::HierarchyPfo::GetUpstreamPoint(), and IsUpstreamTrueVertex().
Referenced by lar_dl_content::DLNeutrinoHierarchyAlgorithm::BuildPandoraHierarchy().
StatusCode lar_dl_content::DLCheatHierarchyTool::Run | ( | const PfoToMCParticleMap & | pfoToMCParticleMap, |
const ChildToParentPfoMap & | childToParentPfoMap, | ||
const pandora::ParticleFlowObject *const | pNeutrinoPfo, | ||
const HierarchyPfo & | childPfo, | ||
bool & | isTrueLink, | ||
bool & | trueChildOrientation | ||
) |
Definition at line 64 of file DLCheatHierarchyTool.cc.
References lar_dl_content::HierarchyPfo::GetDownstreamPoint(), lar_dl_content::HierarchyPfo::GetPfo(), lar_dl_content::ExtremalPoint::GetPosition(), lar_dl_content::HierarchyPfo::GetUpstreamPoint(), and IsUpstreamTrueVertex().
|
private |
Sum the 'energy' of the W hits in an input CaloHitList.
caloHitList | the input CaloHitList |
Definition at line 315 of file DLCheatHierarchyTool.cc.
References f.
Referenced by MatchPFParticles().
|
private |
the MCParticle list name
Definition at line 205 of file DLCheatHierarchyTool.h.
Referenced by GetMCParticleList(), and ReadSettings().
|
private |
the neutrino pfo list name
Definition at line 206 of file DLCheatHierarchyTool.h.
Referenced by GetNeutrinoPfo(), and ReadSettings().
|
private |
the vector of pfo list names
Definition at line 207 of file DLCheatHierarchyTool.h.
Referenced by MatchPFParticles(), and ReadSettings().