LArSoft  v10_06_00
Liquid Argon Software toolkit - https://larsoft.org/
DLCheatHierarchyTool.h
Go to the documentation of this file.
1 
8 #ifndef LAR_DL_CHEAT_HIERARCHY_TOOL_H
9 #define LAR_DL_CHEAT_HIERARCHY_TOOL_H 1
10 
11 #include "Pandora/PandoraInternal.h"
12 
14 
16 
17 using namespace lar_content;
18 
19 namespace lar_dl_content
20 {
21 
25 class DLCheatHierarchyTool : public pandora::AlgorithmTool
26 {
27 public:
28  typedef std::map<const pandora::ParticleFlowObject *, const pandora::MCParticle *> PfoToMCParticleMap;
29  typedef std::map<const pandora::ParticleFlowObject *, std::pair<const pandora::ParticleFlowObject *, int>> ChildToParentPfoMap;
30 
35 
36  pandora::StatusCode Run(const PfoToMCParticleMap &pfoToMCParticleMap, const ChildToParentPfoMap &childToParentPfoMap,
37  const HierarchyPfo &parentPfo, const HierarchyPfo &childPfo, bool &isTrueLink, bool &trueParentOrientation, bool &trueChildOrientation);
38 
39  pandora::StatusCode Run(const PfoToMCParticleMap &pfoToMCParticleMap, const ChildToParentPfoMap &childToParentPfoMap,
40  const pandora::ParticleFlowObject *const pNeutrinoPfo, const HierarchyPfo &childPfo, bool &isTrueLink, bool &trueChildOrientation);
41 
50  void FillHierarchyMap(
51  const pandora::Algorithm *const pAlgorithm, PfoToMCParticleMap &pfoToMCParticleMap, ChildToParentPfoMap &childToParentPfoMap) const;
52 
62  pandora::StatusCode IsNeutronChild(
63  const pandora::ParticleFlowObject *const pPfo, const PfoToMCParticleMap &pfoToMCParticleMap, bool &isNeutronChild) const;
64 
65 private:
66  typedef std::map<const pandora::MCParticle *, const pandora::MCParticle *> MCToMCMap;
67 
68  pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
69 
81  bool IsUpstreamTrueVertex(const PfoToMCParticleMap &pfoToMCParticleMap, const pandora::ParticleFlowObject *const pPfo,
82  const pandora::CartesianVector &upstreamVertex, const pandora::CartesianVector &downstreamVertex);
83 
92  bool GetMCParticleList(const pandora::Algorithm *const pAlgorithm, const pandora::MCParticleList *&pMCParticleList) const;
93 
102  bool GetNeutrinoPfo(const pandora::Algorithm *const pAlgorithm, const pandora::ParticleFlowObject *&pNeutrinoPfo) const;
103 
110  void MatchPFParticles(const pandora::Algorithm *const pAlgorithm, PfoToMCParticleMap &pfoToMCParticleMap) const;
111 
117  float GetNSpacepoints(const pandora::ParticleFlowObject *const pPfo) const;
118 
124  bool IsEMParticle(const pandora::MCParticle *const pMCParticle) const;
125 
133  const pandora::MCParticle *GetLeadEMParticle(const pandora::MCParticle *const pMCParticle) const;
134 
142  float SumEnergy(const pandora::CaloHitList &caloHitList) const;
143 
150  void GetVisibleMCHierarchy(const PfoToMCParticleMap &pfoToMCParticleMap, MCToMCMap &childToParentMCMap) const;
151 
160  void GetVisiblePfoHierarchy(const pandora::ParticleFlowObject *const pNeutrinoPfo, const PfoToMCParticleMap &pfoToMCParticleMap,
161  const MCToMCMap &childToParentMCMap, ChildToParentPfoMap &childToParentPfoMap) const;
162 
170  void BuildSplitHierarchy(const std::pair<const pandora::MCParticle *, pandora::PfoList> &splitPfo, ChildToParentPfoMap &childToParentPfoMap) const;
171 
180  float GetClosestDistance(const pandora::ParticleFlowObject *const pPfo1, const pandora::ParticleFlowObject *const pPfo2) const;
181 
191  const pandora::ParticleFlowObject *BestParentInSplitHierarchy(
192  const pandora::ParticleFlowObject *const pChildPfo, const pandora::PfoList &splitParticle) const;
193 
203  void AssignGeneration(const pandora::ParticleFlowObject *const pParentPfo, const int generationToFind, ChildToParentPfoMap &childToParentPfoMap) const;
204 
205  std::string m_mcParticleListName;
206  std::string m_neutrinoPfoListName;
207  pandora::StringVector m_pfoListNames;
208 };
209 
210 } // namespace lar_dl_content
211 
212 #endif // #ifndef LAR_DL_CHEAT_HIERARCHY_TOOL_H
std::map< const pandora::ParticleFlowObject *, std::pair< const pandora::ParticleFlowObject *, int > > ChildToParentPfoMap
pandora::StringVector m_pfoListNames
the vector of pfo list names
HierarchyPfo class.
std::map< const pandora::MCParticle *, const pandora::MCParticle * > MCToMCMap
Header file for the HierarchyPfo class.
DLCheatHierarchyTool to calculate variables related to the initial shower region. ...
std::string m_neutrinoPfoListName
the neutrino pfo list name
Header file for the lar monte carlo particle helper helper class.
std::string m_mcParticleListName
the MCParticle list name
std::map< const pandora::ParticleFlowObject *, const pandora::MCParticle * > PfoToMCParticleMap