Skip to content
Snippets Groups Projects
Commit 791cd9d4 authored by Patrick Scholer's avatar Patrick Scholer
Browse files

adding parametrization of error of MM simple clustering; adding job option to switch it on or off

parent e60aeb8c
1 merge request!31452Adding error parametrization for MM simple clustering
......@@ -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)));
......
......@@ -44,6 +44,8 @@ namespace Muon
/// Muon Detector Descriptor
const MuonGM::MuonDetectorManager* m_muonMgr;
const MmIdHelper* m_mmIdHelper;
bool m_useErrorParametrization;
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment