41 PfoList tracksToShowers, showersToTracks;
45 const PfoList *pPfoList(
nullptr);
46 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_INITIALIZED, !=, PandoraContentApi::GetList(*
this, pfoListName, pPfoList));
48 if (!pPfoList || pPfoList->empty())
50 if (PandoraContentApi::GetSettings(*this)->ShouldDisplayAlgorithmInfo())
51 std::cout <<
"PfoCharacterisationBaseAlgorithm: unable to find pfo list " << pfoListName <<
std::endl;
56 for (
const ParticleFlowObject *
const pPfo : *pPfoList)
58 PandoraContentApi::ParticleFlowObject::Metadata pfoMetadata;
63 pfoMetadata.m_particleId = MU_MINUS;
66 showersToTracks.push_back(pPfo);
70 pfoMetadata.m_particleId = E_MINUS;
73 tracksToShowers.push_back(pPfo);
76 if (pPfo->GetParticleId() != pfoMetadata.m_particleId.Get())
77 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::ParticleFlowObject::AlterMetadata(*
this, pPfo, pfoMetadata));
82 ClusterList twoDClusterList;
85 for (
const Cluster *
const pCluster : twoDClusterList)
87 if (pCluster->GetParticleId() == pfoMetadata.m_particleId.Get())
90 PandoraContentApi::Cluster::Metadata clusterMetadata;
91 clusterMetadata.m_particleId = pfoMetadata.m_particleId.Get();
92 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::Cluster::AlterMetadata(*
this, pCluster, clusterMetadata));
97 if (!tracksToShowers.empty())
100 if (!showersToTracks.empty())
103 return STATUS_CODE_SUCCESS;
virtual bool IsClearTrack3x2D(const pandora::ParticleFlowObject *const pPfo) const
Whether pfo is identified as a clear track using its three clusters.
pandora::StringVector m_inputPfoListNames
The names of the input pfo lists.
static void GetTwoDClusterList(const pandora::ParticleFlowObject *const pPfo, pandora::ClusterList &clusterList)
Get the list of 2D clusters from an input pfo.
virtual bool IsClearTrack(const pandora::ParticleFlowObject *const pPfo) const =0
Whether pfo is identified as a clear track.
bool m_updateClusterIds
Whether to update daughter cluster particle id labels to match pfo id.
std::string m_trackPfoListName
The track pfo list name.
bool m_useThreeDInformation
Whether to use PFO and 3D information or clusters for characterisation.
std::string m_showerPfoListName
The shower pfo list name.
QTextStream & endl(QTextStream &s)