LArStitchingHelper.h
Go to the documentation of this file.
1 /**
2  * @file larpandoracontent/LArHelpers/LArStitchingHelper.h
3  *
4  * @brief Header file for the helper class for multiple drift volumes.
5  *
6  * $Log: $
7  */
8 #ifndef LAR_STITCHING_HELPER_H
9 #define LAR_STITCHING_HELPER_H 1
10 
11 #include "Geometry/LArTPC.h"
12 
13 #include "Objects/ParticleFlowObject.h"
14 
16 
17 namespace lar_content
18 {
19 
20 /**
21  * @brief LArStitchingHelper class
22  */
24 {
25 public:
26  /**
27  * @brief Find closest tpc to a specified input tpc
28  *
29  * @param pandora the pandora stitching instance
30  * @param inputTPC the specified drift volume
31  * @param checkPositive look in higher (lower) x positions if this is set to true (false)
32  *
33  * @return the closest tpc
34  */
35  static const pandora::LArTPC &FindClosestTPC(const pandora::Pandora &pandora, const pandora::LArTPC &inputTPC, const bool checkPositive);
36 
37  /**
38  * @brief Whether particles from a given pair of tpcs can be stitched together
39  *
40  * @param firstTPC the first tpc
41  * @param secondTPC the second tpc
42  *
43  * @return boolean
44  */
45  static bool CanTPCsBeStitched(const pandora::LArTPC &firstTPC, const pandora::LArTPC &secondTPC);
46 
47  /**
48  * @brief Whether a pair of drift volumes are adjacent to each other
49  *
50  * @param firstTPC the first tpc
51  * @param secondTPC the second tpc
52  *
53  * @return boolean
54  */
55  static bool AreTPCsAdjacent(const pandora::LArTPC &firstTPC, const pandora::LArTPC &secondTPC);
56 
57  /**
58  * @brief Whether a pair of drift volumes are adjacent to each other
59  *
60  * @param pandora the pandora stitching instance
61  * @param firstTPC the first tpc
62  * @param secondTPC the second tpc
63  *
64  * @return boolean
65  */
66  static bool AreTPCsAdjacent(const pandora::Pandora &pandora, const pandora::LArTPC &firstTPC, const pandora::LArTPC &secondTPC);
67 
68  /**
69  * @brief Determine centre in X at the boundary between a pair of tpcs
70  *
71  * @param firstTPC the first tpc
72  * @param secondTPC the second tpc
73  *
74  * @return boundary X centre
75  */
76  static float GetTPCBoundaryCenterX(const pandora::LArTPC &firstTPC, const pandora::LArTPC &secondTPC);
77 
78  /**
79  * @brief Determine width in X at the boundary between a pair of tpcs
80  *
81  * @param firstTPC the first tpc
82  * @param secondTPC the second tpc
83  *
84  * @return boundary X width
85  */
86  static float GetTPCBoundaryWidthX(const pandora::LArTPC &firstTPC, const pandora::LArTPC &secondTPC);
87 
88  /**
89  * @brief Calculate distance between central positions of a pair of tpcs
90  *
91  * @param firstTPC the first tpc
92  * @param secondTPC the second tpc
93  *
94  * @return the distance
95  */
96  static float GetTPCDisplacement(const pandora::LArTPC &firstTPC, const pandora::LArTPC &secondTPC);
97 
98  /**
99  * @brief Given a pair of pointing clusters, find the pair of vertices with smallest yz-separation
100  *
101  * @param larTPC1 the first tpc
102  * @param larTPC2 the second tpc
103  * @param pointingCluster1 the pointing cluster in the first tpc
104  * @param pointingCluster2 the pointing cluster in the second tpc
105  * @param closestVertex1 to receive the relevant vertex from the first pointing cluster
106  * @param closestVertex2 to receive the relevant vertex from the second pointing cluster
107  */
108  static void GetClosestVertices(const pandora::LArTPC &larTPC1, const pandora::LArTPC &larTPC2, const LArPointingCluster &pointingCluster1,
109  const LArPointingCluster &pointingCluster2, LArPointingCluster::Vertex &closestVertex1, LArPointingCluster::Vertex &closestVertex2);
110 
111  /**
112  * @brief Calculate X0 for a pair of vertices
113  *
114  * @param firstTPC the first tpc
115  * @param secondTPC the second tpc
116  * @param firstVertex the relevant vertex from the first pointing cluster
117  * @param secondVertex the relevant vertex from the second pointing cluster
118  *
119  * @return X0 value for this pair of vertices
120  */
121  static float CalculateX0(const pandora::LArTPC &firstTPC, const pandora::LArTPC &secondTPC,
122  const LArPointingCluster::Vertex &firstVertex, const LArPointingCluster::Vertex &secondVertex);
123 
124  /**
125  * @brief Sort tpcs by central positions
126  *
127  * @param pLhs address of first tpc
128  * @param pRhs address of second tpc
129  */
130  static bool SortTPCs(const pandora::LArTPC *const pLhs, const pandora::LArTPC *const pRhs);
131 
132  /**
133  * @brief Whether a pfo has been stitched
134  *
135  * @param pPfo the address of the Pfo
136  *
137  * @return boolean
138  */
139  static bool HasPfoBeenStitched(const pandora::ParticleFlowObject *const pPfo);
140 
141  /**
142  * @brief Return the x0 for a pfo
143  *
144  * @param pPfo the address of the Pfo
145  */
146  static float GetPfoX0(const pandora::ParticleFlowObject *const pPfo);
147 };
148 
149 } // namespace lar_content
150 
151 #endif // #ifndef LAR_STITCHING_HELPER_H
static float CalculateX0(const pandora::LArTPC &firstTPC, const pandora::LArTPC &secondTPC, const LArPointingCluster::Vertex &firstVertex, const LArPointingCluster::Vertex &secondVertex)
Calculate X0 for a pair of vertices.
Header file for the lar pointing cluster class.
LArPointingCluster class.
static bool CanTPCsBeStitched(const pandora::LArTPC &firstTPC, const pandora::LArTPC &secondTPC)
Whether particles from a given pair of tpcs can be stitched together.
static float GetTPCDisplacement(const pandora::LArTPC &firstTPC, const pandora::LArTPC &secondTPC)
Calculate distance between central positions of a pair of tpcs.
static bool HasPfoBeenStitched(const pandora::ParticleFlowObject *const pPfo)
Whether a pfo has been stitched.
static float GetTPCBoundaryCenterX(const pandora::LArTPC &firstTPC, const pandora::LArTPC &secondTPC)
Determine centre in X at the boundary between a pair of tpcs.
static bool AreTPCsAdjacent(const pandora::LArTPC &firstTPC, const pandora::LArTPC &secondTPC)
Whether a pair of drift volumes are adjacent to each other.
static const pandora::LArTPC & FindClosestTPC(const pandora::Pandora &pandora, const pandora::LArTPC &inputTPC, const bool checkPositive)
Find closest tpc to a specified input tpc.
static float GetTPCBoundaryWidthX(const pandora::LArTPC &firstTPC, const pandora::LArTPC &secondTPC)
Determine width in X at the boundary between a pair of tpcs.
static bool SortTPCs(const pandora::LArTPC *const pLhs, const pandora::LArTPC *const pRhs)
Sort tpcs by central positions.
LArStitchingHelper class.
static void GetClosestVertices(const pandora::LArTPC &larTPC1, const pandora::LArTPC &larTPC2, const LArPointingCluster &pointingCluster1, const LArPointingCluster &pointingCluster2, LArPointingCluster::Vertex &closestVertex1, LArPointingCluster::Vertex &closestVertex2)
Given a pair of pointing clusters, find the pair of vertices with smallest yz-separation.
static float GetPfoX0(const pandora::ParticleFlowObject *const pPfo)
Return the x0 for a pfo.