LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
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  :
19  m_listCounter(0)
20 {
21 }
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 83 of file PostProcessingAlgorithm.cc.

References m_caloHitListNames, m_clusterListNames, m_currentPfoListReplacement, m_pfoListNames, and m_vertexListNames.

84 {
85  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadVectorOfValues(xmlHandle,
86  "PfoListNames", m_pfoListNames));
87 
88  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadVectorOfValues(xmlHandle,
89  "ClusterListNames", m_clusterListNames));
90 
91  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadVectorOfValues(xmlHandle,
92  "VertexListNames", m_vertexListNames));
93 
94  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadVectorOfValues(xmlHandle,
95  "CaloHitListNames", m_caloHitListNames));
96 
97  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
98  "CurrentPfoListReplacement", m_currentPfoListReplacement));
99 
100  return STATUS_CODE_SUCCESS;
101 }
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 >
pandora::StatusCode lar_content::PostProcessingAlgorithm::RenameList ( 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 74 of file PostProcessingAlgorithm.cc.

References m_listCounter.

75 {
76  const std::string newListName(oldListName + TypeToString(m_listCounter));
77  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, PandoraContentApi::RenameList<T>(*this, oldListName, newListName));
78  return STATUS_CODE_SUCCESS;
79 }
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 25 of file PostProcessingAlgorithm.cc.

References m_listCounter.

26 {
27  m_listCounter = 0;
28  return STATUS_CODE_SUCCESS;
29 }
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 33 of file PostProcessingAlgorithm.cc.

References m_caloHitListNames, m_clusterListNames, m_currentPfoListReplacement, m_listCounter, m_pfoListNames, and m_vertexListNames.

34 {
35  for (const std::string &listName : m_pfoListNames)
36  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->RenameList<PfoList>(listName));
37 
38  for (const std::string &listName : m_clusterListNames)
39  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->RenameList<ClusterList>(listName));
40 
41  for (const std::string &listName : m_vertexListNames)
42  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->RenameList<VertexList>(listName));
43 
44  for (const std::string &listName : m_caloHitListNames)
45  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->RenameList<CaloHitList>(listName));
46 
47  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::DropCurrentList<CaloHit>(*this));
48  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::DropCurrentList<Track>(*this));
49  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::DropCurrentList<MCParticle>(*this));
50  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::DropCurrentList<Cluster>(*this));
51  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::DropCurrentList<ParticleFlowObject>(*this));
52  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::DropCurrentList<Vertex>(*this));
53 
54  if (!m_currentPfoListReplacement.empty())
55  {
56  const std::string replacementListName(m_currentPfoListReplacement + TypeToString(m_listCounter));
57 
58  if (STATUS_CODE_SUCCESS != PandoraContentApi::ReplaceCurrentList<Pfo>(*this, replacementListName))
59  {
60  if (PandoraContentApi::GetSettings(*this)->ShouldDisplayAlgorithmInfo())
61  std::cout << "PostProcessingAlgorithm: could not replace current pfo list with list named: " << replacementListName << std::endl;
62 
63  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::DropCurrentList<Pfo>(*this));
64  }
65  }
66 
67  ++m_listCounter;
68  return STATUS_CODE_SUCCESS;
69 }
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.

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.

Referenced by ReadSettings(), and Run().

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

The list of cluster list names.

Definition at line 42 of file PostProcessingAlgorithm.h.

Referenced by ReadSettings(), and Run().

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.

Referenced by ReadSettings(), and Run().

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.

Referenced by RenameList(), Reset(), and Run().

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

The list of pfo list names.

Definition at line 41 of file PostProcessingAlgorithm.h.

Referenced by ReadSettings(), and Run().

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

The list of vertex list names.

Definition at line 43 of file PostProcessingAlgorithm.h.

Referenced by ReadSettings(), and Run().


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