LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
LArGeometryHelper.h
Go to the documentation of this file.
1 
8 #ifndef LAR_GEOMETRY_HELPER_H
9 #define LAR_GEOMETRY_HELPER_H 1
10 
11 #include "Objects/Cluster.h"
12 #include "Pandora/PandoraEnumeratedTypes.h"
13 #include "Pandora/StatusCodes.h"
14 
15 #include <unordered_map>
16 
17 namespace pandora
18 {
19 class CartesianVector;
20 class Pandora;
21 } // namespace pandora
22 
23 namespace lar_content
24 {
25 
26 class TwoDSlidingFitResult;
27 
28 //------------------------------------------------------------------------------------------------------------------------------------------
29 
34 {
35 public:
36  typedef std::set<unsigned int> UIntSet;
37 
47  static float MergeTwoPositions(const pandora::Pandora &pandora, const pandora::HitType view1, const pandora::HitType view2,
48  const float position1, const float position2);
49 
59  static pandora::CartesianVector MergeTwoDirections(const pandora::Pandora &pandora, const pandora::HitType view1,
60  const pandora::HitType view2, const pandora::CartesianVector &direction1, const pandora::CartesianVector &direction2);
61 
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);
75 
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);
92 
108  static void MergeThreePositions(const pandora::Pandora &pandora, const pandora::HitType view1, const pandora::HitType view2,
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);
112 
125  static void MergeThreePositions(const pandora::Pandora &pandora, const pandora::CartesianVector &positionU,
126  const pandora::CartesianVector &positionV, const pandora::CartesianVector &positionW, pandora::CartesianVector &outputU,
127  pandora::CartesianVector &outputV, pandora::CartesianVector &outputW, float &chiSquared);
128 
140  static void MergeTwoPositions3D(const pandora::Pandora &pandora, const pandora::HitType view1, const pandora::HitType view2,
141  const pandora::CartesianVector &position1, const pandora::CartesianVector &position2, pandora::CartesianVector &position3D, float &chiSquared);
142 
156  static void MergeThreePositions3D(const pandora::Pandora &pandora, const pandora::HitType view1, const pandora::HitType view2,
157  const pandora::HitType view3, const pandora::CartesianVector &position1, const pandora::CartesianVector &position2,
158  const pandora::CartesianVector &position3, pandora::CartesianVector &position3D, float &chiSquared);
159 
167  static pandora::CartesianVector ProjectPosition(
168  const pandora::Pandora &pandora, const pandora::CartesianVector &position3D, const pandora::HitType view);
169 
177  static pandora::CartesianVector ProjectDirection(
178  const pandora::Pandora &pandora, const pandora::CartesianVector &direction3D, const pandora::HitType view);
179 
186  static float GetWireZPitch(const pandora::Pandora &pandora, const float maxWirePitchDiscrepancy = 0.01);
187 
195  static float GetWirePitch(const pandora::Pandora &pandora, const pandora::HitType view, const float maxWirePitchDiscrepancy = 0.01);
196 
205  static float GetWirePitchRatio(const pandora::Pandora &pandora, const pandora::HitType view);
206 
213  static pandora::CartesianVector GetWireAxis(const pandora::Pandora &pandora, const pandora::HitType view);
214 
225  static bool IsInGap(const pandora::Pandora &pandora, const pandora::CartesianVector &testPoint2D, const pandora::HitType hitType,
226  const float gapTolerance = 0.f);
227 
238  static bool IsInGap3D(const pandora::Pandora &pandora, const pandora::CartesianVector &testPoint3D, const pandora::HitType hitType,
239  const float gapTolerance = 0.f);
240 
251  static bool IsXSamplingPointInGap(
252  const pandora::Pandora &pandora, const float xSample, const TwoDSlidingFitResult &slidingFitResult, const float gapTolerance = 0.f);
253 
262  static float CalculateGapDeltaZ(const pandora::Pandora &pandora, const float minZ, const float maxZ, const pandora::HitType hitType);
263 
270  static float GetSigmaUVW(const pandora::Pandora &pandora, const float maxSigmaDiscrepancy = 0.01);
271 
279  static void GetCommonDaughterVolumes(const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2, UIntSet &intersect);
280 };
281 //------------------------------------------------------------------------------------------------------------------------------------------
282 
283 inline float LArGeometryHelper::GetWireZPitch(const pandora::Pandora &pandora, const float maxWirePitchWDiscrepancy)
284 {
285  return LArGeometryHelper::GetWirePitch(pandora, pandora::TPC_VIEW_W, maxWirePitchWDiscrepancy);
286 }
287 
288 } // namespace lar_content
289 
290 #endif // #ifndef LAR_GEOMETRY_HELPER_H
LArGeometryHelper class.
std::set< unsigned int > UIntSet
TFile f
Definition: plotHisto.C:6
HitType
Definition: HitType.h:12