Private Member Functions | Private Attributes | List of all members
lar_content::PfoHitCleaningAlgorithm Class Reference

PfoHitCleaningAlgorithm class. More...

#include <PfoHitCleaningAlgorithm.h>

Inheritance diagram for lar_content::PfoHitCleaningAlgorithm:

Private Member Functions

pandora::StatusCode Run ()
 
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...
 

Detailed Description

PfoHitCleaningAlgorithm class.

Definition at line 19 of file PfoHitCleaningAlgorithm.h.

Member Function Documentation

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

Definition at line 52 of file PfoHitCleaningAlgorithm.cc.

53 {
54  PANDORA_RETURN_RESULT_IF_AND_IF(
55  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadVectorOfValues(xmlHandle, "PfoListNames", m_pfoListNames));
56  PANDORA_RETURN_RESULT_IF_AND_IF(
57  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadVectorOfValues(xmlHandle, "ClusterListNames", m_clusterListNames));
58 
59  if (m_pfoListNames.size() != m_clusterListNames.size())
60  {
61  std::cout << "PfoHitCleaningAlgorithm: Mismatch between PFO and Cluster list sizes" << std::endl;
62  return STATUS_CODE_INVALID_PARAMETER;
63  }
64 
65  return STATUS_CODE_SUCCESS;
66 }
pandora::StringVector m_clusterListNames
The list of cluster list names.
pandora::StringVector m_pfoListNames
The list of pfo list names.
QTextStream & endl(QTextStream &s)
StatusCode lar_content::PfoHitCleaningAlgorithm::Run ( )
private

Definition at line 20 of file PfoHitCleaningAlgorithm.cc.

21 {
22  for (unsigned int i = 0; i < m_pfoListNames.size(); ++i)
23  {
24  // ATTN - one-to-one correspondance required between PFO and cluster lists
25  const std::string &pfoListName{m_pfoListNames.at(i)};
26  const std::string &clusterListName{m_clusterListNames.at(i)};
27  const PfoList *pList(nullptr);
28  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_INITIALIZED, !=, PandoraContentApi::GetList(*this, pfoListName, pList));
29 
30  if (pList && !pList->empty())
31  {
32  for (const ParticleFlowObject *pPfo : *pList)
33  {
34  ClusterList clustersToRemove;
35  LArPfoHelper::GetClusters(pPfo, TPC_3D, clustersToRemove);
36 
37  for (const Cluster *pCluster : clustersToRemove)
38  {
39  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::RemoveFromPfo(*this, pPfo, pCluster));
40  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
41  PandoraContentApi::Delete<Cluster>(*this, pCluster, clusterListName));
42  }
43  }
44  }
45  }
46 
47  return STATUS_CODE_SUCCESS;
48 }
static void GetClusters(const pandora::PfoList &pfoList, const pandora::HitType &hitType, pandora::ClusterList &clusterList)
Get a list of clusters of a particular hit type from a list of pfos.
pandora::StringVector m_clusterListNames
The list of cluster list names.
std::string string
Definition: nybbler.cc:12
pandora::StringVector m_pfoListNames
The list of pfo list names.

Member Data Documentation

pandora::StringVector lar_content::PfoHitCleaningAlgorithm::m_clusterListNames
private

The list of cluster list names.

Definition at line 26 of file PfoHitCleaningAlgorithm.h.

pandora::StringVector lar_content::PfoHitCleaningAlgorithm::m_pfoListNames
private

The list of pfo list names.

Definition at line 25 of file PfoHitCleaningAlgorithm.h.


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