8 #ifndef LAR_GEOMETRY_HELPER_H
9 #define LAR_GEOMETRY_HELPER_H 1
11 #include "Objects/Cluster.h"
12 #include "Pandora/PandoraEnumeratedTypes.h"
13 #include "Pandora/StatusCodes.h"
15 #include <unordered_map>
19 class CartesianVector;
26 class TwoDSlidingFitResult;
47 static float MergeTwoPositions(
const pandora::Pandora &
pandora,
const pandora::HitType view1,
const pandora::HitType view2,
48 const float position1,
const float position2);
60 const pandora::HitType view2,
const pandora::CartesianVector &direction1,
const pandora::CartesianVector &direction2);
73 static void MergeTwoPositions(
const pandora::Pandora &
pandora,
const pandora::HitType view1,
const pandora::HitType view2,
74 const pandora::CartesianVector &position1,
const pandora::CartesianVector &position2, pandora::CartesianVector &position3,
float &chiSquared);
89 static void MergeTwoPositions(
const pandora::Pandora &
pandora,
const pandora::HitType view1,
const pandora::HitType view2,
90 const pandora::CartesianVector &position1,
const pandora::CartesianVector &position2, pandora::CartesianVector &outputU,
91 pandora::CartesianVector &outputV, pandora::CartesianVector &outputW,
float &chiSquared);
109 const pandora::HitType view3,
const pandora::CartesianVector &position1,
const pandora::CartesianVector &position2,
110 const pandora::CartesianVector &position3, pandora::CartesianVector &outputU, pandora::CartesianVector &outputV,
111 pandora::CartesianVector &outputW,
float &chiSquared);
126 const pandora::CartesianVector &positionV,
const pandora::CartesianVector &positionW, pandora::CartesianVector &outputU,
127 pandora::CartesianVector &outputV, pandora::CartesianVector &outputW,
float &chiSquared);
141 const pandora::CartesianVector &position1,
const pandora::CartesianVector &position2, pandora::CartesianVector &position3D,
float &chiSquared);
157 const pandora::HitType view3,
const pandora::CartesianVector &position1,
const pandora::CartesianVector &position2,
158 const pandora::CartesianVector &position3, pandora::CartesianVector &position3D,
float &chiSquared);
168 const pandora::Pandora &
pandora,
const pandora::CartesianVector &position3D,
const pandora::HitType view);
178 const pandora::Pandora &
pandora,
const pandora::CartesianVector &direction3D,
const pandora::HitType view);
186 static float GetWireZPitch(
const pandora::Pandora &
pandora,
const float maxWirePitchDiscrepancy = 0.01);
195 static float GetWirePitch(
const pandora::Pandora &
pandora,
const pandora::HitType view,
const float maxWirePitchDiscrepancy = 0.01);
203 static pandora::CartesianVector
GetWireAxis(
const pandora::Pandora &
pandora,
const pandora::HitType view);
215 static bool IsInGap(
const pandora::Pandora &
pandora,
const pandora::CartesianVector &testPoint2D,
const pandora::HitType hitType,
216 const float gapTolerance = 0.f);
228 static bool IsInGap3D(
const pandora::Pandora &
pandora,
const pandora::CartesianVector &testPoint3D,
const pandora::HitType hitType,
229 const float gapTolerance = 0.f);
242 const pandora::Pandora &
pandora,
const float xSample,
const TwoDSlidingFitResult &slidingFitResult,
const float gapTolerance = 0.f);
252 static float CalculateGapDeltaZ(
const pandora::Pandora &
pandora,
const float minZ,
const float maxZ,
const pandora::HitType hitType);
260 static float GetSigmaUVW(
const pandora::Pandora &
pandora,
const float maxSigmaDiscrepancy = 0.01);
280 #endif // #ifndef LAR_GEOMETRY_HELPER_H
static float GetSigmaUVW(const pandora::Pandora &pandora, const float maxSigmaDiscrepancy=0.01)
Find the sigmaUVW value for the detector geometry.
static void MergeTwoPositions3D(const pandora::Pandora &pandora, const pandora::HitType view1, const pandora::HitType view2, const pandora::CartesianVector &position1, const pandora::CartesianVector &position2, pandora::CartesianVector &position3D, float &chiSquared)
Merge 2D positions from two views to give unified 3D position.
static pandora::CartesianVector MergeTwoDirections(const pandora::Pandora &pandora, const pandora::HitType view1, const pandora::HitType view2, const pandora::CartesianVector &direction1, const pandora::CartesianVector &direction2)
Merge two views (U,V) to give a third view (Z).
static float CalculateGapDeltaZ(const pandora::Pandora &pandora, const float minZ, const float maxZ, const pandora::HitType hitType)
Calculate the total distance within a given 2D region that is composed of detector gaps...
static pandora::CartesianVector ProjectPosition(const pandora::Pandora &pandora, const pandora::CartesianVector &position3D, const pandora::HitType view)
Project 3D position into a given 2D view.
static float GetWireZPitch(const pandora::Pandora &pandora, const float maxWirePitchDiscrepancy=0.01)
Return the wire pitch.
std::set< unsigned int > UIntSet
static bool IsInGap(const pandora::Pandora &pandora, const pandora::CartesianVector &testPoint2D, const pandora::HitType hitType, const float gapTolerance=0.f)
Whether a 2D test point lies in a registered gap with the associated hit type.
static float MergeTwoPositions(const pandora::Pandora &pandora, const pandora::HitType view1, const pandora::HitType view2, const float position1, const float position2)
Merge two views (U,V) to give a third view (Z).
static float GetWirePitch(const pandora::Pandora &pandora, const pandora::HitType view, const float maxWirePitchDiscrepancy=0.01)
Return the wire pitch.
static void MergeThreePositions3D(const pandora::Pandora &pandora, const pandora::HitType view1, const pandora::HitType view2, const pandora::HitType view3, const pandora::CartesianVector &position1, const pandora::CartesianVector &position2, const pandora::CartesianVector &position3, pandora::CartesianVector &position3D, float &chiSquared)
Merge 2D positions from three views to give unified 3D position.
static pandora::CartesianVector GetWireAxis(const pandora::Pandora &pandora, const pandora::HitType view)
Return the wire axis (vector perpendicular to the wire direction and drift direction) ...
static void MergeThreePositions(const pandora::Pandora &pandora, const pandora::HitType view1, const pandora::HitType view2, const pandora::HitType view3, const pandora::CartesianVector &position1, const pandora::CartesianVector &position2, const pandora::CartesianVector &position3, pandora::CartesianVector &outputU, pandora::CartesianVector &outputV, pandora::CartesianVector &outputW, float &chiSquared)
Merge 2D positions from three views to give unified 2D positions for each view.
static bool IsXSamplingPointInGap(const pandora::Pandora &pandora, const float xSample, const TwoDSlidingFitResult &slidingFitResult, const float gapTolerance=0.f)
Whether there is a gap in a cluster (described via its sliding fit result) at a specified x sampling ...
required by fuzzyCluster table::sbnd_g4_services gaushitTruthMatch pandora
static pandora::CartesianVector ProjectDirection(const pandora::Pandora &pandora, const pandora::CartesianVector &direction3D, const pandora::HitType view)
Project 3D direction into a given 2D view.
TwoDSlidingFitResult class.
static void GetCommonDaughterVolumes(const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2, UIntSet &intersect)
Return the set of common daughter volumes between two 2D clusters.
static bool IsInGap3D(const pandora::Pandora &pandora, const pandora::CartesianVector &testPoint3D, const pandora::HitType hitType, const float gapTolerance=0.f)
Whether a 3D test point lies in a registered gap with the associated hit type.