diff --git a/Tr/TrackMonitors/src/VPHitEfficiencyMonitor.cpp b/Tr/TrackMonitors/src/VPHitEfficiencyMonitor.cpp index b6110662855d1fe99d9646ea41648ec86ec56355..c21a508a5f47dadf17380d0f8098284c923db0f8 100644 --- a/Tr/TrackMonitors/src/VPHitEfficiencyMonitor.cpp +++ b/Tr/TrackMonitors/src/VPHitEfficiencyMonitor.cpp @@ -45,9 +45,10 @@ private: Gaudi::Property<float> m_tolerance{ this, "ResidualTolerance", 0.1 * Gaudi::Units::mm }; // tolerance in mm, was 0.2 Gaudi::Property<float> m_maxTrackError{ this, "MaxTrackCov", 0.2 * Gaudi::Units::mm }; - Gaudi::Property<bool> m_fillHot{ this, "FillHotEfficiencies", true }; - Gaudi::Property<bool> m_checkSensor{ this, "CheckSensorPosition", true }; - Gaudi::Property<bool> m_splitACSide{ this, "UseAandCSide", true }; + Gaudi::Property<bool> m_fillHot{ this, "FillHotEfficiencies", true }; + Gaudi::Property<bool> m_checkSensor{ this, "CheckSensorPosition", true }; + Gaudi::Property<bool> m_splitACSide{ this, "UseAandCSide", true }; + Gaudi::Property<float> m_nSigmaSateAccuracy{ this, "NSigmaUncertainty", 2.5 }; ToolHandle<ITrackInterpolator> m_interpolator{ this, "Interpolator", "TrackInterpolator" }; ToolHandle<ITrackExtrapolator> m_linearextrapolator{ this, "Extrapolator", "TrackRungeKuttaExtrapolator" }; @@ -156,8 +157,13 @@ public: continue; } - const ROOT::Math::XYZPoint localIntersection = - my_sensor.globalToLocal( Gaudi::XYZPoint( state.x(), state.y(), state.z() ) ); + // To also account for the state's error N times the error is added in the oposite direction + const auto signX = state.x() < sizeX / 2. ? -1 : 1; + const auto signY = state.y() < sizeY / 2. ? -1 : 1; + const ROOT::Math::XYZPoint localIntersection = my_sensor.globalToLocal( Gaudi::XYZPoint( + state.x() + signX * m_nSigmaSateAccuracy.value() * std::sqrt( state.covariance()( 0, 0 ) ), + state.y() + signY * m_nSigmaSateAccuracy.value() * std::sqrt( state.covariance()( 1, 1 ) ), state.z() ) ); + if ( !my_sensor.isInActiveArea( localIntersection ) ) { ++m_activeAreaError; continue;