9 #include "Pandora/AlgorithmHeaders.h" 21 ThreeDRemnantsAlgorithm::ThreeDRemnantsAlgorithm() :
22 m_nMaxTensorToolRepeats(1000),
23 m_minClusterCaloHits(5),
24 m_xOverlapWindow(2.
f),
35 const Cluster *
const pCluster = *iter;
37 if (!pCluster->IsAvailable())
43 selectedClusterList.push_back(pCluster);
52 pfoParameters.m_particleId = E_MINUS;
53 pfoParameters.m_charge = PdgTable::GetParticleCharge(pfoParameters.m_particleId.Get());
54 pfoParameters.m_mass = PdgTable::GetParticleMass(pfoParameters.m_particleId.Get());
55 pfoParameters.m_energy = 0.f;
56 pfoParameters.m_momentum = CartesianVector(0.
f, 0.
f, 0.
f);
57 pfoParameters.m_clusterList.insert(pfoParameters.m_clusterList.end(), protoParticle.
m_clusterListU.begin(), protoParticle.
m_clusterListU.end());
58 pfoParameters.m_clusterList.insert(pfoParameters.m_clusterList.end(), protoParticle.
m_clusterListV.begin(), protoParticle.
m_clusterListV.end());
59 pfoParameters.m_clusterList.insert(pfoParameters.m_clusterList.end(), protoParticle.
m_clusterListW.begin(), protoParticle.
m_clusterListW.end());
67 float xMinU(0.
f), xMinV(0.
f), xMinW(0.
f), xMaxU(0.
f), xMaxV(0.
f), xMaxW(0.
f);
74 const float xOverlap(xMax - xMin);
76 if (xOverlap < std::numeric_limits<float>::epsilon())
93 const float pseudoChi2(((u - vw2u) * (u - vw2u) + (v - wu2v) * (v - wu2v) + (w - uv2w) * (w - uv2w)) / 3.
f);
99 const float hackValue(pseudoChi2 + pClusterU->GetElectromagneticEnergy() + pClusterV->GetElectromagneticEnergy() + pClusterW->GetElectromagneticEnergy());
107 unsigned int repeatCounter(0);
129 AlgorithmToolVector algorithmToolVector;
130 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ProcessAlgorithmToolList(*
this, xmlHandle,
131 "TrackTools", algorithmToolVector));
135 RemnantTensorTool *
const pRemnantTensorTool(dynamic_cast<RemnantTensorTool*>(*iter));
137 if (NULL == pRemnantTensorTool)
138 return STATUS_CODE_INVALID_PARAMETER;
143 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
146 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
149 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
152 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
void SelectInputClusters(const pandora::ClusterList *const pInputClusterList, pandora::ClusterList &selectedClusterList) const
Select a subset of input clusters for processing in this algorithm.
virtual pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
unsigned int m_minClusterCaloHits
The selection cut on the number of cluster calo hits.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
float m_pseudoChi2Cut
The selection cut on the matched chi2.
void CalculateOverlapResult(const pandora::Cluster *const pClusterU, const pandora::Cluster *const pClusterV, const pandora::Cluster *const pClusterW)
Calculate cluster overlap result and store in tensor.
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 geometry helper class.
pandora::ClusterList m_clusterListW
List of 2D W clusters in a 3D proto particle.
void SetPfoParameters(const ProtoParticle &protoParticle, PandoraContentApi::ParticleFlowObject::Parameters &pfoParameters) const
Calculate Pfo properties from proto particle.
void SetOverlapResult(const pandora::Cluster *const pClusterU, const pandora::Cluster *const pClusterV, const pandora::Cluster *const pClusterW, const OverlapResult &overlapResult)
Set overlap result.
Header file for the cluster helper class.
TensorType m_overlapTensor
The overlap tensor.
Header file for the three dimensional remnants algorithm class.
pandora::ClusterList m_clusterListV
List of 2D V clusters in a 3D proto particle.
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).
pandora::ClusterList m_clusterListU
List of 2D U clusters in a 3D proto particle.
float m_xOverlapWindow
The sampling pitch in the x coordinate.
RemnantTensorToolVector m_algorithmToolVector
The algorithm tool list.
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.
void ExamineTensor()
Examine contents of tensor, collect together best-matching 2D particles and modify clusters as requir...
unsigned int m_nMaxTensorToolRepeats
The maximum number of repeat loops over tensor tools.