9 #include "Pandora/AlgorithmHeaders.h" 21 CosmicRayShowerMatchingAlgorithm::CosmicRayShowerMatchingAlgorithm() :
22 m_minCaloHitsPerCluster(10),
24 m_minXOverlapFraction(0.5
f),
33 for (
const Cluster *
const pCluster : inputVector)
38 outputVector.push_back(pCluster);
46 float xMin1(0.
f), xMax1(0.
f), xMin2(0.
f), xMax2(0.
f);
53 if (xSpan < std::numeric_limits<float>::epsilon())
65 const Cluster *
const pCluster3)
const 72 if (hitType1 == hitType2 || hitType2 == hitType3 || hitType3 == hitType1)
73 throw StatusCodeException(STATUS_CODE_FAILURE);
76 float xMin1(0.
f), xMin2(0.
f), xMin3(0.
f), xMax1(0.
f), xMax2(0.
f), xMax3(0.
f);
83 const float xOverlap(xMax - xMin);
85 if (xOverlap < std::numeric_limits<float>::epsilon())
101 const float pseudoChi2(((q1 - p1) * (q1 - p1) + (q2 - p2) * (q2 - p2) + (q3 - p3) * (q3 - p3)) / 3.
f);
113 ClusterList clusterList;
119 pfoParameters.m_particleId = E_MINUS;
120 pfoParameters.m_charge = PdgTable::GetParticleCharge(pfoParameters.m_particleId.Get());
121 pfoParameters.m_mass = PdgTable::GetParticleMass(pfoParameters.m_particleId.Get());
122 pfoParameters.m_energy = 0.f;
123 pfoParameters.m_momentum = CartesianVector(0.
f, 0.
f, 0.
f);
124 pfoParameters.m_clusterList = clusterList;
131 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
134 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
137 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
140 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
bool MatchClusters(const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2) const
Match a pair of clusters from two views.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
const pandora::Cluster * m_pClusterV
Address of cluster in V view.
static pandora::HitType GetClusterHitType(const pandora::Cluster *const pCluster)
Get the hit type associated with a two dimensional cluster.
static pandora::StatusCode GetAverageZ(const pandora::Cluster *const pCluster, const float xmin, const float xmax, float &averageZ)
Get average Z positions of the calo hits in a cluster in range xmin to xmax.
Header file for the cosmic ray shower matching algorithm class.
Header file for the geometry helper class.
bool CheckMatchedClusters3D(const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2, const pandora::Cluster *const pCluster3) const
Check that three clusters have a consistent 3D position.
Header file for the cluster helper class.
const pandora::Cluster * m_pClusterW
Address of cluster in W view.
const pandora::Cluster * m_pClusterU
Address of cluster in U view.
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).
float m_pseudoChi2Cut
The selection cut on the matched chi2.
std::vector< art::Ptr< recob::Cluster > > ClusterVector
float m_minXOverlap
requirement on minimum X overlap for associated clusters
static void GetClusterSpanX(const pandora::Cluster *const pCluster, float &xmin, float &xmax)
Get minimum and maximum X positions of the calo hits in a cluster.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
void SelectCleanClusters(const pandora::ClusterVector &inputVector, pandora::ClusterVector &outputVector) const
Select a set of clusters judged to be clean.
float m_minCaloHitsPerCluster
minimum size of clusters for this algorithm
void SetPfoParameters(const Particle &particle, PandoraContentApi::ParticleFlowObject::Parameters &pfoParameters) const
Calculate Pfo properties from proto particle.
float m_minXOverlapFraction
requirement on minimum X overlap fraction for associated clusters