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

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 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)
 
- 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)
 
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...
 

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

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

Definition at line 98 of file TrackShowerIdFeatureTool.h.

Constructor & Destructor Documentation

lar_content::TwoDVertexDistanceFeatureTool::TwoDVertexDistanceFeatureTool ( )

Default constructor.

Definition at line 259 of file TrackShowerIdFeatureTool.cc.

259  : m_slidingLinearFitWindow(10000)
260 {
261 }
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 306 of file TrackShowerIdFeatureTool.cc.

307 {
308  PANDORA_RETURN_RESULT_IF_AND_IF(
309  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "SlidingLinearFitWindow", m_slidingLinearFitWindow));
310 
311  return STATUS_CODE_SUCCESS;
312 }
unsigned int m_slidingLinearFitWindow
The sliding linear fit window.
void lar_content::TwoDVertexDistanceFeatureTool::Run ( LArMvaHelper::MvaFeatureVector featureVector,
const pandora::Algorithm *const  pAlgorithm,
const pandora::Cluster *const  pCluster 
)

Definition at line 265 of file TrackShowerIdFeatureTool.cc.

267 {
268  if (PandoraContentApi::GetSettings(*pAlgorithm)->ShouldDisplayAlgorithmInfo())
269  std::cout << "----> Running Algorithm Tool: " << this->GetInstanceName() << ", " << this->GetType() << std::endl;
270 
271  float straightLineLength(-1.f), ratio(-1.f);
272  try
273  {
274  const TwoDSlidingFitResult slidingFitResultLarge(pCluster, m_slidingLinearFitWindow, LArGeometryHelper::GetWireZPitch(this->GetPandora()));
275  straightLineLength = (slidingFitResultLarge.GetGlobalMaxLayerPosition() - slidingFitResultLarge.GetGlobalMinLayerPosition()).GetMagnitude();
276  if (straightLineLength > std::numeric_limits<float>::epsilon())
277  ratio = (CutClusterCharacterisationAlgorithm::GetVertexDistance(pAlgorithm, pCluster)) / straightLineLength;
278  }
279  catch (const StatusCodeException &)
280  {
281  ratio = -1.f;
282  }
283  featureVector.push_back(ratio);
284 }
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.
unsigned int m_slidingLinearFitWindow
The sliding linear fit window.
BEGIN_PROLOG could also be cout
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.


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