Pandora
Pandora source code navigator
Loading...
Searching...
No Matches
ListDeletionAlgorithm.cc
Go to the documentation of this file.
1
10
12
13using namespace pandora;
14
15namespace lar_content
16{
17
19{
20 for (const std::string &listName : m_pfoListNames)
21 {
22 const PfoList *pList(nullptr);
23 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_INITIALIZED, !=, PandoraContentApi::GetList(*this, listName, pList));
24
25 if (pList && !pList->empty())
26 {
27 const PfoList listCopy(*pList);
28 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::Delete(*this, &listCopy, listName));
29 }
30 }
31
32 for (const std::string &listName : m_clusterListNames)
33 {
34 const ClusterList *pList(nullptr);
35 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_INITIALIZED, !=, PandoraContentApi::GetList(*this, listName, pList));
36
37 if (pList && !pList->empty())
38 {
39 const ClusterList listCopy(*pList);
40 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::Delete(*this, &listCopy, listName));
41 }
42 }
43
44 for (const std::string &listName : m_vertexListNames)
45 {
46 const VertexList *pList(nullptr);
47 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_INITIALIZED, !=, PandoraContentApi::GetList(*this, listName, pList));
48
49 if (pList && !pList->empty())
50 {
51 const VertexList listCopy(*pList);
52 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::Delete(*this, &listCopy, listName));
53 }
54 }
55
56 return STATUS_CODE_SUCCESS;
57}
58
59//------------------------------------------------------------------------------------------------------------------------------------------
60
62{
64 STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadVectorOfValues(xmlHandle, "PfoListNames", m_pfoListNames));
65
67 STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadVectorOfValues(xmlHandle, "ClusterListNames", m_clusterListNames));
68
70 STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadVectorOfValues(xmlHandle, "VertexListNames", m_vertexListNames));
71
72 return STATUS_CODE_SUCCESS;
73}
74
75} // namespace lar_content
Grouping of header files for many classes of use in particle flow algorithms.
Header file for the list deletion algorithm class.
#define PANDORA_RETURN_RESULT_IF_AND_IF(StatusCode1, StatusCode2, Operator, Command)
Definition StatusCodes.h:31
#define PANDORA_RETURN_RESULT_IF(StatusCode1, Operator, Command)
Definition StatusCodes.h:19
static pandora::StatusCode Delete(const pandora::Algorithm &algorithm, const T *const pT)
Delete an object from the current list.
static pandora::StatusCode GetList(const pandora::Algorithm &algorithm, const std::string &listName, const T *&pT)
Get a named list.
pandora::StatusCode Run()
Run the algorithm.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
Read the algorithm settings.
pandora::StringVector m_clusterListNames
The list of cluster list names.
pandora::StringVector m_pfoListNames
The list of pfo list names.
pandora::StringVector m_vertexListNames
The list of vertex list names.
static StatusCode ReadVectorOfValues(const TiXmlHandle &xmlHandle, const std::string &xmlElementName, std::vector< T > &vector)
Read a vector of values from a (space separated) list in an xml element.
Definition XmlHelper.h:229
MANAGED_CONTAINER< const Cluster * > ClusterList
MANAGED_CONTAINER< const Vertex * > VertexList
StatusCode
The StatusCode enum.
MANAGED_CONTAINER< const ParticleFlowObject * > PfoList