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

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
 

Detailed Description

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

Definition at line 92 of file TrackShowerIdFeatureTool.h.

Constructor & Destructor Documentation

lar_content::TwoDVertexDistanceFeatureTool::TwoDVertexDistanceFeatureTool ( )

Default constructor.

Definition at line 206 of file TrackShowerIdFeatureTool.cc.

206  : m_slidingLinearFitWindow(10000)
207 {
208 }
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 235 of file TrackShowerIdFeatureTool.cc.

236 {
237  PANDORA_RETURN_RESULT_IF_AND_IF(
238  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "SlidingLinearFitWindow", m_slidingLinearFitWindow));
239 
240  return STATUS_CODE_SUCCESS;
241 }
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 212 of file TrackShowerIdFeatureTool.cc.

214 {
215  if (PandoraContentApi::GetSettings(*pAlgorithm)->ShouldDisplayAlgorithmInfo())
216  std::cout << "----> Running Algorithm Tool: " << this->GetInstanceName() << ", " << this->GetType() << std::endl;
217 
218  float straightLineLength(-1.f), ratio(-1.f);
219  try
220  {
221  const TwoDSlidingFitResult slidingFitResultLarge(pCluster, m_slidingLinearFitWindow, LArGeometryHelper::GetWireZPitch(this->GetPandora()));
222  straightLineLength = (slidingFitResultLarge.GetGlobalMaxLayerPosition() - slidingFitResultLarge.GetGlobalMinLayerPosition()).GetMagnitude();
223  if (straightLineLength > std::numeric_limits<float>::epsilon())
224  ratio = (CutClusterCharacterisationAlgorithm::GetVertexDistance(pAlgorithm, pCluster)) / straightLineLength;
225  }
226  catch (const StatusCodeException &)
227  {
228  ratio = -1.f;
229  }
230  featureVector.push_back(ratio);
231 }
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.
QTextStream & endl(QTextStream &s)

Member Data Documentation

unsigned int lar_content::TwoDVertexDistanceFeatureTool::m_slidingLinearFitWindow
private

The sliding linear fit window.

Definition at line 114 of file TrackShowerIdFeatureTool.h.


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