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

UnattachedDeltaRaysAlgorithm class. More...

#include <UnattachedDeltaRaysAlgorithm.h>

Inheritance diagram for lar_content::UnattachedDeltaRaysAlgorithm:

Private Member Functions

pandora::StatusCode Run ()
 
pandora::StatusCode ReadSettings (const pandora::TiXmlHandle xmlHandle)
 

Private Attributes

std::string m_pfoListName
 The pfo list name. More...
 

Detailed Description

UnattachedDeltaRaysAlgorithm class.

Definition at line 19 of file UnattachedDeltaRaysAlgorithm.h.

Member Function Documentation

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

Definition at line 53 of file UnattachedDeltaRaysAlgorithm.cc.

54 {
55  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ReadValue(xmlHandle, "PfoListName", m_pfoListName));
56 
57  return STATUS_CODE_SUCCESS;
58 }
StatusCode lar_content::UnattachedDeltaRaysAlgorithm::Run ( )
private

Definition at line 20 of file UnattachedDeltaRaysAlgorithm.cc.

21 {
22  const PfoList *pPfoList(nullptr);
23  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_INITIALIZED, !=, PandoraContentApi::GetList(*this, m_pfoListName, pPfoList));
24 
25  if (!pPfoList || pPfoList->empty())
26  {
27  if (PandoraContentApi::GetSettings(*this)->ShouldDisplayAlgorithmInfo())
28  std::cout << "UnattachedDeltaRaysAlgorithm: pfo list " << m_pfoListName << " unavailable." << std::endl;
29  return STATUS_CODE_SUCCESS;
30  }
31 
32  PfoList unattachedDeltaRays;
33 
34  for (const Pfo *const pPfo : *pPfoList)
35  {
36  if ((0 == pPfo->GetNParentPfos()) && LArPfoHelper::IsShower(pPfo))
37  unattachedDeltaRays.push_back(pPfo);
38  }
39 
40  PfoList allPfosToDelete;
41  LArPfoHelper::GetAllConnectedPfos(unattachedDeltaRays, allPfosToDelete);
42 
43  for (const Pfo *const pPfoToDelete : allPfosToDelete)
44  {
45  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::Delete(*this, pPfoToDelete, m_pfoListName));
46  }
47 
48  return STATUS_CODE_SUCCESS;
49 }
static bool IsShower(const pandora::ParticleFlowObject *const pPfo)
Return shower flag based on Pfo Particle ID.
static void GetAllConnectedPfos(const pandora::PfoList &inputPfoList, pandora::PfoList &outputPfoList)
Get a flat list of all pfos, recursively including all daughters and parents associated with those pf...
QTextStream & endl(QTextStream &s)

Member Data Documentation

std::string lar_content::UnattachedDeltaRaysAlgorithm::m_pfoListName
private

The pfo list name.

Definition at line 25 of file UnattachedDeltaRaysAlgorithm.h.


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