47 const float maxProjectionSeparation,
const float maxXSeparation,
CartesianPointVector &showerStarts3D)
54 bool uFound(
false), vFound(
false), wFound(
false);
55 CartesianVector uShowerStart3D(0.f, 0.f, 0.f), vShowerStart3D(0.f, 0.f, 0.f), wShowerStart3D(0.f, 0.f, 0.f);
63 vShowerStart3D = uShowerStart3D;
64 wShowerStart3D = uShowerStart3D;
76 pAlgorithm, protoShowerU, protoShowerV, protoShowerW, uShowerStart3D, vShowerStart3D, wShowerStart3D))
92 pAlgorithm, protoShowerU, protoShowerV, protoShowerW, maxProjectionSeparation, maxXSeparation, uShowerStart3D) ||
94 pAlgorithm, protoShowerU, protoShowerV, protoShowerW, maxProjectionSeparation, maxXSeparation, uShowerStart3D) ||
96 pAlgorithm, protoShowerU, protoShowerW, protoShowerV, maxProjectionSeparation, maxXSeparation, uShowerStart3D))
102 pAlgorithm, protoShowerV, protoShowerW, protoShowerU, maxProjectionSeparation, maxXSeparation, vShowerStart3D) ||
104 pAlgorithm, protoShowerV, protoShowerW, protoShowerU, maxProjectionSeparation, maxXSeparation, vShowerStart3D) ||
106 pAlgorithm, protoShowerV, protoShowerU, protoShowerW, maxProjectionSeparation, maxXSeparation, vShowerStart3D))
112 pAlgorithm, protoShowerW, protoShowerU, protoShowerV, maxProjectionSeparation, maxXSeparation, wShowerStart3D) ||
114 pAlgorithm, protoShowerW, protoShowerU, protoShowerV, maxProjectionSeparation, maxXSeparation, wShowerStart3D) ||
116 pAlgorithm, protoShowerW, protoShowerV, protoShowerU, maxProjectionSeparation, maxXSeparation, wShowerStart3D))
125 foundShowerStarts3D.push_back(uShowerStart3D);
128 foundShowerStarts3D.push_back(vShowerStart3D);
131 foundShowerStarts3D.push_back(wShowerStart3D);
133 if (foundShowerStarts3D.empty())
139 showerStarts3D.push_back(foundShowerStarts3D.front());
140 showerStarts3D.push_back((foundShowerStarts3D.size() == 3) ? foundShowerStarts3D[1] : foundShowerStarts3D[0]);
141 showerStarts3D.push_back(foundShowerStarts3D.back());
185 const float x(showerStart.
GetX());
186 CartesianVector showerStartA(0.f, 0.f, 0.f), showerStartB(0.f, 0.f, 0.f);
200 pAlgorithm->
GetPandora(), hitType, hitTypeA, hitTypeB, showerStart, showerStartA, showerStartB, showerStart3D, chi2);
215 if (transverse > 1.f)
221 showerStart2D = viewNuVertex + (viewPeakDirection * (std::fabs(x - viewNuVertex.
GetX()) * cosTheta));
232 CartesianVector showerStart1(0.f, 0.f, 0.f), showerStart2(0.f, 0.f, 0.f);
245 CartesianVector projection(0.f, 0.f, 0.f), projection1(0.f, 0.f, 0.f), projection2(0.f, 0.f, 0.f);
248 const float separationSquared((projection - showerStart).GetMagnitudeSquared());
251 const float separationSquared1((projection1 - showerStart1).GetMagnitudeSquared());
254 const float separationSquared2((projection2 - showerStart2).GetMagnitudeSquared());
256 if ((separationSquared > maxSeparation * maxSeparation) || (separationSquared1 > maxSeparation * maxSeparation) ||
257 (separationSquared2 > maxSeparation * maxSeparation))
263 pAlgorithm->
GetPandora(), hitType, hitType1, hitType2, showerStart, showerStart1, showerStart2, showerStart3D, chi2);
274 float lowestL(std::numeric_limits<float>::max());
278 if (std::fabs(pCaloHit->GetPositionVector().GetX() - showerStart3D.
GetX()) > maxXSeparation)
284 if ((lVertex > 0.f) && (lVertex < lowestL))
287 foundShowerStart = pCaloHit->GetPositionVector();
318 if (separation > maxSeparation)
331 const float value1,
const float value2,
const float value3,
float &minValue,
float &middleValue,
float &maxValue)
335 std::sort(values.begin(), values.end());
337 minValue = values.at(0);
338 middleValue = values.at(1);
339 maxValue = values.at(2);
Header file for the algorithm class.
Header file for the cluster helper class.
Header file for the connection pathway helper class.
Header file for the geometry helper class.
Header file for the pfo helper class.
Header file for the ProtoShower class.
Header file for the pandora class.
Header file defining relevant internal typedefs, sort and string conversion functions.
const pandora::CartesianVector & GetStartDirection() const
Get the start direction of the connection pathway.
const pandora::CartesianVector & GetStartPosition() const
Get the start position of the connection pathway.
static float GetClosestDistance(const pandora::ClusterList &clusterList1, const pandora::ClusterList &clusterList2)
Get closest distance between clusters in a pair of cluster lists.
SortByDistanceToPoint class.
const pandora::CartesianVector m_referencePoint
The point relative to which constituent hits are ordered.
bool operator()(const pandora::CartesianVector &lhs, const pandora::CartesianVector &rhs)
Sort constituent hits by their position relative to a referencePoint.
static bool FindShowerStartFromXProjection(const pandora::Algorithm *const pAlgorithm, const ProtoShower &protoShower, const ProtoShower &protoShower1, const ProtoShower &protoShower2, const float maxSeparation, const float maxXSeparation, pandora::CartesianVector &showerStart3D)
Create a 3D shower start position from an input 2D position, assuming consistency of the drift coordi...
static bool FindShowerStartFromDirection(const pandora::Algorithm *const pAlgorithm, const ProtoShower &protoShowerU, const ProtoShower &protoShowerV, const ProtoShower &protoShowerW, pandora::CartesianVector &uShowerStart3D, pandora::CartesianVector &vShowerStart3D, pandora::CartesianVector &wShowerStart3D)
Create a 3D shower start position from each input 2D position, assuming consistency of initial direct...
static void GetMinMiddleMax(const float value1, const float value2, const float value3, float &minValue, float &middleValue, float &maxValue)
Determine the lowest, median and highest value from an input of three numbers.
static bool ProjectShowerStartByDirection(const ProtoShower &protoShower, const float x, pandora::CartesianVector &showerStart2D)
Find a 2D shower start, from a drift coordinate by assuming consistency of initial direction.
static void FindShowerStartFromPosition(const pandora::Algorithm *const pAlgorithm, const ProtoShower &protoShowerU, const ProtoShower &protoShowerV, const ProtoShower &protoShowerW, pandora::CartesianVector &showerStart3D)
Create 3D shower start position from three input 2D positions, assuming consistency of position.
static bool FindShowerStartFromXProjectionRelaxed(const pandora::Algorithm *const pAlgorithm, const ProtoShower &protoShower, const ProtoShower &protoShower1, const ProtoShower &protoShower2, const float maxSeparation, const float maxXSeparation, pandora::CartesianVector &showerStart3D)
A relaxed approach to create a 3D shower start position from an input 2D position,...
static bool FindClosestSpinePosition(const ProtoShower &protoShower, const pandora::CartesianVector &showerStart3D, const float maxXSeparation, pandora::CartesianVector &foundShowerStart)
Find the 2D spine hit that is closest to the neutrino vertex and shares a drift coordinate with an in...
static bool FindShowerStarts3D(const pandora::Algorithm *const pAlgorithm, const pandora::ParticleFlowObject *const pShowerPfo, const ProtoShowerMatch &protoShowerMatch, const pandora::CartesianVector &nuVertexPosition, const float maxSeparationFromHit, const float maxProjectionSeparation, const float maxXSeparation, pandora::CartesianPointVector &showerStarts3D)
Create 3D shower start position(s) from three input 2D positions.
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 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 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 void GetCaloHits(const pandora::PfoList &pfoList, const pandora::HitType &hitType, pandora::CaloHitList &caloHitList)
Get a list of calo hits of a particular hit type from a list of pfos.
const ShowerCore & GetShowerCore() const
Get the shower core.
const ConnectionPathway & GetConnectionPathway() const
Get the connection pathway.
const pandora::CaloHitList & GetSpineHitList() const
Get the spine hit list.
const ProtoShower & GetProtoShowerV() const
Get the V view ProtoShower.
const ProtoShower & GetProtoShowerW() const
Get the W view ProtoShower.
const Consistency & GetConsistencyType() const
Get the consistency type.
const ProtoShower & GetProtoShowerU() const
Get the U view ProtoShower.
const pandora::CartesianVector & GetStartPosition() const
Get the start position of the shower core.
Algorithm class. Algorithm addresses are held only by the algorithm manager. They have a fully define...
const CartesianVector & GetPositionVector() const
Get the position vector of center of calorimeter cell, units mm.
float GetCosOpeningAngle(const CartesianVector &rhs) const
Get the cosine of the opening angle of the cartesian vector with respect to a second cartesian vector...
float GetX() const
Get the cartesian x coordinate.
float GetDistanceSquared(const CartesianVector &rhs) const
Get the distance squared of a cartesian vector with respect to a second cartesian vector.
float GetDotProduct(const CartesianVector &rhs) const
Get the dot product of the cartesian vector with a second cartesian vector.
float GetMagnitude() const
Get the magnitude.
CartesianVector GetCrossProduct(const CartesianVector &rhs) const
Get the cross product of the cartesian vector with a second cartesian vector.
ParticleFlowObject class.
const Pandora & GetPandora() const
Get the associated pandora instance.
Consistency
Consistency enumeration.
HitType
Calorimeter hit type enum.
std::vector< CartesianVector > CartesianPointVector
MANAGED_CONTAINER< const CaloHit * > CaloHitList
std::vector< float > FloatVector