All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Member Functions | List of all members
lar_content::ThreeDVertexDistanceFeatureTool Class Reference

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 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)
 
- Public Member Functions inherited from lar_content::MvaFeatureTool< Ts >
 MvaFeatureTool ()=default
 Default constructor. More...
 
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...args)
 

Private Member Functions

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

Additional Inherited Members

- Public Types inherited from lar_content::MvaFeatureTool< Ts >
typedef std::vector
< MvaFeatureTool< Ts...> * > 
FeatureToolVector
 
typedef std::map< std::string,
MvaFeatureTool< Ts...> * > 
FeatureToolMap
 

Detailed Description

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

Definition at line 189 of file TrackShowerIdFeatureTool.h.

Constructor & Destructor Documentation

lar_content::ThreeDVertexDistanceFeatureTool::ThreeDVertexDistanceFeatureTool ( )

Default constructor.

Definition at line 721 of file TrackShowerIdFeatureTool.cc.

722 {
723 }

Member Function Documentation

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

Definition at line 796 of file TrackShowerIdFeatureTool.cc.

797 {
798  return STATUS_CODE_SUCCESS;
799 }
void lar_content::ThreeDVertexDistanceFeatureTool::Run ( LArMvaHelper::MvaFeatureVector featureVector,
const pandora::Algorithm *const  pAlgorithm,
const pandora::ParticleFlowObject *const  pInputPfo 
)

Definition at line 727 of file TrackShowerIdFeatureTool.cc.

729 {
730  if (PandoraContentApi::GetSettings(*pAlgorithm)->ShouldDisplayAlgorithmInfo())
731  std::cout << "----> Running Algorithm Tool: " << this->GetInstanceName() << ", " << this->GetType() << std::endl;
732 
733  LArMvaHelper::MvaFeature vertexDistance;
734 
735  const VertexList *pVertexList(nullptr);
736  (void)PandoraContentApi::GetCurrentList(*pAlgorithm, pVertexList);
737 
738  if (!pVertexList || pVertexList->empty())
739  {
740  featureVector.push_back(vertexDistance);
741  return;
742  }
743 
744  unsigned int nInteractionVertices(0);
745  const Vertex *pInteractionVertex(nullptr);
746 
747  for (const Vertex *pVertex : *pVertexList)
748  {
749  if ((pVertex->GetVertexLabel() == VERTEX_INTERACTION) && (pVertex->GetVertexType() == VERTEX_3D))
750  {
751  ++nInteractionVertices;
752  pInteractionVertex = pVertex;
753  }
754  }
755 
756  if (pInteractionVertex && (1 == nInteractionVertices))
757  {
758  try
759  {
760  vertexDistance = (pInteractionVertex->GetPosition() - LArPfoHelper::GetVertex(pInputPfo)->GetPosition()).GetMagnitude();
761  }
762  catch (const StatusCodeException &)
763  {
764  CaloHitList threeDCaloHitList;
765  LArPfoHelper::GetCaloHits(pInputPfo, TPC_3D, threeDCaloHitList);
766 
767  if (!threeDCaloHitList.empty())
768  vertexDistance = (pInteractionVertex->GetPosition() - (threeDCaloHitList.front())->GetPositionVector()).GetMagnitude();
769  }
770  }
771 
772  featureVector.push_back(vertexDistance);
773 }
static const pandora::Vertex * GetVertex(const pandora::ParticleFlowObject *const pPfo)
Get the pfo vertex.
MvaTypes::MvaFeature MvaFeature
Definition: LArMvaHelper.h:71
j template void())
Definition: json.hpp:3108
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:182
BEGIN_PROLOG could also be cout
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: