32 if (sliceList.empty())
33 return STATUS_CODE_SUCCESS;
35 std::string clusterListName;
39 std::string pfoListName;
40 const PfoList *pPfoList(
nullptr);
43 for (
const Slice &slice : sliceList)
45 const Cluster *pClusterU(
nullptr), *pClusterV(
nullptr), *pClusterW(
nullptr);
46 PandoraContentApi::Cluster::Parameters clusterParametersU, clusterParametersV, clusterParametersW;
47 clusterParametersU.m_caloHitList = slice.m_caloHitListU;
48 clusterParametersV.m_caloHitList = slice.m_caloHitListV;
49 clusterParametersW.m_caloHitList = slice.m_caloHitListW;
50 if (!clusterParametersU.m_caloHitList.empty())
51 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::Cluster::Create(*
this, clusterParametersU, pClusterU));
52 if (!clusterParametersV.m_caloHitList.empty())
53 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::Cluster::Create(*
this, clusterParametersV, pClusterV));
54 if (!clusterParametersW.m_caloHitList.empty())
55 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::Cluster::Create(*
this, clusterParametersW, pClusterW));
57 if (!pClusterU && !pClusterV && !pClusterW)
60 const Pfo *pSlicePfo(
nullptr);
61 PandoraContentApi::ParticleFlowObject::Parameters pfoParameters;
63 pfoParameters.m_clusterList.push_back(pClusterU);
65 pfoParameters.m_clusterList.push_back(pClusterV);
67 pfoParameters.m_clusterList.push_back(pClusterW);
68 pfoParameters.m_charge = 0;
69 pfoParameters.m_energy = 0.f;
70 pfoParameters.m_mass = 0.f;
72 pfoParameters.m_particleId = 0;
73 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::ParticleFlowObject::Create(*
this, pfoParameters, pSlicePfo));
76 if (!pClusterList->empty())
82 if (!pPfoList->empty())
88 return STATUS_CODE_SUCCESS;
100 return STATUS_CODE_INVALID_PARAMETER;
105 std::string caloHitListNameU, caloHitListNameV, caloHitListNameW;
113 std::string clusterListNameU, clusterListNameV, clusterListNameW;
124 return STATUS_CODE_SUCCESS;
static pandora::StatusCode ReplaceCurrentList(const pandora::Algorithm &algorithm, const std::string &newListName)
Replace the current list with a pre-saved list; use this new list as a permanent replacement for the ...
static pandora::StatusCode CreateTemporaryListAndSetCurrent(const pandora::Algorithm &algorithm, const T *&pT, std::string &temporaryListName)
Create a temporary list and set it to be the current list, enabling object creation.
static pandora::StatusCode RunDaughterAlgorithm(const pandora::Algorithm &algorithm, const std::string &daughterAlgorithmName)
Run an algorithm registered with pandora, from within a parent algorithm.
virtual void RunSlicing(const pandora::Algorithm *const pAlgorithm, const SlicingAlgorithm::HitTypeToNameMap &caloHitListNames, const SlicingAlgorithm::HitTypeToNameMap &clusterListNames, SlicingAlgorithm::SliceList &sliceList)=0
Run the slicing tool.
std::string m_slicingListDeletionAlgorithm
The name of the slicing list deletion algorithm.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
Read the algorithm settings.
std::string m_sliceClusterListName
The name of the output slice cluster list.
pandora::StatusCode Run()
Run the algorithm.
EventSlicingBaseTool * m_pEventSlicingTool
The address of the event slicing tool.
HitTypeToNameMap m_clusterListNames
The hit type to cluster list name map.
std::string m_slicePfoListName
The name of the output slice pfo list.
std::vector< Slice > SliceList
HitTypeToNameMap m_caloHitListNames
The hit type to calo hit list name map.
ParticleFlowObject class.
static StatusCode ProcessAlgorithm(const Algorithm &algorithm, const TiXmlHandle &xmlHandle, const std::string &description, std::string &algorithmName)
Process an algorithm described in an xml element with a matching "description = .....
static StatusCode ProcessAlgorithmTool(const Algorithm &algorithm, const TiXmlHandle &xmlHandle, const std::string &description, AlgorithmTool *&pAlgorithmTool)
Process an algorithm tool described in an xml element with a matching "description = ....