LArSoft  v10_04_05
Liquid Argon Software toolkit - https://larsoft.org/
lar_content::CheatingSecondaryVertexAlgorithm Class Reference

CheatingSecondaryVertexAlgorithm::Algorithm class. More...

#include "CheatingSecondaryVertexAlgorithm.h"

Inheritance diagram for lar_content::CheatingSecondaryVertexAlgorithm:

Public Member Functions

 CheatingSecondaryVertexAlgorithm ()
 Default constructor. More...
 

Private Member Functions

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

Private Attributes

std::string m_inputCaloHitListName
 The name of the input calo hit list. More...
 
std::string m_outputVertexListName
 The name under which to save the output vertex list. More...
 

Detailed Description

CheatingSecondaryVertexAlgorithm::Algorithm class.

Definition at line 19 of file CheatingSecondaryVertexAlgorithm.h.

Constructor & Destructor Documentation

lar_content::CheatingSecondaryVertexAlgorithm::CheatingSecondaryVertexAlgorithm ( )

Default constructor.

Definition at line 22 of file CheatingSecondaryVertexAlgorithm.cc.

22  :
23  m_inputCaloHitListName("CaloHitList2D")
24 {
25 }
std::string m_inputCaloHitListName
The name of the input calo hit list.

Member Function Documentation

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

Definition at line 60 of file CheatingSecondaryVertexAlgorithm.cc.

References m_inputCaloHitListName, and m_outputVertexListName.

61 {
62  PANDORA_RETURN_RESULT_IF_AND_IF(
63  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "CaloHitList2D", m_inputCaloHitListName));
64  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ReadValue(xmlHandle, "OutputVertexListName", m_outputVertexListName));
65 
66  return STATUS_CODE_SUCCESS;
67 }
std::string m_outputVertexListName
The name under which to save the output vertex list.
std::string m_inputCaloHitListName
The name of the input calo hit list.
StatusCode lar_content::CheatingSecondaryVertexAlgorithm::Run ( )
private

Definition at line 29 of file CheatingSecondaryVertexAlgorithm.cc.

References lar_content::LArEventTopology::ConstructVisibleHierarchy(), lar_content::LArEventTopology::GetVertices(), m_inputCaloHitListName, m_outputVertexListName, and lar_content::LArEventTopology::PruneHierarchy().

30 {
31  const CaloHitList *pCaloHitList2D{nullptr};
32  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::GetList(*this, m_inputCaloHitListName, pCaloHitList2D));
33  LArEventTopology eventTopology(*pCaloHitList2D);
34  eventTopology.ConstructVisibleHierarchy();
35  eventTopology.PruneHierarchy();
36  CartesianPointVector vertices;
37  eventTopology.GetVertices(vertices);
38 
39  const VertexList *pVertexList{nullptr};
40  std::string temporaryListName;
41  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::CreateTemporaryListAndSetCurrent(*this, pVertexList, temporaryListName));
42 
43  for (const CartesianVector &position : vertices)
44  {
45  PandoraContentApi::Vertex::Parameters parameters;
46  parameters.m_position = position;
47  parameters.m_vertexLabel = VERTEX_INTERACTION;
48  parameters.m_vertexType = VERTEX_3D;
49 
50  const Vertex *pVertex(nullptr);
51  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::Vertex::Create(*this, parameters, pVertex));
52  }
53  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::SaveList<Vertex>(*this, m_outputVertexListName));
54 
55  return STATUS_CODE_SUCCESS;
56 }
std::string m_outputVertexListName
The name under which to save the output vertex list.
std::string m_inputCaloHitListName
The name of the input calo hit list.
boost::graph_traits< ModuleGraph >::vertex_descriptor Vertex
Definition: ModuleGraph.h:25
std::list< Vertex > VertexList
Definition: DCEL.h:169

Member Data Documentation

std::string lar_content::CheatingSecondaryVertexAlgorithm::m_inputCaloHitListName
private

The name of the input calo hit list.

Definition at line 31 of file CheatingSecondaryVertexAlgorithm.h.

Referenced by ReadSettings(), and Run().

std::string lar_content::CheatingSecondaryVertexAlgorithm::m_outputVertexListName
private

The name under which to save the output vertex list.

Definition at line 32 of file CheatingSecondaryVertexAlgorithm.h.

Referenced by ReadSettings(), and Run().


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