LArSoft  v06_85_00
Liquid Argon Software toolkit - http://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, const pandora::CartesianVector &initialDirection,
81  const pandora::Cluster *const pCluster, const float projectionAngularAllowance);
82 
93  static void GetClosestVertices(const bool useX, const bool useY, const bool useZ,
94  const LArPointingCluster &pointingClusterI, const LArPointingCluster &pointingClusterJ,
95  LArPointingCluster::Vertex &closestVertexI, LArPointingCluster::Vertex &closestVertexJ);
96 
105  static void GetClosestVertices(const LArPointingCluster &pointingClusterI, const LArPointingCluster &pointingClusterJ,
106  LArPointingCluster::Vertex &closestVertexI, LArPointingCluster::Vertex &closestVertexJ);
107 
116  static void GetClosestVerticesInX(const LArPointingCluster &pointingClusterI, const LArPointingCluster &pointingClusterJ,
117  LArPointingCluster::Vertex &closestVertexI, LArPointingCluster::Vertex &closestVertexJ);
118 
127  static void GetClosestVerticesInYZ(const LArPointingCluster &pointingClusterI, const LArPointingCluster &pointingClusterJ,
128  LArPointingCluster::Vertex &closestVertexI, LArPointingCluster::Vertex &closestVertexJ);
129 
138  static void GetImpactParametersInYZ(const LArPointingCluster::Vertex &pointingVertex, const LArPointingCluster::Vertex &targetVertex,
139  float &longitudinal, float &transverse);
140 
149  static void GetImpactParameters(const LArPointingCluster::Vertex &pointingVertex, const LArPointingCluster::Vertex &targetVertex,
150  float &longitudinal, float &transverse);
151 
160  static void GetImpactParameters(const LArPointingCluster::Vertex &pointingVertex, const pandora::CartesianVector &targetPosition,
161  float &longitudinal, float &transverse);
162 
172  static void GetImpactParameters(const pandora::CartesianVector &initialPosition, const pandora::CartesianVector &initialDirection,
173  const pandora::CartesianVector &targetPosition, float &longitudinal, float &transverse);
174 
184  static void GetIntersection(const LArPointingCluster::Vertex &firstVertex, const LArPointingCluster::Vertex &secondVertex,
185  pandora::CartesianVector &intersectPosition, float &firstDisplacement, float &secondDisplacement);
186 
194  static void GetAverageDirection(const LArPointingCluster::Vertex &firstVertex, const LArPointingCluster::Vertex &secondVertex,
195  pandora::CartesianVector &averageDirection);
196 
208  static void GetIntersection(const pandora::CartesianVector &firstPosition, const pandora::CartesianVector &firstDirection,
209  const pandora::CartesianVector &secondPosition, const pandora::CartesianVector &secondDirection,
210  pandora::CartesianVector &intersectPosition, float &firstDisplacement, float &secondDisplacement);
211 
221  static void GetIntersection(const LArPointingCluster::Vertex &vertexCluster, const pandora::Cluster *const pTargetCluster,
222  pandora::CartesianVector &intersectPosition, float &displacementL, float &displacementT);
223 
237  const float minLongitudinalDistance, const float maxLongitudinalDistance, const float maxTransverseDistance, const float angularAllowance);
238 
239 private:
251  static void CollectAssociatedClusters(const LArPointingCluster::Vertex &vertex, const LArPointingClusterList &inputList, const float minLongitudinalDistance,
252  const float maxLongitudinalDistance, const float maxTransverseDistance, const float angularAllowance, LArPointingClusterVertexList &outputList);
253 
262  static float GetAssociatedEnergy(const LArPointingCluster::Vertex &vertex, const LArPointingClusterVertexList &clusterVertices);
263 };
264 
265 } // namespace lar_content
266 
267 #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