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

TwoDVertexDistanceFeatureTool class for the calculation of 2d distance to neutrino vertex. More...

#include "TrackShowerIdFeatureTool.h"

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

Public Types

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

Public Member Functions

 TwoDVertexDistanceFeatureTool ()
 Default constructor. More...
 
void Run (LArMvaHelper::MvaFeatureVector &featureVector, const pandora::Algorithm *const pAlgorithm, const pandora::Cluster *const pCluster)
 
void Run (LArMvaHelper::MvaFeatureMap &featureMap, pandora::StringVector &featureOrder, const std::string &featureToolName, const pandora::Algorithm *const pAlgorithm, const pandora::Cluster *const pCluster)
 
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)
 
float CalculateVertexDistance (const pandora::Algorithm *const pAlgorithm, const pandora::Cluster *const pCluster) const
 Calculation of vertex distance. More...
 

Private Attributes

unsigned int m_slidingLinearFitWindow
 The sliding linear fit window. More...
 

Detailed Description

TwoDVertexDistanceFeatureTool class for the calculation of 2d distance to neutrino vertex.

Definition at line 98 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::TwoDVertexDistanceFeatureTool::TwoDVertexDistanceFeatureTool ( )

Default constructor.

Definition at line 263 of file TrackShowerIdFeatureTool.cc.

263  :
265 {
266 }
unsigned int m_slidingLinearFitWindow
The sliding linear fit window.

Member Function Documentation

float lar_content::TwoDVertexDistanceFeatureTool::CalculateVertexDistance ( const pandora::Algorithm *const  pAlgorithm,
const pandora::Cluster *const  pCluster 
) const
private

Calculation of vertex distance.

Parameters
pClusterthe cluster we are characterizing
Returns
distance to neutrino vertex
StatusCode lar_content::TwoDVertexDistanceFeatureTool::ReadSettings ( const pandora::TiXmlHandle  xmlHandle)
private

Definition at line 311 of file TrackShowerIdFeatureTool.cc.

References m_slidingLinearFitWindow.

312 {
313  PANDORA_RETURN_RESULT_IF_AND_IF(
314  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "SlidingLinearFitWindow", m_slidingLinearFitWindow));
315 
316  return STATUS_CODE_SUCCESS;
317 }
unsigned int m_slidingLinearFitWindow
The sliding linear fit window.
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::TwoDVertexDistanceFeatureTool::Run ( LArMvaHelper::MvaFeatureVector featureVector,
const pandora::Algorithm *const  pAlgorithm,
const pandora::Cluster *const  pCluster 
)

Definition at line 270 of file TrackShowerIdFeatureTool.cc.

References f, lar_content::TwoDSlidingFitResult::GetGlobalMaxLayerPosition(), lar_content::TwoDSlidingFitResult::GetGlobalMinLayerPosition(), lar_content::CutClusterCharacterisationAlgorithm::GetVertexDistance(), lar_content::LArGeometryHelper::GetWireZPitch(), and m_slidingLinearFitWindow.

Referenced by lar_content::PfoHierarchyFeatureTool::Run().

272 {
273  if (PandoraContentApi::GetSettings(*pAlgorithm)->ShouldDisplayAlgorithmInfo())
274  std::cout << "----> Running Algorithm Tool: " << this->GetInstanceName() << ", " << this->GetType() << std::endl;
275 
276  float straightLineLength(-1.f), ratio(-1.f);
277  try
278  {
279  const TwoDSlidingFitResult slidingFitResultLarge(pCluster, m_slidingLinearFitWindow, LArGeometryHelper::GetWireZPitch(this->GetPandora()));
280  straightLineLength = (slidingFitResultLarge.GetGlobalMaxLayerPosition() - slidingFitResultLarge.GetGlobalMinLayerPosition()).GetMagnitude();
281  if (straightLineLength > std::numeric_limits<float>::epsilon())
282  ratio = (CutClusterCharacterisationAlgorithm::GetVertexDistance(pAlgorithm, pCluster)) / straightLineLength;
283  }
284  catch (const StatusCodeException &)
285  {
286  ratio = -1.f;
287  }
288  featureVector.push_back(ratio);
289 }
static float GetVertexDistance(const pandora::Algorithm *const pAlgorithm, const pandora::Cluster *const pCluster)
Get the distance between the interaction vertex (if present in the current vertex list) and a provide...
static float GetWireZPitch(const pandora::Pandora &pandora, const float maxWirePitchDiscrepancy=0.01)
Return the wire pitch.
TFile f
Definition: plotHisto.C:6
unsigned int m_slidingLinearFitWindow
The sliding linear fit window.
void lar_content::TwoDVertexDistanceFeatureTool::Run ( LArMvaHelper::MvaFeatureMap featureMap,
pandora::StringVector &  featureOrder,
const std::string &  featureToolName,
const pandora::Algorithm *const  pAlgorithm,
const pandora::Cluster *const  pCluster 
)

Member Data Documentation

unsigned int lar_content::TwoDVertexDistanceFeatureTool::m_slidingLinearFitWindow
private

The sliding linear fit window.

Definition at line 122 of file TrackShowerIdFeatureTool.h.

Referenced by ReadSettings(), and Run().


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