DeltaRayParentAlgorithm.h
Go to the documentation of this file.
1 /**
2  * @file larpandoracontent/LArThreeDReco/LArCosmicRay/DeltaRayParentAlgorithm.h
3  *
4  * @brief Header file for the delta ray parent class.
5  *
6  * $Log: $
7  */
8 #ifndef LAR_DELTA_RAY_PARENT_ALGORITHM_H
9 #define LAR_DELTA_RAY_PARENT_ALGORITHM_H 1
10 
11 #include "Pandora/Algorithm.h"
12 
13 namespace lar_content
14 {
15 
16 /**
17  * @brief DeltaRayParentAlgorithm class
18  */
19 class DeltaRayParentAlgorithm : public pandora::Algorithm
20 {
21 public:
22  typedef std::map<const pandora::ParticleFlowObject *, float> PfoLengthMap;
23 
24  /**
25  * @brief Default constructor
26  */
28 
29  pandora::StatusCode Run();
30 
31 private:
32  /**
33  * @brief Initialise the delta ray pfo length map
34  *
35  * @param muonPfoList the list of all cosmic ray pfos
36  * @param deltaRayPfoList the list of all delta ray pfos
37  * @param pfoLengthMap the output mapping of pfos to their 2D length
38  */
39  void InitialisePfoLengthMap(const pandora::PfoList *const muonPfoList, const pandora::PfoList *const deltaRayPfoList, PfoLengthMap &pfoLengthMap) const;
40 
41  /**
42  * @brief Identify the parent pfo of a given delta ray pfo (can be either a cosmic ray or delta ray pfo)
43  *
44  * @param pfoLengthMap the mapping of pfos to their 2D length
45  * @param pPfo the address of the input delta ray pfo
46  * @param pParentPfo the output address of the parent pfo
47  */
48  void FindParentPfo(const PfoLengthMap &pfoLengthMap, const pandora::ParticleFlowObject *const pPfo, const pandora::ParticleFlowObject *&pParentPfo) const;
49 
50  /**
51  * @brief Get distance between two Pfos using 2D clusters
52  *
53  * @param pPfo the address of the first Pfo
54  * @param pPfo the address of the second Pfo
55  * @param to recieve the output pfo separation
56  *
57  * @return whether the pfo separation could be calculated
58  */
59  pandora::StatusCode GetTwoDSeparation(
60  const pandora::ParticleFlowObject *const pPfo1, const pandora::ParticleFlowObject *const pPfo2, float &separation) const;
61 
62  /**
63  * @brief Apply parent-child link (if parent is a cosmic ray create parent-child link else merge the delta ray cluster into parent delta ray pfo)
64  *
65  * @param muonPfoList the list of all cosmic ray pfos
66  * @param deltaRayPfoList the list of all delta ray pfos
67  * @param pPfo the address of the input delta ray pfo
68  * @param pParentPfo the address of the parent pfo
69  * @param pfoLengthMap the mapping of pfos to their 2D length
70  */
71  void AssignToParentPfo(const pandora::PfoList *const muonPfoList, const pandora::PfoList *const deltaRayPfoList,
72  const pandora::ParticleFlowObject *const pPfo, const pandora::ParticleFlowObject *const pParentPfo, PfoLengthMap &pfoLengthMap) const;
73 
74  /**
75  * @brief Update the pfo length map after a parent-child delta ray merge
76  *
77  * @param pfosToRemove the list of pfos to remove from the map
78  * @param pPfoToAdd the address of the pfo to add to the map
79  * @param pfoLengthMap the mapping of pfos to their 2D length
80  */
81  void UpdatePfoLengthMap(const pandora::PfoList &pfosToRemove, const pandora::ParticleFlowObject *const pPfoToAdd, PfoLengthMap &pfoLengthMap) const;
82 
83  pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
84 
85  std::string m_muonPfoListName; ///< The list of reconstructed muon pfos
86  std::string m_deltaRayPfoListName; ///< The list of reconstructed delta ray pfos
87  float m_distanceForMatching; ///< The maximum separation of a delta ray pfo from its parent
88 };
89 
90 } // namespace lar_content
91 
92 #endif // #ifndef LAR_DELTA_RAY_PARENT_ALGORITHM_H
std::string string
Definition: nybbler.cc:12
pandora::StatusCode GetTwoDSeparation(const pandora::ParticleFlowObject *const pPfo1, const pandora::ParticleFlowObject *const pPfo2, float &separation) const
Get distance between two Pfos using 2D clusters.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
std::string m_muonPfoListName
The list of reconstructed muon pfos.
float m_distanceForMatching
The maximum separation of a delta ray pfo from its parent.
void AssignToParentPfo(const pandora::PfoList *const muonPfoList, const pandora::PfoList *const deltaRayPfoList, const pandora::ParticleFlowObject *const pPfo, const pandora::ParticleFlowObject *const pParentPfo, PfoLengthMap &pfoLengthMap) const
Apply parent-child link (if parent is a cosmic ray create parent-child link else merge the delta ray ...
void UpdatePfoLengthMap(const pandora::PfoList &pfosToRemove, const pandora::ParticleFlowObject *const pPfoToAdd, PfoLengthMap &pfoLengthMap) const
Update the pfo length map after a parent-child delta ray merge.
void FindParentPfo(const PfoLengthMap &pfoLengthMap, const pandora::ParticleFlowObject *const pPfo, const pandora::ParticleFlowObject *&pParentPfo) const
Identify the parent pfo of a given delta ray pfo (can be either a cosmic ray or delta ray pfo) ...
std::map< const pandora::ParticleFlowObject *, float > PfoLengthMap
void InitialisePfoLengthMap(const pandora::PfoList *const muonPfoList, const pandora::PfoList *const deltaRayPfoList, PfoLengthMap &pfoLengthMap) const
Initialise the delta ray pfo length map.
std::string m_deltaRayPfoListName
The list of reconstructed delta ray pfos.
DeltaRayParentAlgorithm class.