LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
lar_content::TwoDShowerFitFeatureTool Class Referenceabstract

ShowerFitFeatureTool to calculate variables related to sliding shower fit. More...

#include "TrackShowerIdFeatureTool.h"

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

Public Types

typedef std::vector< MvaFeatureTool< Ts... > * > FeatureToolVector
 

Public Member Functions

 TwoDShowerFitFeatureTool ()
 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 CalculateShowerFitWidth (const pandora::Algorithm *const pAlgorithm, const pandora::Cluster *const pCluster) const
 Calculation of the shower fit width variable. More...
 

Private Attributes

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

Detailed Description

ShowerFitFeatureTool to calculate variables related to sliding shower fit.

Definition at line 22 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::TwoDShowerFitFeatureTool::TwoDShowerFitFeatureTool ( )

Default constructor.

Definition at line 30 of file TrackShowerIdFeatureTool.cc.

30  :
33 {
34 }
unsigned int m_slidingShowerFitWindow
The sliding shower fit window.
unsigned int m_slidingLinearFitWindow
The sliding linear fit window.

Member Function Documentation

float lar_content::TwoDShowerFitFeatureTool::CalculateShowerFitWidth ( const pandora::Algorithm *const  pAlgorithm,
const pandora::Cluster *const  pCluster 
) const
private

Calculation of the shower fit width variable.

Parameters
pAlgorithmaddress of the calling algorithm
pClusterthe cluster we are characterizing
Returns
shower fit width
StatusCode lar_content::TwoDShowerFitFeatureTool::ReadSettings ( const pandora::TiXmlHandle  xmlHandle)
private

Definition at line 62 of file TrackShowerIdFeatureTool.cc.

References m_slidingLinearFitWindow, and m_slidingShowerFitWindow.

63 {
64  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
65  "SlidingShowerFitWindow", m_slidingShowerFitWindow));
66 
67  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
68  "SlidingLinearFitWindow", m_slidingLinearFitWindow));
69 
70  return STATUS_CODE_SUCCESS;
71 }
unsigned int m_slidingShowerFitWindow
The sliding shower fit window.
unsigned int m_slidingLinearFitWindow
The sliding linear fit window.
void lar_content::TwoDShowerFitFeatureTool::Run ( LArMvaHelper::MvaFeatureVector featureVector,
const pandora::Algorithm *const  pAlgorithm,
const pandora::Cluster *const  pCluster 
)

Definition at line 38 of file TrackShowerIdFeatureTool.cc.

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

40 {
41  if (PandoraContentApi::GetSettings(*pAlgorithm)->ShouldDisplayAlgorithmInfo())
42  std::cout << "----> Running Algorithm Tool: " << this->GetInstanceName() << ", " << this->GetType() << std::endl;
43 
44  float ratio(-1.f);
45  try
46  {
47  const TwoDSlidingFitResult slidingFitResultLarge(pCluster, m_slidingLinearFitWindow, LArGeometryHelper::GetWireZPitch(this->GetPandora()));
48  const float straightLineLength = (slidingFitResultLarge.GetGlobalMaxLayerPosition() - slidingFitResultLarge.GetGlobalMinLayerPosition()).GetMagnitude();
49  if (straightLineLength > std::numeric_limits<float>::epsilon())
50  ratio = (CutClusterCharacterisationAlgorithm::GetShowerFitWidth(pAlgorithm, pCluster, m_slidingShowerFitWindow))/straightLineLength;
51  }
52  catch (const StatusCodeException &)
53  {
54  ratio = -1.f;
55  }
56  featureVector.push_back(ratio);
57 
58 }
unsigned int m_slidingShowerFitWindow
The sliding shower fit window.
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.
static float GetShowerFitWidth(const pandora::Algorithm *const pAlgorithm, const pandora::Cluster *const pCluster, const unsigned int showerFitWindow)
Get a measure of the width of a cluster, using a sliding shower fit result.
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

Member Data Documentation

unsigned int lar_content::TwoDShowerFitFeatureTool::m_slidingLinearFitWindow
private

The sliding linear fit window.

Definition at line 46 of file TrackShowerIdFeatureTool.h.

Referenced by ReadSettings(), and Run().

unsigned int lar_content::TwoDShowerFitFeatureTool::m_slidingShowerFitWindow
private

The sliding shower fit window.

Definition at line 45 of file TrackShowerIdFeatureTool.h.

Referenced by ReadSettings(), and Run().


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