LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
LArPointingClusterHelper.h
Go to the documentation of this file.
1 
8 #ifndef LAR_POINTING_CLUSTER_HELPER_H
9 #define LAR_POINTING_CLUSTER_HELPER_H 1
10 
11 #include "Objects/Cluster.h"
12 
14 
15 namespace lar_content
16 {
17 
22 {
23 public:
31  static float GetLengthSquared(const LArPointingCluster &pointingCluster);
32 
40  static float GetLength(const LArPointingCluster &pointingCluster);
41 
52  static bool IsNode(const pandora::CartesianVector &parentVertex, const LArPointingCluster::Vertex &daughterVertex,
53  const float minLongitudinalDistance, const float maxTransverseDistance);
54 
67  static bool IsEmission(const pandora::CartesianVector &parentVertex, const LArPointingCluster::Vertex &daughterVertex,
68  const float minLongitudinalDistance, const float maxLongitudinalDistance, const float maxTransverseDistance, const float angularAllowance);
69 
80  static pandora::CartesianVector GetProjectedPosition(const pandora::CartesianVector &initialPosition,
81  const pandora::CartesianVector &initialDirection, const pandora::Cluster *const pCluster, const float projectionAngularAllowance);
82 
93  static void GetClosestVertices(const bool useX, const bool useY, const bool useZ, const LArPointingCluster &pointingClusterI,
94  const LArPointingCluster &pointingClusterJ, LArPointingCluster::Vertex &closestVertexI, LArPointingCluster::Vertex &closestVertexJ);
95 
104  static void GetClosestVertices(const LArPointingCluster &pointingClusterI, const LArPointingCluster &pointingClusterJ,
105  LArPointingCluster::Vertex &closestVertexI, LArPointingCluster::Vertex &closestVertexJ);
106 
115  static void GetClosestVerticesInX(const LArPointingCluster &pointingClusterI, const LArPointingCluster &pointingClusterJ,
116  LArPointingCluster::Vertex &closestVertexI, LArPointingCluster::Vertex &closestVertexJ);
117 
126  static void GetClosestVerticesInYZ(const LArPointingCluster &pointingClusterI, const LArPointingCluster &pointingClusterJ,
127  LArPointingCluster::Vertex &closestVertexI, LArPointingCluster::Vertex &closestVertexJ);
128 
137  static void GetImpactParametersInYZ(const LArPointingCluster::Vertex &pointingVertex, const LArPointingCluster::Vertex &targetVertex,
138  float &longitudinal, float &transverse);
139 
148  static void GetImpactParameters(const LArPointingCluster::Vertex &pointingVertex, const LArPointingCluster::Vertex &targetVertex,
149  float &longitudinal, float &transverse);
150 
159  static void GetImpactParameters(const LArPointingCluster::Vertex &pointingVertex, const pandora::CartesianVector &targetPosition,
160  float &longitudinal, float &transverse);
161 
171  static void GetImpactParameters(const pandora::CartesianVector &initialPosition, const pandora::CartesianVector &initialDirection,
172  const pandora::CartesianVector &targetPosition, float &longitudinal, float &transverse);
173 
183  static void GetIntersection(const LArPointingCluster::Vertex &firstVertex, const LArPointingCluster::Vertex &secondVertex,
184  pandora::CartesianVector &intersectPosition, float &firstDisplacement, float &secondDisplacement);
185 
193  static void GetAverageDirection(const LArPointingCluster::Vertex &firstVertex, const LArPointingCluster::Vertex &secondVertex,
194  pandora::CartesianVector &averageDirection);
195 
207  static void GetIntersection(const pandora::CartesianVector &firstPosition, const pandora::CartesianVector &firstDirection,
208  const pandora::CartesianVector &secondPosition, const pandora::CartesianVector &secondDirection,
209  pandora::CartesianVector &intersectPosition, float &firstDisplacement, float &secondDisplacement);
210 
220  static void GetIntersection(const LArPointingCluster::Vertex &vertexCluster, const pandora::Cluster *const pTargetCluster,
221  pandora::CartesianVector &intersectPosition, float &displacementL, float &displacementT);
222 
236  const LArPointingClusterList &pointingClusterList, const float minLongitudinalDistance, const float maxLongitudinalDistance,
237  const float maxTransverseDistance, const float angularAllowance);
238 
239 private:
252  const float minLongitudinalDistance, const float maxLongitudinalDistance, const float maxTransverseDistance,
253  const float angularAllowance, LArPointingClusterVertexList &outputList);
254 
263  static float GetAssociatedEnergy(const LArPointingCluster::Vertex &vertex, const LArPointingClusterVertexList &clusterVertices);
264 };
265 
266 } // namespace lar_content
267 
268 #endif // #ifndef LAR_POINTING_CLUSTER_HELPER_H
Header file for the lar pointing cluster class.
static bool IsEmission(const pandora::CartesianVector &parentVertex, const LArPointingCluster::Vertex &daughterVertex, const float minLongitudinalDistance, const float maxLongitudinalDistance, const float maxTransverseDistance, const float angularAllowance)
Whether pointing vertex is emitted from a given position.
static void GetClosestVerticesInYZ(const LArPointingCluster &pointingClusterI, const LArPointingCluster &pointingClusterJ, LArPointingCluster::Vertex &closestVertexI, LArPointingCluster::Vertex &closestVertexJ)
Given a pair of pointing clusters, find the pair of vertices with smallest yz-separation.
static void GetIntersection(const LArPointingCluster::Vertex &firstVertex, const LArPointingCluster::Vertex &secondVertex, pandora::CartesianVector &intersectPosition, float &firstDisplacement, float &secondDisplacement)
Get intersection of two vertices.
std::vector< LArPointingCluster > LArPointingClusterList
static void GetImpactParametersInYZ(const LArPointingCluster::Vertex &pointingVertex, const LArPointingCluster::Vertex &targetVertex, float &longitudinal, float &transverse)
Calculate impact parameters between a pair of pointing vertices using yz-coordinates.
static pandora::CartesianVector GetProjectedPosition(const pandora::CartesianVector &initialPosition, const pandora::CartesianVector &initialDirection, const pandora::Cluster *const pCluster, const float projectionAngularAllowance)
Get projected position on a cluster from a specified position and direction.
static void GetImpactParameters(const LArPointingCluster::Vertex &pointingVertex, const LArPointingCluster::Vertex &targetVertex, float &longitudinal, float &transverse)
Calculate impact parameters between a pair of pointing vertices.
static float GetLength(const LArPointingCluster &pointingCluster)
Calculate distance squared between inner and outer vertices of pointing cluster.
LArPointingCluster class.
LArPointingClusterHelper class.
static void GetClosestVertices(const bool useX, const bool useY, const bool useZ, const LArPointingCluster &pointingClusterI, const LArPointingCluster &pointingClusterJ, LArPointingCluster::Vertex &closestVertexI, LArPointingCluster::Vertex &closestVertexJ)
Given a pair of pointing clusters, receive the closest or farthest pair of vertices.
std::vector< LArPointingCluster::Vertex > LArPointingClusterVertexList
static void CollectAssociatedClusters(const LArPointingCluster::Vertex &vertex, const LArPointingClusterList &inputList, const float minLongitudinalDistance, const float maxLongitudinalDistance, const float maxTransverseDistance, const float angularAllowance, LArPointingClusterVertexList &outputList)
Collect cluster vertices, from a provided input list, associated with a specified vertex...
static float GetAssociatedEnergy(const LArPointingCluster::Vertex &vertex, const LArPointingClusterVertexList &clusterVertices)
Get an estimate of the energy associated with a specified vertex.
static void GetAverageDirection(const LArPointingCluster::Vertex &firstVertex, const LArPointingCluster::Vertex &secondVertex, pandora::CartesianVector &averageDirection)
Get average direction of two vertices.
static LArPointingCluster::Vertex GetBestVertexEstimate(const LArPointingClusterVertexList &vertexList, const LArPointingClusterList &pointingClusterList, const float minLongitudinalDistance, const float maxLongitudinalDistance, const float maxTransverseDistance, const float angularAllowance)
Simple and fast vertex selection, choosing best vertex from a specified list to represent a set of po...
static void GetClosestVerticesInX(const LArPointingCluster &pointingClusterI, const LArPointingCluster &pointingClusterJ, LArPointingCluster::Vertex &closestVertexI, LArPointingCluster::Vertex &closestVertexJ)
Given a pair of pointing clusters, find the pair of vertices with smallest x-separation.
static float GetLengthSquared(const LArPointingCluster &pointingCluster)
Calculate distance squared between inner and outer vertices of pointing cluster.
static bool IsNode(const pandora::CartesianVector &parentVertex, const LArPointingCluster::Vertex &daughterVertex, const float minLongitudinalDistance, const float maxTransverseDistance)
Whether pointing vertex is adjacent to a given position.
vertex reconstruction