32 if (sliceList.empty())
33 return STATUS_CODE_SUCCESS;
36 const ClusterList *pClusterList(
nullptr);
37 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::CreateTemporaryListAndSetCurrent(*
this, pClusterList, clusterListName));
40 const PfoList *pPfoList(
nullptr);
41 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::CreateTemporaryListAndSetCurrent(*
this, pPfoList, pfoListName));
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)
58 throw StatusCodeException(STATUS_CODE_FAILURE);
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;
71 pfoParameters.m_momentum = CartesianVector(0.
f, 0.
f, 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())
78 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::SaveList<Cluster>(*
this,
m_sliceClusterListName));
79 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::ReplaceCurrentList<Cluster>(*
this,
m_sliceClusterListName));
82 if (!pPfoList->empty())
84 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::SaveList<ParticleFlowObject>(*
this,
m_slicePfoListName));
85 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::ReplaceCurrentList<ParticleFlowObject>(*
this,
m_slicePfoListName));
88 return STATUS_CODE_SUCCESS;
SlicingAlgorithm::Slice Slice
HitTypeToNameMap m_caloHitListNames
The hit type to calo hit list name map.
std::string m_slicingListDeletionAlgorithm
The name of the slicing list deletion 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_sliceClusterListName
The name of the output slice cluster list.
HitTypeToNameMap m_clusterListNames
The hit type to cluster list name map.
std::vector< Slice > SliceList
std::string m_slicePfoListName
The name of the output slice pfo list.
EventSlicingBaseTool * m_pEventSlicingTool
The address of the event slicing tool.