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

CheatingCosmicRayShowerMatchingAlg class. More...

#include <CheatingCosmicRayShowerMatchingAlg.h>

Inheritance diagram for lar_content::CheatingCosmicRayShowerMatchingAlg:

Private Member Functions

pandora::StatusCode Run ()
 
void GetCandidateClusters (pandora::ClusterList &candidateClusterList) const
 Get the list of candidate clusters for matching with existing pfos. More...
 
void CosmicRayShowerMatching (const pandora::ParticleFlowObject *const pPfo, const pandora::Cluster *const pPfoCluster, const pandora::ClusterList &candidateClusterList) const
 Perform cosmic ray shower matching for a specific cluster in a pfo. More...
 
pandora::StatusCode ReadSettings (const pandora::TiXmlHandle xmlHandle)
 

Private Attributes

std::string m_inputPfoListName
 The input pfo list name. More...
 
pandora::StringVector m_inputClusterListNames
 The input cluster list names. More...
 

Detailed Description

CheatingCosmicRayShowerMatchingAlg class.

Definition at line 19 of file CheatingCosmicRayShowerMatchingAlg.h.

Member Function Documentation

void lar_content::CheatingCosmicRayShowerMatchingAlg::CosmicRayShowerMatching ( const pandora::ParticleFlowObject *const  pPfo,
const pandora::Cluster *const  pPfoCluster,
const pandora::ClusterList &  candidateClusterList 
) const
private

Perform cosmic ray shower matching for a specific cluster in a pfo.

Parameters
pPfothe pfo of interest
pPfoClusterthe pfo cluster of interest
candidateClusterListthe list of candidate clusters

Definition at line 62 of file CheatingCosmicRayShowerMatchingAlg.cc.

64 {
65  try
66  {
67  const HitType pfoClusterHitType(LArClusterHelper::GetClusterHitType(pPfoCluster));
68  const MCParticle *const pPfoMCParticle(MCParticleHelper::GetMainMCParticle(pPfoCluster));
69  const MCParticle *const pPfoParentMCParticle(LArMCParticleHelper::GetParentMCParticle(pPfoMCParticle));
70 
71  for (const Cluster *const pCandidateCluster : candidateClusterList)
72  {
73  if (pfoClusterHitType != LArClusterHelper::GetClusterHitType(pCandidateCluster))
74  continue;
75 
76  if (!PandoraContentApi::IsAvailable(*this, pCandidateCluster))
77  continue;
78 
79  if (pPfoCluster == pCandidateCluster)
80  continue;
81 
82  try
83  {
84  const MCParticle *const pMCParticle(MCParticleHelper::GetMainMCParticle(pCandidateCluster));
85  const MCParticle *const pParentMCParticle(LArMCParticleHelper::GetParentMCParticle(pMCParticle));
86 
87  if (!LArMCParticleHelper::IsNeutrino(pParentMCParticle) && (pPfoParentMCParticle == pParentMCParticle))
88  PANDORA_THROW_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::AddToPfo(*this, pPfo, pCandidateCluster));
89  }
90  catch (const StatusCodeException &)
91  {
92  }
93  }
94  }
95  catch (const StatusCodeException &)
96  {
97  }
98 }
static pandora::HitType GetClusterHitType(const pandora::Cluster *const pCluster)
Get the hit type associated with a two dimensional cluster.
static const pandora::MCParticle * GetParentMCParticle(const pandora::MCParticle *const pMCParticle)
Get the parent mc particle.
static bool IsNeutrino(const pandora::MCParticle *const pMCParticle)
Whether a mc particle is a neutrino or antineutrino.
void lar_content::CheatingCosmicRayShowerMatchingAlg::GetCandidateClusters ( pandora::ClusterList &  candidateClusterList) const
private

Get the list of candidate clusters for matching with existing pfos.

Parameters
candidateClusterListto receive the list of candidate clusters

Definition at line 44 of file CheatingCosmicRayShowerMatchingAlg.cc.

45 {
46  for (const std::string &clusterListName : m_inputClusterListNames)
47  {
48  const ClusterList *pClusterList(nullptr);
49 
50  if (STATUS_CODE_SUCCESS != PandoraContentApi::GetList(*this, clusterListName, pClusterList))
51  {
52  std::cout << "CheatingCosmicRayShowerMatchingAlg - Could not access cluster list with name " << clusterListName << std::endl;
53  continue;
54  }
55 
56  candidateClusterList.insert(candidateClusterList.end(), pClusterList->begin(), pClusterList->end());
57  }
58 }
pandora::StringVector m_inputClusterListNames
The input cluster list names.
BEGIN_PROLOG could also be cout
StatusCode lar_content::CheatingCosmicRayShowerMatchingAlg::ReadSettings ( const pandora::TiXmlHandle  xmlHandle)
private

Definition at line 102 of file CheatingCosmicRayShowerMatchingAlg.cc.

103 {
104  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ReadValue(xmlHandle, "InputPfoListName", m_inputPfoListName));
105 
106  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ReadVectorOfValues(xmlHandle, "InputClusterListNames", m_inputClusterListNames));
107 
108  return STATUS_CODE_SUCCESS;
109 }
pandora::StringVector m_inputClusterListNames
The input cluster list names.
StatusCode lar_content::CheatingCosmicRayShowerMatchingAlg::Run ( )
private

Definition at line 22 of file CheatingCosmicRayShowerMatchingAlg.cc.

23 {
24  ClusterList candidateClusterList;
25  this->GetCandidateClusters(candidateClusterList);
26 
27  const PfoList *pPfoList(nullptr);
28  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::GetList(*this, m_inputPfoListName, pPfoList));
29 
30  for (const ParticleFlowObject *const pPfo : *pPfoList)
31  {
32  ClusterList twoDClusters;
33  LArPfoHelper::GetTwoDClusterList(pPfo, twoDClusters);
34 
35  for (const Cluster *const pPfoCluster : twoDClusters)
36  this->CosmicRayShowerMatching(pPfo, pPfoCluster, candidateClusterList);
37  }
38 
39  return STATUS_CODE_SUCCESS;
40 }
static void GetTwoDClusterList(const pandora::ParticleFlowObject *const pPfo, pandora::ClusterList &clusterList)
Get the list of 2D clusters from an input pfo.
void GetCandidateClusters(pandora::ClusterList &candidateClusterList) const
Get the list of candidate clusters for matching with existing pfos.
void CosmicRayShowerMatching(const pandora::ParticleFlowObject *const pPfo, const pandora::Cluster *const pPfoCluster, const pandora::ClusterList &candidateClusterList) const
Perform cosmic ray shower matching for a specific cluster in a pfo.

Member Data Documentation

pandora::StringVector lar_content::CheatingCosmicRayShowerMatchingAlg::m_inputClusterListNames
private

The input cluster list names.

Definition at line 44 of file CheatingCosmicRayShowerMatchingAlg.h.

std::string lar_content::CheatingCosmicRayShowerMatchingAlg::m_inputPfoListName
private

The input pfo list name.

Definition at line 43 of file CheatingCosmicRayShowerMatchingAlg.h.


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