9 #include "Pandora/AlgorithmHeaders.h" 26 StreamingAlgorithm::StreamingAlgorithm() :
44 std::string algStreamName{
"Algorithms" + listName};
45 const ClusterList *pClusterList{
nullptr};
47 PandoraContentApi::ReplaceCurrentList<Cluster>(*
this, listName);
48 StatusCode code{PandoraContentApi::GetCurrentList(*
this, pClusterList)};
49 if (code == STATUS_CODE_SUCCESS)
53 PandoraContentApi::GetCurrentList(*
this, pClusterList);
54 if (!pClusterList->empty())
56 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::RunDaughterAlgorithm(*
this, alg));
65 else if (code != STATUS_CODE_NOT_INITIALIZED)
76 return STATUS_CODE_SUCCESS;
83 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
"ListType",
m_listType));
87 std::cout <<
"StreamingAlgorithm::ReadSettings - Error: Only Cluster list type is supported at this time" << std::endl;
88 return STATUS_CODE_INVALID_PARAMETER;
91 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ReadVectorOfValues(xmlHandle,
"InputListNames",
m_inputListNames));
94 std::cout <<
"StreamingAlgorithm::ReadSettings - Error: No input lists found" << std::endl;
95 return STATUS_CODE_NOT_FOUND;
98 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
"OutputListName",
m_outputListName));
99 PANDORA_RETURN_RESULT_IF_AND_IF(
100 STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadVectorOfValues(xmlHandle,
"OutputListNames",
m_outputListNames));
103 std::cout <<
"StreamingAlgorithm::ReadSettings - Error: You must provide either a single output list name OR a list of output list names" 105 return STATUS_CODE_NOT_FOUND;
109 std::cout <<
"StreamingAlgorithm::ReadSettings - Error: When providing a list of output lists, there should be a one-to-one " 110 <<
"correspondence with the list of input lists" << std::endl;
111 return STATUS_CODE_INVALID_PARAMETER;
116 std::string algStreamName{
"Algorithms" + listName};
119 std::cout <<
"StreamingAlgorithm::ReadSettings - Error: Duplicate stream name found" << std::endl;
120 return STATUS_CODE_INVALID_PARAMETER;
122 PANDORA_RETURN_RESULT_IF(
123 STATUS_CODE_SUCCESS, !=, XmlHelper::ProcessAlgorithmList(*
this, xmlHandle, algStreamName,
m_streamAlgorithmMap[algStreamName]));
126 std::cout <<
"StreamingAlgorithm::ReadSettings - Error: Found no algorithms for \'" << algStreamName <<
"\'" << std::endl;
127 return STATUS_CODE_NOT_FOUND;
131 return STATUS_CODE_SUCCESS;
pandora::StringVector m_inputListNames
The names of the input lists.
virtual ~StreamingAlgorithm()
Header file for the lar calo hit class.
pandora::StringVector m_outputListNames
Names of the output lists if not combining into a single list at the end.
Header file for the lar monitoring helper helper class.
Header file for the lar monte carlo particle helper helper class.
pandora::StatusCode Run()
StreamAlgorithmMap m_streamAlgorithmMap
A map from individual streams to the algorithms that stream should run.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
std::string m_listType
The type of the input lists (currently only Cluster is supported)
std::string m_outputListName
The name of the output list.