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

NeutrinoCreationAlgorithm class. More...

#include <NeutrinoCreationAlgorithm.h>

Inheritance diagram for lar_content::NeutrinoCreationAlgorithm:

Public Member Functions

 NeutrinoCreationAlgorithm ()
 Default constructor. More...
 

Private Member Functions

pandora::StatusCode Run ()
 
pandora::StatusCode ForceSingleEmptyNeutrino () const
 Force creation of a single neutrino, with no vertex, regardless of number of input vertices. More...
 
void FillDefaultNeutrinoParameters (PandoraContentApi::ParticleFlowObject::Parameters &pfoParameters) const
 Fill provided pfo parameters with default/dummy values for later refinement. More...
 
pandora::StatusCode ReadSettings (const pandora::TiXmlHandle xmlHandle)
 

Private Attributes

std::string m_vertexListName
 The name of the neutrino vertex list. More...
 
std::string m_neutrinoPfoListName
 The name of the neutrino pfo list. More...
 
bool m_forceSingleEmptyNeutrino
 Whether to force creation of a single neutrino, with no vertex, regardless of number of input vertices. More...
 

Detailed Description

NeutrinoCreationAlgorithm class.

Definition at line 19 of file NeutrinoCreationAlgorithm.h.

Constructor & Destructor Documentation

lar_content::NeutrinoCreationAlgorithm::NeutrinoCreationAlgorithm ( )

Default constructor.

Definition at line 22 of file NeutrinoCreationAlgorithm.cc.

23 {
24 }
bool m_forceSingleEmptyNeutrino
Whether to force creation of a single neutrino, with no vertex, regardless of number of input vertice...

Member Function Documentation

void lar_content::NeutrinoCreationAlgorithm::FillDefaultNeutrinoParameters ( PandoraContentApi::ParticleFlowObject::Parameters &  pfoParameters) const
private

Fill provided pfo parameters with default/dummy values for later refinement.

Parameters
pfoParametersthe pfo parameters

Definition at line 99 of file NeutrinoCreationAlgorithm.cc.

100 {
101  pfoParameters.m_particleId = NU_MU;
102  pfoParameters.m_charge = PdgTable::GetParticleCharge(pfoParameters.m_particleId.Get());
103  pfoParameters.m_mass = PdgTable::GetParticleMass(pfoParameters.m_particleId.Get());
104  pfoParameters.m_energy = 0.f;
105  pfoParameters.m_momentum = CartesianVector(0.f, 0.f, 0.f);
106  pfoParameters.m_propertiesToAdd["IsNeutrino"] = 1.f;
107 }
StatusCode lar_content::NeutrinoCreationAlgorithm::ForceSingleEmptyNeutrino ( ) const
private

Force creation of a single neutrino, with no vertex, regardless of number of input vertices.

Definition at line 76 of file NeutrinoCreationAlgorithm.cc.

77 {
78  std::string neutrinoPfoListName;
79  const PfoList *pNeutrinoPfoList(nullptr);
80  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::CreateTemporaryListAndSetCurrent(*this, pNeutrinoPfoList, neutrinoPfoListName));
81 
82  PandoraContentApi::ParticleFlowObject::Parameters pfoParameters;
83  this->FillDefaultNeutrinoParameters(pfoParameters);
84 
85  const ParticleFlowObject *pNeutrinoPfo(nullptr);
86  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::ParticleFlowObject::Create(*this, pfoParameters, pNeutrinoPfo));
87 
88  if ((!pNeutrinoPfoList) || pNeutrinoPfoList->empty())
89  throw StatusCodeException(STATUS_CODE_FAILURE);
90 
91  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::SaveList<Pfo>(*this, m_neutrinoPfoListName));
92  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::ReplaceCurrentList<Pfo>(*this, m_neutrinoPfoListName));
93 
94  return STATUS_CODE_SUCCESS;
95 }
std::string string
Definition: nybbler.cc:12
void FillDefaultNeutrinoParameters(PandoraContentApi::ParticleFlowObject::Parameters &pfoParameters) const
Fill provided pfo parameters with default/dummy values for later refinement.
std::string m_neutrinoPfoListName
The name of the neutrino pfo list.
StatusCode lar_content::NeutrinoCreationAlgorithm::ReadSettings ( const pandora::TiXmlHandle  xmlHandle)
private

Definition at line 111 of file NeutrinoCreationAlgorithm.cc.

112 {
113  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ReadValue(xmlHandle, "InputVertexListName", m_vertexListName));
114 
115  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ReadValue(xmlHandle, "NeutrinoPfoListName", m_neutrinoPfoListName));
116 
117  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
118  XmlHelper::ReadValue(xmlHandle, "ForceSingleEmptyNeutrino", m_forceSingleEmptyNeutrino));
119 
120  return STATUS_CODE_SUCCESS;
121 }
std::string m_vertexListName
The name of the neutrino vertex list.
bool m_forceSingleEmptyNeutrino
Whether to force creation of a single neutrino, with no vertex, regardless of number of input vertice...
std::string m_neutrinoPfoListName
The name of the neutrino pfo list.
StatusCode lar_content::NeutrinoCreationAlgorithm::Run ( )
private

Definition at line 28 of file NeutrinoCreationAlgorithm.cc.

29 {
31  return this->ForceSingleEmptyNeutrino();
32 
33  const VertexList *pVertexList(nullptr);
34  PANDORA_RETURN_RESULT_IF_AND_IF(
35  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_INITIALIZED, !=, PandoraContentApi::GetList(*this, m_vertexListName, pVertexList));
36 
37  if (!pVertexList || pVertexList->empty())
38  {
39  if (PandoraContentApi::GetSettings(*this)->ShouldDisplayAlgorithmInfo())
40  std::cout << "NeutrinoCreationAlgorithm: unable to find vertex list " << m_vertexListName << std::endl;
41 
42  return STATUS_CODE_SUCCESS;
43  }
44 
45  std::string neutrinoPfoListName;
46  const PfoList *pNeutrinoPfoList(nullptr);
47  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::CreateTemporaryListAndSetCurrent(*this, pNeutrinoPfoList, neutrinoPfoListName));
48 
49  for (VertexList::const_iterator vIter = pVertexList->begin(), vIterEnd = pVertexList->end(); vIter != vIterEnd; ++vIter)
50  {
51  const Vertex *const pVertex = *vIter;
52 
53  if (VERTEX_3D != pVertex->GetVertexType())
54  throw StatusCodeException(STATUS_CODE_FAILURE);
55 
56  // ATTN Placeholder properties to be set by a later neutrino properties algorithm
57  PandoraContentApi::ParticleFlowObject::Parameters pfoParameters;
58  this->FillDefaultNeutrinoParameters(pfoParameters);
59  pfoParameters.m_vertexList.push_back(pVertex);
60 
61  const ParticleFlowObject *pNeutrinoPfo(nullptr);
62  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::ParticleFlowObject::Create(*this, pfoParameters, pNeutrinoPfo));
63  }
64 
65  if ((!pNeutrinoPfoList) || pNeutrinoPfoList->empty())
66  throw StatusCodeException(STATUS_CODE_FAILURE);
67 
68  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::SaveList<Pfo>(*this, m_neutrinoPfoListName));
69  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::ReplaceCurrentList<Pfo>(*this, m_neutrinoPfoListName));
70 
71  return STATUS_CODE_SUCCESS;
72 }
std::string m_vertexListName
The name of the neutrino vertex list.
std::string string
Definition: nybbler.cc:12
bool m_forceSingleEmptyNeutrino
Whether to force creation of a single neutrino, with no vertex, regardless of number of input vertice...
intermediate_table::const_iterator const_iterator
void FillDefaultNeutrinoParameters(PandoraContentApi::ParticleFlowObject::Parameters &pfoParameters) const
Fill provided pfo parameters with default/dummy values for later refinement.
std::string m_neutrinoPfoListName
The name of the neutrino pfo list.
boost::graph_traits< ModuleGraph >::vertex_descriptor Vertex
Definition: ModuleGraph.h:25
std::list< Vertex > VertexList
Definition: DCEL.h:182
pandora::StatusCode ForceSingleEmptyNeutrino() const
Force creation of a single neutrino, with no vertex, regardless of number of input vertices...
QTextStream & endl(QTextStream &s)

Member Data Documentation

bool lar_content::NeutrinoCreationAlgorithm::m_forceSingleEmptyNeutrino
private

Whether to force creation of a single neutrino, with no vertex, regardless of number of input vertices.

Definition at line 47 of file NeutrinoCreationAlgorithm.h.

std::string lar_content::NeutrinoCreationAlgorithm::m_neutrinoPfoListName
private

The name of the neutrino pfo list.

Definition at line 45 of file NeutrinoCreationAlgorithm.h.

std::string lar_content::NeutrinoCreationAlgorithm::m_vertexListName
private

The name of the neutrino vertex list.

Definition at line 44 of file NeutrinoCreationAlgorithm.h.


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