LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
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

Constructor & Destructor Documentation

lar_content::TwoDParticleCreationAlgorithm::TwoDParticleCreationAlgorithm ( )

Default constructor.

Definition at line 18 of file TwoDParticleCreationAlgorithm.cc.

18  :
21 {
22 }
float m_minClusterEnergy
Min energy for clusters to form pfos.
TFile f
Definition: plotHisto.C:6
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 70 of file TwoDParticleCreationAlgorithm.cc.

References m_minClusterEnergy, and m_minHitsInCluster.

Referenced by Run().

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

References m_inputClusterListNameU, m_inputClusterListNameV, m_inputClusterListNameW, m_minClusterEnergy, m_minHitsInCluster, and m_outputPfoListName.

113 {
114  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ReadValue(xmlHandle, "OutputPfoListName", m_outputPfoListName));
115 
116  PANDORA_RETURN_RESULT_IF_AND_IF(
117  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "ClusterListNameU", m_inputClusterListNameU));
118 
119  PANDORA_RETURN_RESULT_IF_AND_IF(
120  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "ClusterListNameV", m_inputClusterListNameV));
121 
122  PANDORA_RETURN_RESULT_IF_AND_IF(
123  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "ClusterListNameW", m_inputClusterListNameW));
124 
125  PANDORA_RETURN_RESULT_IF_AND_IF(
126  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "MinHitsInCluster", m_minHitsInCluster));
127 
128  PANDORA_RETURN_RESULT_IF_AND_IF(
129  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "MinClusterEnergy", m_minClusterEnergy));
130 
131  return STATUS_CODE_SUCCESS;
132 }
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 26 of file TwoDParticleCreationAlgorithm.cc.

References CreatePFOs(), m_inputClusterListNameU, m_inputClusterListNameV, m_inputClusterListNameW, and m_outputPfoListName.

27 {
28  const PfoList *pPfoList = nullptr;
29  std::string pfoListName;
30  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::CreateTemporaryListAndSetCurrent(*this, pPfoList, pfoListName));
31 
32  if (!m_inputClusterListNameU.empty())
33  {
34  const ClusterList *pClusterListU = nullptr;
35  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::GetList(*this, m_inputClusterListNameU, pClusterListU));
36 
37  if (pClusterListU)
38  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->CreatePFOs(pClusterListU));
39  }
40 
41  if (!m_inputClusterListNameV.empty())
42  {
43  const ClusterList *pClusterListV = nullptr;
44  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::GetList(*this, m_inputClusterListNameV, pClusterListV));
45 
46  if (pClusterListV)
47  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->CreatePFOs(pClusterListV));
48  }
49 
50  if (!m_inputClusterListNameW.empty())
51  {
52  const ClusterList *pClusterListW = nullptr;
53  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::GetList(*this, m_inputClusterListNameW, pClusterListW));
54 
55  if (pClusterListW)
56  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, this->CreatePFOs(pClusterListW));
57  }
58 
59  if (!pPfoList->empty())
60  {
61  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::SaveList<Pfo>(*this, m_outputPfoListName));
62  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::ReplaceCurrentList<Pfo>(*this, m_outputPfoListName));
63  }
64 
65  return STATUS_CODE_SUCCESS;
66 }
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.

Referenced by ReadSettings(), and Run().

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.

Referenced by ReadSettings(), and Run().

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.

Referenced by ReadSettings(), and Run().

float lar_content::TwoDParticleCreationAlgorithm::m_minClusterEnergy
private

Min energy for clusters to form pfos.

Definition at line 44 of file TwoDParticleCreationAlgorithm.h.

Referenced by CreatePFOs(), and ReadSettings().

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.

Referenced by CreatePFOs(), and ReadSettings().

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

The output pfo list name.

Definition at line 42 of file TwoDParticleCreationAlgorithm.h.

Referenced by ReadSettings(), and Run().


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