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

LArMuonId class. More...

#include <LArParticleIdPlugins.h>

Inheritance diagram for lar_content::LArParticleIdPlugins::LArMuonId:

Public Member Functions

 LArMuonId ()
 Default constructor. More...
 
bool IsMatch (const pandora::Cluster *const pCluster) const
 
bool IsMatch (const pandora::ParticleFlowObject *const pPfo) const
 

Private Member Functions

float GetMuonTrackWidth (const TwoDSlidingFitResult &twoDSlidingFitResult) const
 Get the muon track width estimator for a provided sliding fit result. More...
 
pandora::StatusCode ReadSettings (const pandora::TiXmlHandle xmlHandle)
 

Private Attributes

unsigned int m_layerFitHalfWindow
 Layer fit half window, used for calculating sliding muon track width. More...
 
float m_minLayerOccupancy
 Min layer occupancy for for muon identification. More...
 
float m_maxTrackWidth
 Max muon track width estimator for muon identification. More...
 
float m_trackResidualQuantile
 Track residual quantile, used for calculating muon track width. More...
 
unsigned int m_minClustersPassingId
 Match pfo if at sufficient clusters in pfo pass the cluster particle id logic. More...
 

Detailed Description

LArMuonId class.

Definition at line 29 of file LArParticleIdPlugins.h.

Constructor & Destructor Documentation

lar_content::LArParticleIdPlugins::LArMuonId::LArMuonId ( )

Default constructor.

Definition at line 29 of file LArParticleIdPlugins.cc.

29  :
32  m_maxTrackWidth(0.5f),
35 {
36 }
unsigned int m_layerFitHalfWindow
Layer fit half window, used for calculating sliding muon track width.
float m_trackResidualQuantile
Track residual quantile, used for calculating muon track width.
float m_minLayerOccupancy
Min layer occupancy for for muon identification.
float m_maxTrackWidth
Max muon track width estimator for muon identification.
unsigned int m_minClustersPassingId
Match pfo if at sufficient clusters in pfo pass the cluster particle id logic.

Member Function Documentation

float lar_content::LArParticleIdPlugins::LArMuonId::GetMuonTrackWidth ( const TwoDSlidingFitResult twoDSlidingFitResult) const
private

Get the muon track width estimator for a provided sliding fit result.

Parameters
twoDSlidingFitResultthe sliding fit result
Returns
the muon track width estimator

Definition at line 80 of file LArParticleIdPlugins.cc.

81 {
82  FloatVector residuals;
83  const OrderedCaloHitList &orderedCaloHitList(twoDSlidingFitResult.GetCluster()->GetOrderedCaloHitList());
84  const LayerFitResultMap &layerFitResultMap(twoDSlidingFitResult.GetLayerFitResultMap());
85 
86  for (OrderedCaloHitList::const_iterator iter = orderedCaloHitList.begin(); iter != orderedCaloHitList.end(); ++iter)
87  {
88  for (CaloHitList::const_iterator hitIter = iter->second->begin(), hitIterEnd = iter->second->end(); hitIter != hitIterEnd; ++hitIter)
89  {
90  float rL(0.f), rT(0.f);
91  twoDSlidingFitResult.GetLocalPosition((*hitIter)->GetPositionVector(), rL, rT);
92  const int layer(twoDSlidingFitResult.GetLayer(rL));
93 
94  LayerFitResultMap::const_iterator fitResultIter = layerFitResultMap.find(layer);
95 
96  if (layerFitResultMap.end() == fitResultIter)
97  continue;
98 
99  const double fitT(fitResultIter->second.GetFitT());
100  const double gradient(fitResultIter->second.GetGradient());
101  const double residualSquared((fitT - rT) * (fitT - rT) / (1. + gradient * gradient)); // angular correction (note: this is cheating!)
102  residuals.push_back(residualSquared);
103  }
104  }
105 
106  if (residuals.empty())
107  throw StatusCodeException(STATUS_CODE_NOT_INITIALIZED);
108 
109  std::sort(residuals.begin(), residuals.end());
110  const float theQuantile(residuals[m_trackResidualQuantile * residuals.size()]);
111 
112  return std::sqrt(theQuantile);
113 }
float m_trackResidualQuantile
Track residual quantile, used for calculating muon track width.
intermediate_table::const_iterator const_iterator
std::map< int, LayerFitResult > LayerFitResultMap
Dft::FloatVector FloatVector
bool lar_content::LArParticleIdPlugins::LArMuonId::IsMatch ( const pandora::Cluster *const  pCluster) const
bool lar_content::LArParticleIdPlugins::LArMuonId::IsMatch ( const pandora::ParticleFlowObject *const  pPfo) const

Definition at line 56 of file LArParticleIdPlugins.cc.

57 {
58  ClusterList clusterList;
59  LArPfoHelper::GetTwoDClusterList(pPfo, clusterList);
60 
61  if (clusterList.empty())
62  return false;
63 
64  unsigned int nClustersPassing(0);
65 
66  for (const Cluster *const pCluster : clusterList)
67  {
68  if (this->IsMatch(pCluster))
69  ++nClustersPassing;
70  }
71 
72  if (nClustersPassing < m_minClustersPassingId)
73  return false;
74 
75  return true;
76 }
static void GetTwoDClusterList(const pandora::ParticleFlowObject *const pPfo, pandora::ClusterList &clusterList)
Get the list of 2D clusters from an input pfo.
bool IsMatch(const pandora::Cluster *const pCluster) const
unsigned int m_minClustersPassingId
Match pfo if at sufficient clusters in pfo pass the cluster particle id logic.
StatusCode lar_content::LArParticleIdPlugins::LArMuonId::ReadSettings ( const pandora::TiXmlHandle  xmlHandle)
private

Definition at line 117 of file LArParticleIdPlugins.cc.

118 {
119  PANDORA_RETURN_RESULT_IF_AND_IF(
120  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "LayerFitHalfWindow", m_layerFitHalfWindow));
121 
122  PANDORA_RETURN_RESULT_IF_AND_IF(
123  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "MinLayerOccupancy", m_minLayerOccupancy));
124 
125  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "MaxTrackWidth", m_maxTrackWidth));
126 
127  PANDORA_RETURN_RESULT_IF_AND_IF(
128  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "TrackResidualQuantile", m_trackResidualQuantile));
129 
130  PANDORA_RETURN_RESULT_IF_AND_IF(
131  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "MinClustersPassingId", m_minClustersPassingId));
132 
133  return STATUS_CODE_SUCCESS;
134 }
unsigned int m_layerFitHalfWindow
Layer fit half window, used for calculating sliding muon track width.
float m_trackResidualQuantile
Track residual quantile, used for calculating muon track width.
float m_minLayerOccupancy
Min layer occupancy for for muon identification.
float m_maxTrackWidth
Max muon track width estimator for muon identification.
unsigned int m_minClustersPassingId
Match pfo if at sufficient clusters in pfo pass the cluster particle id logic.

Member Data Documentation

unsigned int lar_content::LArParticleIdPlugins::LArMuonId::m_layerFitHalfWindow
private

Layer fit half window, used for calculating sliding muon track width.

Definition at line 52 of file LArParticleIdPlugins.h.

float lar_content::LArParticleIdPlugins::LArMuonId::m_maxTrackWidth
private

Max muon track width estimator for muon identification.

Definition at line 54 of file LArParticleIdPlugins.h.

unsigned int lar_content::LArParticleIdPlugins::LArMuonId::m_minClustersPassingId
private

Match pfo if at sufficient clusters in pfo pass the cluster particle id logic.

Definition at line 56 of file LArParticleIdPlugins.h.

float lar_content::LArParticleIdPlugins::LArMuonId::m_minLayerOccupancy
private

Min layer occupancy for for muon identification.

Definition at line 53 of file LArParticleIdPlugins.h.

float lar_content::LArParticleIdPlugins::LArMuonId::m_trackResidualQuantile
private

Track residual quantile, used for calculating muon track width.

Definition at line 55 of file LArParticleIdPlugins.h.


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