LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
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.

References lar_content::LArClusterHelper::GetLayerOccupancy(), GetMuonTrackWidth(), lar_content::LArGeometryHelper::GetWireZPitch(), IsMatch(), m_layerFitHalfWindow, m_maxTrackWidth, and m_minLayerOccupancy.

29  :
31  m_minLayerOccupancy (0.75f),
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.
TFile f
Definition: plotHisto.C:6
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.

References f, lar_content::TwoDSlidingFitResult::GetCluster(), lar_content::TwoDSlidingFitResult::GetLayer(), lar_content::TwoDSlidingFitResult::GetLayerFitResultMap(), lar_content::TwoDSlidingFitResult::GetLocalPosition(), and m_trackResidualQuantile.

Referenced by LArMuonId().

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.
TFile f
Definition: plotHisto.C:6
intermediate_table::const_iterator const_iterator
std::map< int, LayerFitResult > LayerFitResultMap
bool lar_content::LArParticleIdPlugins::LArMuonId::IsMatch ( const pandora::Cluster *const  pCluster) const

Referenced by IsMatch(), and LArMuonId().

bool lar_content::LArParticleIdPlugins::LArMuonId::IsMatch ( const pandora::ParticleFlowObject *const  pPfo) const

Definition at line 56 of file LArParticleIdPlugins.cc.

References lar_content::LArPfoHelper::GetTwoDClusterList(), IsMatch(), and m_minClustersPassingId.

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.
Definition: LArPfoHelper.cc:97
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.

References m_layerFitHalfWindow, m_maxTrackWidth, m_minClustersPassingId, m_minLayerOccupancy, and m_trackResidualQuantile.

118 {
119  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
120  "LayerFitHalfWindow", m_layerFitHalfWindow));
121 
122  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
123  "MinLayerOccupancy", m_minLayerOccupancy));
124 
125  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
126  "MaxTrackWidth", m_maxTrackWidth));
127 
128  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
129  "TrackResidualQuantile", m_trackResidualQuantile));
130 
131  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
132  "MinClustersPassingId", m_minClustersPassingId));
133 
134  return STATUS_CODE_SUCCESS;
135 }
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.

Referenced by LArMuonId(), and ReadSettings().

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

Max muon track width estimator for muon identification.

Definition at line 54 of file LArParticleIdPlugins.h.

Referenced by LArMuonId(), and ReadSettings().

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.

Referenced by IsMatch(), and ReadSettings().

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

Min layer occupancy for for muon identification.

Definition at line 53 of file LArParticleIdPlugins.h.

Referenced by LArMuonId(), and ReadSettings().

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.

Referenced by GetMuonTrackWidth(), and ReadSettings().


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