LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
lar_content::TwoDVertexDistanceFeatureTool Class Referenceabstract

VertexDistanceFeatureTool class for the calculation of 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
 

Public Member Functions

 TwoDVertexDistanceFeatureTool ()
 Default constructor. More...
 
void Run (LArMvaHelper::MvaFeatureVector &featureVector, const pandora::Algorithm *const pAlgorithm, const pandora::Cluster *const pCluster)
 
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...
 

Detailed Description

VertexDistanceFeatureTool class for the calculation of distance to neutrino vertex.

Definition at line 92 of file TrackShowerIdFeatureTool.h.

Member Typedef Documentation

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

Definition at line 30 of file LArMvaHelper.h.

Constructor & Destructor Documentation

lar_content::TwoDVertexDistanceFeatureTool::TwoDVertexDistanceFeatureTool ( )

Default constructor.

Definition at line 211 of file TrackShowerIdFeatureTool.cc.

211  :
213 {
214 }
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 241 of file TrackShowerIdFeatureTool.cc.

References m_slidingLinearFitWindow.

242 {
243 
244  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
245  "SlidingLinearFitWindow", m_slidingLinearFitWindow));
246 
247  return STATUS_CODE_SUCCESS;
248 }
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
void lar_content::TwoDVertexDistanceFeatureTool::Run ( LArMvaHelper::MvaFeatureVector featureVector,
const pandora::Algorithm *const  pAlgorithm,
const pandora::Cluster *const  pCluster 
)

Definition at line 218 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.

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

Member Data Documentation

unsigned int lar_content::TwoDVertexDistanceFeatureTool::m_slidingLinearFitWindow
private

The sliding linear fit window.

Definition at line 114 of file TrackShowerIdFeatureTool.h.

Referenced by ReadSettings(), and Run().


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