All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Private Member Functions | Private Attributes | List of all members
lar_content::ListMergingAlgorithm Class Reference

ListMergingAlgorithm class. More...

#include <ListMergingAlgorithm.h>

Inheritance diagram for lar_content::ListMergingAlgorithm:

Private Member Functions

pandora::StatusCode Run ()
 
pandora::StatusCode ReadSettings (const pandora::TiXmlHandle xmlHandle)
 

Private Attributes

pandora::StringVector m_sourceClusterListNames
 The source cluster list names. More...
 
pandora::StringVector m_targetClusterListNames
 The target cluster list names. More...
 
pandora::StringVector m_sourcePfoListNames
 The source pfo list names. More...
 
pandora::StringVector m_targetPfoListNames
 The target pfo list names. More...
 

Detailed Description

ListMergingAlgorithm class.

Definition at line 19 of file ListMergingAlgorithm.h.

Member Function Documentation

StatusCode lar_content::ListMergingAlgorithm::ReadSettings ( const pandora::TiXmlHandle  xmlHandle)
private

Definition at line 89 of file ListMergingAlgorithm.cc.

90 {
91  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
92  XmlHelper::ReadVectorOfValues(xmlHandle, "SourceClusterListNames", m_sourceClusterListNames));
93 
94  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
95  XmlHelper::ReadVectorOfValues(xmlHandle, "TargetClusterListNames", m_targetClusterListNames));
96 
97  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
98  XmlHelper::ReadVectorOfValues(xmlHandle, "SourcePfoListNames", m_sourcePfoListNames));
99 
100  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
101  XmlHelper::ReadVectorOfValues(xmlHandle, "TargetPfoListNames", m_targetPfoListNames));
102 
104  {
105  std::cout << "ListMergingAlgorithm::ReadSettings: invalid list configuration " << std::endl;
106  return STATUS_CODE_INVALID_PARAMETER;
107  }
108 
109  return STATUS_CODE_SUCCESS;
110 }
pandora::StringVector m_targetClusterListNames
The target cluster list names.
pandora::StringVector m_targetPfoListNames
The target pfo list names.
pandora::StringVector m_sourceClusterListNames
The source cluster list names.
pandora::StringVector m_sourcePfoListNames
The source pfo list names.
BEGIN_PROLOG could also be cout
StatusCode lar_content::ListMergingAlgorithm::Run ( )
private

Definition at line 18 of file ListMergingAlgorithm.cc.

19 {
20  // Cluster list merging
22  return STATUS_CODE_FAILURE;
23 
24  for (unsigned int iIndex = 0, iIndexEnd = m_sourceClusterListNames.size(); iIndex < iIndexEnd; ++iIndex)
25  {
26  const std::string &sourceListName(m_sourceClusterListNames.at(iIndex));
27  const std::string &targetListName(m_targetClusterListNames.at(iIndex));
28 
29  const StatusCode statusCode(PandoraContentApi::SaveList<Cluster>(*this, sourceListName, targetListName));
30 
31  if (STATUS_CODE_SUCCESS != statusCode)
32  {
33  if (STATUS_CODE_NOT_FOUND == statusCode)
34  {
35  if (this->GetPandora().GetSettings()->ShouldDisplayAlgorithmInfo())
36  std::cout << "ListMergingAlgorithm: cluster list not found, source: " << sourceListName
37  << ", target: " << targetListName << std::endl;
38  }
39  else if (STATUS_CODE_NOT_INITIALIZED == statusCode)
40  {
41  if (this->GetPandora().GetSettings()->ShouldDisplayAlgorithmInfo())
42  std::cout << "ListMergingAlgorithm: no clusters to move, source: " << sourceListName << ", target: " << targetListName << std::endl;
43  }
44  else
45  {
46  std::cout << "ListMergingAlgorithm: error in cluster merging, source: " << sourceListName << ", target: " << targetListName
47  << std::endl;
48  return statusCode;
49  }
50  }
51  }
52 
53  // Pfo list merging
54  if (m_sourcePfoListNames.size() != m_targetPfoListNames.size())
55  return STATUS_CODE_FAILURE;
56 
57  for (unsigned int iIndex = 0, iIndexEnd = m_sourcePfoListNames.size(); iIndex < iIndexEnd; ++iIndex)
58  {
59  const std::string &sourceListName(m_sourcePfoListNames.at(iIndex));
60  const std::string &targetListName(m_targetPfoListNames.at(iIndex));
61 
62  const StatusCode statusCode(PandoraContentApi::SaveList<Pfo>(*this, sourceListName, targetListName));
63 
64  if (STATUS_CODE_SUCCESS != statusCode)
65  {
66  if (STATUS_CODE_NOT_FOUND == statusCode)
67  {
68  if (this->GetPandora().GetSettings()->ShouldDisplayAlgorithmInfo())
69  std::cout << "ListMergingAlgorithm: pfo list not found, source: " << sourceListName << ", target: " << targetListName << std::endl;
70  }
71  else if (STATUS_CODE_NOT_INITIALIZED == statusCode)
72  {
73  if (this->GetPandora().GetSettings()->ShouldDisplayAlgorithmInfo())
74  std::cout << "ListMergingAlgorithm: no pfos to move, source: " << sourceListName << ", target: " << targetListName << std::endl;
75  }
76  else
77  {
78  std::cout << "ListMergingAlgorithm: error in pfo merging, source: " << sourceListName << ", target: " << targetListName << std::endl;
79  return statusCode;
80  }
81  }
82  }
83 
84  return STATUS_CODE_SUCCESS;
85 }
pandora::StringVector m_targetClusterListNames
The target cluster list names.
pandora::StringVector m_targetPfoListNames
The target pfo list names.
pandora::StringVector m_sourceClusterListNames
The source cluster list names.
pandora::StringVector m_sourcePfoListNames
The source pfo list names.
BEGIN_PROLOG could also be cout

Member Data Documentation

pandora::StringVector lar_content::ListMergingAlgorithm::m_sourceClusterListNames
private

The source cluster list names.

Definition at line 25 of file ListMergingAlgorithm.h.

pandora::StringVector lar_content::ListMergingAlgorithm::m_sourcePfoListNames
private

The source pfo list names.

Definition at line 28 of file ListMergingAlgorithm.h.

pandora::StringVector lar_content::ListMergingAlgorithm::m_targetClusterListNames
private

The target cluster list names.

Definition at line 26 of file ListMergingAlgorithm.h.

pandora::StringVector lar_content::ListMergingAlgorithm::m_targetPfoListNames
private

The target pfo list names.

Definition at line 29 of file ListMergingAlgorithm.h.


The documentation for this class was generated from the following files: