30 m_layerFitHalfWindow(20),
31 m_minLayerOccupancy(0.75f),
32 m_maxTrackWidth(0.5f),
33 m_trackResidualQuantile(0.8f),
34 m_minClustersPassingId(2)
46 const TwoDSlidingFitResult twoDSlidingFitResult(pCluster, m_layerFitHalfWindow, slidingFitPitch);
48 if (this->GetMuonTrackWidth(twoDSlidingFitResult) > m_maxTrackWidth)
61 if (clusterList.empty())
64 unsigned int nClustersPassing(0);
66 for (
const Cluster *
const pCluster : clusterList)
68 if (this->IsMatch(pCluster))
72 if (nClustersPassing < m_minClustersPassingId)
88 for (CaloHitList::const_iterator hitIter = iter->second->begin(), hitIterEnd = iter->second->end(); hitIter != hitIterEnd; ++hitIter)
90 float rL(0.f), rT(0.f);
91 twoDSlidingFitResult.
GetLocalPosition((*hitIter)->GetPositionVector(), rL, rT);
92 const int layer(twoDSlidingFitResult.
GetLayer(rL));
94 LayerFitResultMap::const_iterator fitResultIter = layerFitResultMap.find(layer);
96 if (layerFitResultMap.end() == fitResultIter)
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));
102 residuals.push_back(residualSquared);
106 if (residuals.empty())
109 std::sort(residuals.begin(), residuals.end());
110 const float theQuantile(residuals[m_trackResidualQuantile * residuals.size()]);
112 return std::sqrt(theQuantile);
120 STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
XmlHelper::ReadValue(xmlHandle,
"LayerFitHalfWindow", m_layerFitHalfWindow));
123 STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
XmlHelper::ReadValue(xmlHandle,
"MinLayerOccupancy", m_minLayerOccupancy));
128 STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
XmlHelper::ReadValue(xmlHandle,
"TrackResidualQuantile", m_trackResidualQuantile));
131 STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
XmlHelper::ReadValue(xmlHandle,
"MinClustersPassingId", m_minClustersPassingId));
133 return STATUS_CODE_SUCCESS;
Header file for the cluster class.
Header file for the cluster helper class.
Header file for the geometry helper class.
Header file for the lar particle id plugins class.
Header file for the pfo helper class.
Header file for the lar two dimensional sliding fit result class.
#define PANDORA_RETURN_RESULT_IF_AND_IF(StatusCode1, StatusCode2, Operator, Command)
Header file for the xml helper class.
static float GetLayerOccupancy(const pandora::Cluster *const pCluster)
Fraction of occupied layers in cluster.
static float GetWireZPitch(const pandora::Pandora &pandora, const float maxWirePitchDiscrepancy=0.01)
Return the wire pitch.
bool IsMatch(const pandora::Cluster *const pCluster) const
Whether the cluster matches the specific particle hypothesis.
LArMuonId()
Default constructor.
float GetMuonTrackWidth(const TwoDSlidingFitResult &twoDSlidingFitResult) const
Get the muon track width estimator for a provided sliding fit result.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
Read the algorithm settings.
static void GetTwoDClusterList(const pandora::ParticleFlowObject *const pPfo, pandora::ClusterList &clusterList)
Get the list of 2D clusters from an input pfo.
TwoDSlidingFitResult class.
void GetLocalPosition(const pandora::CartesianVector &position, float &rL, float &rT) const
Get local sliding fit coordinates for a given global position.
const LayerFitResultMap & GetLayerFitResultMap() const
Get the layer fit result map.
const pandora::Cluster * GetCluster() const
Get the address of the cluster, if originally provided.
int GetLayer(const float rL) const
Get layer number for given sliding linear fit longitudinal coordinate.
const OrderedCaloHitList & GetOrderedCaloHitList() const
Get the ordered calo hit list.
Calo hit lists arranged by pseudo layer.
const_iterator end() const
Returns a const iterator referring to the past-the-end element in the ordered calo hit list.
const_iterator begin() const
Returns a const iterator referring to the first element in the ordered calo hit list.
TheList::const_iterator const_iterator
ParticleFlowObject class.
StatusCodeException class.
static StatusCode ReadValue(const TiXmlHandle &xmlHandle, const std::string &xmlElementName, T &t)
Read a value from an xml element.
std::map< int, LayerFitResult > LayerFitResultMap
MANAGED_CONTAINER< const Cluster * > ClusterList
std::vector< float > FloatVector
StatusCode
The StatusCode enum.