LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
lar_content::CheatingVertexCreationAlgorithm Class Reference

CheatingVertexCreationAlgorithm::Algorithm class. More...

#include "CheatingVertexCreationAlgorithm.h"

Inheritance diagram for lar_content::CheatingVertexCreationAlgorithm:

Public Member Functions

 CheatingVertexCreationAlgorithm ()
 Default constructor. More...
 

Private Member Functions

pandora::StatusCode Run ()
 
pandora::StatusCode ReadSettings (const pandora::TiXmlHandle xmlHandle)
 

Private Attributes

std::string m_outputVertexListName
 The name under which to save the output vertex list. More...
 
bool m_replaceCurrentVertexList
 Whether to replace the current vertex list with the output list. More...
 
float m_vertexXCorrection
 The vertex x correction, added to reported mc neutrino endpoint x value, in cm. More...
 

Detailed Description

CheatingVertexCreationAlgorithm::Algorithm class.

Definition at line 19 of file CheatingVertexCreationAlgorithm.h.

Constructor & Destructor Documentation

lar_content::CheatingVertexCreationAlgorithm::CheatingVertexCreationAlgorithm ( )

Default constructor.

Definition at line 21 of file CheatingVertexCreationAlgorithm.cc.

21  :
24 {
25 }
float m_vertexXCorrection
The vertex x correction, added to reported mc neutrino endpoint x value, in cm.
TFile f
Definition: plotHisto.C:6
bool m_replaceCurrentVertexList
Whether to replace the current vertex list with the output list.

Member Function Documentation

StatusCode lar_content::CheatingVertexCreationAlgorithm::ReadSettings ( const pandora::TiXmlHandle  xmlHandle)
private

Definition at line 66 of file CheatingVertexCreationAlgorithm.cc.

References m_outputVertexListName, m_replaceCurrentVertexList, and m_vertexXCorrection.

67 {
68  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ReadValue(xmlHandle, "OutputVertexListName", m_outputVertexListName));
69 
70  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
71  XmlHelper::ReadValue(xmlHandle, "ReplaceCurrentVertexList", m_replaceCurrentVertexList));
72 
73  PANDORA_RETURN_RESULT_IF_AND_IF(
74  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "VertexXCorrection", m_vertexXCorrection));
75 
76  return STATUS_CODE_SUCCESS;
77 }
float m_vertexXCorrection
The vertex x correction, added to reported mc neutrino endpoint x value, in cm.
bool m_replaceCurrentVertexList
Whether to replace the current vertex list with the output list.
std::string m_outputVertexListName
The name under which to save the output vertex list.
StatusCode lar_content::CheatingVertexCreationAlgorithm::Run ( )
private

Definition at line 29 of file CheatingVertexCreationAlgorithm.cc.

References lar_content::LArMCParticleHelper::IsNeutrino(), m_outputVertexListName, m_replaceCurrentVertexList, and m_vertexXCorrection.

30 {
31  const MCParticleList *pMCParticleList(nullptr);
32  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::GetCurrentList(*this, pMCParticleList));
33 
34  const VertexList *pVertexList(nullptr);
35  std::string temporaryListName;
36  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::CreateTemporaryListAndSetCurrent(*this, pVertexList, temporaryListName));
37 
38  for (const MCParticle *const pMCParticle : *pMCParticleList)
39  {
40  if (!LArMCParticleHelper::IsNeutrino(pMCParticle))
41  continue;
42 
43  PandoraContentApi::Vertex::Parameters parameters;
44  parameters.m_position = CartesianVector(
45  pMCParticle->GetEndpoint().GetX() + m_vertexXCorrection, pMCParticle->GetEndpoint().GetY(), pMCParticle->GetEndpoint().GetZ());
46  parameters.m_vertexLabel = VERTEX_INTERACTION;
47  parameters.m_vertexType = VERTEX_3D;
48 
49  const Vertex *pVertex(nullptr);
50  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::Vertex::Create(*this, parameters, pVertex));
51  }
52 
53  if (!pVertexList->empty())
54  {
55  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::SaveList<Vertex>(*this, m_outputVertexListName));
56 
58  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::ReplaceCurrentList<Vertex>(*this, m_outputVertexListName));
59  }
60 
61  return STATUS_CODE_SUCCESS;
62 }
float m_vertexXCorrection
The vertex x correction, added to reported mc neutrino endpoint x value, in cm.
bool m_replaceCurrentVertexList
Whether to replace the current vertex list with the output list.
std::string m_outputVertexListName
The name under which to save the output vertex list.
boost::graph_traits< ModuleGraph >::vertex_descriptor Vertex
Definition: ModuleGraph.h:25
std::list< Vertex > VertexList
Definition: DCEL.h:169
static bool IsNeutrino(const pandora::MCParticle *const pMCParticle)
Whether a mc particle is a neutrino or antineutrino.

Member Data Documentation

std::string lar_content::CheatingVertexCreationAlgorithm::m_outputVertexListName
private

The name under which to save the output vertex list.

Definition at line 31 of file CheatingVertexCreationAlgorithm.h.

Referenced by ReadSettings(), and Run().

bool lar_content::CheatingVertexCreationAlgorithm::m_replaceCurrentVertexList
private

Whether to replace the current vertex list with the output list.

Definition at line 32 of file CheatingVertexCreationAlgorithm.h.

Referenced by ReadSettings(), and Run().

float lar_content::CheatingVertexCreationAlgorithm::m_vertexXCorrection
private

The vertex x correction, added to reported mc neutrino endpoint x value, in cm.

Definition at line 33 of file CheatingVertexCreationAlgorithm.h.

Referenced by ReadSettings(), and Run().


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