Public Member Functions | Private Member Functions | Private Attributes | List of all members
lar_content::TwoDShowerFitFeatureTool Class Reference

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

#include <TrackShowerIdFeatureTool.h>

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

Public Member Functions

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

Additional Inherited Members

- Public Types inherited from lar_content::MvaFeatureTool< Ts >
typedef std::vector< MvaFeatureTool< Ts... > * > FeatureToolVector
 

Detailed Description

TwoDShowerFitFeatureTool to calculate variables related to sliding shower fit.

Definition at line 24 of file TrackShowerIdFeatureTool.h.

Constructor & Destructor Documentation

lar_content::TwoDShowerFitFeatureTool::TwoDShowerFitFeatureTool ( )

Default constructor.

Definition at line 26 of file TrackShowerIdFeatureTool.cc.

27 {
28 }
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 55 of file TrackShowerIdFeatureTool.cc.

56 {
57  PANDORA_RETURN_RESULT_IF_AND_IF(
58  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "SlidingShowerFitWindow", m_slidingShowerFitWindow));
59 
60  PANDORA_RETURN_RESULT_IF_AND_IF(
61  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "SlidingLinearFitWindow", m_slidingLinearFitWindow));
62 
63  return STATUS_CODE_SUCCESS;
64 }
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 32 of file TrackShowerIdFeatureTool.cc.

33 {
34  if (PandoraContentApi::GetSettings(*pAlgorithm)->ShouldDisplayAlgorithmInfo())
35  std::cout << "----> Running Algorithm Tool: " << this->GetInstanceName() << ", " << this->GetType() << std::endl;
36 
37  float ratio(-1.f);
38  try
39  {
40  const TwoDSlidingFitResult slidingFitResultLarge(pCluster, m_slidingLinearFitWindow, LArGeometryHelper::GetWireZPitch(this->GetPandora()));
41  const float straightLineLength =
42  (slidingFitResultLarge.GetGlobalMaxLayerPosition() - slidingFitResultLarge.GetGlobalMinLayerPosition()).GetMagnitude();
43  if (straightLineLength > std::numeric_limits<float>::epsilon())
44  ratio = (CutClusterCharacterisationAlgorithm::GetShowerFitWidth(pAlgorithm, pCluster, m_slidingShowerFitWindow)) / straightLineLength;
45  }
46  catch (const StatusCodeException &)
47  {
48  ratio = -1.f;
49  }
50  featureVector.push_back(ratio);
51 }
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.
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.
QTextStream & endl(QTextStream &s)

Member Data Documentation

unsigned int lar_content::TwoDShowerFitFeatureTool::m_slidingLinearFitWindow
private

The sliding linear fit window.

Definition at line 48 of file TrackShowerIdFeatureTool.h.

unsigned int lar_content::TwoDShowerFitFeatureTool::m_slidingShowerFitWindow
private

The sliding shower fit window.

Definition at line 47 of file TrackShowerIdFeatureTool.h.


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