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

PostProcessingAlgorithm class. More...

#include <PostProcessingAlgorithm.h>

Inheritance diagram for lar_content::PostProcessingAlgorithm:

Public Member Functions

 PostProcessingAlgorithm ()
 Default constructor. More...
 
template<typename T >
StatusCode RenameList (const std::string &oldListName) const
 

Private Member Functions

pandora::StatusCode Reset ()
 
pandora::StatusCode Run ()
 
template<typename T >
pandora::StatusCode RenameList (const std::string &oldListName) const
 Rename a list of relevant type with specified name - the new name will be the old name with appended list counter. More...
 
pandora::StatusCode ReadSettings (const pandora::TiXmlHandle xmlHandle)
 

Private Attributes

pandora::StringVector m_pfoListNames
 The list of pfo list names. More...
 
pandora::StringVector m_clusterListNames
 The list of cluster list names. More...
 
pandora::StringVector m_vertexListNames
 The list of vertex list names. More...
 
pandora::StringVector m_caloHitListNames
 The list of calo hit list names. More...
 
std::string m_currentPfoListReplacement
 The name of the pfo list to replace the current list. More...
 
unsigned int m_listCounter
 The counter appended to output (and replacement current) list names and reset each event. More...
 

Detailed Description

PostProcessingAlgorithm class.

Definition at line 19 of file PostProcessingAlgorithm.h.

Constructor & Destructor Documentation

lar_content::PostProcessingAlgorithm::PostProcessingAlgorithm ( )

Default constructor.

Definition at line 18 of file PostProcessingAlgorithm.cc.

18  : m_listCounter(0)
19 {
20 }
unsigned int m_listCounter
The counter appended to output (and replacement current) list names and reset each event...

Member Function Documentation

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

Definition at line 82 of file PostProcessingAlgorithm.cc.

83 {
84  PANDORA_RETURN_RESULT_IF_AND_IF(
85  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadVectorOfValues(xmlHandle, "PfoListNames", m_pfoListNames));
86 
87  PANDORA_RETURN_RESULT_IF_AND_IF(
88  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadVectorOfValues(xmlHandle, "ClusterListNames", m_clusterListNames));
89 
90  PANDORA_RETURN_RESULT_IF_AND_IF(
91  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadVectorOfValues(xmlHandle, "VertexListNames", m_vertexListNames));
92 
93  PANDORA_RETURN_RESULT_IF_AND_IF(
94  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadVectorOfValues(xmlHandle, "CaloHitListNames", m_caloHitListNames));
95 
96  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
97  XmlHelper::ReadValue(xmlHandle, "CurrentPfoListReplacement", m_currentPfoListReplacement));
98 
99  return STATUS_CODE_SUCCESS;
100 }
std::string m_currentPfoListReplacement
The name of the pfo list to replace the current list.
pandora::StringVector m_clusterListNames
The list of cluster list names.
pandora::StringVector m_caloHitListNames
The list of calo hit list names.
pandora::StringVector m_vertexListNames
The list of vertex list names.
pandora::StringVector m_pfoListNames
The list of pfo list names.
template<typename T >
template pandora::StatusCode lar_content::PostProcessingAlgorithm::RenameList< CaloHitList > ( const std::string &  oldListName) const
private

Rename a list of relevant type with specified name - the new name will be the old name with appended list counter.

Parameters
oldListNamethe old list name
template<typename T >
StatusCode lar_content::PostProcessingAlgorithm::RenameList ( const std::string &  oldListName) const

Definition at line 73 of file PostProcessingAlgorithm.cc.

74 {
75  const std::string newListName(oldListName + TypeToString(m_listCounter));
76  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, PandoraContentApi::RenameList<T>(*this, oldListName, newListName));
77  return STATUS_CODE_SUCCESS;
78 }
unsigned int m_listCounter
The counter appended to output (and replacement current) list names and reset each event...
StatusCode lar_content::PostProcessingAlgorithm::Reset ( )
private

Definition at line 24 of file PostProcessingAlgorithm.cc.

25 {
26  m_listCounter = 0;
27  return STATUS_CODE_SUCCESS;
28 }
unsigned int m_listCounter
The counter appended to output (and replacement current) list names and reset each event...
StatusCode lar_content::PostProcessingAlgorithm::Run ( )
private

Definition at line 32 of file PostProcessingAlgorithm.cc.

33 {
34  for (const std::string &listName : m_pfoListNames)
35  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->RenameList<PfoList>(listName));
36 
37  for (const std::string &listName : m_clusterListNames)
38  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->RenameList<ClusterList>(listName));
39 
40  for (const std::string &listName : m_vertexListNames)
41  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->RenameList<VertexList>(listName));
42 
43  for (const std::string &listName : m_caloHitListNames)
44  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->RenameList<CaloHitList>(listName));
45 
46  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::DropCurrentList<CaloHit>(*this));
47  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::DropCurrentList<Track>(*this));
48  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::DropCurrentList<MCParticle>(*this));
49  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::DropCurrentList<Cluster>(*this));
50  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::DropCurrentList<ParticleFlowObject>(*this));
51  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::DropCurrentList<Vertex>(*this));
52 
53  if (!m_currentPfoListReplacement.empty())
54  {
55  const std::string replacementListName(m_currentPfoListReplacement + TypeToString(m_listCounter));
56 
57  if (STATUS_CODE_SUCCESS != PandoraContentApi::ReplaceCurrentList<Pfo>(*this, replacementListName))
58  {
59  if (PandoraContentApi::GetSettings(*this)->ShouldDisplayAlgorithmInfo())
60  std::cout << "PostProcessingAlgorithm: could not replace current pfo list with list named: " << replacementListName << std::endl;
61 
62  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::DropCurrentList<Pfo>(*this));
63  }
64  }
65 
66  ++m_listCounter;
67  return STATUS_CODE_SUCCESS;
68 }
std::string m_currentPfoListReplacement
The name of the pfo list to replace the current list.
pandora::StringVector m_clusterListNames
The list of cluster list names.
unsigned int m_listCounter
The counter appended to output (and replacement current) list names and reset each event...
pandora::StringVector m_caloHitListNames
The list of calo hit list names.
pandora::StringVector m_vertexListNames
The list of vertex list names.
pandora::StringVector m_pfoListNames
The list of pfo list names.
BEGIN_PROLOG could also be cout

Member Data Documentation

pandora::StringVector lar_content::PostProcessingAlgorithm::m_caloHitListNames
private

The list of calo hit list names.

Definition at line 44 of file PostProcessingAlgorithm.h.

pandora::StringVector lar_content::PostProcessingAlgorithm::m_clusterListNames
private

The list of cluster list names.

Definition at line 42 of file PostProcessingAlgorithm.h.

std::string lar_content::PostProcessingAlgorithm::m_currentPfoListReplacement
private

The name of the pfo list to replace the current list.

Definition at line 46 of file PostProcessingAlgorithm.h.

unsigned int lar_content::PostProcessingAlgorithm::m_listCounter
private

The counter appended to output (and replacement current) list names and reset each event.

Definition at line 48 of file PostProcessingAlgorithm.h.

pandora::StringVector lar_content::PostProcessingAlgorithm::m_pfoListNames
private

The list of pfo list names.

Definition at line 41 of file PostProcessingAlgorithm.h.

pandora::StringVector lar_content::PostProcessingAlgorithm::m_vertexListNames
private

The list of vertex list names.

Definition at line 43 of file PostProcessingAlgorithm.h.


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