9 #include "Pandora/AlgorithmHeaders.h" 18 TwoDParticleCreationAlgorithm::TwoDParticleCreationAlgorithm() :
19 m_minHitsInCluster(5),
20 m_minClusterEnergy(0.
f)
28 const PfoList *pPfoList =
nullptr; std::string pfoListName;
29 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::CreateTemporaryListAndSetCurrent(*
this, pPfoList, pfoListName));
33 const ClusterList *pClusterListU =
nullptr;
34 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::GetList(*
this,
m_inputClusterListNameU, pClusterListU));
37 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->
CreatePFOs(pClusterListU));
42 const ClusterList *pClusterListV =
nullptr;
43 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::GetList(*
this,
m_inputClusterListNameV, pClusterListV));
46 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->
CreatePFOs(pClusterListV));
51 const ClusterList *pClusterListW =
nullptr;
52 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::GetList(*
this,
m_inputClusterListNameW, pClusterListW));
55 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->
CreatePFOs(pClusterListW));
58 if (!pPfoList->empty())
60 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::SaveList<Pfo>(*
this,
m_outputPfoListName));
61 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::ReplaceCurrentList<Pfo>(*
this,
m_outputPfoListName));
64 return STATUS_CODE_SUCCESS;
73 const Cluster *
const pCluster = *iter;
79 const float clusterEnergy(pCluster->GetElectromagneticEnergy());
84 PandoraContentApi::ParticleFlowObject::Parameters pfoParameters;
87 const ParticleType particleType(PandoraContentApi::GetPlugins(*this)->GetParticleId()->IsMuon(pCluster) ? MU_MINUS : PHOTON);
89 const ClusterFitResult &fitToAllHitsResult(pCluster->GetFitToAllHitsResult());
91 if (!fitToAllHitsResult.IsFitSuccessful())
95 pfoParameters.m_particleId = particleType;
96 pfoParameters.m_charge = 0;
97 pfoParameters.m_mass = 0.;
98 pfoParameters.m_energy = clusterEnergy;
99 pfoParameters.m_momentum = CartesianVector(fitToAllHitsResult.GetDirection() * clusterEnergy);
100 pfoParameters.m_clusterList.push_back(pCluster);
102 const ParticleFlowObject *pPfo(NULL);
103 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::ParticleFlowObject::Create(*
this, pfoParameters, pPfo));
106 return STATUS_CODE_SUCCESS;
113 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ReadValue(xmlHandle,
116 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
119 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
122 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
125 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
128 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
131 return STATUS_CODE_SUCCESS;
float m_minClusterEnergy
Min energy for clusters to form pfos.
std::string m_inputClusterListNameW
The input cluster list name for the W view.
pandora::StatusCode CreatePFOs(const pandora::ClusterList *const pClusterList) const
Create pfos for provided clusters.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
std::string m_inputClusterListNameU
The input cluster list name for the U view.
std::string m_inputClusterListNameV
The input cluster list name for the V view.
std::string m_outputPfoListName
The output pfo list name.
pandora::StatusCode Run()
Header file for the two dimensional particle creation algorithm class.
unsigned int m_minHitsInCluster
Min number of hits for clusters to form pfos.