diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MMClusterization/src/SimpleMMClusterBuilderTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MMClusterization/src/SimpleMMClusterBuilderTool.cxx index b583d97411bbed6360abfb0ad32fb3bae4d72af6..8a48cec9143b457e52e346738e5daba5c4139d6b 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MMClusterization/src/SimpleMMClusterBuilderTool.cxx +++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MMClusterization/src/SimpleMMClusterBuilderTool.cxx @@ -17,6 +17,7 @@ Muon::SimpleMMClusterBuilderTool::SimpleMMClusterBuilderTool(const std::string& m_mmIdHelper(nullptr) { declareInterface<IMMClusterBuilderTool>(this); + declareProperty("useErrorParametrization",m_useErrorParametrization=false); } @@ -165,6 +166,7 @@ StatusCode Muon::SimpleMMClusterBuilderTool::getClusters(std::vector<Muon::MMPre double weightedPosX = 0.0; double posY = 0.0; double totalCharge = 0.0; + double theta = 0.0; if ( mergeStrips.size() > 0 ) { /// get the Y local position from the first strip ( it's the same for all strips in the cluster) posY = MMprds[mergeIndices[0]].localPosition().y(); @@ -173,9 +175,11 @@ StatusCode Muon::SimpleMMClusterBuilderTool::getClusters(std::vector<Muon::MMPre double charge = MMprds[mergeIndices[k]].charge(); weightedPosX += posX*charge; totalCharge += charge; + theta += std::atan(MMprds[mergeIndices[k]].globalPosition().perp()/std::abs(MMprds[mergeIndices[k]].globalPosition().z()))*charge; ATH_MSG_VERBOSE("Adding a strip to the centroid calculation: charge=" << charge); } weightedPosX = weightedPosX/totalCharge; + theta /= totalCharge; } @@ -188,7 +192,12 @@ StatusCode Muon::SimpleMMClusterBuilderTool::getClusters(std::vector<Muon::MMPre /// Amg::MatrixX* covN = new Amg::MatrixX(1,1); covN->setIdentity(); - (*covN)(0,0) = 6.*(nmerge + 1.)*covX; + if(!m_useErrorParametrization){ + (*covN)(0,0) = 6.*(nmerge + 1.)*covX; + }else{ + double localUncertainty = 0.074+0.66*theta-0.15*theta*theta; + (*covN)(0,0) = localUncertainty * localUncertainty; + } if(nmerge<=1) (*covN)(0,0) = covX; ATH_MSG_VERBOSE(" make merged prepData at strip " << m_mmIdHelper->channel(MMprds[j].identify()) << " nmerge " << nmerge << " sqrt covX " << sqrt((*covN)(0,0))); diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MMClusterization/src/SimpleMMClusterBuilderTool.h b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MMClusterization/src/SimpleMMClusterBuilderTool.h index a5c2164b721665b676c65bd2b25aa92f005826ba..a32cacefcfd757bd498002de2a6d33b1b7c68baa 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MMClusterization/src/SimpleMMClusterBuilderTool.h +++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MMClusterization/src/SimpleMMClusterBuilderTool.h @@ -44,6 +44,8 @@ namespace Muon /// Muon Detector Descriptor const MuonGM::MuonDetectorManager* m_muonMgr; const MmIdHelper* m_mmIdHelper; + + bool m_useErrorParametrization; };