LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
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 87 of file ListMergingAlgorithm.cc.

88 {
89  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadVectorOfValues(xmlHandle,
90  "SourceClusterListNames", m_sourceClusterListNames));
91 
92  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadVectorOfValues(xmlHandle,
93  "TargetClusterListNames", m_targetClusterListNames));
94 
95  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadVectorOfValues(xmlHandle,
96  "SourcePfoListNames", m_sourcePfoListNames));
97 
98  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadVectorOfValues(xmlHandle,
99  "TargetPfoListNames", m_targetPfoListNames));
100 
102  {
103  std::cout << "ListMergingAlgorithm::ReadSettings: invalid list configuration " << std::endl;
104  return STATUS_CODE_INVALID_PARAMETER;
105  }
106 
107  return STATUS_CODE_SUCCESS;
108 }
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.
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 << ", target: " << targetListName << std::endl;
37  }
38  else if (STATUS_CODE_NOT_INITIALIZED == statusCode)
39  {
40  if (this->GetPandora().GetSettings()->ShouldDisplayAlgorithmInfo())
41  std::cout << "ListMergingAlgorithm: no clusters to move, source: " << sourceListName << ", target: " << targetListName << std::endl;
42  }
43  else
44  {
45  std::cout << "ListMergingAlgorithm: error in cluster merging, source: " << sourceListName << ", target: " << targetListName << std::endl;
46  return statusCode;
47  }
48  }
49  }
50 
51  // Pfo list merging
52  if (m_sourcePfoListNames.size() != m_targetPfoListNames.size())
53  return STATUS_CODE_FAILURE;
54 
55  for (unsigned int iIndex = 0, iIndexEnd = m_sourcePfoListNames.size(); iIndex < iIndexEnd; ++iIndex)
56  {
57  const std::string &sourceListName(m_sourcePfoListNames.at(iIndex));
58  const std::string &targetListName(m_targetPfoListNames.at(iIndex));
59 
60  const StatusCode statusCode(PandoraContentApi::SaveList<Pfo>(*this, sourceListName, targetListName));
61 
62  if (STATUS_CODE_SUCCESS != statusCode)
63  {
64  if (STATUS_CODE_NOT_FOUND == statusCode)
65  {
66  if (this->GetPandora().GetSettings()->ShouldDisplayAlgorithmInfo())
67  std::cout << "ListMergingAlgorithm: pfo list not found, source: " << sourceListName << ", target: " << targetListName << std::endl;
68  }
69  else if (STATUS_CODE_NOT_INITIALIZED == statusCode)
70  {
71  if (this->GetPandora().GetSettings()->ShouldDisplayAlgorithmInfo())
72  std::cout << "ListMergingAlgorithm: no pfos to move, source: " << sourceListName << ", target: " << targetListName << std::endl;
73  }
74  else
75  {
76  std::cout << "ListMergingAlgorithm: error in pfo merging, source: " << sourceListName << ", target: " << targetListName << std::endl;
77  return statusCode;
78  }
79  }
80  }
81 
82  return STATUS_CODE_SUCCESS;
83 }
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.

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: