diff --git a/InnerDetector/InDetRecTools/SiClusterOnTrackTool/CMakeLists.txt b/InnerDetector/InDetRecTools/SiClusterOnTrackTool/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..62bc468ad4a93377ae82bc0d46f327f07d938eb5
--- /dev/null
+++ b/InnerDetector/InDetRecTools/SiClusterOnTrackTool/CMakeLists.txt
@@ -0,0 +1,43 @@
+################################################################################
+# Package: SiClusterOnTrackTool
+################################################################################
+
+# Declare the package name:
+atlas_subdir( SiClusterOnTrackTool )
+
+# Declare the package's dependencies:
+atlas_depends_on_subdirs( PUBLIC
+                          Control/AthenaBaseComps
+                          Database/AthenaPOOL/AthenaPoolUtilities
+                          DetectorDescription/GeoPrimitives
+                          GaudiKernel
+                          InnerDetector/InDetDetDescr/SCT_ModuleDistortions
+                          InnerDetector/InDetRecEvent/InDetPrepRawData
+                          InnerDetector/InDetRecEvent/InDetRIO_OnTrack
+                          Tracking/TrkEvent/TrkParameters
+                          Tracking/TrkTools/TrkToolInterfaces
+                          Tracking/TrkTools/TrkAmbiguityProcessor
+                          PRIVATE
+                          Control/StoreGate
+                          Event/EventPrimitives
+                          InnerDetector/InDetConditions/PixelConditionsServices
+                          InnerDetector/InDetConditions/PixelConditionsTools
+                          InnerDetector/InDetDetDescr/InDetIdentifier
+                          InnerDetector/InDetDetDescr/InDetReadoutGeometry
+                          InnerDetector/InDetDetDescr/PixelGeoModel
+                          InnerDetector/InDetRecTools/SiClusterizationTool
+                          Tracking/TrkDetDescr/TrkSurfaces )
+
+# External dependencies:
+find_package( Eigen )
+
+# Component(s) in the package:
+atlas_add_component( SiClusterOnTrackTool
+                     src/*.cxx
+                     src/components/*.cxx
+                     INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS}
+                     LINK_LIBRARIES ${EIGEN_LIBRARIES} AthenaBaseComps AthenaPoolUtilities GeoPrimitives GaudiKernel InDetPrepRawData InDetRIO_OnTrack TrkParameters TrkToolInterfaces TrkAmbiguityProcessorLib StoreGateLib SGtests EventPrimitives InDetIdentifier InDetReadoutGeometry SiClusterizationToolLib TrkSurfaces )
+
+# Install files from the package:
+atlas_install_headers( SiClusterOnTrackTool )
+
diff --git a/InnerDetector/InDetRecTools/SiClusterOnTrackTool/SiClusterOnTrackTool/PixelClusterOnTrackTool.h b/InnerDetector/InDetRecTools/SiClusterOnTrackTool/SiClusterOnTrackTool/PixelClusterOnTrackTool.h
index 73818981dfd29c2f8959152af9a03f0b6b0fdc3a..65dd1a657a2b062b5ef58860c5c84ad636feb5a7 100755
--- a/InnerDetector/InDetRecTools/SiClusterOnTrackTool/SiClusterOnTrackTool/PixelClusterOnTrackTool.h
+++ b/InnerDetector/InDetRecTools/SiClusterOnTrackTool/SiClusterOnTrackTool/PixelClusterOnTrackTool.h
@@ -25,11 +25,13 @@
 #include "InDetPrepRawData/PixelGangedClusterAmbiguities.h"
 #include "TrkParameters/TrackParameters.h"
 //#include "InDetIdentifier/PixelID.h"
-#include "GeoPrimitives/GeoPrimitives.h"
+#include "GeoPrimitives/GeoPrimitives.h"
+#include "TrkAmbiguityProcessor/dRMap.h"
 
 //#include "PixelConditionsServices/IPixelOfflineCalibSvc.h"
 //#include "PixelConditionsTools/IModuleDistortionsTool.h"
 
+#include "AthenaPoolUtilities/CondAttrListCollection.h"
 class PixelID;
 class IPixelOfflineCalibSvc;
 class IModuleDistortionsTool;
@@ -86,6 +88,8 @@ public:
  
   void correctBow(const Identifier&, Amg::Vector2D& locpos, const double tanphi, const double taneta) const;
 
+  double splineIBLPullX(float x, int layer) const;
+
   /** @brief produces a PixelClusterOnTrack (object factory!).
 
       Depending on job options it changes the pixel cluster position
@@ -109,8 +113,8 @@ public:
   virtual const InDet::PixelClusterOnTrack* correct
     (const Trk::PrepRawData&, const Trk::TrackParameters&, 
      const InDet::PixelClusterStrategy) const;
-     
 
+     
   ///////////////////////////////////////////////////////////////////
   // Private methods:
   ///////////////////////////////////////////////////////////////////
@@ -132,7 +136,7 @@ public:
   ToolHandle<IModuleDistortionsTool>            m_pixDistoTool    ;
   ToolHandle<Trk::IRIO_OnTrackErrorScalingTool> m_errorScalingTool;
   ServiceHandle<IPixelOfflineCalibSvc>          m_calibSvc        ;
-
+  StoreGateSvc*                                 m_detStore        ;
   /* ME: Test histos have nothing to do with production code, use a flag
     IHistogram1D* m_h_Resx;
     IHistogram1D* m_h_Resy;
@@ -169,7 +173,8 @@ public:
   const PixelID*                     m_pixelid;
   
   /** Enable NN based calibration (do only if NN calibration is applied) **/
-  mutable bool                      m_applyNNcorrection;
+  mutable bool                      m_applyNNcorrection;
+  mutable bool                      m_applydRcorrection;
   bool				    m_NNIBLcorrection;
   bool				    m_IBLAbsent;
   
@@ -179,13 +184,16 @@ public:
   ServiceHandle<IIncidentSvc>                           m_incidentSvc;          //!< IncidentSvc to catch begin of event and end of envent
   ServiceHandle<IBLParameterSvc>                        m_IBLParameterSvc;
   mutable const InDet::PixelGangedClusterAmbiguities*   m_splitClusterMap;      //!< the actual split map         
-  std::string                                           m_splitClusterMapName;  //!< split cluster ambiguity map
+  std::string                                           m_splitClusterMapName;  //!< split cluster ambiguity map
+  mutable const InDet::DRMap*                           m_dRMap;      //!< the actual dR map         
+  std::string                                           m_dRMapName;  //!< dR map
   bool                                                  m_doNotRecalibrateNN;
   bool                                                  m_noNNandBroadErrors;
 	
 	/** Enable different treatment of  cluster errors based on NN information (do only if TIDE ambi is run) **/
   bool                      m_usingTIDE_Ambi;
-
+  
+  std::vector< std::vector<float> > m_fX, m_fY, m_fB, m_fC, m_fD;
 };
 
 } // end of namespace InDet
diff --git a/InnerDetector/InDetRecTools/SiClusterOnTrackTool/cmt/requirements b/InnerDetector/InDetRecTools/SiClusterOnTrackTool/cmt/requirements
index f4549ac6e0e0ed85b65a7c38cc2ce2e1958ceffb..8540a42d98c835c49ce3034646c3c64e20fdd483 100755
--- a/InnerDetector/InDetRecTools/SiClusterOnTrackTool/cmt/requirements
+++ b/InnerDetector/InDetRecTools/SiClusterOnTrackTool/cmt/requirements
@@ -1,31 +1,30 @@
 package SiClusterOnTrackTool
 
-manager Igor Gavrilenko <Igor.Gavrilenko@cern.ch>
-
-private
-
-use StoreGate               StoreGate-*               Control
-use TrkSurfaces             TrkSurfaces-*             Tracking/TrkDetDescr
-use InDetIdentifier         InDetIdentifier-*         InnerDetector/InDetDetDescr
-use InDetReadoutGeometry    InDetReadoutGeometry-*    InnerDetector/InDetDetDescr
-use PixelConditionsTools    PixelConditionsTools-*    InnerDetector/InDetConditions
-use PixelConditionsServices PixelConditionsServices-* InnerDetector/InDetConditions
-use SiClusterizationTool    SiClusterizationTool-*    InnerDetector/InDetRecTools
-use EventPrimitives         EventPrimitives-*         Event
-use PixelGeoModel                       PixelGeoModel-*                 InnerDetector/InDetDetDescr
-
 public
-
-use AtlasPolicy             AtlasPolicy-*
-use GaudiInterface          GaudiInterface-*          External 
-use AthenaBaseComps         AthenaBaseComps-*         Control
-use TrkParameters           TrkParameters-*           Tracking/TrkEvent
-use TrkToolInterfaces       TrkToolInterfaces-*       Tracking/TrkTools
-use InDetRIO_OnTrack        InDetRIO_OnTrack-*        InnerDetector/InDetRecEvent
-use SCT_ModuleDistortions   SCT_ModuleDistortions-*   InnerDetector/InDetDetDescr
-use InDetPrepRawData        InDetPrepRawData-*        InnerDetector/InDetRecEvent
-use GeoPrimitives           GeoPrimitives-*           DetectorDescription
-
+use  AtlasPolicy                AtlasPolicy-*
+use  AthenaBaseComps            AthenaBaseComps-*               Control
+use  AthenaPoolUtilities        AthenaPoolUtilities-*           Database/AthenaPOOL
+use  GaudiInterface             GaudiInterface-*                External
+use  GeoPrimitives              GeoPrimitives-*                 DetectorDescription
+use  InDetPrepRawData           InDetPrepRawData-*              InnerDetector/InDetRecEvent
+use  InDetRIO_OnTrack           InDetRIO_OnTrack-*              InnerDetector/InDetRecEvent
+use  SCT_ModuleDistortions      SCT_ModuleDistortions-*         InnerDetector/InDetDetDescr
+use  TrkAmbiguityProcessor      TrkAmbiguityProcessor-*         Tracking/TrkTools
+use  TrkParameters              TrkParameters-*                 Tracking/TrkEvent
+use  TrkToolInterfaces          TrkToolInterfaces-*             Tracking/TrkTools
+private
+use  AtlasCORAL                 AtlasCORAL-*                    External
+use  EventPrimitives            EventPrimitives-*               Event
+use  InDetIdentifier            InDetIdentifier-*               InnerDetector/InDetDetDescr
+use  InDetReadoutGeometry       InDetReadoutGeometry-*          InnerDetector/InDetDetDescr
+use  PixelConditionsServices    PixelConditionsServices-*       InnerDetector/InDetConditions
+use  PixelConditionsTools       PixelConditionsTools-*          InnerDetector/InDetConditions
+use  PixelGeoModel              PixelGeoModel-*                 InnerDetector/InDetDetDescr
+use  SiClusterizationTool       SiClusterizationTool-*          InnerDetector/InDetRecTools
+use  StoreGate                  StoreGate-*                     Control
+use  TrkSurfaces                TrkSurfaces-*                   Tracking/TrkDetDescr
+end_private
+ 
 library SiClusterOnTrackTool *.cxx components/*.cxx
 apply_pattern component_library 	
 
diff --git a/InnerDetector/InDetRecTools/SiClusterOnTrackTool/src/PixelClusterOnTrackTool.cxx b/InnerDetector/InDetRecTools/SiClusterOnTrackTool/src/PixelClusterOnTrackTool.cxx
index 1938f0ff5acb89b7dff3e78c8b65b3b20bac4fef..667a8b394fb3ae95fd490b4702381f277b5e3c53 100755
--- a/InnerDetector/InDetRecTools/SiClusterOnTrackTool/src/PixelClusterOnTrackTool.cxx
+++ b/InnerDetector/InDetRecTools/SiClusterOnTrackTool/src/PixelClusterOnTrackTool.cxx
@@ -26,11 +26,13 @@
 #include "PixelGeoModel/IBLParameterSvc.h"
 #include "InDetReadoutGeometry/SiDetectorElement.h"
 
+#include "CoralBase/AttributeListSpecification.h"
+#include "CoralBase/Attribute.h"
+#include "AthenaPoolUtilities/CondAttrListCollection.h"
+#include "AthenaPoolUtilities/AthenaAttributeList.h"
 using CLHEP::mm;
 using CLHEP::micrometer;
 
-
-
 ///////////////////////////////////////////////////////////////////
 // Constructor
 ///////////////////////////////////////////////////////////////////
@@ -66,9 +68,11 @@ InDet::PixelClusterOnTrackTool::PixelClusterOnTrackTool
   m_pixDistoTool("PixelDistortionsTool"),
   m_errorScalingTool("Trk::RIO_OnTrackErrorScalingTool/RIO_OnTrackErrorScalingTool"),
   m_calibSvc("PixelOfflineCalibSvc",n),
+  m_detStore(0),
   m_disableDistortions(false),
   m_rel13like(false),
   m_applyNNcorrection(false),
+  m_applydRcorrection(false),
   m_NNIBLcorrection(false),
   m_IBLAbsent(true),
   m_NnClusterizationFactory("InDet::NnClusterizationFactory/NnClusterizationFactory"),
@@ -77,6 +81,8 @@ InDet::PixelClusterOnTrackTool::PixelClusterOnTrackTool
   m_IBLParameterSvc("IBLParameterSvc",n), 
   m_splitClusterMap(0),
   m_splitClusterMapName("SplitClusterAmbiguityMap"),
+  m_dRMap(0),
+  m_dRMapName("dRMap"),
   m_doNotRecalibrateNN(false),
   m_noNNandBroadErrors(false),
   m_usingTIDE_Ambi(false)
@@ -91,14 +97,16 @@ InDet::PixelClusterOnTrackTool::PixelClusterOnTrackTool
   declareProperty("Release13like",            m_rel13like, "Activate release-13 like settigs");
   declareProperty("PixelOfflineCalibSvc",     m_calibSvc, "Offline calibration svc");
   declareProperty("applyNNcorrection",        m_applyNNcorrection);
+  declareProperty("applydRcorrection",        m_applydRcorrection);
   declareProperty("NNIBLcorrection",        m_NNIBLcorrection);
   declareProperty("EventStore",              m_storeGate );
   declareProperty("IncidentService",         m_incidentSvc );
   declareProperty("NnClusterizationFactory", m_NnClusterizationFactory);
   declareProperty("SplitClusterAmbiguityMap", m_splitClusterMapName);
+  declareProperty("dRMapName",                m_dRMapName);
   declareProperty("doNotRecalibrateNN",       m_doNotRecalibrateNN);
   declareProperty("m_noNNandBroadErrors",     m_noNNandBroadErrors);
-  declareProperty("RunningTIDE_Ambi",     m_usingTIDE_Ambi);
+  declareProperty("RunningTIDE_Ambi",         m_usingTIDE_Ambi);
 
 }
 
@@ -172,17 +180,20 @@ StatusCode InDet::PixelClusterOnTrackTool::initialize()
     ATH_MSG_FATAL ("Could not get Pixel ID helper");
     return StatusCode::FAILURE;
   }
-
+  
+  sc = service("DetectorStore", m_detStore);
+  if ( !sc.isSuccess() || 0 == m_detStore) return msg(MSG:: ERROR) << "Could not find DetStore" << endreq, StatusCode::FAILURE;
   if (m_storeGate.retrieve().isFailure()){
     ATH_MSG_WARNING("Can not retrieve " << m_storeGate << ". Exiting.");
     return StatusCode::FAILURE;
   }
-
+  
   if (m_incidentSvc.retrieve().isFailure()){
     ATH_MSG_WARNING("Can not retrieve " << m_incidentSvc << ". Exiting.");
     return StatusCode::FAILURE;
   }
 
+  m_incidentSvc->addListener( this, IncidentType::BeginEvent);
   // register to the incident service: EndEvent needed for memory cleanup
   m_incidentSvc->addListener( this, "EndEvent");
 
@@ -201,6 +212,70 @@ StatusCode InDet::PixelClusterOnTrackTool::initialize()
 
  
 void InDet::PixelClusterOnTrackTool::handle(const Incident& inc){
+
+  if ( inc.type() == IncidentType::BeginEvent ){
+      if(m_fX.size()==0){
+          const CondAttrListCollection* atrlistcol=0;
+          if (StatusCode::SUCCESS==m_detStore->retrieve(atrlistcol,"/PIXEL/PixelClustering/PixelCovCorr")) {
+              // loop over objects in collection
+              for (CondAttrListCollection::const_iterator citr=atrlistcol->begin(); citr!=atrlistcol->end();++citr) {
+                  std::vector<float> fx, fy, fb, fc, fd;
+                  const coral::AttributeList& atrlist=citr->second;
+                  
+                  fx.push_back(atrlist["fX1"].data<float>());
+                  fx.push_back(atrlist["fX2"].data<float>());
+                  fx.push_back(atrlist["fX3"].data<float>());
+                  fx.push_back(atrlist["fX4"].data<float>());
+                  fx.push_back(atrlist["fX5"].data<float>());
+                  fx.push_back(atrlist["fX6"].data<float>());
+                  fx.push_back(atrlist["fX7"].data<float>());
+                  m_fX.push_back(fx);
+                  
+                  fy.push_back(atrlist["fY1"].data<float>());
+                  fy.push_back(atrlist["fY2"].data<float>());
+                  fy.push_back(atrlist["fY3"].data<float>());
+                  fy.push_back(atrlist["fY4"].data<float>());
+                  fy.push_back(atrlist["fY5"].data<float>());
+                  fy.push_back(atrlist["fY6"].data<float>());
+                  fy.push_back(atrlist["fY7"].data<float>());
+                  m_fY.push_back(fy);
+                  
+                  fb.push_back(atrlist["fB1"].data<float>());
+                  fb.push_back(atrlist["fB2"].data<float>());
+                  fb.push_back(atrlist["fB3"].data<float>());
+                  fb.push_back(atrlist["fB4"].data<float>());
+                  fb.push_back(atrlist["fB5"].data<float>());
+                  fb.push_back(atrlist["fB6"].data<float>());
+                  fb.push_back(atrlist["fB7"].data<float>());
+                  m_fB.push_back(fb);
+                  
+                  fc.push_back(atrlist["fC1"].data<float>());
+                  fc.push_back(atrlist["fC2"].data<float>());
+                  fc.push_back(atrlist["fC3"].data<float>());
+                  fc.push_back(atrlist["fC4"].data<float>());
+                  fc.push_back(atrlist["fC5"].data<float>());
+                  fc.push_back(atrlist["fC6"].data<float>());
+                  fc.push_back(atrlist["fC7"].data<float>());
+                  m_fC.push_back(fc);
+                  
+                  fd.push_back(atrlist["fD1"].data<float>());
+                  fd.push_back(atrlist["fD2"].data<float>());
+                  fd.push_back(atrlist["fD3"].data<float>());
+                  fd.push_back(atrlist["fD4"].data<float>());
+                  fd.push_back(atrlist["fD5"].data<float>());
+                  fd.push_back(atrlist["fD6"].data<float>());
+                  fd.push_back(atrlist["fD7"].data<float>());
+                  m_fD.push_back(fd);
+              }
+          }
+          else {
+                  msg(MSG::ERROR) << "Cannot find covariance corrections for key "
+                  << "/PIXEL/PixelClustering/PixelCovCorr" << " - no correction " << endreq;
+              return;                                   
+          }
+      }
+  }
+  
   if ( inc.type() == "EndEvent" ){
     ATH_MSG_VERBOSE("'EndEvent' incident caught. Refreshing Cache.");
     m_splitClusterMap = 0;
@@ -226,6 +301,7 @@ const InDet::PixelClusterOnTrack* InDet::PixelClusterOnTrackTool::correct
 {
   // check if cluster splitting actually could be done you could : switching off will only happen once
   bool clusterMapExists = m_applyNNcorrection ? m_storeGate->contains<InDet::PixelGangedClusterAmbiguities>(m_splitClusterMapName) : false;
+
   if (!clusterMapExists && m_applyNNcorrection){
       ATH_MSG_INFO("No PixelCluster splitting information available, switchng NN recalibration off (was: on).");
       ATH_MSG_INFO(" -> This is expected if you read ESD data prior to release 17.0.2.8");
@@ -646,12 +722,14 @@ const InDet::PixelClusterOnTrack* InDet::PixelClusterOnTrackTool::correctNN
     if( m_scalePixelCov ){
       Amg::MatrixX* newCov = m_errorScalingTool->createScaledPixelCovariance(cov,element->identify());
       if( !newCov ) {
-    ATH_MSG_WARNING("Failed to create scaled error for Pixel");
-    return 0;
+	ATH_MSG_WARNING("Failed to create scaled error for Pixel");
+	return 0;
       }
       cov = *newCov;
+
       delete newCov;
     }
+
     return new InDet::PixelClusterOnTrack(pixelPrepCluster,locpar,cov,iH,glob,pixelPrepCluster->gangedPixel(),false);
   }
 
@@ -662,7 +740,14 @@ const InDet::PixelClusterOnTrack* InDet::PixelClusterOnTrackTool::correctNN
       return 0;
     } 
   }
-
+  
+  if (!m_dRMap &&  m_storeGate->contains<InDet::DRMap >(m_dRMapName) && m_applydRcorrection) {
+    StatusCode sc = m_storeGate->retrieve(m_dRMap, m_dRMapName);
+    if (sc.isFailure()) {
+      ATH_MSG_DEBUG("Could not retrieve dR map.");
+    }
+  }
+ 
   Amg::Vector2D finalposition;
   Amg::MatrixX finalerrormatrix;
   
@@ -688,8 +773,6 @@ const InDet::PixelClusterOnTrack* InDet::PixelClusterOnTrackTool::correctNN
         " y: " << finalposition[1] << " +/- " << 
         sqrt(finalerrormatrix(1,1)) << endreq;
   }
-  
-
 
   Amg::Vector3D my_track = trackPar.momentum();
   Amg::Vector3D my_normal = element->normal();
@@ -713,7 +796,7 @@ const InDet::PixelClusterOnTrack* InDet::PixelClusterOnTrackTool::correctNN
       ATH_MSG_WARNING("Failed to create scaled error for Pixel");
       return 0;
     }
-    cov = *newCov;
+    //    cov = *newCov;
     delete newCov;
   }
 
@@ -732,14 +815,11 @@ const InDet::PixelClusterOnTrack* InDet::PixelClusterOnTrackTool::correctNN
 
 }
 
-
-
 bool InDet::PixelClusterOnTrackTool::getErrorsDefaultAmbi( const InDet::PixelCluster* pixelPrepCluster, const Trk::TrackParameters& trackPar, 
                            Amg::Vector2D& finalposition,  Amg::MatrixX&  finalerrormatrix ) const
 {
 
   std::vector<Amg::Vector2D> vectorOfPositions;
-  
   int numberOfSubclusters=1;
   vectorOfPositions.push_back(pixelPrepCluster->localPosition());
   
@@ -767,7 +847,7 @@ bool InDet::PixelClusterOnTrackTool::getErrorsDefaultAmbi( const InDet::PixelClu
       
       if(msgLvl(MSG::DEBUG))
       {
-        msg(MSG::DEBUG) << "Found one more pixel cluster. Posistion x: " 
+        msg(MSG::DEBUG) << "Found one more pixel cluster. Position x: " 
                         << pixelAddCluster->localPosition()[0] << "y: " << pixelAddCluster->localPosition()[1] << endreq;
       }
     }//find relevant element of map
@@ -815,12 +895,12 @@ bool InDet::PixelClusterOnTrackTool::getErrorsDefaultAmbi( const InDet::PixelClu
   }
   
 
-
   // GP: now the not so nice part of matching the new result with the old one...
   // Takes the error into account to improve the matching
 
   if (numberOfSubclusters==1)
   {
+
     finalposition=allLocalPositions[0];
     finalerrormatrix=allErrorMatrix[0];
   }
@@ -852,11 +932,13 @@ bool InDet::PixelClusterOnTrackTool::getErrorsDefaultAmbi( const InDet::PixelClu
     
     if (distancesq1<distancesq2)
     {
+
       finalposition=allLocalPositions[0];
       finalerrormatrix=allErrorMatrix[0];
     }
     else
     {
+
       finalposition=allLocalPositions[1];
       finalerrormatrix=allErrorMatrix[1];
     }
@@ -892,16 +974,19 @@ bool InDet::PixelClusterOnTrackTool::getErrorsDefaultAmbi( const InDet::PixelClu
       
     if (smallestDistanceIndex==0 ||  smallestDistanceIndex==1)
     {
+
       finalposition=allLocalPositions[0];
       finalerrormatrix=allErrorMatrix[0];
     }
     if (smallestDistanceIndex==2 ||  smallestDistanceIndex==4)
     {
+
       finalposition=allLocalPositions[1];
       finalerrormatrix=allErrorMatrix[1];
     }
     if (smallestDistanceIndex==3 || smallestDistanceIndex==5)
     {
+
       finalposition=allLocalPositions[2];
       finalerrormatrix=allErrorMatrix[2];
     }
@@ -909,10 +994,10 @@ bool InDet::PixelClusterOnTrackTool::getErrorsDefaultAmbi( const InDet::PixelClu
   return true;
 }
 
-
-
-bool InDet::PixelClusterOnTrackTool::getErrorsTIDE_Ambi( const InDet::PixelCluster* pixelPrepCluster, const Trk::TrackParameters& trackPar,  
-                        Amg::Vector2D& finalposition,  Amg::MatrixX&  finalerrormatrix ) const
+bool InDet::PixelClusterOnTrackTool::getErrorsTIDE_Ambi( const InDet::PixelCluster* pixelPrepCluster, 
+							 const Trk::TrackParameters& trackPar,  
+							 Amg::Vector2D& finalposition,  
+							 Amg::MatrixX&  finalerrormatrix ) const
 {
 
 
@@ -934,7 +1019,7 @@ bool InDet::PixelClusterOnTrackTool::getErrorsTIDE_Ambi( const InDet::PixelClust
     ATH_MSG_WARNING( "Parameters are not at a plane ! Aborting cluster correction... " );
     return false;
   }
-
+  
   std::vector<Amg::Vector2D>     allLocalPositions;
   std::vector<Amg::MatrixX>      allErrorMatrix;
 
@@ -957,19 +1042,81 @@ bool InDet::PixelClusterOnTrackTool::getErrorsTIDE_Ambi( const InDet::PixelClust
     return false;
   }
   
+  bool correctdR = false;
+  std::vector<float>      correctiondR(3,0.);
+  if(m_applydRcorrection && m_dRMap && m_dRMap->size()>0 && pixelPrepCluster->isSplit() ){
+    const InDetDD::SiDetectorElement* det = pixelPrepCluster->detectorElement(); 
 
+    if (det->isBarrel()){
+        int pixelLayer = m_pixelid->layer_disk(det->identify());
 
+        float correctiondRX = 1.0; // correction factor to be applied to covariance(!)
+        float correctiondRZ = 1.0; // correction factor to be applied to covariance(!)
+        
+        const InDetDD::PixelModuleDesign* design (dynamic_cast<const InDetDD::PixelModuleDesign*>(&det->design()));
+        float pitchX = design->phiPitch();
+        float pitchZ = design->etaPitch();
+
+        ATH_MSG_DEBUG("PixelClusterOnTrackTool: Trying to apply dR correction for pixelLayer " << pixelLayer);
+
+        InDet::DRMap::const_iterator it = m_dRMap->find(pixelPrepCluster);
+        if(it!=m_dRMap->end()){
+            correctdR = true;
+            float mindX = it->second.first;
+            float mindZ = it->second.second;
+            float mindXOverPitch = mindX / pitchX;
+            float mindZOverPitch = mindZ / pitchZ;
+        
+            float dR = sqrt(mindX*mindX + mindZ*mindZ);
+            
+            ATH_MSG_DEBUG( " ---- Min dX ---- " << mindX << " mindZ " << mindZ);
+            
+            if(dR > 0. && dR < 2.0) {
+                correctiondRX = splineIBLPullX(mindXOverPitch, pixelLayer);
+                correctiondRZ = splineIBLPullX(mindZOverPitch, pixelLayer);
+                
+                if(correctiondRX > 3.75) correctiondRX = 3.75;
+                if(correctiondRZ > 3.75) correctiondRZ = 3.75;
+            }
+            else{
+                correctiondRX = 2.35;
+                correctiondRZ = 1.70;
+            }
+        
+            ATH_MSG_DEBUG("PixelClusterOnTrackTool: Correction factor calculation for distX/pitch= " << mindXOverPitch << " -> " << correctiondRX <<  " distZ/pitch= " << mindZOverPitch << " -> " << correctiondRZ);
+        }
+        else{
+            ATH_MSG_WARNING("Split Pixel cluster not found in dRmap! " << pixelPrepCluster);
+        }
+    
+        ATH_MSG_DEBUG( " ++++ Hit Error ++++ Layer " << pixelLayer << " Correction Flag " << m_applydRcorrection << " Split " <<pixelPrepCluster->isSplit() << " Scaling " << correctiondRX << " " << correctiondRZ);
+    
+        correctiondRX *= correctiondRX;
+        correctiondRZ *= correctiondRZ;
+        
+        correctiondR[0] = correctiondRX*correctiondRX;
+        correctiondR[1] = correctiondRZ*correctiondRZ;
+        correctiondR[2] = correctiondRX*correctiondRZ;
+    }
+  }
   // AKM: now the not so nice part find the best match position option
   // Takes the error into account to scale the importance of the measurement
 
-  if (numberOfSubclusters==1)
-  {
+  if (numberOfSubclusters==1){
     finalposition=allLocalPositions[0];
-    finalerrormatrix=allErrorMatrix[0];
+
+    if(correctdR){
+      allErrorMatrix[0](0,0) *= correctiondR[0];
+      allErrorMatrix[0](1,1) *= correctiondR[1];
+      allErrorMatrix[0](0,1) *= correctiondR[2];
+      allErrorMatrix[0](1,0) *= correctiondR[2];
+      ATH_MSG_DEBUG( " ++++ Hit Error ++++ " <<  numberOfSubclusters << " Split " << pixelPrepCluster->isSplit() << " Scaling " << sqrt(correctiondR[0]) << " " << sqrt(correctiondR[1]) << " Rescaled ErrX " << sqrt(allErrorMatrix[0](0,0)) << " Rescaled ErrZ " << sqrt(allErrorMatrix[0](1,1))); 
+    }
+
+    finalerrormatrix=allErrorMatrix[0]; 
     return true;
   }
 
-
   //Get the track parameters local position
   const Amg::Vector2D localpos =  trackPar.localPosition();
   //Use the track parameters cov to weight distcances 
@@ -978,7 +1125,6 @@ bool InDet::PixelClusterOnTrackTool::getErrorsTIDE_Ambi( const InDet::PixelClust
     localerr = Amg::Vector2D( sqrt( (*trackPar.covariance())(0,0) ), sqrt( (*trackPar.covariance())(1,1) ) );
   } 
 
-
   double minDistance(1e300);
   int index(0);
   
@@ -995,8 +1141,45 @@ bool InDet::PixelClusterOnTrackTool::getErrorsTIDE_Ambi( const InDet::PixelClust
   }
 
   finalposition=allLocalPositions[index];
+
+  if(correctdR){
+    allErrorMatrix[index](0,0) *= correctiondR[0];
+    allErrorMatrix[index](1,1) *= correctiondR[1];
+    allErrorMatrix[index](0,1) *= correctiondR[2];
+    allErrorMatrix[index](1,0) *= correctiondR[2];
+     ATH_MSG_DEBUG( " ++++ Hit Error ++++ " <<  numberOfSubclusters << " Split " << pixelPrepCluster->isSplit() << " Scaling " << sqrt(correctiondR[0]) << " " << sqrt(correctiondR[1]) << " Rescaled ErrX " << sqrt(allErrorMatrix[index](0,0)) << " Rescaled ErrZ " << sqrt(allErrorMatrix[index](1,1))); 
+  }
+
   finalerrormatrix=allErrorMatrix[index];
- 
   return true;
 
 }
+
+double InDet::PixelClusterOnTrackTool::splineIBLPullX(float x, int layer) const {
+
+   const int fNp = m_fY[layer].size();
+   const int fKstep = 0;
+   const double fDelta = -1;
+   const double fXmin = *std::min_element( std::begin(m_fX[layer]), std::end(m_fX[layer]) );
+   const double fXmax = *std::max_element( std::begin(m_fX[layer]), std::end(m_fX[layer]) );
+
+   int klow=0;
+   if(x<=fXmin) klow=0;
+   else if(x>=fXmax) klow=fNp-1;
+   else {
+     if(fKstep) {
+       // Equidistant knots, use histogramming
+       klow = int((x-fXmin)/fDelta);
+       if (klow < fNp-1) klow = fNp-1;
+     } else {
+       int khig=fNp-1, khalf;
+       // Non equidistant knots, binary search
+       while(khig-klow>1)
+         if(x>m_fX[layer][khalf=(klow+khig)/2]) klow=khalf;
+         else khig=khalf;
+     }
+   }
+   // Evaluate now
+   double dx=x-m_fX[layer][klow];
+   return (m_fY[layer][klow]+dx*(m_fB[layer][klow]+dx*(m_fC[layer][klow]+dx*m_fD[layer][klow])));
+}