58 MatchedSlidingFitMap::const_iterator iterU = inputSlidingFitMap.find(
TPC_VIEW_U);
59 const bool foundU(inputSlidingFitMap.end() != iterU);
61 MatchedSlidingFitMap::const_iterator iterV = inputSlidingFitMap.find(
TPC_VIEW_V);
62 const bool foundV(inputSlidingFitMap.end() != iterV);
64 MatchedSlidingFitMap::const_iterator iterW = inputSlidingFitMap.find(
TPC_VIEW_W);
65 const bool foundW(inputSlidingFitMap.end() != iterW);
67 bool useU(
false), useV(
false), useW(
false);
68 float bestChi2(std::numeric_limits<float>::max());
70 for (
unsigned int iPermutation = 0; iPermutation < 4; ++iPermutation)
72 const bool isForwardU((1 == iPermutation) ?
false :
true);
73 const bool isForwardV((2 == iPermutation) ?
false :
true);
74 const bool isForwardW((3 == iPermutation) ?
false :
true);
102 float vtxChi2(std::numeric_limits<float>::max()), endChi2(std::numeric_limits<float>::max());
104 if (foundU && foundV)
110 if (foundV && foundW)
116 if (foundW && foundU)
122 bool matchedU(
false), matchedV(
false), matchedW(
false);
123 unsigned int matchedViews(0);
167 if (matchedViews < 2)
170 if (vtxChi2 + endChi2 < bestChi2)
178 bestChi2 = vtxChi2 + endChi2;
183 outputSlidingFitMap.insert(MatchedSlidingFitMap::value_type(iterU->first, iterU->second));
186 outputSlidingFitMap.insert(MatchedSlidingFitMap::value_type(iterV->first, iterV->second));
189 outputSlidingFitMap.insert(MatchedSlidingFitMap::value_type(iterW->first, iterW->second));
191 if (outputSlidingFitMap.empty())
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 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.
Proto hits are temporary constructs to be used during iterative 3D hit procedure.
bool IsPositionSet() const
Whether the proto hit position is set.
pandora::CartesianVector GetGlobalMinLayerPosition() const
Get global position corresponding to the fit result in minimum fit layer.
pandora::CartesianVector GetGlobalMaxLayerPosition() const
Get global position corresponding to the fit result in maximum fit layer.