LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
lar_content::ThreeDVertexDistanceFeatureTool Class Referenceabstract

ThreeDVertexDistanceFeatureTool class for the calculation of 3d distance to neutrino vertex. More...

#include "TrackShowerIdFeatureTool.h"

Inheritance diagram for lar_content::ThreeDVertexDistanceFeatureTool:
lar_content::MvaFeatureTool< Ts >

Public Types

typedef std::vector< MvaFeatureTool< Ts... > * > FeatureToolVector
 
typedef std::map< std::string, MvaFeatureTool< Ts... > * > FeatureToolMap
 

Public Member Functions

 ThreeDVertexDistanceFeatureTool ()
 Default constructor. More...
 
void Run (LArMvaHelper::MvaFeatureVector &featureVector, const pandora::Algorithm *const pAlgorithm, const pandora::ParticleFlowObject *const pInputPfo)
 
void Run (LArMvaHelper::MvaFeatureMap &featureMap, pandora::StringVector &featureOrder, const std::string &featureToolName, const pandora::Algorithm *const pAlgorithm, const pandora::ParticleFlowObject *const pInputPfo)
 
virtual void Run (MvaTypes::MvaFeatureVector &featureVector, Ts...args)=0
 Run the algorithm tool. More...
 
virtual void Run (MvaTypes::MvaFeatureMap &featureMap, pandora::StringVector &featureOrder, const std::string &featureToolName, Ts...)
 

Private Member Functions

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

Detailed Description

ThreeDVertexDistanceFeatureTool class for the calculation of 3d distance to neutrino vertex.

Definition at line 189 of file TrackShowerIdFeatureTool.h.

Member Typedef Documentation

template<typename... Ts>
typedef std::map<std::string, MvaFeatureTool<Ts...> *> lar_content::MvaFeatureTool< Ts >::FeatureToolMap
inherited

Definition at line 37 of file LArMvaHelper.h.

template<typename... Ts>
typedef std::vector<MvaFeatureTool<Ts...> *> lar_content::MvaFeatureTool< Ts >::FeatureToolVector
inherited

Definition at line 36 of file LArMvaHelper.h.

Constructor & Destructor Documentation

lar_content::ThreeDVertexDistanceFeatureTool::ThreeDVertexDistanceFeatureTool ( )

Default constructor.

Definition at line 728 of file TrackShowerIdFeatureTool.cc.

729 {
730 }

Member Function Documentation

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

Definition at line 803 of file TrackShowerIdFeatureTool.cc.

804 {
805  return STATUS_CODE_SUCCESS;
806 }
template<typename... Ts>
virtual void lar_content::MvaFeatureTool< Ts >::Run ( MvaTypes::MvaFeatureVector featureVector,
Ts...  args 
)
pure virtualinherited

Run the algorithm tool.

Parameters
featureVectorthe vector of features to append
argsarguments to pass to the tool
template<typename... Ts>
virtual void lar_content::MvaFeatureTool< Ts >::Run ( MvaTypes::MvaFeatureMap featureMap,
pandora::StringVector &  featureOrder,
const std::string &  featureToolName,
Ts...   
)
inlinevirtualinherited

Definition at line 51 of file LArMvaHelper.h.

52  {
53  (void)featureMap;
54  (void)featureOrder;
55  (void)featureToolName;
56  return;
57  };
void lar_content::ThreeDVertexDistanceFeatureTool::Run ( LArMvaHelper::MvaFeatureVector featureVector,
const pandora::Algorithm *const  pAlgorithm,
const pandora::ParticleFlowObject *const  pInputPfo 
)

Definition at line 734 of file TrackShowerIdFeatureTool.cc.

References lar_content::LArPfoHelper::GetCaloHits(), lar_content::LArPfoHelper::GetVertex(), and lar_content::ThreeDLinearFitFeatureTool::Run().

736 {
737  if (PandoraContentApi::GetSettings(*pAlgorithm)->ShouldDisplayAlgorithmInfo())
738  std::cout << "----> Running Algorithm Tool: " << this->GetInstanceName() << ", " << this->GetType() << std::endl;
739 
740  LArMvaHelper::MvaFeature vertexDistance;
741 
742  const VertexList *pVertexList(nullptr);
743  (void)PandoraContentApi::GetCurrentList(*pAlgorithm, pVertexList);
744 
745  if (!pVertexList || pVertexList->empty())
746  {
747  featureVector.push_back(vertexDistance);
748  return;
749  }
750 
751  unsigned int nInteractionVertices(0);
752  const Vertex *pInteractionVertex(nullptr);
753 
754  for (const Vertex *pVertex : *pVertexList)
755  {
756  if ((pVertex->GetVertexLabel() == VERTEX_INTERACTION) && (pVertex->GetVertexType() == VERTEX_3D))
757  {
758  ++nInteractionVertices;
759  pInteractionVertex = pVertex;
760  }
761  }
762 
763  if (pInteractionVertex && (1 == nInteractionVertices))
764  {
765  try
766  {
767  vertexDistance = (pInteractionVertex->GetPosition() - LArPfoHelper::GetVertex(pInputPfo)->GetPosition()).GetMagnitude();
768  }
769  catch (const StatusCodeException &)
770  {
771  CaloHitList threeDCaloHitList;
772  LArPfoHelper::GetCaloHits(pInputPfo, TPC_3D, threeDCaloHitList);
773 
774  if (!threeDCaloHitList.empty())
775  vertexDistance = (pInteractionVertex->GetPosition() - (threeDCaloHitList.front())->GetPositionVector()).GetMagnitude();
776  }
777  }
778 
779  featureVector.push_back(vertexDistance);
780 }
static const pandora::Vertex * GetVertex(const pandora::ParticleFlowObject *const pPfo)
Get the pfo vertex.
MvaTypes::MvaFeature MvaFeature
Definition: LArMvaHelper.h:74
boost::graph_traits< ModuleGraph >::vertex_descriptor Vertex
Definition: ModuleGraph.h:25
static void GetCaloHits(const pandora::PfoList &pfoList, const pandora::HitType &hitType, pandora::CaloHitList &caloHitList)
Get a list of calo hits of a particular hit type from a list of pfos.
std::list< Vertex > VertexList
Definition: DCEL.h:169
void lar_content::ThreeDVertexDistanceFeatureTool::Run ( LArMvaHelper::MvaFeatureMap featureMap,
pandora::StringVector &  featureOrder,
const std::string &  featureToolName,
const pandora::Algorithm *const  pAlgorithm,
const pandora::ParticleFlowObject *const  pInputPfo 
)

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