LArSoft  v09_90_00
Liquid Argon Software toolkit - https://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_sourceVertexListNames
 The source vertex list names. More...
 
pandora::StringVector m_targetVertexListNames
 The target vertex list names. More...
 
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 121 of file ListMergingAlgorithm.cc.

122 {
123  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
124  XmlHelper::ReadVectorOfValues(xmlHandle, "SourceVertexListNames", m_sourceVertexListNames));
125 
126  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
127  XmlHelper::ReadVectorOfValues(xmlHandle, "TargetVertexListNames", m_targetVertexListNames));
128 
129  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
130  XmlHelper::ReadVectorOfValues(xmlHandle, "SourceClusterListNames", m_sourceClusterListNames));
131 
132  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
133  XmlHelper::ReadVectorOfValues(xmlHandle, "TargetClusterListNames", m_targetClusterListNames));
134 
135  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
136  XmlHelper::ReadVectorOfValues(xmlHandle, "SourcePfoListNames", m_sourcePfoListNames));
137 
138  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
139  XmlHelper::ReadVectorOfValues(xmlHandle, "TargetPfoListNames", m_targetPfoListNames));
140 
142  {
143  std::cout << "ListMergingAlgorithm::ReadSettings: invalid list configuration " << std::endl;
144  return STATUS_CODE_INVALID_PARAMETER;
145  }
146 
147  return STATUS_CODE_SUCCESS;
148 }
pandora::StringVector m_targetClusterListNames
The target cluster list names.
pandora::StringVector m_targetPfoListNames
The target pfo list names.
pandora::StringVector m_targetVertexListNames
The target vertex list names.
pandora::StringVector m_sourceClusterListNames
The source cluster list names.
pandora::StringVector m_sourcePfoListNames
The source pfo list names.
pandora::StringVector m_sourceVertexListNames
The source vertex list names.
StatusCode lar_content::ListMergingAlgorithm::Run ( )
private

Definition at line 18 of file ListMergingAlgorithm.cc.

19 {
20  // Vertex list merging
22  return STATUS_CODE_FAILURE;
23 
24  for (unsigned int iIndex = 0, iIndexEnd = m_sourceVertexListNames.size(); iIndex < iIndexEnd; ++iIndex)
25  {
26  const std::string &sourceListName(m_sourceVertexListNames.at(iIndex));
27  const std::string &targetListName(m_targetVertexListNames.at(iIndex));
28 
29  const StatusCode statusCode(PandoraContentApi::SaveList<Vertex>(*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: vertex list not found, source: " << sourceListName << ", target: " << targetListName
37  << std::endl;
38  }
39  else if (STATUS_CODE_NOT_INITIALIZED == statusCode)
40  {
41  if (this->GetPandora().GetSettings()->ShouldDisplayAlgorithmInfo())
42  std::cout << "ListMergingAlgorithm: no vertexs to move, source: " << sourceListName << ", target: " << targetListName << std::endl;
43  }
44  else
45  {
46  std::cout << "ListMergingAlgorithm: error in vertex merging, source: " << sourceListName << ", target: " << targetListName << std::endl;
47  return statusCode;
48  }
49  }
50  }
51 
52  // Cluster list merging
54  return STATUS_CODE_FAILURE;
55 
56  for (unsigned int iIndex = 0, iIndexEnd = m_sourceClusterListNames.size(); iIndex < iIndexEnd; ++iIndex)
57  {
58  const std::string &sourceListName(m_sourceClusterListNames.at(iIndex));
59  const std::string &targetListName(m_targetClusterListNames.at(iIndex));
60 
61  const StatusCode statusCode(PandoraContentApi::SaveList<Cluster>(*this, sourceListName, targetListName));
62 
63  if (STATUS_CODE_SUCCESS != statusCode)
64  {
65  if (STATUS_CODE_NOT_FOUND == statusCode)
66  {
67  if (this->GetPandora().GetSettings()->ShouldDisplayAlgorithmInfo())
68  std::cout << "ListMergingAlgorithm: cluster list not found, source: " << sourceListName
69  << ", 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 clusters to move, source: " << sourceListName << ", target: " << targetListName << std::endl;
75  }
76  else
77  {
78  std::cout << "ListMergingAlgorithm: error in cluster merging, source: " << sourceListName << ", target: " << targetListName
79  << std::endl;
80  return statusCode;
81  }
82  }
83  }
84 
85  // Pfo list merging
86  if (m_sourcePfoListNames.size() != m_targetPfoListNames.size())
87  return STATUS_CODE_FAILURE;
88 
89  for (unsigned int iIndex = 0, iIndexEnd = m_sourcePfoListNames.size(); iIndex < iIndexEnd; ++iIndex)
90  {
91  const std::string &sourceListName(m_sourcePfoListNames.at(iIndex));
92  const std::string &targetListName(m_targetPfoListNames.at(iIndex));
93 
94  const StatusCode statusCode(PandoraContentApi::SaveList<Pfo>(*this, sourceListName, targetListName));
95 
96  if (STATUS_CODE_SUCCESS != statusCode)
97  {
98  if (STATUS_CODE_NOT_FOUND == statusCode)
99  {
100  if (this->GetPandora().GetSettings()->ShouldDisplayAlgorithmInfo())
101  std::cout << "ListMergingAlgorithm: pfo list not found, source: " << sourceListName << ", target: " << targetListName << std::endl;
102  }
103  else if (STATUS_CODE_NOT_INITIALIZED == statusCode)
104  {
105  if (this->GetPandora().GetSettings()->ShouldDisplayAlgorithmInfo())
106  std::cout << "ListMergingAlgorithm: no pfos to move, source: " << sourceListName << ", target: " << targetListName << std::endl;
107  }
108  else
109  {
110  std::cout << "ListMergingAlgorithm: error in pfo merging, source: " << sourceListName << ", target: " << targetListName << std::endl;
111  return statusCode;
112  }
113  }
114  }
115 
116  return STATUS_CODE_SUCCESS;
117 }
pandora::StringVector m_targetClusterListNames
The target cluster list names.
pandora::StringVector m_targetPfoListNames
The target pfo list names.
pandora::StringVector m_targetVertexListNames
The target vertex list names.
pandora::StringVector m_sourceClusterListNames
The source cluster list names.
pandora::StringVector m_sourcePfoListNames
The source pfo list names.
pandora::StringVector m_sourceVertexListNames
The source vertex list names.

Member Data Documentation

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

The source cluster list names.

Definition at line 28 of file ListMergingAlgorithm.h.

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

The source pfo list names.

Definition at line 31 of file ListMergingAlgorithm.h.

pandora::StringVector lar_content::ListMergingAlgorithm::m_sourceVertexListNames
private

The source vertex list names.

Definition at line 25 of file ListMergingAlgorithm.h.

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

The target cluster list names.

Definition at line 29 of file ListMergingAlgorithm.h.

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

The target pfo list names.

Definition at line 32 of file ListMergingAlgorithm.h.

pandora::StringVector lar_content::ListMergingAlgorithm::m_targetVertexListNames
private

The target vertex list names.

Definition at line 26 of file ListMergingAlgorithm.h.


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