diff --git a/InnerDetector/InDetExample/InDetRecExample/python/InDetJobProperties.py b/InnerDetector/InDetExample/InDetRecExample/python/InDetJobProperties.py
index 2ec6f97f3607d61fbbfc4664faf2daf51291b08e..91458c40cb8741bee45814f19af1ff4139adc630 100644
--- a/InnerDetector/InDetExample/InDetRecExample/python/InDetJobProperties.py
+++ b/InnerDetector/InDetExample/InDetRecExample/python/InDetJobProperties.py
@@ -322,6 +322,18 @@ class doHadCaloSeededSSS(InDetFlagsJobProperty):
     allowedTypes = ['bool']
     StoredValue  = False
 
+class doCaloSeededAmbi(InDetFlagsJobProperty):
+    """Use Calo ROIs to seed specific cuts for the ambi"""
+    statusOn     = True
+    allowedTypes = ['bool']
+    StoredValue  = False
+
+class doCaloSeededRefit(InDetFlagsJobProperty):
+    """Use Calo ROIs to seed refif for the ambi processor"""
+    statusOn     = True
+    allowedTypes = ['bool']
+    StoredValue  = False
+
 class doBeamGas(InDetFlagsJobProperty):
     """Turn running of BeamGas second pass on and off"""
     statusOn     = True
@@ -2646,6 +2658,8 @@ _list_InDetJobProperties = [Enabled,
                             doBremRecovery,
                             doCaloSeededBrem,
                             doHadCaloSeededSSS,
+                            doCaloSeededAmbi,
+                            doCaloSeededRefit,
                             doBeamGas,
                             doBeamHalo,
                             doVtxLumi,
diff --git a/InnerDetector/InDetExample/InDetRecExample/python/InDetKeys.py b/InnerDetector/InDetExample/InDetRecExample/python/InDetKeys.py
index 551cf7ac2f6509d4c72f07772691c96b175d0719..ddf98443ad02b6092fa99bf3332a13d79aceb0a6 100644
--- a/InnerDetector/InDetExample/InDetRecExample/python/InDetKeys.py
+++ b/InnerDetector/InDetExample/InDetRecExample/python/InDetKeys.py
@@ -968,7 +968,9 @@ class HadCaloClusterContainer(JobProperty):
     """Brem Reco: Container of EM clusters"""
     statusOn     = True
     allowedTypes = ['str']
-    StoredValue  = 'CaloCalTopoCluster'
+    StoredValue  = 'CaloCalTopoClusters'
+
+#here there was an error: CaloCalTopoCluster without s
 
 class HadCaloCellContainer(JobProperty):
     """Brem Reco: Container of calo cell"""
diff --git a/InnerDetector/InDetExample/InDetRecExample/share/ConfiguredNewTrackingSiPattern.py b/InnerDetector/InDetExample/InDetRecExample/share/ConfiguredNewTrackingSiPattern.py
index 9871a6f43340d2c1e9d3a08aca24a625591435ba..f6add0ad42bb884ebe23b4c6035caf4ace533880 100644
--- a/InnerDetector/InDetExample/InDetRecExample/share/ConfiguredNewTrackingSiPattern.py
+++ b/InnerDetector/InDetExample/InDetRecExample/share/ConfiguredNewTrackingSiPattern.py
@@ -369,11 +369,14 @@ class  ConfiguredNewTrackingSiPattern:
            InDetAmbiTrackSelectionTool.minSiHitsToAllowSplitting = nhitsToAllowSplitting
            InDetAmbiTrackSelectionTool.minUniqueSCTHits          = 4
            InDetAmbiTrackSelectionTool.minTrackChi2ForSharedHits = 3
-           InDetAmbiTrackSelectionTool.InputHadClusterContainerName = InDetKeys.HadCaloClusterROIContainer()
-           InDetAmbiTrackSelectionTool.doHadCaloSeed             = False   #Only split in cluster in region of interest
+           InDetAmbiTrackSelectionTool.InputHadClusterContainerName = InDetKeys.HadCaloClusterROIContainer()+"Bjet"
+           InDetAmbiTrackSelectionTool.doHadCaloSeed             = InDetFlags.doCaloSeededAmbi()   #Do special cuts in region of interest
            InDetAmbiTrackSelectionTool.minPtSplit                = InDetFlags.pixelClusterSplitMinPt()       #Only allow split clusters on track withe pt greater than this MeV
-           InDetAmbiTrackSelectionTool.phiWidth                  = 0.2     #Split cluster ROI size
-           InDetAmbiTrackSelectionTool.etaWidth                  = 0.2     #Split cluster ROI size
+           InDetAmbiTrackSelectionTool.maxSharedModulesInROI     = 3     #Maximum number of shared modules for tracks in ROI
+           InDetAmbiTrackSelectionTool.minNotSharedInROI         = 2     #Minimum number of unique modules for tracks in ROI
+           InDetAmbiTrackSelectionTool.minSiHitsToAllowSplittingInROI = 7  #Minimum number of Si hits to allow splittings for tracks in ROI
+           InDetAmbiTrackSelectionTool.phiWidth                  = 0.1     #Split cluster ROI size
+           InDetAmbiTrackSelectionTool.etaWidth                  = 0.1     #Split cluster ROI size
            InDetAmbiTrackSelectionTool.InputEmClusterContainerName = InDetKeys.CaloClusterROIContainer()
            InDetAmbiTrackSelectionTool.doEmCaloSeed              = False   #Only split in cluster in region of interest
            InDetAmbiTrackSelectionTool.minPtConv                 = 10000   #Only allow split clusters on track withe pt greater than this MeV
@@ -471,7 +474,10 @@ class  ConfiguredNewTrackingSiPattern:
 	                                                 caloSeededBrem     = InDetFlags.doCaloSeededBrem() and NewTrackingCuts.mode() != "DBM",
 	                                                 pTminBrem          = NewTrackingCuts.minPTBrem(),
 	                                                 RefitPrds          = True, 
+                                                     doHadCaloSeed      = InDetFlags.doCaloSeededRefit(),
+                                                     InputHadClusterContainerName = InDetKeys.HadCaloClusterROIContainer()+"Bjet",
 	                                                 RejectTracksWithInvalidCov=InDetFlags.doRejectInvalidCov())
+           #We hadded doHadCaloSeed and InputHadClusterContainerName
          else:
            from TrkAmbiguityProcessor.TrkAmbiguityProcessorConf import Trk__SimpleAmbiguityProcessorTool as ProcessorTool
            InDetAmbiguityProcessor = ProcessorTool(name               = 'InDetAmbiguityProcessor'+NewTrackingCuts.extension(),
diff --git a/InnerDetector/InDetExample/InDetRecExample/share/InDetRecHadCaloSeededROISelection.py b/InnerDetector/InDetExample/InDetRecExample/share/InDetRecHadCaloSeededROISelection.py
index 9a7dddc384be7b0b40b5eeeed13c1e816864f4db..b69bd080af4c208f4695e247dc4d0bf7f7fac4d3 100644
--- a/InnerDetector/InDetExample/InDetRecExample/share/InDetRecHadCaloSeededROISelection.py
+++ b/InnerDetector/InDetExample/InDetRecExample/share/InDetRecHadCaloSeededROISelection.py
@@ -4,6 +4,8 @@
 #
 # ------------------------------------------------------------
 
+#We are building ROIs corresponding (ideally) to high pt Bs
+
 #
 # --- load the tool to check the energy deposits and select clusters
 #
@@ -11,9 +13,11 @@ from egammaRec.Factories import ToolFactory
 from egammaCaloTools import egammaCaloToolsConf
 egammaCaloClusterHadROISelector = ToolFactory( egammaCaloToolsConf.egammaCaloClusterSelector,
                                                name = 'caloClusterHadROISelector',
-                                               ClusterEtCut = 25000
+                                               egammaCheckEnergyDepositTool = "",
+                                               ClusterEtCut = 150e3
                                              ) 
 
+
 #
 # --- get the builder tool
 #
@@ -23,17 +27,17 @@ InDetCaloClusterROIBuilder = InDet__CaloClusterROI_Builder(name = "InDetCaloClus
 if (InDetFlags.doPrintConfigurables()):
     print InDetCaloClusterROIBuilder
 
+
 #
 # --- now load the algorithm
 #
 from InDetCaloClusterROISelector.InDetCaloClusterROISelectorConf import InDet__CaloClusterROI_Selector
-InDetHadCaloClusterROISelector = InDet__CaloClusterROI_Selector (name                         = "InDetHadCaloClusterROISelector",
-                                                              InputClusterContainerName    = InDetKeys.HadCaloClusterContainer(),    # "LArClusterEM"
-                                                              OutputClusterContainerName   = InDetKeys.HadCaloClusterROIContainer(), # "InDetCaloClusterROIs"
-                                                              CaloClusterROIBuilder        = InDetCaloClusterROIBuilder
-                                                              egammaCaloClusterSelector    = egammaCaloClusterHadROISelector()
-                                                             )
-
+InDetHadCaloClusterROISelector = InDet__CaloClusterROI_Selector ( name                         = "InDetHadCaloClusterROISelector",
+                                                                  InputClusterContainerName    = InDetKeys.HadCaloClusterContainer(),    # "CaloCalTopoClusters
+                                                                  OutputClusterContainerName   = InDetKeys.HadCaloClusterROIContainer()+"Bjet", # "InDetCaloClusterROIs"
+                                                                  CaloClusterROIBuilder        = InDetCaloClusterROIBuilder,
+                                                                  egammaCaloClusterSelector    = egammaCaloClusterHadROISelector()
+                                                                )
 topSequence += InDetHadCaloClusterROISelector
 if (InDetFlags.doPrintConfigurables()):
     print InDetHadCaloClusterROISelector
diff --git a/InnerDetector/InDetExample/InDetRecExample/share/InDetRec_jobOptions.py b/InnerDetector/InDetExample/InDetRecExample/share/InDetRec_jobOptions.py
index cb8fff5cf22c0cc0397701043bbedd3afcdad6f0..659ac28b2c7785f6f3199d3e6b5695f9083abdfd 100755
--- a/InnerDetector/InDetExample/InDetRecExample/share/InDetRec_jobOptions.py
+++ b/InnerDetector/InDetExample/InDetRecExample/share/InDetRec_jobOptions.py
@@ -138,11 +138,11 @@ else:
 
     # ------------------------------------------------------------
     # 
-    # -----------ROI seeding for SSS seeds
+    # -----------ROI seeding for SSS seeds or Ambi
     #
     # ------------------------------------------------------------
     #
-    if InDetFlags.doHadCaloSeededSSS() and DetFlags.detdescr.Calo_allOn():
+    if (InDetFlags.doHadCaloSeededSSS() or InDetFlags.doCaloSeededAmbi() or InDetFlags.doCaloSeededRefit()) and DetFlags.detdescr.Calo_allOn():
       include ("InDetRecExample/InDetRecHadCaloSeededROISelection.py")
 
     # ------------------------------------------------------------
diff --git a/InnerDetector/InDetRecTools/InDetAmbiTrackSelectionTool/CMakeLists.txt b/InnerDetector/InDetRecTools/InDetAmbiTrackSelectionTool/CMakeLists.txt
index d0142529e11a9ebd8724ab26e1a6b1b6428e5e5d..14e6533ee5e2cdb2d743ac33d645461ec0014442 100644
--- a/InnerDetector/InDetRecTools/InDetAmbiTrackSelectionTool/CMakeLists.txt
+++ b/InnerDetector/InDetRecTools/InDetAmbiTrackSelectionTool/CMakeLists.txt
@@ -28,7 +28,8 @@ atlas_depends_on_subdirs(
    Tracking/TrkEvent/TrkPrepRawData
    Tracking/TrkEvent/TrkPseudoMeasurementOnTrack
    Tracking/TrkEvent/TrkTrackSummary 
-   Tracking/TrkEvent/TrkParameters )
+   Tracking/TrkEvent/TrkParameters
+   Tracking/TrkFitter/TrkFitterInterfaces)
 
 # External dependencies:
 find_package( ROOT COMPONENTS Core MathCore )
@@ -41,4 +42,4 @@ atlas_add_component( InDetAmbiTrackSelectionTool
    TrkTrack TrkToolInterfaces TrkValInterfaces AthContainers StoreGateLib
    InDetIdentifier InDetPrepRawData InDetRecToolInterfaces TrkDetElementBase
    TrkSurfaces TrkCaloClusterROI TrkMeasurementBase TrkPrepRawData
-   TrkPseudoMeasurementOnTrack TrkTrackSummary TrkParameters PixelGeoModelLib )
+   TrkPseudoMeasurementOnTrack TrkTrackSummary TrkParameters PixelGeoModelLib TrkFitterInterfaces)
diff --git a/InnerDetector/InDetRecTools/InDetAmbiTrackSelectionTool/InDetAmbiTrackSelectionTool/InDetAmbiTrackSelectionTool.h b/InnerDetector/InDetRecTools/InDetAmbiTrackSelectionTool/InDetAmbiTrackSelectionTool/InDetAmbiTrackSelectionTool.h
index 91a1240a9b7532bb3d8ea80483ee804d5a02ae7f..d2fd1b6f93edcc0dd110de1037226e0c629389eb 100755
--- a/InnerDetector/InDetRecTools/InDetAmbiTrackSelectionTool/InDetAmbiTrackSelectionTool/InDetAmbiTrackSelectionTool.h
+++ b/InnerDetector/InDetRecTools/InDetAmbiTrackSelectionTool/InDetAmbiTrackSelectionTool/InDetAmbiTrackSelectionTool.h
@@ -15,6 +15,7 @@
 #include "TrkTrack/TrackStateOnSurface.h"
 #include "TrkToolInterfaces/IAmbiTrackSelectionTool.h"
 #include "TrkToolInterfaces/IPRD_AssociationTool.h"
+#include <map>
 #include <vector>
 
 class SiliconID;
diff --git a/InnerDetector/InDetRecTools/InDetAmbiTrackSelectionTool/InDetAmbiTrackSelectionTool/InDetDenseEnvAmbiTrackSelectionTool.h b/InnerDetector/InDetRecTools/InDetAmbiTrackSelectionTool/InDetAmbiTrackSelectionTool/InDetDenseEnvAmbiTrackSelectionTool.h
index 8d19dfdab3b3b58f602acc527a95367d3aa41475..7818fb8b9212647a20b704ea6ed223c0f0fc2e83 100755
--- a/InnerDetector/InDetRecTools/InDetAmbiTrackSelectionTool/InDetAmbiTrackSelectionTool/InDetDenseEnvAmbiTrackSelectionTool.h
+++ b/InnerDetector/InDetRecTools/InDetAmbiTrackSelectionTool/InDetAmbiTrackSelectionTool/InDetDenseEnvAmbiTrackSelectionTool.h
@@ -9,16 +9,20 @@
 #ifndef INDETInDetDenseEnvAmbiTrackSelectionTool_H
 #define INDETInDetDenseEnvAmbiTrackSelectionTool_H
 
+#include "TrkFitterInterfaces/ITrackFitter.h"
 #include "AthenaBaseComps/AthAlgTool.h"
 #include "GaudiKernel/ToolHandle.h"
 #include "GaudiKernel/IIncidentSvc.h"
 #include "StoreGate/ReadHandleKey.h"
 #include "TrkCaloClusterROI/CaloClusterROI_Collection.h"
+#include "TrkTrack/TrackStateOnSurface.h"
 #include "TrkToolInterfaces/IAmbiTrackSelectionTool.h"
 #include "TrkToolInterfaces/IPRD_AssociationTool.h"
 #include <map>
 #include <vector>
 #include "TrkTrack/Track.h" //for use in the struct lessTrkTrack implementation in this header
+#include "TrkRIO_OnTrack/RIO_OnTrack.h"
+#include "TrkValInterfaces/ITrkObserverTool.h"
 #include "TrkParameters/TrackParameters.h"
 #include <cmath> //for std::fabs in implementation of structs in this header
 #include <iostream> //for cout in dumpInfo 
@@ -36,6 +40,7 @@ namespace Trk {
 namespace InDet 
 {
 
+  //In here we refer to ROIs as region of interests corresponding to high pt B tracks.
   /** @class InDetDenseEnvAmbiTrackSelectionTool 
       This tool cross checks the hits on a track with the hits already stored in 
       a PRD_AssociationTool. Shared hits are allowed to some extent und under certain conditions
@@ -316,31 +321,36 @@ namespace InDet
       ToolHandle<Trk::ITrkObserverTool> m_observerTool;
       
       /** some cut values */
-      int m_minHits;                // Min Number of hits on track            
-      int m_minTRT_Hits;            // Min Number of TRT hits on track
-      mutable int m_maxShared;      // Max shared hits -- calulated from  m_maxSharedModules
-      int m_maxSharedModules;       // Max number of shared modules
-      int m_maxSharedModulesInROI;  // Max number of shared modules in ROI
-      int m_maxTracksPerPRD;        // Max number of tracks per hit if it is nor split
-      int m_minNotShared;           // Min number of hits that are not shared
-      float m_minScoreShareTracks;  // Min track score to alow it to share hits
-      bool m_cosmics;               // Trying to reco cosmics?
-      bool m_parameterization;      // Use table of min number DCs
+      int m_minHits;                  // Min Number of hits on track            
+      int m_minTRT_Hits;              // Min Number of TRT hits on track
+      mutable int m_maxShared;        // Max shared hits -- calulated from  m_maxSharedModules
+      int m_maxSharedModules;         // Max number of shared modules
+      int m_maxSharedModulesInROI;    // Max number of shared modules in ROI
+      int m_maxTracksPerPRD;          // Max number of tracks per hit if it is nor split
+      mutable int m_minNotShared;     // Min number of hits that are not shared -- can change if we are in ROI
+      int m_minNotSharedModules;      // Min number of non shared modules
+      int m_minNotSharedModulesInROI; // Min number of non shared modules  in ROI
+      float m_minScoreShareTracks;    // Min track score to alow it to share hits
+      bool m_cosmics;                 // Trying to reco cosmics?
+      bool m_parameterization;        // Use table of min number DCs
       bool m_doPixelClusterSplitting; // Split pixel clusters
-      float m_sharedProbCut;        // Min split prob to break a cluster into two parts
-      float m_sharedProbCut2;       // Min split prob to break a clsuter into three parts
-      float m_minsharedProbCut;     // Min split prob cut to all a cluster to be shared
+      float m_sharedProbCut;          // Min split prob to break a cluster into two parts
+      float m_sharedProbCut2;         // Min split prob to break a clsuter into three parts
+      float m_minsharedProbCut;       // Min split prob cut to all a cluster to be shared
       
-      float m_minTrackChi2ForSharedHits; // Min track chi2 to split share hits
-      int m_minUniqueSCTHits;            // Min number of hits in the SCT that we need before we allow hit sharing in the SCT
-      int m_minSiHitsToAllowSplitting;   // Min number of hits before we allow split sharing of hits  
-      int m_maxPixMultiCluster;          // Max number of tracks that can be associated to a split cluster 
+      float m_minTrackChi2ForSharedHits;       // Min track chi2 to split share hits
+      int m_minUniqueSCTHits;                  // Min number of hits in the SCT that we need before we allow hit sharing in the SCT
+      mutable int m_minSiHits;                 // Min number of hits before we allow split sharing of hits -- can change if we are in ROI
+      int m_minSiHitsToAllowSplitting;         // Min number of hits before we allow split sharing of hits  
+      int m_minSiHitsToAllowSplittingInROI;    // Min number of hits before we allow split sharing of hits In ROI 
+      int m_maxPixMultiCluster;                // Max number of tracks that can be associated to a split cluster 
  
 
 
       // ROI stuff
       bool m_useHClusSeed;
       float m_minPtSplit;
+      float m_minPtBjetROI;
       float m_phiWidth;
       float m_etaWidth;
       SG::ReadHandleKey<CaloClusterROI_Collection> m_inputHadClusterContainerName;
diff --git a/InnerDetector/InDetRecTools/InDetAmbiTrackSelectionTool/src/InDetDenseEnvAmbiTrackSelectionTool.cxx b/InnerDetector/InDetRecTools/InDetAmbiTrackSelectionTool/src/InDetDenseEnvAmbiTrackSelectionTool.cxx
index b18ffbb14887cacb08c73aae73eabf4385c549c3..6185ce71926f87e95df98da0f0b6a9ad4dd4edc1 100755
--- a/InnerDetector/InDetRecTools/InDetAmbiTrackSelectionTool/src/InDetDenseEnvAmbiTrackSelectionTool.cxx
+++ b/InnerDetector/InDetRecTools/InDetAmbiTrackSelectionTool/src/InDetDenseEnvAmbiTrackSelectionTool.cxx
@@ -40,7 +40,6 @@ InDet::InDetDenseEnvAmbiTrackSelectionTool::InDetDenseEnvAmbiTrackSelectionTool(
   AthAlgTool(t,n,p),
   m_assoTool("Trk::PRD_AssociationTool/PRD_AssociationTool"),
   m_selectortool("InDet::InDetTrtDriftCircleCutTool"       ),
-  //m_selectionTool("InDet::InDetDenseEnvAmbiTrackSelectionTool/InDetAmbiTrackSelectionTool"),//WPM
   m_IBLParameterSvc("IBLParameterSvc",n),
   m_incidentSvc("IncidentSvc", n),
   m_detID(nullptr),
@@ -57,10 +56,11 @@ InDet::InDetDenseEnvAmbiTrackSelectionTool::InDetDenseEnvAmbiTrackSelectionTool(
   declareProperty("minHits"              , m_minHits                 = 5);
   declareProperty("minTRTHits"           , m_minTRT_Hits             = 0);
   declareProperty("maxShared"            , m_maxSharedModules        = 1);
-  declareProperty("maxSharedModulesInROI", m_maxSharedModulesInROI   = 1);
+  declareProperty("maxSharedModulesInROI", m_maxSharedModulesInROI   = 2); //Test value for recovering B jet efficiency at high pt
   declareProperty("minScoreShareTracks"  , m_minScoreShareTracks     = 0.0);
   declareProperty("maxTracksPerSharedPRD", m_maxTracksPerPRD         = 2);
-  declareProperty("minNotShared"         , m_minNotShared            = 6);
+  declareProperty("minNotShared"         , m_minNotSharedModules     = 6);
+  declareProperty("minNotSharedInROI"    , m_minNotSharedModulesInROI= 4); //Test value for recovering B jet efficiency at high pt
   declareProperty("Cosmics"              , m_cosmics                 = false);
   declareProperty("UseParameterization"  , m_parameterization        = true);
   declareProperty("doPixelSplitting"     , m_doPixelClusterSplitting = false);
@@ -72,13 +72,15 @@ InDet::InDetDenseEnvAmbiTrackSelectionTool::InDetDenseEnvAmbiTrackSelectionTool(
   declareProperty("minTrackChi2ForSharedHits", m_minTrackChi2ForSharedHits = 3); //3
   declareProperty("minUniqueSCTHits"         , m_minUniqueSCTHits          = 2); //2
   declareProperty("minSiHitsToAllowSplitting", m_minSiHitsToAllowSplitting = 9); //9
+  declareProperty("minSiHitsToAllowSplittingInROI", m_minSiHitsToAllowSplittingInROI = 7); //Test value for recovering B jet efficiency
   declareProperty("maxPixMultiCluster"       , m_maxPixMultiCluster        = 4);
   
   
-  declareProperty("doHadCaloSeed"        ,m_useHClusSeed = false);
-  declareProperty("minPtSplit"           ,m_minPtSplit   = 0.   );
-  declareProperty("phiWidth"             ,m_phiWidth     = 0.2  );
-  declareProperty("etaWidth"             ,m_etaWidth     = 0.2  );
+  declareProperty("doHadCaloSeed"        ,m_useHClusSeed = false );
+  declareProperty("minPtSplit"           ,m_minPtSplit   = 0.    );
+  declareProperty("minPtBjetROI"         ,m_minPtBjetROI = 15000.); //inMeV
+  declareProperty("phiWidth"             ,m_phiWidth     = 0.2   );
+  declareProperty("etaWidth"             ,m_etaWidth     = 0.2   );
   declareProperty("InputHadClusterContainerName",m_inputHadClusterContainerName="InDetHadCaloClusterROIs");
   declareProperty("MonitorAmbiguitySolving"  , m_monitorTracks = false);
   declareProperty("ObserverTool"             , m_observerTool);
@@ -100,6 +102,8 @@ InDet::InDetDenseEnvAmbiTrackSelectionTool::InDetDenseEnvAmbiTrackSelectionTool(
 
   // compute the number of shared hits from the number of max shared modules
   m_maxShared=2*m_maxSharedModules+1;
+  m_minNotShared = m_minNotSharedModules;
+  m_minSiHits = m_minSiHitsToAllowSplitting;
 }
 
 //================ Destructor =================================================
@@ -251,6 +255,8 @@ const Trk::Track* InDet::InDetDenseEnvAmbiTrackSelectionTool::getCleanedOutTrack
 
   // compute the number of shared hits from the number of max shared modules
   m_maxShared=2*m_maxSharedModules+1;
+  m_minNotShared = m_minNotSharedModules;
+  m_minSiHits = m_minSiHitsToAllowSplitting;
 
   // cut on TRT hits, might use eta dependent cuts here
   int  nCutTRT = m_minTRT_Hits;
@@ -281,11 +287,6 @@ const Trk::Track* InDet::InDetDenseEnvAmbiTrackSelectionTool::getCleanedOutTrack
   
   ATH_MSG_DEBUG ("DecidedWhichHitsToKeep " << TrkCouldBeAccepted );
     
-  
-
-  int  totalSiHits = trackHitDetails.totalSiHits();
- 
-
   //WPM add in a loop to check how many splitable SCT clusters there are here!!!!
   ATH_MSG_DEBUG ("How many SCT clusters can be split? ");
   
@@ -331,6 +332,7 @@ const Trk::Track* InDet::InDetDenseEnvAmbiTrackSelectionTool::getCleanedOutTrack
   // now see what to do with the track
   //
  
+  int  totalSiHits = trackHitDetails.totalSiHits();
    ATH_MSG_DEBUG ("totalSiHits " << totalSiHits );
    ATH_MSG_DEBUG ("score " << score );
 
@@ -345,7 +347,7 @@ const Trk::Track* InDet::InDetDenseEnvAmbiTrackSelectionTool::getCleanedOutTrack
     ATH_MSG_DEBUG ("=> Suggest to keep track with "<<trackHitDetails.numShared<<" shared hits !");
     
 
-    //  Change pixel hits property for shared hits as this is track will be accepeted into the final track colection
+    //  Change pixel hits property for shared hits as this track will be accepted into the final track colection
     if(!trackHitDetails.isPatternTrack){
       updatePixelClusterInformation( tsosDetails ); 
     }
@@ -457,14 +459,13 @@ const Trk::Track* InDet::InDetDenseEnvAmbiTrackSelectionTool::getCleanedOutTrack
       
           // update shared hit counter
           //cntIns += isPixel ? 2 : 1;
-	  if(isPixel) {cntIns += 2;}
-	  else if(  m_detID->is_sct(rot->identify()) && isSplitable ){ cntIns += 0;}
-	  else{cntIns += 1;}
+          if(isPixel) {cntIns += 2;}
+          else if(  m_detID->is_sct(rot->identify()) && isSplitable ){ cntIns += 0;}
+          else{cntIns += 1;}
 
 
-        } else{
+        } else
           ATH_MSG_VERBOSE ("---> Reject hit shared with " << numberOfTracksWithThisPrd << " tracks !");
-	}
       }
     }
 
@@ -499,7 +500,7 @@ const Trk::Track* InDet::InDetDenseEnvAmbiTrackSelectionTool::getCleanedOutTrack
         ATH_MSG_DEBUG ("=> Failed to create subtrack");
         if (m_monitorTracks && TrkCouldBeAccepted)	// otherwise (!TrkCouldBeAccepted) already rejected
           m_observerTool->rejectTrack(*ptrTrack, 112);		// rejection location 112: "Failed to create subtrack"
-	ATH_MSG_DEBUG ("reject track; Failed to create subtrack");
+        ATH_MSG_DEBUG ("reject track; Failed to create subtrack");
         return 0;
       }
   
@@ -513,7 +514,7 @@ const Trk::Track* InDet::InDetDenseEnvAmbiTrackSelectionTool::getCleanedOutTrack
       ATH_MSG_DEBUG ("=> Successfully created subtrack with shared hits recovered !");
       if (m_monitorTracks) {
         m_observerTool->rejectTrack(*ptrTrack, 113);		// rejection location 113: There is a cleaner track, subtrack created
-	ATH_MSG_DEBUG ("reject track; There is a cleaner track, subtrack created");
+        ATH_MSG_DEBUG ("reject track; There is a cleaner track, subtrack created");
         // observer Tool creates subtrack in ProcessorTool.cxx	
       }
       return newTrack;
@@ -772,9 +773,9 @@ void InDet::InDetDenseEnvAmbiTrackSelectionTool::fillTrackDetails(const Trk::Tra
 	      }
       }
       //Always set to 0 if splitting not allowed
-       else{
-	       tsosDetails.splitProb1[index] = 0;
-         tsosDetails.splitProb2[index] = 0;
+      else{
+	    tsosDetails.splitProb1[index] = 0;
+        tsosDetails.splitProb2[index] = 0;
       }
     } 
 
@@ -860,19 +861,24 @@ bool InDet::InDetDenseEnvAmbiTrackSelectionTool::decideWhichHitsToKeep(const Trk
 
   // Are we in a ROI?
   bool inROIandPTok(true);
+  bool inROI(true);
   if(  ptrTrack->trackParameters()->front() ){
     if(  ptrTrack->trackParameters()->front()->pT() < m_minPtSplit )
       inROIandPTok = false;
     
-    if(inROIandPTok){ 
-      bool inROI  = m_useHClusSeed && isHadCaloCompatible(*ptrTrack->trackParameters()->front());
-    
-      if( m_useHClusSeed && inROI )  
-        inROIandPTok = false;
+    if(  ptrTrack->trackParameters()->front()->pT() < m_minPtBjetROI )
+      inROI = false;
    
+
+    if(inROI){ 
+      inROI  = m_useHClusSeed && isHadCaloCompatible(*ptrTrack->trackParameters()->front());
+    
       // If we are in a ROI change the shared hit cut;
-      if(inROI)
+      if(inROI){
         m_maxShared=2*m_maxSharedModulesInROI+1;
+        m_minNotShared = m_minNotSharedModulesInROI;
+        m_minSiHits = m_minSiHitsToAllowSplittingInROI;
+      }
     }
   } 
   
@@ -1062,7 +1068,7 @@ bool InDet::InDetDenseEnvAmbiTrackSelectionTool::decideWhichHitsToKeep(const Trk
           TrkCouldBeAccepted = false; // we have to remove at least one PRD   
           if (m_monitorTracks)
             m_observerTool->rejectTrack(*ptrTrack, 105);		// rejection location 105: "Too many hits shared - we have to remove at least one PRD" 
-	  ATH_MSG_DEBUG ("reject track; Too many hits shared - we have to remove at least one PRD 105");    
+          ATH_MSG_DEBUG ("reject track; Too many hits shared - we have to remove at least one PRD 105");    
           tsosDetails.type[index]    = RejectedHit;
           continue; 
         } 
@@ -1347,7 +1353,7 @@ bool InDet::InDetDenseEnvAmbiTrackSelectionTool::decideWhichHitsToKeep(const Trk
           TrkCouldBeAccepted = false;
           if (m_monitorTracks)
             m_observerTool->rejectTrack(*ptrTrack, 110);		// rejection location 110: "Tracks shared hits will mess up an accpeted track"
-	  ATH_MSG_DEBUG ("reject track; Tracks shared hits will mess up an accpeted track");
+          ATH_MSG_DEBUG ("reject track; Tracks shared hits will mess up an accepted track");
           tsosDetails.type[index] = RejectedHit;
           trackHitDetails.numShared--;                             // decrease counter 
           trackHitDetails.numWeightedShared -= (tsosDetails.detType[index]%10== 1 ? 2 : 1);  // increase counter
diff --git a/Tracking/TrkTools/TrkAmbiguityProcessor/CMakeLists.txt b/Tracking/TrkTools/TrkAmbiguityProcessor/CMakeLists.txt
index dc2dbfe0d858ddcabc44e88196dc385bda69fd1f..dca24e432cff8dfabb0ca100dc64c4de16a7fb65 100644
--- a/Tracking/TrkTools/TrkAmbiguityProcessor/CMakeLists.txt
+++ b/Tracking/TrkTools/TrkAmbiguityProcessor/CMakeLists.txt
@@ -20,6 +20,7 @@ atlas_depends_on_subdirs( PRIVATE
                           Tracking/TrkEvent/TrkTrack
                           Tracking/TrkEvent/TrkTrackSummary
                           Tracking/TrkEvent/TrkTruthData
+                          Tracking/TrkEvent/TrkCaloClusterROI
                           Tracking/TrkFitter/TrkFitterInterfaces
                           Tracking/TrkTools/TrkToolInterfaces
                           Tracking/TrkValidation/TrkValInterfaces
@@ -35,7 +36,7 @@ atlas_add_library(   TrkAmbiguityProcessorLib
                      src/DenseEnvironmentsAmbiguityProcessorTool.cxx
                      PUBLIC_HEADERS TrkAmbiguityProcessor
                      PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaBaseComps AtlasDetDescr GaudiKernel InDetPrepRawData InDetRecToolInterfaces TrkDetElementBase TrkEventPrimitives TrkParameters TrkRIO_OnTrack TrkTrack TrkTrackSummary TrkTruthData TrkFitterInterfaces TrkToolInterfaces TrkValInterfaces TrkExInterfaces )
+                     LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaBaseComps AtlasDetDescr GaudiKernel InDetPrepRawData InDetRecToolInterfaces TrkDetElementBase TrkEventPrimitives TrkParameters TrkRIO_OnTrack TrkTrack TrkTrackSummary TrkTruthData TrkFitterInterfaces TrkToolInterfaces TrkValInterfaces TrkExInterfaces TrkCaloClusterROI)
 
 atlas_add_component( TrkAmbiguityProcessor
                      src/SimpleAmbiguityProcessorTool.cxx  src/TrackScoringTool.cxx  src/TrackSelectionProcessorTool.cxx
diff --git a/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityProcessorTool.cxx b/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityProcessorTool.cxx
index 900859b0b5b314bd96247de432c689d675550045..f9079e1e0b358b9d80ba26f0d91c72c7f28e4beb 100644
--- a/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityProcessorTool.cxx
+++ b/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityProcessorTool.cxx
@@ -14,6 +14,7 @@
 #include "InDetRecToolInterfaces/IPixelClusterSplitProbTool.h"
 #include "TrkExInterfaces/IExtrapolator.h"
 #include "TrkTrackSummary/TrackSummary.h"
+#include "TrkCaloClusterROI/CaloClusterROI_Collection.h"
 
 #include <map>
 #include <ext/functional>
@@ -22,6 +23,7 @@
 
 #include "InDetPrepRawData/PixelCluster.h"
 #include "InDetPrepRawData/SCT_Cluster.h"
+#include "InDetIdentifier/PixelID.h"
 
 
 #ifdef SIMPLEAMBIGPROCDEBUGCODE
@@ -116,6 +118,13 @@ Trk::DenseEnvironmentsAmbiguityProcessorTool::DenseEnvironmentsAmbiguityProcesso
   declareProperty("SplitClusterAmbiguityMap" , m_splitClusterMapName);//Unused Remove later
   declareProperty("MonitorAmbiguitySolving"  , m_monitorTracks = false);
 
+  //To determine the ROI for high pt Bs
+  declareProperty("doHadCaloSeed"        ,m_useHClusSeed = false );
+  declareProperty("minPtBjetROI"         ,m_minPtBjetROI = 15000.); //inMeV
+  declareProperty("phiWidth"             ,m_phiWidth     = 0.1   );
+  declareProperty("etaWidth"             ,m_etaWidth     = 0.1   );
+  declareProperty("InputHadClusterContainerName",m_inputHadClusterContainerName="InDetHadCaloClusterROIs");
+
 #ifdef SIMPLEAMBIGPROCDEBUGCODE
   declareProperty("ResolvedTrackConnection", m_resolvedTrackConnection="SiSPS_ResolvedTrackConnection");
   declareProperty("TruthCollection", m_truthCollection="SiSPSeededTracksTruthCollection");
@@ -177,6 +186,22 @@ StatusCode Trk::DenseEnvironmentsAmbiguityProcessorTool::initialize()
   
   ATH_CHECK(m_assoTool.retrieve()) ;
    
+  sc = detStore()->retrieve(m_pixelId, "PixelID");
+  if (sc.isFailure())
+  {
+    ATH_MSG_FATAL( "Could not get PixelID helper !" );
+    return StatusCode::FAILURE;
+  }
+
+  sc = detStore()->retrieve(m_idHelper, "AtlasID");
+  if (sc.isFailure())
+  {
+    ATH_MSG_FATAL( "Could not get AtlasDetectorID helper" );
+    return StatusCode::FAILURE;
+  }
+
+  ATH_CHECK(m_assoTool.retrieve()) ;
+  
   // suppress refit overwrites force refit
   if (m_forceRefit && m_suppressTrackFit ) 
   {
@@ -199,6 +224,9 @@ StatusCode Trk::DenseEnvironmentsAmbiguityProcessorTool::initialize()
   if (m_tryBremFit)
     ATH_MSG_INFO( "Try brem fit and recovery for electron like tracks." );
 
+  //Initialise the ROI tool
+  ATH_CHECK(m_inputHadClusterContainerName.initialize(m_useHClusSeed));
+
   // statistics
   for (int i=0; i<4; i++) {
     m_Ncandidates[i]      = 0;
@@ -800,6 +828,9 @@ void Trk::DenseEnvironmentsAmbiguityProcessorTool::solveTracks()
     // clean it out to make sure not to many shared hits
     ATH_MSG_VERBOSE ("--- Trying next track "<<itnext->second.first<<"\t with score "<<-itnext->first);
     const Trk::Track* cleanedTrack = m_selectionTool->getCleanedOutTrack( itnext->second.first , -(itnext->first));
+    //Find the HighPtBROI
+    reloadHadROIs();
+    bool refitBTracks = decideIfInHighPtBROI(itnext->second.first);
 
     // cleaned track is input track and fitted
     if (cleanedTrack == itnext->second.first && itnext->second.second )
@@ -813,12 +844,38 @@ void Trk::DenseEnvironmentsAmbiguityProcessorTool::solveTracks()
       if (m_tryBremFit && itnext->second.first->info().trackProperties(Trk::TrackInfo::BremFit))
         increment_by_eta(m_NacceptedBrem,itnext->second.first);
 
-      // add track to PRD_AssociationTool
-      StatusCode sc = m_selectionTool->registerPRDs(itnext->second.first);
-      if (sc.isFailure()) ATH_MSG_ERROR( "addPRDs() failed" );
-      // add to output list 
-      m_finalTracks->push_back( const_cast<Track*>(itnext->second.first) );
-
+      //Compute the fitQuality
+      double fitQual = 0;
+      if ( itnext->second.second ) {
+        if  (itnext->second.first->fitQuality() && itnext->second.first->fitQuality()->numberDoF()>0 ){ 
+          fitQual = itnext->second.first->fitQuality()->chiSquared()/itnext->second.first->fitQuality()->numberDoF();
+        }
+      } 
+      if(fitQual > 1.3 && refitBTracks){
+        const Trk::Track* refittedTrack = refitTracksFromB(itnext->second.first, fitQual);
+        if(refittedTrack){
+          // add track to PRD_AssociationTool
+          StatusCode sc = m_selectionTool->registerPRDs(refittedTrack);
+          if (sc.isFailure()) ATH_MSG_ERROR( "addPRDs() failed" );
+          // add to output list 
+          m_finalTracks->push_back( const_cast<Track*>(refittedTrack) );
+          delete (cleanedTrack);
+        }
+        else{
+          // add track to PRD_AssociationTool
+          StatusCode sc = m_selectionTool->registerPRDs(itnext->second.first);
+          if (sc.isFailure()) ATH_MSG_ERROR( "addPRDs() failed" );
+          // add to output list 
+          m_finalTracks->push_back( const_cast<Track*>(itnext->second.first) );
+        }
+      } 
+      else {
+        // add track to PRD_AssociationTool
+        StatusCode sc = m_selectionTool->registerPRDs(itnext->second.first);
+        if (sc.isFailure()) ATH_MSG_ERROR( "addPRDs() failed" );
+        // add to output list 
+        m_finalTracks->push_back( const_cast<Track*>(itnext->second.first) );
+      }
 
 
       // don't forget to drop track from map
@@ -1513,6 +1570,161 @@ void Trk::DenseEnvironmentsAmbiguityProcessorTool::storeTrkDistanceMapdR( const
   return;
 }
 
+//============================================================================================================
+bool Trk::DenseEnvironmentsAmbiguityProcessorTool::decideIfInHighPtBROI(const Trk::Track* ptrTrack)
+{
+  // Are we in a ROI?
+  bool inROIandPTok(true);
+  if(  ptrTrack->trackParameters()->front() ){
+    if(  ptrTrack->trackParameters()->front()->pT() < m_minPtBjetROI ){
+      inROIandPTok = false;
+      return false;
+    }
+    if(inROIandPTok){
+
+      bool inROI  = m_useHClusSeed && isHadCaloCompatible(*ptrTrack->trackParameters()->front());
+      return inROI;
+    }
+    else
+      return false;
+  } else
+    return false;
+}
+
+//============================================================================================================
+bool Trk::DenseEnvironmentsAmbiguityProcessorTool::isHadCaloCompatible(const Trk::TrackParameters& Tp) const
+{
+  const double pi = M_PI, pi2 = 2.*M_PI;
+    if(m_hadF.empty()) return false;
+  
+  auto f = m_hadF.begin(), fe = m_hadF.end();
+  auto e = m_hadE.begin();
+  auto r = m_hadR.begin();
+  auto z = m_hadZ.begin();
+  
+  double F = Tp.momentum().phi();
+  double E = Tp.eta();
+  
+  for(; f!=fe; ++f) {
+    double df = fabs(F-(*f));
+    if(df > pi        ) df = fabs(pi2-df);
+    if(df < m_phiWidth) {
+      //Correct eta of cluster to take into account the z postion of the track
+      double newZ   = *z - Tp.position().z();
+      double newEta =  atanh( newZ / sqrt( (*r) * (*r) + newZ*newZ ) );
+  
+      double de = fabs(E-newEta);
+      if(de < m_etaWidth) return true;
+    }
+    ++e;
+    ++r;
+    ++z;
+  }
+  return false;
+}
+
+//============================================================================================================
+void Trk::DenseEnvironmentsAmbiguityProcessorTool::reloadHadROIs()
+{
+  if(m_useHClusSeed) {
+    m_hadF.clear();
+    m_hadE.clear();
+    m_hadR.clear();
+    m_hadZ.clear();
+  
+    SG::ReadHandle<CaloClusterROI_Collection> calo(m_inputHadClusterContainerName);
+    for( const auto& ccROI : *calo) {
+      m_hadF.push_back( ccROI->globalPosition().phi() );
+      m_hadE.push_back( ccROI->globalPosition().eta() );
+      m_hadR.push_back( ccROI->globalPosition().perp() );
+      m_hadZ.push_back( ccROI->globalPosition().z() );
+    }
+  }
+}
+   
+//============================================================================================================
+void Trk::DenseEnvironmentsAmbiguityProcessorTool::removeInnerHits(std::vector<const Trk::MeasurementBase*>& measurements) const
+{
+  int count = 0; 
+  for (size_t i=0; i < measurements.size(); ++i){
+    const Trk::RIO_OnTrack* rio = dynamic_cast <const Trk::RIO_OnTrack*>(measurements.at(i));
+    if (rio != 0) {
+      const Identifier& surfaceID = (rio->identify()) ;                            
+      if(m_idHelper->is_pixel(surfaceID) && count ==0){  
+        //Only do this if we want to remove the pixel hits 
+        const Identifier& id = m_pixelId->wafer_id(surfaceID);
+        int layerDisk = m_pixelId -> layer_disk(id);
+        if (layerDisk < 3){
+          measurements.erase(measurements.begin()+i);
+          break;
+        }
+        else{
+          break;
+        }
+      }
+      else 
+        break;
+    }
+  }
+}
+
+//============================================================================================================
+const Trk::Track* Trk::DenseEnvironmentsAmbiguityProcessorTool::refitTracksFromB(const Trk::Track* track, double fitQualityOriginal) const 
+{
+  const Trk::TrackParameters* par = track->perigeeParameters();
+  if (par==0) {
+    par = track->trackParameters()->front();
+    if (par==0) {
+      ATH_MSG_DEBUG ("Track ("<<track<<") has no Track Parameters ! No refit !");
+      return 0;
+    }
+  }
+  
+  //std::vector<const Trk::MeasurementBase*>* measurementSet = new std::vector<const Trk::MeasurementBase*>;
+  std::vector<const Trk::MeasurementBase*> measurementSet;
+  //store all silicon measurements into the measurementset
+  DataVector<const Trk::TrackStateOnSurface>::const_iterator trackStateOnSurface = track->trackStateOnSurfaces()->begin();
+  for ( ; trackStateOnSurface != track->trackStateOnSurfaces()->end(); ++trackStateOnSurface ) {
+    if ( !(*trackStateOnSurface) ){
+      ATH_MSG_WARNING( "This track contains an empty MeasurementBase object that won't be included in the fit" );
+      continue;
+    }
+    if ( (*trackStateOnSurface)->measurementOnTrack() ){
+      if ( (*trackStateOnSurface)->type( Trk::TrackStateOnSurface::Measurement) ){
+        const Trk::RIO_OnTrack* rio = dynamic_cast <const Trk::RIO_OnTrack*>( (*trackStateOnSurface)->measurementOnTrack() );
+        if (rio != 0) {
+          const Identifier& surfaceID = (rio->identify()) ;                            
+          if(m_idHelper->is_pixel(surfaceID)|| m_idHelper->is_sct(surfaceID)) {
+            measurementSet.push_back( (*trackStateOnSurface)->measurementOnTrack() );
+          }
+        }
+      }
+    }
+  }
+
+  size_t previousMeasSize = measurementSet.size();
+  while (true){
+    removeInnerHits(measurementSet); 
+    if(measurementSet.size()>4){
+      const Trk::Track* refittedTrack = fit(measurementSet,*par,true,Trk::pion);
+      double fitQualPostRefit = 10;
+      if  (refittedTrack && refittedTrack->fitQuality() && refittedTrack->fitQuality()->numberDoF()!=0 ) 
+        fitQualPostRefit = refittedTrack->fitQuality()->chiSquared()/refittedTrack->fitQuality()->numberDoF(); 
+      if (fitQualityOriginal/fitQualPostRefit > 1){
+        if ( fitQualityOriginal/fitQualPostRefit > 1.2){
+          return refittedTrack;
+        }
+      }
+      if (previousMeasSize == measurementSet.size()){
+        return 0;
+      }
+      previousMeasSize = measurementSet.size();
+    } else {
+      //cannot refit the track because we do not have enough measurements
+      return 0;
+    }
+  }
+}
 
 
 //==================================================================================================
diff --git a/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityProcessorTool.h b/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityProcessorTool.h
index 8749b7c2d98ba8d7fe311ac783ad29e4d9a81929..53f768114a521897406b2463f08a246f437c4a90 100644
--- a/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityProcessorTool.h
+++ b/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityProcessorTool.h
@@ -18,6 +18,7 @@
 #include "InDetPrepRawData/PixelGangedClusterAmbiguities.h"
 #include "TrkValInterfaces/ITrkObserverTool.h"
 #include "TrkAmbiguityProcessor/dRMap.h"
+#include "TrkCaloClusterROI/CaloClusterROI_Collection.h"
 
 
 //need to include the following, since its a typedef and can't be forward declared.
@@ -127,6 +128,19 @@ namespace Trk {
       void storeTrkDistanceMapdR(const TrackCollection& tracks,
                                  std::vector<const Trk::Track*> &refit_tracks_out );
       
+      /** refit Tracks that are in the region of interest and removes inner hits that are wrongly assigned*/
+      void removeInnerHits(std::vector<const Trk::MeasurementBase*>& measurements) const;
+      const Trk::Track* refitTracksFromB(const Trk::Track* track,double fitQualityOriginal) const;
+     
+      /** see if we are in the region of interest for B tracks*/
+      bool decideIfInHighPtBROI(const Trk::Track*);
+
+      /** Check if the cluster is compatible with a hadronic cluster*/
+      bool isHadCaloCompatible(const Trk::TrackParameters& Tp) const;
+
+      /** Load the clusters to see if they are compatibles with ROI*/
+      void reloadHadROIs();
+
       /**  Find SiS Tracks that share hits in the track score map*/
       void overlapppingTracks();
      
@@ -140,6 +154,8 @@ namespace Trk {
 
       Trk::Track *fit(std::vector<const Trk::PrepRawData*> &raw,
       			const TrackParameters &param, bool flag, Trk::ParticleHypothesis hypo) const;
+      Trk::Track *fit(std::vector<const Trk::MeasurementBase*> &measurements,
+      			const TrackParameters &param, bool flag, Trk::ParticleHypothesis hypo) const;
       template<typename... Args>
       Trk::Track *fit(const Track &track, Args... args) const;
       bool _checkTrack(const Trk::Track *) const;
@@ -169,6 +185,18 @@ namespace Trk {
       /** suppress Track Fit */ 
       bool m_suppressTrackFit;
 
+      /** variables to decide if we are in a ROI */
+      bool m_useHClusSeed;
+      float m_minPtBjetROI;
+      float m_phiWidth;
+      float m_etaWidth;
+      SG::ReadHandleKey<CaloClusterROI_Collection> m_inputHadClusterContainerName;
+
+      std::vector<double>   m_hadF;
+      std::vector<double>   m_hadE;
+      std::vector<double>   m_hadR;
+      std::vector<double>   m_hadZ;
+
       /** control material effects (0=non-interacting, 1=pion, 2=electron, 3=muon, 4=pion) read in as an integer 
       read in as an integer and convert to particle hypothesis */
       int m_matEffects;
@@ -202,6 +230,10 @@ namespace Trk {
        tracks */ 
       ToolHandle<Trk::IPRD_AssociationTool> m_assoTool;
       
+      /**These allow us to retrieve the helpers*/
+      const PixelID* m_pixelId;
+      const AtlasDetectorID* m_idHelper;
+      
       /** unsorted container of track and track scores.*/
       TrackScoreMap m_trackScoreTrackMap;
     
@@ -289,7 +321,6 @@ namespace Trk {
       bool isSharedTrack( const Track* track);
       bool isTrueTrack( const Track* track);
 
-      const PixelID* m_pixelId;
 
       void addTrackToMap(Trk::Track* Tr);
       void findSharedTrueTracks(const TrackCollection* recTracks);    
@@ -333,6 +364,27 @@ namespace Trk {
          return new_track;
       }
 
+      inline
+      Trk::Track *DenseEnvironmentsAmbiguityProcessorTool::fit(std::vector<const Trk::MeasurementBase*> &measurements, const TrackParameters &param, bool flag, Trk::ParticleHypothesis hypo) const
+      {
+        Trk::Track *new_track=nullptr;
+        for ( const ToolHandle<ITrackFitter> &a_fitter : m_fitterTool) {
+           delete new_track;
+           new_track=nullptr;
+           new_track =  a_fitter->fit(measurements, param, flag, hypo);
+           if (Trk::DenseEnvironmentsAmbiguityProcessorTool::_checkTrack(new_track)) {
+              return new_track;
+           }
+           ATH_MSG_WARNING( "The track fitter, " <<  a_fitter->name() << ", produced a track with an invalid covariance matrix." );
+        }
+        ATH_MSG_WARNING( "None of the " <<  m_fitterTool.size() << " track fitter(s) produced a track with a valid covariance matrix." );
+        if (m_rejectInvalidTracks) {
+          delete new_track;
+          new_track=nullptr;
+        }
+        return new_track;
+      }
+
       template<typename... Args>
       inline
       Trk::Track *DenseEnvironmentsAmbiguityProcessorTool::fit(const Track &track, Args... args) const
diff --git a/Tracking/TrkValidation/TrkValTools/CMakeLists.txt b/Tracking/TrkValidation/TrkValTools/CMakeLists.txt
index d543728bfe8306a23083b1af1ae3ca50a7bfd041..2a5b2f60aeed9b87d8df6e4e4d4a9694241acb4f 100644
--- a/Tracking/TrkValidation/TrkValTools/CMakeLists.txt
+++ b/Tracking/TrkValidation/TrkValTools/CMakeLists.txt
@@ -8,6 +8,7 @@ atlas_subdir( TrkValTools )
 # Declare the package's dependencies:
 atlas_depends_on_subdirs( PUBLIC
                           Control/AthenaBaseComps
+                          Control/AthenaMonitoring
                           Control/AthContainers
                           Control/SGTools
                           Event/xAOD/xAODTracking
@@ -18,9 +19,22 @@ atlas_depends_on_subdirs( PUBLIC
                           Tracking/TrkTools/TrkToolInterfaces
                           Tracking/TrkValidation/TrkValEvent
                           Tracking/TrkValidation/TrkValInterfaces
+                          InnerDetector/InDetRecTools/InDetTrackSelectionTool
+                          GaudiKernel
+                          Event/xAOD/xAODCore
+                          Event/xAOD/xAODJet
+                          Event/xAOD/xAODTruth
+                          Event/xAOD/xAODEventInfo
+                          Event/xAOD/xAODPFlow
+                          Event/xAOD/xAODCaloEvent
+                          InnerDetector/InDetRecTools/TrackVertexAssociationTool
+                          Tracking/TrkValidation/TrkValTools/TrkValTools/HighPtBTrackingAnalysis                         PRIVATE
+                          Commission/CommissionEvent
                           PRIVATE
                           Commission/CommissionEvent
                           DetectorDescription/AtlasDetDescr
+                          Control/AthToolSupport/AsgTools
+                          Control/AthenaKernel
                           Event/EventInfo
                           Event/EventPrimitives
                           Generators/GeneratorObjects
@@ -34,20 +48,24 @@ atlas_depends_on_subdirs( PUBLIC
                           Tracking/TrkEvent/TrkTrackSummary
                           Tracking/TrkEvent/TrkTruthData
                           Tracking/TrkExtrapolation/TrkExInterfaces
-                          Tracking/TrkFitter/TrkFitterUtils )
+                          Tracking/TrkFitter/TrkFitterUtils
+                          Tools/PathResolver)
 
 # External dependencies:
 find_package( CLHEP )
 find_package( HepMC )
 find_package( HepPDT )
-find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread Graf Graf3d Gpad Html Postscript Gui GX11TTF GX11 )
+find_package( ROOT COMPONENTS Core EG Tree MathCore Hist RIO pthread Graf Graf3d Gpad Html Postscript Gui GX11TTF GX11 )
+find_package( Eigen )
+find_package( XercesC )
+find_package( Boost )
 
 # Component(s) in the package:
 atlas_add_component( TrkValTools
                      src/*.cxx
                      src/components/*.cxx
                      INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${HEPPDT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${HEPMC_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${ROOT_LIBRARIES} ${HEPPDT_LIBRARIES} ${CLHEP_LIBRARIES} ${HEPMC_LIBRARIES} AthenaBaseComps AthContainers SGTools xAODTracking GaudiKernel TrkEventPrimitives TrkParameters TrkTrack TrkToolInterfaces TrkValEvent TrkValInterfaces CommissionEvent AtlasDetDescr EventInfo EventPrimitives GeneratorObjects TrkSurfaces TrkCompetingRIOsOnTrack TrkEventUtils TrkMaterialOnTrack TrkMeasurementBase TrkParticleBase TrkRIO_OnTrack TrkTrackSummary TrkTruthData TrkExInterfaces TrkFitterUtils )
+                     LINK_LIBRARIES ${ROOT_LIBRARIES} ${HEPPDT_LIBRARIES} ${CLHEP_LIBRARIES} ${HEPMC_LIBRARIES} AthenaBaseComps AthContainers SGTools xAODTracking GaudiKernel TrkEventPrimitives TrkParameters TrkTrack TrkToolInterfaces TrkValEvent TrkValInterfaces CommissionEvent AtlasDetDescr EventInfo EventPrimitives GeneratorObjects TrkSurfaces TrkCompetingRIOsOnTrack TrkEventUtils TrkMaterialOnTrack TrkMeasurementBase TrkParticleBase TrkRIO_OnTrack TrkTrackSummary TrkTruthData TrkExInterfaces TrkFitterUtils xAODTruth xAODJet xAODPFlow xAODCaloEvent xAODCore xAODEventInfo AsgTools AthenaKernel AthenaMonitoringLib)
 
 # Install files from the package:
 atlas_install_headers( TrkValTools )