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::TwoDParticleCreationAlgorithm Class Reference

TwoDParticleCreationAlgorithm class. More...

#include <TwoDParticleCreationAlgorithm.h>

Inheritance diagram for lar_content::TwoDParticleCreationAlgorithm:

Public Member Functions

 TwoDParticleCreationAlgorithm ()
 Default constructor. More...
 

Private Member Functions

pandora::StatusCode Run ()
 
pandora::StatusCode ReadSettings (const pandora::TiXmlHandle xmlHandle)
 
pandora::StatusCode CreatePFOs (const pandora::ClusterList *const pClusterList) const
 Create pfos for provided clusters. More...
 

Private Attributes

std::string m_inputClusterListNameU
 The input cluster list name for the U view. More...
 
std::string m_inputClusterListNameV
 The input cluster list name for the V view. More...
 
std::string m_inputClusterListNameW
 The input cluster list name for the W view. More...
 
std::string m_outputPfoListName
 The output pfo list name. More...
 
unsigned int m_minHitsInCluster
 Min number of hits for clusters to form pfos. More...
 
float m_minClusterEnergy
 Min energy for clusters to form pfos. More...
 

Detailed Description

TwoDParticleCreationAlgorithm class.

Definition at line 19 of file TwoDParticleCreationAlgorithm.h.

Constructor & Destructor Documentation

lar_content::TwoDParticleCreationAlgorithm::TwoDParticleCreationAlgorithm ( )

Default constructor.

Definition at line 18 of file TwoDParticleCreationAlgorithm.cc.

19 {
20 }
float m_minClusterEnergy
Min energy for clusters to form pfos.
unsigned int m_minHitsInCluster
Min number of hits for clusters to form pfos.

Member Function Documentation

StatusCode lar_content::TwoDParticleCreationAlgorithm::CreatePFOs ( const pandora::ClusterList *const  pClusterList) const
private

Create pfos for provided clusters.

Parameters
pClusterListaddress of the cluster list

Definition at line 68 of file TwoDParticleCreationAlgorithm.cc.

69 {
70  for (ClusterList::const_iterator iter = pClusterList->begin(), iterEnd = pClusterList->end(); iter != iterEnd; ++iter)
71  {
72  const Cluster *const pCluster = *iter;
73 
74  if (pCluster->GetNCaloHits() < m_minHitsInCluster)
75  continue;
76 
77  // TODO Finalize particle id and energy measurement here
78  const float clusterEnergy(pCluster->GetElectromagneticEnergy());
79 
80  if (clusterEnergy < m_minClusterEnergy)
81  continue;
82 
84 
85  // TODO Finalize particle id here
86  const ParticleType particleType(PandoraContentApi::GetPlugins(*this)->GetParticleId()->IsMuon(pCluster) ? MU_MINUS : PHOTON);
87 
88  const ClusterFitResult &fitToAllHitsResult(pCluster->GetFitToAllHitsResult());
89 
90  if (!fitToAllHitsResult.IsFitSuccessful())
91  continue;
92 
93  // TODO Check remaining parameters
94  pfoParameters.m_particleId = particleType;
95  pfoParameters.m_charge = 0;
96  pfoParameters.m_mass = 0.;
97  pfoParameters.m_energy = clusterEnergy;
98  pfoParameters.m_momentum = CartesianVector(fitToAllHitsResult.GetDirection() * clusterEnergy);
99  pfoParameters.m_clusterList.push_back(pCluster);
100 
101  const ParticleFlowObject *pPfo(NULL);
102  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::ParticleFlowObject::Create(*this, pfoParameters, pPfo));
103  }
104 
105  return STATUS_CODE_SUCCESS;
106 }
float m_minClusterEnergy
Min energy for clusters to form pfos.
fhicl::Table< sbnd::crt::CRTDetSimParams > Parameters
unsigned int m_minHitsInCluster
Min number of hits for clusters to form pfos.
StatusCode lar_content::TwoDParticleCreationAlgorithm::ReadSettings ( const pandora::TiXmlHandle  xmlHandle)
private

Definition at line 110 of file TwoDParticleCreationAlgorithm.cc.

111 {
112  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ReadValue(xmlHandle, "OutputPfoListName", m_outputPfoListName));
113 
114  PANDORA_RETURN_RESULT_IF_AND_IF(
115  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "ClusterListNameU", m_inputClusterListNameU));
116 
117  PANDORA_RETURN_RESULT_IF_AND_IF(
118  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "ClusterListNameV", m_inputClusterListNameV));
119 
120  PANDORA_RETURN_RESULT_IF_AND_IF(
121  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "ClusterListNameW", m_inputClusterListNameW));
122 
123  PANDORA_RETURN_RESULT_IF_AND_IF(
124  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "MinHitsInCluster", m_minHitsInCluster));
125 
126  PANDORA_RETURN_RESULT_IF_AND_IF(
127  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "MinClusterEnergy", m_minClusterEnergy));
128 
129  return STATUS_CODE_SUCCESS;
130 }
float m_minClusterEnergy
Min energy for clusters to form pfos.
std::string m_inputClusterListNameW
The input cluster list name for the W view.
std::string m_inputClusterListNameU
The input cluster list name for the U view.
std::string m_inputClusterListNameV
The input cluster list name for the V view.
std::string m_outputPfoListName
The output pfo list name.
unsigned int m_minHitsInCluster
Min number of hits for clusters to form pfos.
StatusCode lar_content::TwoDParticleCreationAlgorithm::Run ( )
private

Definition at line 24 of file TwoDParticleCreationAlgorithm.cc.

25 {
26  const PfoList *pPfoList = nullptr;
27  std::string pfoListName;
28  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::CreateTemporaryListAndSetCurrent(*this, pPfoList, pfoListName));
29 
30  if (!m_inputClusterListNameU.empty())
31  {
32  const ClusterList *pClusterListU = nullptr;
33  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::GetList(*this, m_inputClusterListNameU, pClusterListU));
34 
35  if (pClusterListU)
36  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->CreatePFOs(pClusterListU));
37  }
38 
39  if (!m_inputClusterListNameV.empty())
40  {
41  const ClusterList *pClusterListV = nullptr;
42  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::GetList(*this, m_inputClusterListNameV, pClusterListV));
43 
44  if (pClusterListV)
45  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->CreatePFOs(pClusterListV));
46  }
47 
48  if (!m_inputClusterListNameW.empty())
49  {
50  const ClusterList *pClusterListW = nullptr;
51  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::GetList(*this, m_inputClusterListNameW, pClusterListW));
52 
53  if (pClusterListW)
54  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->CreatePFOs(pClusterListW));
55  }
56 
57  if (!pPfoList->empty())
58  {
59  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::SaveList<Pfo>(*this, m_outputPfoListName));
60  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::ReplaceCurrentList<Pfo>(*this, m_outputPfoListName));
61  }
62 
63  return STATUS_CODE_SUCCESS;
64 }
std::string m_inputClusterListNameW
The input cluster list name for the W view.
pandora::StatusCode CreatePFOs(const pandora::ClusterList *const pClusterList) const
Create pfos for provided clusters.
std::string m_inputClusterListNameU
The input cluster list name for the U view.
std::string m_inputClusterListNameV
The input cluster list name for the V view.
std::string m_outputPfoListName
The output pfo list name.

Member Data Documentation

std::string lar_content::TwoDParticleCreationAlgorithm::m_inputClusterListNameU
private

The input cluster list name for the U view.

Definition at line 38 of file TwoDParticleCreationAlgorithm.h.

std::string lar_content::TwoDParticleCreationAlgorithm::m_inputClusterListNameV
private

The input cluster list name for the V view.

Definition at line 39 of file TwoDParticleCreationAlgorithm.h.

std::string lar_content::TwoDParticleCreationAlgorithm::m_inputClusterListNameW
private

The input cluster list name for the W view.

Definition at line 40 of file TwoDParticleCreationAlgorithm.h.

float lar_content::TwoDParticleCreationAlgorithm::m_minClusterEnergy
private

Min energy for clusters to form pfos.

Definition at line 44 of file TwoDParticleCreationAlgorithm.h.

unsigned int lar_content::TwoDParticleCreationAlgorithm::m_minHitsInCluster
private

Min number of hits for clusters to form pfos.

Definition at line 43 of file TwoDParticleCreationAlgorithm.h.

std::string lar_content::TwoDParticleCreationAlgorithm::m_outputPfoListName
private

The output pfo list name.

Definition at line 42 of file TwoDParticleCreationAlgorithm.h.


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