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

22  :
24 {
25 }
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 100 of file NeutrinoCreationAlgorithm.cc.

References f.

Referenced by ForceSingleEmptyNeutrino(), and Run().

101 {
102  pfoParameters.m_particleId = NU_MU;
103  pfoParameters.m_charge = PdgTable::GetParticleCharge(pfoParameters.m_particleId.Get());
104  pfoParameters.m_mass = PdgTable::GetParticleMass(pfoParameters.m_particleId.Get());
105  pfoParameters.m_energy = 0.f;
106  pfoParameters.m_momentum = CartesianVector(0.f, 0.f, 0.f);
107  pfoParameters.m_propertiesToAdd["IsNeutrino"] = 1.f;
108 }
TFile f
Definition: plotHisto.C:6
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 77 of file NeutrinoCreationAlgorithm.cc.

References FillDefaultNeutrinoParameters(), and m_neutrinoPfoListName.

Referenced by Run().

78 {
79  std::string neutrinoPfoListName;
80  const PfoList *pNeutrinoPfoList(nullptr);
81  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::CreateTemporaryListAndSetCurrent(*this, pNeutrinoPfoList, neutrinoPfoListName));
82 
83  PandoraContentApi::ParticleFlowObject::Parameters pfoParameters;
84  this->FillDefaultNeutrinoParameters(pfoParameters);
85 
86  const ParticleFlowObject *pNeutrinoPfo(nullptr);
87  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::ParticleFlowObject::Create(*this, pfoParameters, pNeutrinoPfo));
88 
89  if ((!pNeutrinoPfoList) || pNeutrinoPfoList->empty())
90  throw StatusCodeException(STATUS_CODE_FAILURE);
91 
92  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::SaveList<Pfo>(*this, m_neutrinoPfoListName));
93  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::ReplaceCurrentList<Pfo>(*this, m_neutrinoPfoListName));
94 
95  return STATUS_CODE_SUCCESS;
96 }
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 112 of file NeutrinoCreationAlgorithm.cc.

References m_forceSingleEmptyNeutrino, m_neutrinoPfoListName, and m_vertexListName.

113 {
114  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ReadValue(xmlHandle, "InputVertexListName", m_vertexListName));
115 
116  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ReadValue(xmlHandle, "NeutrinoPfoListName", m_neutrinoPfoListName));
117 
118  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
119  XmlHelper::ReadValue(xmlHandle, "ForceSingleEmptyNeutrino", m_forceSingleEmptyNeutrino));
120 
121  return STATUS_CODE_SUCCESS;
122 }
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 29 of file NeutrinoCreationAlgorithm.cc.

References FillDefaultNeutrinoParameters(), ForceSingleEmptyNeutrino(), m_forceSingleEmptyNeutrino, m_neutrinoPfoListName, and m_vertexListName.

30 {
32  return this->ForceSingleEmptyNeutrino();
33 
34  const VertexList *pVertexList(nullptr);
35  PANDORA_RETURN_RESULT_IF_AND_IF(
36  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_INITIALIZED, !=, PandoraContentApi::GetList(*this, m_vertexListName, pVertexList));
37 
38  if (!pVertexList || pVertexList->empty())
39  {
40  if (PandoraContentApi::GetSettings(*this)->ShouldDisplayAlgorithmInfo())
41  std::cout << "NeutrinoCreationAlgorithm: unable to find vertex list " << m_vertexListName << std::endl;
42 
43  return STATUS_CODE_SUCCESS;
44  }
45 
46  std::string neutrinoPfoListName;
47  const PfoList *pNeutrinoPfoList(nullptr);
48  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::CreateTemporaryListAndSetCurrent(*this, pNeutrinoPfoList, neutrinoPfoListName));
49 
50  for (VertexList::const_iterator vIter = pVertexList->begin(), vIterEnd = pVertexList->end(); vIter != vIterEnd; ++vIter)
51  {
52  const Vertex *const pVertex = *vIter;
53 
54  if (VERTEX_3D != pVertex->GetVertexType())
55  throw StatusCodeException(STATUS_CODE_FAILURE);
56 
57  // ATTN Placeholder properties to be set by a later neutrino properties algorithm
58  PandoraContentApi::ParticleFlowObject::Parameters pfoParameters;
59  this->FillDefaultNeutrinoParameters(pfoParameters);
60  pfoParameters.m_vertexList.push_back(pVertex);
61 
62  const ParticleFlowObject *pNeutrinoPfo(nullptr);
63  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::ParticleFlowObject::Create(*this, pfoParameters, pNeutrinoPfo));
64  }
65 
66  if ((!pNeutrinoPfoList) || pNeutrinoPfoList->empty())
67  throw StatusCodeException(STATUS_CODE_FAILURE);
68 
69  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::SaveList<Pfo>(*this, m_neutrinoPfoListName));
70  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::ReplaceCurrentList<Pfo>(*this, m_neutrinoPfoListName));
71 
72  return STATUS_CODE_SUCCESS;
73 }
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...
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:169
pandora::StatusCode ForceSingleEmptyNeutrino() const
Force creation of a single neutrino, with no vertex, regardless of number of input vertices...

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.

Referenced by ReadSettings(), and Run().

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

The name of the neutrino pfo list.

Definition at line 45 of file NeutrinoCreationAlgorithm.h.

Referenced by ForceSingleEmptyNeutrino(), ReadSettings(), and Run().

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

The name of the neutrino vertex list.

Definition at line 44 of file NeutrinoCreationAlgorithm.h.

Referenced by ReadSettings(), and Run().


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