diff --git a/Calorimeter/CaloEvent/CaloEvent/CaloEventDict.h b/Calorimeter/CaloEvent/CaloEvent/CaloEventDict.h
index d8a11adf072aee204739b544d025212c5047adc5..e03d3b90afee13bb98f618425d047d3debe3a0a6 100644
--- a/Calorimeter/CaloEvent/CaloEvent/CaloEventDict.h
+++ b/Calorimeter/CaloEvent/CaloEvent/CaloEventDict.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 /***************************************************************************
@@ -63,6 +63,8 @@ namespace CaloDict{
     ElementLink<CaloShowerContainer>                     m_link4;
     std::pair<ElementLink<CaloShowerContainer>,double>   m_pair4;
 
+    std::pair<unsigned int,double>                       m_pair5;
+
     Navigable<CaloCellLinkContainer,double>              m_navCellLink;
     Navigable<CaloClusterContainer,double>               m_navCluster;
 
diff --git a/Calorimeter/CaloEvent/CaloEvent/selection.xml b/Calorimeter/CaloEvent/CaloEvent/selection.xml
index 778b68a7fdefdf00518ef5661f414fd1e1fb7ec2..d3bda1520a875e14fece5773c91acbd1af11a4ce 100644
--- a/Calorimeter/CaloEvent/CaloEvent/selection.xml
+++ b/Calorimeter/CaloEvent/CaloEvent/selection.xml
@@ -54,7 +54,7 @@
 
   <class name="CaloClusterCellLink" />
   <class name="std::vector<std::pair<unsigned int,double> >" />
-  <class name="std::pair<unsigned int,double>" />
+  <class pattern="std::*pair*<unsigned int*double>" />
   <class name="DataVector<CaloClusterCellLink>" />
   <class name="CaloClusterCellLinkContainer"
 	 id="545AC204-2749-4AAC-9783-B1E5A7A0030F" />
diff --git a/Control/AthenaConfiguration/python/AthConfigFlags.py b/Control/AthenaConfiguration/python/AthConfigFlags.py
index 4526e852f760e7cbeb14bfb0b56c10bc12d4d370..5a88f12536e64a6054af6d55209d3249a943f7e1 100644
--- a/Control/AthenaConfiguration/python/AthConfigFlags.py
+++ b/Control/AthenaConfiguration/python/AthConfigFlags.py
@@ -236,6 +236,36 @@ class AthConfigFlags(object):
             f.get(self)
         return
 
+
+    def fillFromArgs(self,listOfArgs=None):
+        """
+        Expects a list of strings of key=value pairs representing configuration flags. 
+        Used to set flags from command-line parameters, like ConfigFlags.fillFromArgs(sys.argv[1:])
+        """
+        
+        if listOfArgs is None:
+            import sys
+            listOfArgs=sys.argv[1:]
+
+        for arg in listOfArgs:
+            #Safety check on arg: Contains exactly one '=' and left side is a valid flag
+            argsplit=arg.split("=")
+            if len(argsplit)!=2:
+                raise ValueError("Can't interpret argument %s, expected a key=value format" % arg)
+
+            key=argsplit[0].strip()
+            if not self.hasFlag(key):
+                raise KeyError("%s is not a known configuration flag" % key)
+            
+            #Arg looks good enough, just exec it:
+            argToExec="self."+arg
+
+            exec(argToExec)
+            pass
+        return
+
+
+
 import unittest
 class TestFlagsSetup(unittest.TestCase):    
     def setUp(self):
diff --git a/Control/StoreGate/StoreGate/CondHandleKey.h b/Control/StoreGate/StoreGate/CondHandleKey.h
index c5ba0717e487ce9b5b69ff821c6dfd6d10b29ef3..0a0f4831eb0fce70bcd643341e4c376a85d98ad4 100644
--- a/Control/StoreGate/StoreGate/CondHandleKey.h
+++ b/Control/StoreGate/StoreGate/CondHandleKey.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef STOREGATE_CONDHANDLEKEY_H
@@ -25,7 +25,8 @@ namespace SG {
 
 //    CondHandleKey& operator= (const std::string& sgkey);
 
-    StatusCode initialize();
+    StatusCode initialize(bool used = true);
+    StatusCode initialize (AllowEmptyEnum);
 
     const std::string& dbKey() const { return m_dbKey; }
     void setDbKey(const std::string& dbKey) { m_dbKey = dbKey; }
diff --git a/Control/StoreGate/StoreGate/CondHandleKey.icc b/Control/StoreGate/StoreGate/CondHandleKey.icc
index 6b36756ca42328049ebe0d40038db8bbbe3eef3d..98bb1297b098fcab02238b6eddae276274a2159c 100644
--- a/Control/StoreGate/StoreGate/CondHandleKey.icc
+++ b/Control/StoreGate/StoreGate/CondHandleKey.icc
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "AthenaKernel/StoreID.h"
@@ -24,13 +24,14 @@ namespace SG {
   
   template <class T>
   StatusCode
-  CondHandleKey<T>::initialize() {
+  CondHandleKey<T>::initialize(bool used /*= true*/) {
     if (m_isInit) return StatusCode::SUCCESS;
     
 
-    if (VarHandleKey::initialize() != StatusCode::SUCCESS) {
+    if (VarHandleKey::initialize(used) != StatusCode::SUCCESS) {
       return StatusCode::FAILURE;
     }
+    if (empty()) return StatusCode::SUCCESS;
 
     if (!m_cs.isValid()) {
       MsgStream msg(Athena::getMessageSvc(), "CondHandleKey");
@@ -94,6 +95,14 @@ namespace SG {
 
   }
 
+  template <class T>
+  StatusCode
+  CondHandleKey<T>::initialize(AllowEmptyEnum) {
+    if (key().empty()) {
+      return StatusCode::SUCCESS;
+    }
+    return initialize (true);
+  }
 //---------------------------------------------------------------------------
 
   template <class T>
diff --git a/Control/StoreGate/StoreGate/ReadCondHandle.h b/Control/StoreGate/StoreGate/ReadCondHandle.h
index 4090e9672e35430bfeb5025de97dc5c2b3db5d23..13ca37fac51a12dfc575adeed09a6c6a780e08bf 100644
--- a/Control/StoreGate/StoreGate/ReadCondHandle.h
+++ b/Control/StoreGate/StoreGate/ReadCondHandle.h
@@ -50,7 +50,8 @@ namespace SG {
     const_pointer_type retrieve( const EventIDBase& t);
 
     const_pointer_type  operator->()  { return  retrieve(); }
-    const_pointer_type  operator*()   { return  retrieve(); }   
+    const_pointer_type  operator*()   { return  retrieve(); }
+    const_pointer_type  cptr()        { return  retrieve(); }
 
     
     bool isValid();
diff --git a/Event/EventCommonTPCnv/EventCommonTPCnv/OLD_selection.xml b/Event/EventCommonTPCnv/EventCommonTPCnv/OLD_selection.xml
index 1d9efdd2719b1f025d7c391f4c17d18f11bee08b..95150885f13685b5e5b25b3236ddd54f6b3577b1 100755
--- a/Event/EventCommonTPCnv/EventCommonTPCnv/OLD_selection.xml
+++ b/Event/EventCommonTPCnv/EventCommonTPCnv/OLD_selection.xml
@@ -4,6 +4,7 @@
 
   <class name="INav4MomAssocs_p2" id="8040BEAA-BC65-43B8-B468-A7157C89ACB3" />
   <class name="INav4MomAssocs_p2::Assocs_t" />
-  <class name="INav4MomAssocs_p2::AssocElem_t" />
+  <!-- pick up INav4MomAssocs_p2::AssocElem_t and associated pair_base -->
+  <class pattern="std::*pair*<ElementLink_p2<unsigned int>,*"/>
 
 </lcgdict>
diff --git a/Event/EventCommonTPCnv/EventCommonTPCnv/selection.xml b/Event/EventCommonTPCnv/EventCommonTPCnv/selection.xml
index 3da9ee9620f131537a651d17c9fb9a6b8fe774ec..e25f13d8d267b0f2fbe1085895574bc594725faf 100755
--- a/Event/EventCommonTPCnv/EventCommonTPCnv/selection.xml
+++ b/Event/EventCommonTPCnv/EventCommonTPCnv/selection.xml
@@ -18,7 +18,8 @@
 
   <class name="INav4MomAssocs_p3" id="455AEE6B-9834-4E72-8F81-2532A52E3BE7" />
   <class name="INav4MomAssocs_p3::Assocs_t" />
-  <class name="INav4MomAssocs_p3::AssocElem_t" />
+  <!-- pick up INav4MomAssocs_p3::AssocElem_t and associated pair_base -->
+  <class pattern="std::*pair*<ElementLink_p3<unsigned int>,*"/>
 
   <class name="INav4MomLinkContainer_p1" id="A7F0A4C5-F343-4724-B317-FB5A890355FA" />
   <class name="IParticleLinkContainer_p1" id="E82C71AF-AC5C-453B-9A35-FA45A849838E" />
diff --git a/Event/xAOD/xAODTracking/Root/Vertex_v1.cxx b/Event/xAOD/xAODTracking/Root/Vertex_v1.cxx
index f81c836967167b74d92dc9576518a49b6f73ce38..38d19abcb514bc3bb4f3cf94eee28846f6cc77d6 100644
--- a/Event/xAOD/xAODTracking/Root/Vertex_v1.cxx
+++ b/Event/xAOD/xAODTracking/Root/Vertex_v1.cxx
@@ -99,7 +99,7 @@ namespace xAOD {
       setY( position( 1 ) );
       setZ( position( 2 ) );
       // Reset the cache
-      m_position.reset();
+      m_position.store(position);
       return;
    }
 
@@ -124,7 +124,7 @@ namespace xAOD {
 
      // Set the persistent variable:
      setCovariance( vec );
-     m_covariance.reset();
+     m_covariance.store(cov);
      return;
    }
 
diff --git a/HLT/Trigger/TrigControl/TrigExamples/TrigExPartialEB/share/MTCalibPeb.py b/HLT/Trigger/TrigControl/TrigExamples/TrigExPartialEB/share/MTCalibPeb.py
index 39a5cc62d8f2acb1fa1e562f301c6f26eb16947b..cffdd5f7c3f608a1e46c88a227f3ee3e01eb0687 100644
--- a/HLT/Trigger/TrigControl/TrigExamples/TrigExPartialEB/share/MTCalibPeb.py
+++ b/HLT/Trigger/TrigControl/TrigExamples/TrigExPartialEB/share/MTCalibPeb.py
@@ -78,16 +78,17 @@ hypoTool2.RandomAcceptRate = 0.25
 hypoTool2.BurnTimePerCycleMillisec = 20
 hypoTool2.NumBurnCycles = 10
 hypoTool2.TimeBetweenROBReqMillisec = 50
+exampleROBList = [0x420024, 0x420025, 0x420026, 0x420027, 0x420034, 0x420035, 0x420036, 0x420037,
+                  0x42005c, 0x42005d, 0x42005e, 0x42005f, 0x42006c, 0x42006d, 0x42006e, 0x42006f] # ROS-LAR-EMBC-02
 hypoTool2.ROBAccessDict = {
- "01 :ADD: Preload  ": [ 0x42002a, 0x42002b ],    # robs for 1st preload
- "02 :ADD: Preload  ": [ 0x42002e, 0x42002f ],    # robs for 2nd preload
- "03 :GET: Retrieve ": [ 0x42002e, 0x420060 ],    # robs for 1st retrieval
- "04 :ADD: Preload  ": [ 0x420060 ],              # robs for 3rd preload
- "05 :ADD: Preload  ": [ 0x420064 ],              # robs for 4th preload
- "06 :ADD: Preload  ": [ 0x42002e, 0x420060 ],    # robs for 5th preload
- "07 :GET: Retrieve ": [ 0x420060 ],              # robs for 2nd retrieval
- "08 :GET: Retrieve ": [ 0x420064 ],              # robs for 3rd retrieval
- "09 :COL: Ev.Build ": [ 0x0 ]                    # event building
+ "01 :ADD:       Preload ":  [ 0x420024, 0x420025 ], # robs for 1st preload
+ "02 :ADD:       Preload ":  [ 0x420026, 0x420027 ], # robs for 2nd preload
+ "03 :GET:       Retrieve ": [ 0x420025, 0x420026 ], # robs for 1st retrieval (prefetched)
+ "04 :GET:       Retrieve ": [ 0x420034 ],           # robs for 2nd retrieval (not prefetched)
+ "05 :ADD:       Preload ":  exampleROBList,         # robs for 3rd preload (the full list)
+ "05 :GET:RND5:  Retrieve ": exampleROBList,         # robs for 3rd retrieval (5 random from the list)
+ "06 :GET:RND10: Retrieve ": exampleROBList,         # robs for 4th retrieval (10 random from the list)
+ "07 :COL:       Ev.Build ": []                      # event building
 } # This is just an example with a few ROBs (LAr in this case) for testing the ROBDataProvider
 
 # Chain 3 - medium rate, produces random data, writes PEB info for data scouting
@@ -115,7 +116,7 @@ from TrigOutputHandling.TrigOutputHandlingConfig import TriggerEDMSerialiserTool
 serialiser = TriggerEDMSerialiserToolCfg("Serialiser")
 serialiser.addCollectionListToMainResult([
   "xAOD::TrigCompositeContainer_v1#"+hypo.HypoOutputDecisions,
-  "xAOD::TrigCompositeAuxContainer_v2#"+hypo.HypoOutputDecisions+"Aux.decisions",
+  "xAOD::TrigCompositeAuxContainer_v2#"+hypo.HypoOutputDecisions+"Aux.",
 ])
 # Data scouting example
 resultList = [serialiser.fullResultID(), 1]
diff --git a/HLT/Trigger/TrigControl/TrigExamples/TrigExPartialEB/src/MTCalibPebHypoTool.cxx b/HLT/Trigger/TrigControl/TrigExamples/TrigExPartialEB/src/MTCalibPebHypoTool.cxx
index 3786018d926326782991b2141c119921b7e676f6..f814488953e9a009ff886dbb8976732014d6f005 100644
--- a/HLT/Trigger/TrigControl/TrigExamples/TrigExPartialEB/src/MTCalibPebHypoTool.cxx
+++ b/HLT/Trigger/TrigControl/TrigExamples/TrigExPartialEB/src/MTCalibPebHypoTool.cxx
@@ -49,7 +49,7 @@ namespace {
   }
   /// Print helper for a container with ROB/SubDet IDs
   template<typename Container>
-  std::string idsToString(const Container& ids) {
+  const std::string idsToString(const Container& ids) {
     std::ostringstream str;
     for (const uint32_t id : ids)
       str << "0x" << std::hex << id << std::dec << " ";
@@ -128,6 +128,22 @@ StatusCode MTCalibPebHypoTool::initialize() {
                  [](const auto& p){return p.first;});
   ATH_CHECK(m_randomDataWHK.initialize());
 
+  // Parse and print the ROB request dictionary
+  for (const auto& [instrString,robVec] : m_robAccessDictProp.value()) {
+    m_robAccessDict.emplace_back(ROBRequestInstruction(instrString),robVec);
+    if (m_robAccessDict.back().first.type==ROBRequestInstruction::Type::INVALID) {
+      ATH_MSG_ERROR("Invalid instruction " << instrString);
+      return StatusCode::FAILURE;
+    }
+  }
+  if (msgLvl(MSG::DEBUG) && !m_robAccessDict.empty()) {
+    ATH_MSG_DEBUG(name() << " will execute the following ROB request instructions:");
+    for (const auto& [instr,robVec] : m_robAccessDict) {
+      ATH_MSG_DEBUG("---> Instruction : " << instr.toString());
+      ATH_MSG_DEBUG("     ROB list    : " << idsToString(robVec));
+    }
+  }
+
   return StatusCode::SUCCESS;
 }
 
@@ -162,35 +178,57 @@ StatusCode MTCalibPebHypoTool::decide(const MTCalibPebHypoTool::Input& input) co
   // ---------------------------------------------------------------------------
   // Prefetch or retrieve ROBs
   // ---------------------------------------------------------------------------
-  for (const auto& p : m_robAccessDict) {
+  for (const auto& [instr,robVec] : m_robAccessDict) {
     // Check for timeout
     if (Athena::Timeout::instance(input.eventContext).reached()) {
       ATH_MSG_ERROR("Timeout reached in ROB retrieval loop");
       return Athena::Status::TIMEOUT;
     }
-    const std::string& instruction = p.first;
-    const std::vector<uint32_t>& robs = p.second;
-    if (instruction.find(":ADD:")!=std::string::npos) {
-      // Prefetch ROBs
-      ATH_MSG_DEBUG("Preloading ROBs: " << idsToString(robs));
-      m_robDataProviderSvc->addROBData(input.eventContext, robs, name()+"-ADD");
-    }
-    if (instruction.find(":GET:")!=std::string::npos) {
-      // Retrieve ROBs
-      ATH_MSG_DEBUG("Retrieving ROBs: " << idsToString(robs));
-      // VROBFRAG = std::vector<const eformat::ROBFragment<const uint32_t*>* >
-      IROBDataProviderSvc::VROBFRAG robFragments;
-      m_robDataProviderSvc->getROBData(input.eventContext, robs, robFragments, name()+"-GET");
-      ATH_MSG_DEBUG("Number of ROBs retrieved: " << robFragments.size());
-      if (!robFragments.empty())
-        ATH_MSG_DEBUG("List of ROBs found: " << std::endl << robFragments);
+
+    // Select a random sample of ROBs from the list, if needed
+    ATH_MSG_DEBUG("Processing instruction " << instr.toString());
+    std::vector<uint32_t> robs;
+    if (instr.isRandom && instr.nRandom < robVec.size()) {
+      std::sample(robVec.begin(),robVec.end(),
+                  std::back_inserter(robs),
+                  instr.nRandom,
+                  threadLocalGenerator());
     }
-    if (instruction.find(":COL:")!=std::string::npos) {
-      // Event building
-      ATH_MSG_DEBUG("Requesting full event ROBs");
-      int nrobs = m_robDataProviderSvc->collectCompleteEventData(input.eventContext, name()+"-COL");
-      ATH_MSG_DEBUG("Number of ROBs retrieved: " << nrobs);
+    else robs = robVec;
+
+    // Execute the ROB requests
+    switch (instr.type) {
+      case ROBRequestInstruction::Type::ADD: {
+        // Prefetch ROBs
+        ATH_MSG_DEBUG("Preloading ROBs: " << idsToString(robs));
+        m_robDataProviderSvc->addROBData(input.eventContext, robs, name()+"-ADD");
+        break;
+      }
+      case ROBRequestInstruction::Type::GET: {
+        // Retrieve ROBs
+        ATH_MSG_DEBUG("Retrieving ROBs: " << idsToString(robs));
+        // VROBFRAG is a typedef for std::vector<const eformat::ROBFragment<const uint32_t*>*>
+        IROBDataProviderSvc::VROBFRAG robFragments;
+        m_robDataProviderSvc->getROBData(input.eventContext, robs, robFragments, name()+"-GET");
+        ATH_MSG_DEBUG("Number of ROBs retrieved: " << robFragments.size());
+        if (!robFragments.empty())
+          ATH_MSG_DEBUG("List of ROBs found: " << std::endl << robFragments);
+        break;
+      }
+      case ROBRequestInstruction::Type::COL: {
+        // Event building
+        ATH_MSG_DEBUG("Requesting full event ROBs");
+        int nrobs = m_robDataProviderSvc->collectCompleteEventData(input.eventContext, name()+"-COL");
+        ATH_MSG_DEBUG("Number of ROBs retrieved: " << nrobs);
+        break;
+      }
+      default: {
+        ATH_MSG_ERROR("Invalid ROB request instruction " << instr.toString());
+        return StatusCode::FAILURE;
+      }
     }
+
+    // Sleep between ROB requests
     std::this_thread::sleep_for(std::chrono::milliseconds(m_timeBetweenRobReqMillisec));
   }
 
@@ -238,3 +276,32 @@ StatusCode MTCalibPebHypoTool::decide(const MTCalibPebHypoTool::Input& input) co
 
   return StatusCode::SUCCESS;
 }
+
+// =============================================================================
+MTCalibPebHypoTool::ROBRequestInstruction::ROBRequestInstruction(std::string_view str) {
+  if (str.find(":ADD:")!=std::string_view::npos) type = ROBRequestInstruction::ADD;
+  else if (str.find(":GET:")!=std::string_view::npos) type = ROBRequestInstruction::GET;
+  else if (str.find(":COL:")!=std::string_view::npos) type = ROBRequestInstruction::COL;
+  if (size_t pos=str.find(":RND"); pos!=std::string_view::npos) {
+    size_t firstDigit=pos+4;
+    size_t lastDigit=str.find_first_of(":",firstDigit);
+    size_t num = std::stoul(str.substr(firstDigit,lastDigit).data());
+    isRandom = true;
+    nRandom = num;
+  }
+}
+
+// =============================================================================
+const std::string MTCalibPebHypoTool::ROBRequestInstruction::toString() const {
+  std::string s;
+  s += "type=";
+  if (type==INVALID) s+="INVALID";
+  else if (type==ADD) s+="ADD";
+  else if (type==GET) s+="GET";
+  else if (type==COL) s+="COL";
+  s += ", isRandom=";
+  s += isRandom ? "true" : "false";
+  s += ", nRandom=";
+  s += std::to_string(nRandom);
+  return s;
+}
\ No newline at end of file
diff --git a/HLT/Trigger/TrigControl/TrigExamples/TrigExPartialEB/src/MTCalibPebHypoTool.h b/HLT/Trigger/TrigControl/TrigExamples/TrigExPartialEB/src/MTCalibPebHypoTool.h
index 667d44cd73772847948bcf4ff2fdeecd43e1f186..8640bbdb5ec1e69871d451c53aef1d13ece13cd2 100644
--- a/HLT/Trigger/TrigControl/TrigExamples/TrigExPartialEB/src/MTCalibPebHypoTool.h
+++ b/HLT/Trigger/TrigControl/TrigExamples/TrigExPartialEB/src/MTCalibPebHypoTool.h
@@ -43,6 +43,21 @@ public:
   StatusCode decide(const Input& input) const;
 
 private:
+  // ------------------------- Types -------------------------------------------
+  ///  ROB request instruction description
+  struct ROBRequestInstruction {
+    /// Constructor from string key in the ROBAccessDict property
+    ROBRequestInstruction(std::string_view str);
+    /// String form for debug print-outs
+    const std::string toString() const;
+    /// Type of instruction
+    enum Type {INVALID, ADD, GET, COL} type = INVALID;
+    /// Flag switching requests of a random sub-sample of the ROB list
+    bool isRandom = false;
+    /// Size of random request
+    size_t nRandom = 0;
+  };
+
   // ------------------------- Properties --------------------------------------
   Gaudi::Property<double> m_acceptRate {
     this, "RandomAcceptRate", -1,
@@ -60,11 +75,14 @@ private:
     this, "BurnTimeRandomly", true,
     "If true, burn time per cycle is a random value from uniform distribution between 0 and the given value"
   };
-  Gaudi::Property<std::map<std::string,std::vector<uint32_t> > > m_robAccessDict {
+  Gaudi::Property<std::map<std::string,std::vector<uint32_t> > > m_robAccessDictProp {
     this, "ROBAccessDict", {},
-    "List of prefetch/retrieve operations with given ROB IDs."
-    "The string key has to contain :ADD: (prefetch), :GET: (retrieve), or :COL: (full event building)."
-    "The value is a vector of corresponding ROB IDs."
+    "Dictionary of prefetch/retrieve operations with given ROB IDs. The value is a vector of ROB IDs. "
+    "The string key has to contain :ADD: (prefetch), :GET: (retrieve), or :COL: (full event building). :ADD: and :GET: "
+    "may be also appended with :RNDX: where X is an integer. In this case, random X ROBs will be prefetched/retrieved "
+    "from the provided list, e.g. :GET:RND10: retrieves 10 random ROBs from the list. Otherwise the full list is used. "
+    "Note std::map is sorted by std::less<std::string>, so starting the key with a number may be needed to enforce "
+    "ordering, e.g. '01 :ADD:RND10:'."
   };
   Gaudi::Property<unsigned int> m_timeBetweenRobReqMillisec {
     this, "TimeBetweenROBReqMillisec", 0,
@@ -93,6 +111,8 @@ private:
   HLT::Identifier m_decisionId;
   /// WriteHandleKey array for collections specified in the CreateRandomData property
   SG::WriteHandleKeyArray<xAOD::TrigCompositeContainer> m_randomDataWHK;
+  /// Ordered map of ROB request instructions filled from ROBAccessDict property at initialisation
+  std::vector<std::pair<ROBRequestInstruction,std::vector<uint32_t>>> m_robAccessDict;
 };
 
 #endif // TRIGEXPARTIALEB_MTCALIBPEBHYPOTOOL_H
diff --git a/InnerDetector/InDetConditions/InDetByteStreamErrors/InDetByteStreamErrors/selection.xml b/InnerDetector/InDetConditions/InDetByteStreamErrors/InDetByteStreamErrors/selection.xml
index 0a98892d97d5c3bd37aa291127d5e7206dc55af0..f16c111734d294197a23febca45014ad05b3064c 100755
--- a/InnerDetector/InDetConditions/InDetByteStreamErrors/InDetByteStreamErrors/selection.xml
+++ b/InnerDetector/InDetConditions/InDetByteStreamErrors/InDetByteStreamErrors/selection.xml
@@ -1,10 +1,10 @@
 <lcgdict>	
-  <class name="std::pair<unsigned char, unsigned int>" />
+  <class pattern="std::*pair*<unsigned char*unsigned int>" />
   <class name="std::vector<std::pair<unsigned char, unsigned int>*>" />
   <class name="TRT_BSErrContainer"  id="9DEEFC74-1772-4A81-B83D-3D4A123603B8" />
 
-  <class name="std::pair<unsigned int, unsigned char>" />
-  <class name="std::pair<unsigned char, std::pair<unsigned int, unsigned char> >" />
+  <class pattern="std::*pair*<unsigned int*unsigned char>" />
+  <class pattern="std::*pair*<unsigned char*std::pair<unsigned int*unsigned char> >" />
   <class name="std::vector<std::pair<unsigned char, std::pair<unsigned int, unsigned char> >*>" />
 
   <class name="TRT_BSIdErrContainer"  id="60735BF7-1781-4023-AC1E-5A6456E66423" />
diff --git a/InnerDetector/InDetConditions/InDetCondFolders/python/InDetAlignFolders.py b/InnerDetector/InDetConditions/InDetCondFolders/python/InDetAlignFolders.py
index 3b14da63b092d3415cb70472a1bac8f6f98948fb..531dae9a8b16850820252d504f27fd199ce39c53 100644
--- a/InnerDetector/InDetConditions/InDetCondFolders/python/InDetAlignFolders.py
+++ b/InnerDetector/InDetConditions/InDetCondFolders/python/InDetAlignFolders.py
@@ -14,12 +14,12 @@ topSequence = AlgSequence()
 conddb.addFolderSplitOnline("TRT","/TRT/Onl/Calib/DX","/TRT/Calib/DX")
 
 # Dead/Noisy Straw Lists
-if DetFlags.simulate.any_on() or hasattr(topSequence,"OutputConditionsAlg"): # revert to old style CondHandle in case of simulation or streaming to POOL
+if hasattr(topSequence,"OutputConditionsAlg"): # revert to old style CondHandle in case streaming to POOL
     conddb.addFolderSplitOnline("TRT","/TRT/Onl/Cond/Status","/TRT/Cond/Status")
 else:
     conddb.addFolderSplitOnline("TRT","/TRT/Onl/Cond/Status","/TRT/Cond/Status",className='TRTCond::StrawStatusMultChanContainer')
 
-if DetFlags.simulate.any_on() or hasattr(topSequence,"OutputConditionsAlg"):
+if hasattr(topSequence,"OutputConditionsAlg"):
     conddb.addFolderSplitOnline("TRT","/TRT/Onl/Cond/StatusPermanent","/TRT/Cond/StatusPermanent")
 else:
     conddb.addFolderSplitOnline("TRT","/TRT/Onl/Cond/StatusPermanent","/TRT/Cond/StatusPermanent",className='TRTCond::StrawStatusMultChanContainer')
@@ -79,8 +79,6 @@ if DetFlags.TRT_on() and ((not DetFlags.simulate.TRT_on()) or DetFlags.overlay.T
         import os
         if "AthSimulation_DIR" not in os.environ: # Protection for AthSimulation builds
             condSeq += TRTAlignCondAlg
-
-
 if DetFlags.SCT_on() and ((not DetFlags.simulate.SCT_on()) or DetFlags.overlay.SCT_on()):
 
     if not hasattr(condSeq, "SCT_AlignCondAlg"):
diff --git a/InnerDetector/InDetConditions/SCT_ConditionsTools/python/SCT_DCSConditionsConfig.py b/InnerDetector/InDetConditions/SCT_ConditionsTools/python/SCT_DCSConditionsConfig.py
index 9f09f2eb727d1285a8a00395b7b76728c58c0d9d..d718e090ca0a08f1a25c2b22ae9bee2dd3d6abb2 100644
--- a/InnerDetector/InDetConditions/SCT_ConditionsTools/python/SCT_DCSConditionsConfig.py
+++ b/InnerDetector/InDetConditions/SCT_ConditionsTools/python/SCT_DCSConditionsConfig.py
@@ -44,5 +44,6 @@ def SCT_DCSConditionsCfg(flags, name="InDetSCT_DCSConditions", **kwargs):
         acc.addCondAlgo(hvAlg)
         tempAlg = SCT_DCSConditionsTempCondAlg(name=name + "TempCondAlg", ReadKey=tempFolder)
         acc.addCondAlgo(tempAlg)
-    return acc, tool
+    acc.setPrivateTools(tool)
+    return acc
 
diff --git a/InnerDetector/InDetConditions/SCT_ConditionsTools/python/SCT_ReadCalibChipDataConfig.py b/InnerDetector/InDetConditions/SCT_ConditionsTools/python/SCT_ReadCalibChipDataConfig.py
index 0727f41c115870ea81b2185dc4df3bb3f46bc755..081cd9d9d85b6f666e0ace54779f913f09e8ecb4 100644
--- a/InnerDetector/InDetConditions/SCT_ConditionsTools/python/SCT_ReadCalibChipDataConfig.py
+++ b/InnerDetector/InDetConditions/SCT_ConditionsTools/python/SCT_ReadCalibChipDataConfig.py
@@ -13,7 +13,7 @@ def SCT_ReadCalibChipDataToolCfg(flags, name="InDetSCT_ReadCalibChipDataTool", *
     return SCT_ReadCalibChipDataTool(name, **kwargs)
 
 def SCT_ReadCalibChipDataCfg(flags, name="SCT_ReadCalibChip", **kwargs):
-    """Return configured ComponentAccumulator and tool for SCT_ReadCalibChipDataCfg
+    """Return configured ComponentAccumulator with SCT_ReadCalibChipDataCfg tool
 
     Accepts optional noiseFolder and gainFolder keyword arguments
     """
@@ -29,5 +29,6 @@ def SCT_ReadCalibChipDataCfg(flags, name="SCT_ReadCalibChip", **kwargs):
     gainAlg = SCT_ReadCalibChipGainCondAlg(name=name + "GainCondAlg", ReadKey=gainFolder)
     acc.addCondAlgo(gainAlg)
     tool = kwargs.get("ReadCalibChipDataTool", SCT_ReadCalibChipDataToolCfg(flags))
-    return acc, tool
+    acc.setPrivateTools(tool)
+    return acc
 
diff --git a/InnerDetector/InDetConditions/SCT_ConditionsTools/python/SCT_SiliconConditionsConfig.py b/InnerDetector/InDetConditions/SCT_ConditionsTools/python/SCT_SiliconConditionsConfig.py
index fb841600267fcbdb457f6f6a8c2446c513ed1358..50971f5df3807d2fc96dbb33e4423886f6c0775a 100644
--- a/InnerDetector/InDetConditions/SCT_ConditionsTools/python/SCT_SiliconConditionsConfig.py
+++ b/InnerDetector/InDetConditions/SCT_ConditionsTools/python/SCT_SiliconConditionsConfig.py
@@ -30,5 +30,6 @@ def SCT_SiliconConditionsCfg(flags, name="SCT_Silicon", **kwargs):
         tempAlg = SCT_SiliconTempCondAlg(name=name + "TempCondAlg", **CondArgs)
         acc.addCondAlgo(hvAlg)
         acc.addCondAlgo(tempAlg)
-    return acc, tool
+    acc.setPrivateTools(tool)
+    return acc
 
diff --git a/InnerDetector/InDetConditions/SCT_ConditionsTools/test/SCT_ConditionsConfig_test.py b/InnerDetector/InDetConditions/SCT_ConditionsTools/test/SCT_ConditionsConfig_test.py
index 78cdab2ff3f91e7240d6e2b80998d4a5bb03b563..fdbb1c4b7fb2990450b4384f17109a8933b2d7d5 100755
--- a/InnerDetector/InDetConditions/SCT_ConditionsTools/test/SCT_ConditionsConfig_test.py
+++ b/InnerDetector/InDetConditions/SCT_ConditionsTools/test/SCT_ConditionsConfig_test.py
@@ -16,14 +16,10 @@ from SCT_ConditionsTools.SCT_ReadCalibChipDataConfig import SCT_ReadCalibChipDat
 log.setLevel(DEBUG)
 Configurable.configurableRun3Behavior = True
 ConfigFlags.Input.Files = defaultTestFiles.HITS
-# DCS
-DCSAcc, DCSTool = SCT_DCSConditionsCfg(ConfigFlags, name="DCSTest")
-# Silicon
-SiliconAcc, SiliconTool = SCT_SiliconConditionsCfg(ConfigFlags, name="SiliconTest")
-# ReadCalibChipData
-ReadAcc, ReadTool = SCT_ReadCalibChipDataCfg(ConfigFlags, name="ReadTest")
-# prevent raise on __del__
-DCSAcc.wasMerged()
-SiliconAcc.wasMerged()
-ReadAcc.wasMerged()
+# call tests
+tacc = SCT_DCSConditionsCfg(ConfigFlags, name="DCSTest")
+tacc.merge(SCT_SiliconConditionsCfg(ConfigFlags, name="SiliconTest"))
+tacc.merge(SCT_ReadCalibChipDataCfg(ConfigFlags, name="ReadTest"))
+# reset to prevent errors on deletion
+tacc.__init__()
 
diff --git a/InnerDetector/InDetConditions/SiLorentzAngleTool/python/PixelLorentzAngleConfig.py b/InnerDetector/InDetConditions/SiLorentzAngleTool/python/PixelLorentzAngleConfig.py
index 908a57e1419c6bfc51f8139ff30ee8c423bd6dc3..3c5d03f3cca97c2e6a59299e803aa45300a2e2ee 100644
--- a/InnerDetector/InDetConditions/SiLorentzAngleTool/python/PixelLorentzAngleConfig.py
+++ b/InnerDetector/InDetConditions/SiLorentzAngleTool/python/PixelLorentzAngleConfig.py
@@ -23,12 +23,15 @@ def PixelLorentzAngleCfg(flags, name="PixelSiLorentzAngleCondAlg", **kwargs):
     """
     acc, svc = MagneticFieldSvcCfg(flags)
     tool = kwargs.get("SiLorentzAngleTool", PixelLorentzAngleToolCfg(flags))
-    acc.merge(PixelDCSConditionsCfg(flags))
-    SiPropAcc, SiPropTool = PixelSiPropertiesCfg(flags)
+    DCSCondAcc = PixelDCSConditionsCfg(flags)
+    DCSCondAcc.popPrivateTools()
+    acc.merge(DCSCondAcc)
+    SiPropAcc = PixelSiPropertiesCfg(flags)
     acc.merge(SiPropAcc)
-    kwargs.setdefault("SiPropertiesTool", SiPropTool)
+    kwargs.setdefault("SiPropertiesTool", SiPropAcc.popPrivateTools())
     kwargs.setdefault("UseMagFieldSvc", tool.UseMagFieldSvc)
     kwargs.setdefault("UseMagFieldDcs", not flags.Common.isOnline)
     acc.addCondAlgo(PixelSiLorentzAngleCondAlg(name, **kwargs))
-    return acc, tool
+    acc.setPrivateTools(tool)
+    return acc
 
diff --git a/InnerDetector/InDetConditions/SiLorentzAngleTool/python/SCT_LorentzAngleConfig.py b/InnerDetector/InDetConditions/SiLorentzAngleTool/python/SCT_LorentzAngleConfig.py
index 233f4ff54db39caa83fdea2c29180081acdc14de..4e0f267d1dc22c4965a55e3b43fc581b87df03e5 100644
--- a/InnerDetector/InDetConditions/SiLorentzAngleTool/python/SCT_LorentzAngleConfig.py
+++ b/InnerDetector/InDetConditions/SiLorentzAngleTool/python/SCT_LorentzAngleConfig.py
@@ -39,19 +39,20 @@ def SCT_LorentzAngleCfg(flags, name="SCT_SiLorentzAngleCondAlg",
             DCSkwargs["hvFolder"] = dcs_folder + "/HV"
             DCSkwargs["tempFolder"] = dcs_folder + "/MODTEMP"
             DCSkwargs["stateFolder"] = dcs_folder + "/CHANSTAT"
-        DCSAcc, DCSTool = SCT_DCSConditionsCfg(flags, **DCSkwargs)
+        DCSAcc = SCT_DCSConditionsCfg(flags, **DCSkwargs)
         acc.merge(DCSAcc)
-        SCAcc, SCTool = SCT_SiliconConditionsCfg(flags, DCSConditionsTool=DCSTool)
+        SCAcc = SCT_SiliconConditionsCfg(flags, DCSConditionsTool=DCSAcc.popPrivateTools())
     else:
         SCTool = SCT_SiliconConditionsToolCfg(flags, UseDB=False, ForceUseGeoModel=True)
-        SCAcc, SCTool = SCT_SiliconConditionsCfg(flags, SiliconConditionsTool=SCTool)
+        SCAcc = SCT_SiliconConditionsCfg(flags, SiliconConditionsTool=SCTool)
+    SCAcc.popPrivateTools()
     acc.merge(SCAcc)
     # set up SCTSiLorentzAngleCondAlg
     kwargs.setdefault("UseMagFieldSvc", tool.UseMagFieldSvc)
     kwargs.setdefault("UseMagFieldDcs", not flags.Common.isOnline)
     kwargs.setdefault("UseGeoModel", forceUseGeoModel)
     kwargs.setdefault("useSctDefaults", False)
-    alg = SCTSiLorentzAngleCondAlg(name, **kwargs)
-    acc.addCondAlgo(alg)
-    return acc, tool
+    acc.addCondAlgo(SCTSiLorentzAngleCondAlg(name, **kwargs))
+    acc.setPrivateTools(tool)
+    return acc
 
diff --git a/InnerDetector/InDetConditions/SiLorentzAngleTool/test/SiLorentzAngleConfig_test.py b/InnerDetector/InDetConditions/SiLorentzAngleTool/test/SiLorentzAngleConfig_test.py
index 1c72737ed6f7f06be70315e55bf8b7d74777adb9..56842f729be3ae28193d9c3b95b3e70825165390 100755
--- a/InnerDetector/InDetConditions/SiLorentzAngleTool/test/SiLorentzAngleConfig_test.py
+++ b/InnerDetector/InDetConditions/SiLorentzAngleTool/test/SiLorentzAngleConfig_test.py
@@ -16,16 +16,17 @@ from SiLorentzAngleTool.PixelLorentzAngleConfig import PixelLorentzAngleCfg
 log.setLevel(DEBUG)
 Configurable.configurableRun3Behavior = True
 ConfigFlags.Input.Files = defaultTestFiles.HITS
+# using __init__ to reset, preventing errors on deletion
 # case online
 ConfigFlags.Common.isOnline = True
-acc, tool = SCT_LorentzAngleCfg(ConfigFlags, name="SCT_LorentzAngleTestOnline")
-acc2, tool = PixelLorentzAngleCfg(ConfigFlags, name="PixelLorentzAngleTestOnline")
-acc.merge(acc2)
-acc.wasMerged()
+tacc = SCT_LorentzAngleCfg(ConfigFlags, name="SCT_LorentzAngleTestOnline")
+tacc.__init__()
+tacc = PixelLorentzAngleCfg(ConfigFlags, name="PixelLorentzAngleTestOnline")
+tacc.__init__()
 # case offline
 ConfigFlags.Common.isOnline = False
-acc, tool = SCT_LorentzAngleCfg(ConfigFlags, name="SCT_LorentzAngleTestOffline")
-acc2, tool = PixelLorentzAngleCfg(ConfigFlags, name="PixelLorentzAngleTestOffline")
-acc.merge(acc2)
-acc.wasMerged()
+tacc = SCT_LorentzAngleCfg(ConfigFlags, name="SCT_LorentzAngleTestOffline")
+tacc.__init__()
+tacc = PixelLorentzAngleCfg(ConfigFlags, name="PixelLorentzAngleTestOffline")
+tacc.__init__()
 
diff --git a/InnerDetector/InDetConditions/SiPropertiesTool/python/PixelSiPropertiesConfig.py b/InnerDetector/InDetConditions/SiPropertiesTool/python/PixelSiPropertiesConfig.py
index 66de19b5e61c5ffced1ab01237fe366803585207..ef5aaa94910f42f44054125aa00bb1cd38536b79 100644
--- a/InnerDetector/InDetConditions/SiPropertiesTool/python/PixelSiPropertiesConfig.py
+++ b/InnerDetector/InDetConditions/SiPropertiesTool/python/PixelSiPropertiesConfig.py
@@ -21,5 +21,6 @@ def PixelSiPropertiesCfg(flags, name="PixelSiPropertiesCondAlg", **kwargs):
     acc = PixelDCSConditionsCfg(flags)
     tool = kwargs.get("SiPropertiesTool", PixelSiPropertiesToolCfg(flags))
     acc.addCondAlgo(PixelSiPropertiesCondAlg(name, **kwargs))
-    return acc, tool
+    acc.setPrivateTools(tool)
+    return acc
 
diff --git a/InnerDetector/InDetConditions/SiPropertiesTool/python/SCT_SiPropertiesConfig.py b/InnerDetector/InDetConditions/SiPropertiesTool/python/SCT_SiPropertiesConfig.py
index db9151a29e3def4f04f5d2dd722dbd7502856be9..5ce6c514b4dd68c1f46f3265f1dcef6beda68678 100644
--- a/InnerDetector/InDetConditions/SiPropertiesTool/python/SCT_SiPropertiesConfig.py
+++ b/InnerDetector/InDetConditions/SiPropertiesTool/python/SCT_SiPropertiesConfig.py
@@ -21,5 +21,6 @@ def SCT_SiPropertiesCfg(flags, name="SCTSiPropertiesCondAlg", **kwargs):
     tool = kwargs.get("SiPropertiesTool", SCT_SiPropertiesToolCfg(flags))
     alg = SCTSiPropertiesCondAlg(name, **kwargs)
     acc.addEventAlgo(alg)
-    return acc, tool
+    acc.setPrivateTools(tool)
+    return acc
 
diff --git a/InnerDetector/InDetConditions/SiPropertiesTool/test/SiPropertiesConfig_test.py b/InnerDetector/InDetConditions/SiPropertiesTool/test/SiPropertiesConfig_test.py
index b68c74d5ce63700a141371ab782de23380df4a4b..67e7196dc6d79fc9b9babec9e8b40053a28e1dbb 100755
--- a/InnerDetector/InDetConditions/SiPropertiesTool/test/SiPropertiesConfig_test.py
+++ b/InnerDetector/InDetConditions/SiPropertiesTool/test/SiPropertiesConfig_test.py
@@ -17,9 +17,8 @@ log.setLevel(DEBUG)
 Configurable.configurableRun3Behavior = True
 ConfigFlags.Input.Files = defaultTestFiles.HITS
 # test
-acc1, tool = SCT_SiPropertiesCfg(ConfigFlags, name="SCT_SiPropertiesConfigTest")
-acc2, tool = PixelSiPropertiesCfg(ConfigFlags, name="PixelSiPropertiesConfigTest")
-# prevent raise on __del__
-acc1.merge(acc2)
-acc1.wasMerged()
+tacc = SCT_SiPropertiesCfg(ConfigFlags, name="SCT_SiPropertiesConfigTest")
+tacc.merge(PixelSiPropertiesCfg(ConfigFlags, name="PixelSiPropertiesConfigTest"))
+# reset to prevent errors on deletion
+tacc.__init__()
 
diff --git a/InnerDetector/InDetConditions/TRT_ConditionsAlgs/CMakeLists.txt b/InnerDetector/InDetConditions/TRT_ConditionsAlgs/CMakeLists.txt
index 1fd40d58fb4cb293c5cdec7138ce1bbfaca6cba0..b1945841b756c6d5e10f7cc3636e5a1d83e874a7 100644
--- a/InnerDetector/InDetConditions/TRT_ConditionsAlgs/CMakeLists.txt
+++ b/InnerDetector/InDetConditions/TRT_ConditionsAlgs/CMakeLists.txt
@@ -10,20 +10,22 @@ atlas_depends_on_subdirs( PUBLIC
                           Control/AthenaBaseComps
                           GaudiKernel
                           InnerDetector/InDetConditions/TRT_ConditionsServices
-                          PRIVATE
                           InnerDetector/InDetConditions/TRT_ConditionsData
+                          PRIVATE
                           InnerDetector/InDetDetDescr/InDetIdentifier
                           InnerDetector/InDetDetDescr/InDetReadoutGeometry
 		          Database/AthenaPOOL/AthenaPoolUtilities
 			  DetectorDescription/DetDescrCond/DetDescrConditions 
 			  DetectorDescription/GeoModel/GeoModelUtilities )
 
-
+# External dependencies:
+find_package( CORAL COMPONENTS CoralBase CoralKernel RelationalAccess )
 
 # Component(s) in the package:
 atlas_add_component( TRT_ConditionsAlgs
                      src/*.cxx
                      src/components/*.cxx
+                     INCLUDE_DIRS ${CORAL_INCLUDE_DIRS}
                      LINK_LIBRARIES AthenaBaseComps GaudiKernel TRT_ConditionsServicesLib TRT_ConditionsData InDetIdentifier
                                                InDetReadoutGeometry AthenaPoolUtilities DetDescrConditions GeoModelUtilities )
 
diff --git a/InnerDetector/InDetConditions/TRT_ConditionsAlgs/src/TRTActiveCondAlg.cxx b/InnerDetector/InDetConditions/TRT_ConditionsAlgs/src/TRTActiveCondAlg.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..31335ca0136df3a6493d649b967c42024cf43c39
--- /dev/null
+++ b/InnerDetector/InDetConditions/TRT_ConditionsAlgs/src/TRTActiveCondAlg.cxx
@@ -0,0 +1,225 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include "TRTActiveCondAlg.h"
+#include "InDetReadoutGeometry/TRT_DetectorManager.h"
+
+TRTActiveCondAlg::TRTActiveCondAlg(const std::string& name
+				 , ISvcLocator* pSvcLocator )
+  : ::AthReentrantAlgorithm(name,pSvcLocator),
+    m_condSvc("CondSvc",name),
+    m_detManager(nullptr),
+    m_strawStatus("TRT_StrawStatusSummaryTool",this),
+    m_trtId(0)
+{ declareProperty("TRTStrawStatusSummaryTool",m_strawStatus); }
+TRTActiveCondAlg::~TRTActiveCondAlg(){}
+
+StatusCode TRTActiveCondAlg::initialize()
+{
+
+  // CondSvc
+  ATH_CHECK( m_condSvc.retrieve() );
+
+  // Straw status
+  ATH_CHECK ( m_strawStatus.retrieve() );
+
+  // Read key
+  ATH_CHECK( m_strawReadKey.initialize() );
+
+
+  // Register write handle
+  ATH_CHECK( m_strawWriteKey.initialize() );
+
+  if (m_condSvc->regHandle(this, m_strawWriteKey).isFailure()) {
+    ATH_MSG_ERROR("unable to register WriteCondHandle " << m_strawWriteKey.fullKey() << " with CondSvc");
+    return StatusCode::FAILURE;
+  }
+
+  // Detector manager
+  ATH_CHECK(detStore()->retrieve(m_detManager,"TRT"));
+
+  // TRT ID helper
+  ATH_CHECK(detStore()->retrieve(m_trtId,"TRT_ID"));
+
+  return StatusCode::SUCCESS;
+}
+
+StatusCode TRTActiveCondAlg::execute(const EventContext& ctx) const 
+{
+  ATH_MSG_DEBUG("execute " << name());
+
+  // ____________ Construct Write Cond Handle and check its validity ____________
+
+  SG::WriteCondHandle<TRTCond::ActiveFraction> writeHandle{m_strawWriteKey,ctx};
+
+  // Do we have a valid Write Cond Handle for current time?
+  if(writeHandle.isValid()) {
+    ATH_MSG_DEBUG("CondHandle " << writeHandle.fullKey() << " is already valid."
+                  << ". In theory this should not be called, but may happen"
+                  << " if multiple concurrent events are being processed out of order.");
+
+    return StatusCode::SUCCESS; 
+  }
+
+
+
+  // ____________ Construct new Write Cond Object  ____________
+  std::unique_ptr<TRTCond::ActiveFraction> writeCdo{std::make_unique<TRTCond::ActiveFraction>()};
+  
+
+  // ____________ Compute number of alive straws for Write Cond object  ____________
+
+
+
+  ATH_MSG_INFO(" Initialize TRTCond::ActiveFraction table with number of phi, eta bins: " 
+	       << writeCdo->getPhiBins().size() << ", " << writeCdo->getEtaBins().size() );
+
+  for (unsigned int i=0; i<writeCdo->getEtaBins().size(); i++) {
+     float etaMin = writeCdo->getEtaBins()[i].first;
+     float etaMax = writeCdo->getEtaBins()[i].second;
+     int bin = writeCdo->findEtaBin( (etaMin+etaMax)/2. );
+     ATH_MSG_DEBUG("TRTCond::ActiveFraction: findEtaBin( " << etaMin << ", " << etaMax << " ] = " << bin );
+
+    for (unsigned int j=0; j<writeCdo->getPhiBins().size(); j++) {
+      float phiMin = writeCdo->getPhiBins()[j].first;
+      float phiMax = writeCdo->getPhiBins()[j].second;
+      int bin = writeCdo->findPhiBin( (phiMin+phiMax)/2. );
+      ATH_MSG_DEBUG("TRTCond::ActiveFraction: findPhiBin( " << phiMin << ", " << phiMax << " ] = " << bin );
+    }
+  }
+
+  std::vector<int> dummyPhiVec( writeCdo->getPhiBins().size(), 0 );
+  std::vector<std::vector<int> > dummyTableCountAll( writeCdo->getEtaBins().size(), dummyPhiVec );
+  std::vector<std::vector<int> > dummyTableCountDead( writeCdo->getEtaBins().size(), dummyPhiVec );
+
+
+  float rMinEndcap = 617.; 
+  float rMaxEndcap = 1106.;
+  int countAll(0), countDead(0), countSaved(0), countPhiSkipped(0), countEtaSkipped(0), countInvalidEtaValues(0); 
+  for (std::vector<Identifier>::const_iterator it = m_trtId->straw_layer_begin(); it != m_trtId->straw_layer_end(); it++  ) {
+     int nStrawsInLayer = m_trtId->straw_max(*it);
+     for (int i=0; i<=nStrawsInLayer; i++) { 
+
+        Identifier id = m_trtId->straw_id(*it, i);	 
+        bool status = m_strawStatus->get_status(id);
+        countAll++; if (status) countDead++;
+
+        const Amg::Vector3D &strawPosition = m_detManager->getElement( id )->center( id );
+        double phi = atan2( strawPosition.y(), strawPosition.x() );
+        int phiBin = writeCdo->findPhiBin( phi );
+	if (phiBin<0) { 
+           ATH_MSG_DEBUG("TRTCond::ActiveFraction phiBin<0: " << phi << " " << phiBin);
+           countPhiSkipped++;
+           continue;
+        }
+
+	// calculate etaMin, etaMax
+	int side = m_trtId->barrel_ec(id);
+        float z = fabs( strawPosition.z() );
+	float thetaMin(0.), thetaMax(0.);
+	if (abs(side)==1) { // barrel
+           float zRange = 360.; // straw length / 2  
+	   if ( m_trtId->layer_or_wheel(id) == 0 && m_trtId->straw_layer(id) < 9 ) zRange = 160.;  // short straws
+	   float r = sqrt( pow(strawPosition.x(), 2) + pow(strawPosition.y(), 2) );
+	   thetaMin = atan( r / (z+zRange) );
+	   thetaMax = ((z-zRange)>0.) ? atan( r / (z-zRange) ) : 1.57; // M_PI_2 - epsilon
+	} else { // endcap
+	   thetaMin = atan( rMinEndcap / z );		
+	   thetaMax = atan( rMaxEndcap / z );	
+	}
+        if (side<0) { // theta -> M_PI - theta
+          float thetaDummy = thetaMin;
+          thetaMin = M_PI - thetaMax;
+          thetaMax = M_PI - thetaDummy;
+        }
+
+        float thetaCheck[] = {thetaMax, thetaMin};
+        float etaCheck[] = {0., 0.};
+        for (int ti=0; ti<2; ti++) {
+           if (thetaCheck[ti]<=0.||thetaCheck[ti]>=M_PI) ATH_MSG_DEBUG("TRTCond::ActiveFraction: theta " << ti << " " << thetaCheck[ti]);
+           float tanTheta = tan(thetaCheck[ti]/2.);
+           if (tanTheta<=0.) {
+              ATH_MSG_DEBUG("TRTCond::ActiveFraction: theta tan " << ti << " " << tanTheta );
+              countInvalidEtaValues++;
+              continue;
+           }
+           etaCheck[ti] = -log( tanTheta );
+        }
+        float etaMin = etaCheck[0];
+        float etaMax = etaCheck[1];
+	int etaMinBin = writeCdo->findEtaBin( etaMin );
+	int etaMaxBin = writeCdo->findEtaBin( etaMax ); 
+        if (etaMin>=etaMax) ATH_MSG_WARNING("TRTCond::ActiveFractionSvc: etaMaxBin<etaMinBin " << etaMin << " " << etaMax << " " << thetaMin << " " << thetaMax);
+	if (etaMinBin<0 && etaMaxBin<0) { 
+           ATH_MSG_WARNING("TRTCond::ActiveFraction: etaMaxBin<etaMinBin " << thetaMin << " " << thetaMax 
+			   << " " << etaMin << " " << etaMax << " " << etaMinBin << " " << etaMaxBin << ", side: " << side);
+           countEtaSkipped++;
+           continue; 
+        }
+	if (etaMinBin<0) etaMinBin = 0;
+	if (etaMaxBin<0) etaMaxBin = writeCdo->getEtaBins().size() - 1;
+        if (etaMaxBin<etaMinBin) ATH_MSG_WARNING( "TRTCond::ActiveFraction: etaMaxBin<etaMinBin " << etaMinBin << " " << etaMaxBin << ", side: " << side);
+
+        countSaved++; // now save straw info for these bins
+	for (int iEta = etaMinBin; iEta <= etaMaxBin; iEta++) {
+	   dummyTableCountAll[iEta][phiBin]++;
+	   if (status) dummyTableCountDead[iEta][phiBin]++;
+	}
+
+     }
+  } // end straw Identifier loop 	
+
+  for (unsigned int i = 0; i < writeCdo->getEtaBins().size(); ++i) { // fill the table
+     for (unsigned int j = 0; j < writeCdo->getPhiBins().size(); ++j) {
+        float deadFraction = 1. * dummyTableCountDead[i][j];
+	if (dummyTableCountAll[i][j]>0) deadFraction /= (1. * dummyTableCountAll[i][j]);
+        writeCdo->setActiveFraction(i, j, 1. - deadFraction);
+        ATH_MSG_DEBUG( "dummyTableCountDead: " << i << ", " << j << ", count " << dummyTableCountAll[i][j] << " dead " << deadFraction);
+     }
+  }
+
+  float deadStrawFraction = (1.*countDead) / (1.*countAll);
+  ATH_MSG_INFO( " Initialize TRTCond::ActiveFraction table finished, count all TRT straws: " << countAll 
+                                  << ", count dead straws: " << countDead << " (" << deadStrawFraction 
+                                  << "%), straws skipped due to invalid phi, eta range: " << countPhiSkipped << " " << countEtaSkipped );
+
+  if (countInvalidEtaValues) ATH_MSG_WARNING("TRT_ActiveFractionSvc: found invalid eta range, check: " << countInvalidEtaValues);
+
+
+
+  //__________ Assign range of writeCdo to that of the ReadHandle___________ 
+  EventIDRange rangeW;
+
+    SG::ReadCondHandle<StrawStatusContainer> strawReadHandle{m_strawReadKey,ctx};
+    const StrawStatusContainer* strawContainer{*strawReadHandle};
+    if(strawContainer==nullptr) {
+        ATH_MSG_ERROR("Null pointer to the straw status container");
+        return StatusCode::FAILURE;
+    }
+
+    // Get range
+    if(!strawReadHandle.range(rangeW)) {
+        ATH_MSG_ERROR("Failed to retrieve validity range for " << strawReadHandle.key());
+        return StatusCode::FAILURE;
+    }
+
+
+  // Record  CDO
+ if(writeHandle.record(rangeW,std::move(writeCdo)).isFailure()) {
+    ATH_MSG_ERROR("Could not record ActiveFraction " << writeHandle.key() 
+		  << " with EventRange " << rangeW
+		  << " into Conditions Store");
+    return StatusCode::FAILURE;
+  }
+
+
+  return StatusCode::SUCCESS;
+}
+
+StatusCode TRTActiveCondAlg::finalize()
+{
+  ATH_MSG_DEBUG("finalize " << name());
+  return StatusCode::SUCCESS;
+}
+
diff --git a/InnerDetector/InDetConditions/TRT_ConditionsAlgs/src/TRTActiveCondAlg.h b/InnerDetector/InDetConditions/TRT_ConditionsAlgs/src/TRTActiveCondAlg.h
new file mode 100644
index 0000000000000000000000000000000000000000..9de4b93e758c9adc2b4911bd30ad8c47dee39e6c
--- /dev/null
+++ b/InnerDetector/InDetConditions/TRT_ConditionsAlgs/src/TRTActiveCondAlg.h
@@ -0,0 +1,42 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef TRTACTIVECONDALG_H
+#define TRTACTIVECONDALG_H
+
+#include "AthenaBaseComps/AthReentrantAlgorithm.h"
+#include "StoreGate/ReadCondHandleKey.h"
+#include "StoreGate/WriteCondHandleKey.h"
+#include "GaudiKernel/ToolHandle.h"
+#include "TRT_ConditionsData/ActiveFraction.h"
+#include "TRT_ConditionsServices/ITRT_StrawStatusSummaryTool.h"
+#include "GaudiKernel/ICondSvc.h"
+#include "GaudiKernel/Property.h"
+namespace InDetDD {
+  class TRT_DetectorManager;
+}
+class TRT_ID;
+
+//* Fills a eta,phi binned map of the fraction of straws, and posts it on CondStore 
+class TRTActiveCondAlg : public AthReentrantAlgorithm
+{
+ public:
+  typedef TRTCond::StrawStatusMultChanContainer StrawStatusContainer ;
+  TRTActiveCondAlg(const std::string& name, ISvcLocator* pSvcLocator);
+  virtual ~TRTActiveCondAlg() override;
+
+  virtual StatusCode initialize() override;
+  virtual StatusCode execute(const EventContext& ctx) const override;
+  virtual StatusCode finalize() override;
+
+ private:
+  ServiceHandle<ICondSvc> m_condSvc;
+  SG::ReadCondHandleKey<StrawStatusContainer> m_strawReadKey{this,"StrawReadKey","/TRT/Cond/Status","Straw Status in-key"};
+  SG::WriteCondHandleKey<TRTCond::ActiveFraction> m_strawWriteKey{this,"ActiveWriteKey","ActiveFraction","ActiveFraction out-key"};
+  const InDetDD::TRT_DetectorManager* m_detManager;
+  ToolHandle<ITRT_StrawStatusSummaryTool> m_strawStatus;
+  const TRT_ID *m_trtId;
+
+};
+#endif
diff --git a/InnerDetector/InDetConditions/TRT_ConditionsAlgs/src/TRTHTCondAlg.cxx b/InnerDetector/InDetConditions/TRT_ConditionsAlgs/src/TRTHTCondAlg.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..c712cb762c7b7e8e923b23e53f6ca0d8264b8a9e
--- /dev/null
+++ b/InnerDetector/InDetConditions/TRT_ConditionsAlgs/src/TRTHTCondAlg.cxx
@@ -0,0 +1,94 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include "TRTHTCondAlg.h"
+
+TRTHTCondAlg::TRTHTCondAlg(const std::string& name
+				 , ISvcLocator* pSvcLocator )
+  : ::AthReentrantAlgorithm(name,pSvcLocator),
+    m_condSvc("CondSvc",name)
+{}
+TRTHTCondAlg::~TRTHTCondAlg(){}
+
+StatusCode TRTHTCondAlg::initialize()
+{
+
+  // CondSvc
+  ATH_CHECK( m_condSvc.retrieve() );
+
+  // Read key
+  ATH_CHECK( m_ReadKey.initialize() );
+
+  // Register write handle
+  ATH_CHECK( m_WriteKey.initialize() );
+
+  if (m_condSvc->regHandle(this, m_WriteKey).isFailure()) {
+    ATH_MSG_ERROR("unable to register WriteCondHandle " << m_WriteKey.fullKey() << " with CondSvc");
+    return StatusCode::FAILURE;
+  }
+
+  return StatusCode::SUCCESS;
+}
+
+StatusCode TRTHTCondAlg::execute(const EventContext& ctx) const 
+{
+  ATH_MSG_DEBUG("execute " << name());
+
+  // ____________ Construct Write Cond Handle and check its validity ____________
+
+  SG::WriteCondHandle<HTcalculator> writeHandle{m_WriteKey,ctx};
+
+  // Do we have a valid Write Cond Handle for current time?
+  if(writeHandle.isValid()) {
+    ATH_MSG_DEBUG("CondHandle " << writeHandle.fullKey() << " is already valid."
+                  << ". In theory this should not be called, but may happen"
+                  << " if multiple concurrent events are being processed out of order.");
+
+    return StatusCode::SUCCESS; 
+  }
+
+
+
+  // ____________ Construct new Write Cond Object  ____________
+  std::unique_ptr<HTcalculator> writeCdo{std::make_unique<HTcalculator>()};
+  
+
+  // ____________ Compute the array structures for the HTcalculator object  ____________
+  SG::ReadCondHandle<CondAttrListVec> readHandle{m_ReadKey,ctx};
+  const CondAttrListVec* channel_values{*readHandle};
+  if(channel_values==nullptr) {
+      ATH_MSG_ERROR(" Problem reading TRT/Calib/PID_vector cond object");
+      return StatusCode::FAILURE;
+  }
+  if(StatusCode::SUCCESS != writeCdo->ReadVectorDB( channel_values  )) {
+     ATH_MSG_ERROR ("Problem filling HT Calculator.");
+     return StatusCode::FAILURE;     
+  }
+
+ 
+  //__________ Assign range of writeCdo to that of the ReadHandle___________ 
+  EventIDRange rangeW;
+
+  if(!readHandle.range(rangeW)) {
+        ATH_MSG_ERROR("Failed to retrieve validity range for " << readHandle.key());
+        return StatusCode::FAILURE;
+  }
+
+  // Record  CDO
+ if(writeHandle.record(rangeW,std::move(writeCdo)).isFailure()) {
+    ATH_MSG_ERROR("Could not record HTCalculator " << writeHandle.key() 
+		  << " with EventRange " << rangeW
+		  << " into Conditions Store");
+    return StatusCode::FAILURE;
+  }
+
+
+  return StatusCode::SUCCESS;
+}
+
+StatusCode TRTHTCondAlg::finalize()
+{
+  ATH_MSG_DEBUG("finalize " << name());
+  return StatusCode::SUCCESS;
+}
diff --git a/InnerDetector/InDetConditions/TRT_ConditionsAlgs/src/TRTHTCondAlg.h b/InnerDetector/InDetConditions/TRT_ConditionsAlgs/src/TRTHTCondAlg.h
new file mode 100644
index 0000000000000000000000000000000000000000..47b11cfc0f044b8e1bc454d7231772322c1ada30
--- /dev/null
+++ b/InnerDetector/InDetConditions/TRT_ConditionsAlgs/src/TRTHTCondAlg.h
@@ -0,0 +1,32 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef TRTHTCONDALG_H
+#define TRTHTCONDALG_H
+
+#include "AthenaBaseComps/AthReentrantAlgorithm.h"
+#include "StoreGate/WriteCondHandleKey.h"
+#include "TRT_ConditionsData/HTcalculator.h"
+#include "AthenaPoolUtilities/CondAttrListVec.h"
+#include "GaudiKernel/ICondSvc.h"
+#include "GaudiKernel/Property.h"
+
+
+class TRTHTCondAlg : public AthReentrantAlgorithm
+{
+ public:
+  TRTHTCondAlg(const std::string& name, ISvcLocator* pSvcLocator);
+  virtual ~TRTHTCondAlg() override;
+
+  virtual StatusCode initialize() override;
+  virtual StatusCode execute(const EventContext& ctx) const override;
+  virtual StatusCode finalize() override;
+
+ private:
+  ServiceHandle<ICondSvc> m_condSvc;
+  SG::ReadCondHandleKey<CondAttrListVec> m_ReadKey{this,"HTReadKey","/TRT/Calib/PID_vector","Pid in-key"};
+  SG::WriteCondHandleKey<HTcalculator> m_WriteKey{this,"HTWriteKey","HTcalculator","HTcalcutor out-key"};
+
+};
+#endif
diff --git a/InnerDetector/InDetConditions/TRT_ConditionsAlgs/src/TRTStrawCondAlg.cxx b/InnerDetector/InDetConditions/TRT_ConditionsAlgs/src/TRTStrawCondAlg.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..03d75e50a31580019414f8adec0ace8d12a7e9cd
--- /dev/null
+++ b/InnerDetector/InDetConditions/TRT_ConditionsAlgs/src/TRTStrawCondAlg.cxx
@@ -0,0 +1,185 @@
+/*
+  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include "TRTStrawCondAlg.h"
+#include "InDetReadoutGeometry/TRT_DetectorManager.h"
+
+TRTStrawCondAlg::TRTStrawCondAlg(const std::string& name
+				 , ISvcLocator* pSvcLocator )
+  : ::AthReentrantAlgorithm(name,pSvcLocator),
+    m_condSvc("CondSvc",name),
+    m_detManager(nullptr),
+    m_strawStatus("TRT_StrawStatusSummaryTool",this),
+    m_trtId(0),
+    m_isGEANT4(true)
+{ declareProperty("TRTStrawStatusSummaryTool",m_strawStatus);
+  declareProperty("isGEANT4",m_isGEANT4);
+}
+TRTStrawCondAlg::~TRTStrawCondAlg(){}
+
+StatusCode TRTStrawCondAlg::initialize()
+{
+
+  // CondSvc
+  ATH_CHECK( m_condSvc.retrieve() );
+
+  // Straw status
+  ATH_CHECK ( m_strawStatus.retrieve() );
+
+  // Read key
+  ATH_CHECK( m_strawReadKey.initialize() );
+
+
+  // Register write handle
+  ATH_CHECK( m_strawWriteKey.initialize() );
+
+  if (m_condSvc->regHandle(this, m_strawWriteKey).isFailure()) {
+    ATH_MSG_ERROR("unable to register WriteCondHandle " << m_strawWriteKey.fullKey() << " with CondSvc");
+    return StatusCode::FAILURE;
+  }
+
+  // Detector manager
+  ATH_CHECK(detStore()->retrieve(m_detManager,"TRT"));
+
+  // TRT ID helper
+  ATH_CHECK(detStore()->retrieve(m_trtId,"TRT_ID"));
+
+  return StatusCode::SUCCESS;
+}
+
+StatusCode TRTStrawCondAlg::execute(const EventContext& ctx) const 
+{
+  ATH_MSG_DEBUG("execute " << name());
+
+  // ____________ Construct Write Cond Handle and check its validity ____________
+
+  SG::WriteCondHandle<TRTCond::AliveStraws> writeHandle{m_strawWriteKey,ctx};
+
+  // Do we have a valid Write Cond Handle for current time?
+  if(writeHandle.isValid()) {
+    ATH_MSG_DEBUG("CondHandle " << writeHandle.fullKey() << " is already valid."
+                  << ". In theory this should not be called, but may happen"
+                  << " if multiple concurrent events are being processed out of order.");
+
+    return StatusCode::SUCCESS; 
+  }
+
+
+
+  // ____________ Construct new Write Cond Object  ____________
+  std::unique_ptr<TRTCond::AliveStraws> writeCdo{std::make_unique<TRTCond::AliveStraws>()};
+  
+
+  // ____________ Compute number of alive straws for Write Cond object  ____________
+
+  for (std::vector<Identifier>::const_iterator it = m_trtId->straw_layer_begin(); it != m_trtId->straw_layer_end(); it++  ) {
+
+   unsigned int nstraws = 0;
+   if (m_detManager){
+     const InDetDD::TRT_BaseElement *el = m_detManager->getElement(*it);
+     if( !el ) continue;
+     nstraws = el->nStraws();
+   }
+   else{
+     nstraws = m_trtId->straw_max( *it) + 1; // There is a difference of 1 between both methods....
+   }
+   for (unsigned int i=0; i<nstraws  ;i++) {
+      Identifier id = m_trtId->straw_id( *it, i);
+      int det = m_trtId->barrel_ec(         id)     ;
+      int lay = m_trtId->layer_or_wheel(    id)     ;
+      int phi = m_trtId->phi_module(        id)     ;
+      bool status               = m_strawStatus->get_status( id );
+
+      if ( status ) {
+	ATH_MSG_VERBOSE(" The sector " << det << " " << lay << " " << phi << " has status " << status);
+	continue;
+      }
+
+      int i_total = findArrayTotalIndex(det, lay);
+      int i_wheel = findArrayLocalWheelIndex(det, lay);
+       
+      writeCdo->update(i_total,i_wheel,phi);
+
+     }
+  }
+
+  //__________ Assign range of writeCdo to that of the ReadHandle___________ 
+  EventIDRange rangeW;
+
+    SG::ReadCondHandle<StrawStatusContainer> strawReadHandle{m_strawReadKey,ctx};
+    const StrawStatusContainer* strawContainer{*strawReadHandle};
+    if(strawContainer==nullptr) {
+        ATH_MSG_ERROR("Null pointer to the straw status container");
+        return StatusCode::FAILURE;
+    }
+
+    // Get range
+    if(!strawReadHandle.range(rangeW)) {
+        ATH_MSG_ERROR("Failed to retrieve validity range for " << strawReadHandle.key());
+        return StatusCode::FAILURE;
+    }
+
+
+  // Record  CDO
+ if(writeHandle.record(rangeW,std::move(writeCdo)).isFailure()) {
+    ATH_MSG_ERROR("Could not record AliveStraws " << writeHandle.key() 
+		  << " with EventRange " << rangeW
+		  << " into Conditions Store");
+    return StatusCode::FAILURE;
+  }
+
+
+  return StatusCode::SUCCESS;
+}
+
+StatusCode TRTStrawCondAlg::finalize()
+{
+  ATH_MSG_DEBUG("finalize " << name());
+  return StatusCode::SUCCESS;
+}
+
+int TRTStrawCondAlg::findArrayTotalIndex(const int det, const int lay) const{
+    int arrayindex = 0; // to be reset below
+    // NOTE: Below, arrayindex starts at 1
+    // because index 0 is filled with TOTAL value.
+    if      (det == -1) arrayindex = 1; // barrel side C
+    else if (det == -2) {               // endcap side C
+      if (lay < 6)      arrayindex = 2; //   wheel A
+      else              arrayindex = 3; //   wheel B
+    }
+    else if (det ==  1) arrayindex = 4; // barrel side A
+    else if (det ==  2) {               // endcap side A
+      if (lay < 6)      arrayindex = 5; //   wheel A
+      else              arrayindex = 6; //   wheel B
+    }
+    else        ATH_MSG_WARNING(" detector value is: " << det << ", out of range -2, -1, 1, 2, so THIS IS NOT TRT!!!");
+    return arrayindex;
+  }
+
+int TRTStrawCondAlg::findArrayLocalWheelIndex(const int det, const int lay) const{
+    int arrayindex = 9; // to be reset below
+    if      (det == -1) {                // barrel side C
+      if      (lay == 0) arrayindex = 0; // layer 0
+      else if (lay == 1) arrayindex = 1; // layer 1
+      else if (lay == 2) arrayindex = 2; // layer 2
+    }
+    else if (det == -2) {                // endcap side C
+      for (int i=0; i<14; ++i){
+        if (lay==i) arrayindex=i+3;
+      }
+    }
+    else if (det ==  1) {                // barrel side A
+      if      (lay == 0) arrayindex = 17; // layer 0
+      else if (lay == 1) arrayindex = 18; // layer 1
+      else if (lay == 2) arrayindex = 19; // layer 2
+    }
+    else if (det ==  2) {                // endcap side A
+      for (int i=0; i<14; ++i){
+        if (lay==i) arrayindex=i+20;
+      }
+    }
+    else        ATH_MSG_WARNING(" detector value is: " << det << ", out of range -2, -1, 1, 2, so THIS IS NOT TRT!!!");
+    return arrayindex;
+  }
+
diff --git a/InnerDetector/InDetConditions/TRT_ConditionsAlgs/src/TRTStrawCondAlg.h b/InnerDetector/InDetConditions/TRT_ConditionsAlgs/src/TRTStrawCondAlg.h
new file mode 100644
index 0000000000000000000000000000000000000000..096bde0366c29d998a70c3fda56b8ab1bb8fe1f8
--- /dev/null
+++ b/InnerDetector/InDetConditions/TRT_ConditionsAlgs/src/TRTStrawCondAlg.h
@@ -0,0 +1,44 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef TRTSTRAWCONDALG_H
+#define TRTSTRAWCONDALG_H
+
+#include "AthenaBaseComps/AthReentrantAlgorithm.h"
+#include "StoreGate/WriteCondHandleKey.h"
+#include "GaudiKernel/ToolHandle.h"
+#include "TRT_ConditionsData/AliveStraws.h"
+#include "TRT_ConditionsServices/ITRT_StrawStatusSummaryTool.h"
+#include "GaudiKernel/ICondSvc.h"
+#include "GaudiKernel/Property.h"
+namespace InDetDD {
+  class TRT_DetectorManager;
+}
+class TRT_ID;
+
+class TRTStrawCondAlg : public AthReentrantAlgorithm
+{
+ public:
+  typedef TRTCond::StrawStatusMultChanContainer StrawStatusContainer ;
+  TRTStrawCondAlg(const std::string& name, ISvcLocator* pSvcLocator);
+  virtual ~TRTStrawCondAlg() override;
+
+  virtual StatusCode initialize() override;
+  virtual StatusCode execute(const EventContext& ctx) const override;
+  virtual StatusCode finalize() override;
+  virtual int findArrayTotalIndex(const int det, const int lay) const;
+  virtual int findArrayLocalWheelIndex(const int det, const int lay) const;
+
+
+ private:
+  ServiceHandle<ICondSvc> m_condSvc;
+  SG::ReadCondHandleKey<StrawStatusContainer> m_strawReadKey{this,"StrawReadKey","/TRT/Cond/Status","Straw Status in-key"};
+  SG::WriteCondHandleKey<TRTCond::AliveStraws> m_strawWriteKey{this,"StrawWriteKey","AliveStraws","AliveStraws out-key"};
+  const InDetDD::TRT_DetectorManager* m_detManager;
+  ToolHandle<ITRT_StrawStatusSummaryTool> m_strawStatus;
+  const TRT_ID *m_trtId;
+  bool m_isGEANT4;
+
+};
+#endif
diff --git a/InnerDetector/InDetConditions/TRT_ConditionsAlgs/src/TRTToTCondAlg.cxx b/InnerDetector/InDetConditions/TRT_ConditionsAlgs/src/TRTToTCondAlg.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..7dffa8af699e9317a23b6a51e2e1bac2c554bd6e
--- /dev/null
+++ b/InnerDetector/InDetConditions/TRT_ConditionsAlgs/src/TRTToTCondAlg.cxx
@@ -0,0 +1,564 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include "TRTToTCondAlg.h"
+#include "AthenaPoolUtilities/AthenaAttributeList.h"
+#include "CoralBase/AttributeListSpecification.h"
+
+
+TRTToTCondAlg::TRTToTCondAlg(const std::string& name
+				 , ISvcLocator* pSvcLocator )
+  : ::AthAlgorithm(name,pSvcLocator),
+    m_condSvc("CondSvc",name)
+{}
+TRTToTCondAlg::~TRTToTCondAlg(){}
+
+StatusCode TRTToTCondAlg::initialize()
+{
+
+  // CondSvc
+  ATH_CHECK( m_condSvc.retrieve() );
+
+  // Read key
+  ATH_CHECK( m_VecReadKey.initialize() );
+  ATH_CHECK( m_ValReadKey.initialize() );
+
+  // Register write handle
+  ATH_CHECK( m_WriteKey.initialize() );
+
+  if (m_condSvc->regHandle(this, m_WriteKey).isFailure()) {
+    ATH_MSG_ERROR("unable to register WriteCondHandle " << m_WriteKey.fullKey() << " with CondSvc");
+    return StatusCode::FAILURE;
+  }
+
+  return StatusCode::SUCCESS;
+}
+
+StatusCode TRTToTCondAlg::execute() 
+{
+  ATH_MSG_DEBUG("execute " << name());
+
+  // ____________ Construct Write Cond Handle and check its validity ____________
+
+  SG::WriteCondHandle<TRTDedxcorrection> writeHandle{m_WriteKey};
+
+  // Do we have a valid Write Cond Handle for current time?
+  if(writeHandle.isValid()) {
+    ATH_MSG_DEBUG("CondHandle " << writeHandle.fullKey() << " is already valid."
+                  << ". In theory this should not be called, but may happen"
+                  << " if multiple concurrent events are being processed out of order.");
+
+    return StatusCode::SUCCESS; 
+  }
+
+
+
+  //  // ____________ Construct new Write Cond Object  ____________
+  //  std::unique_ptr<TRTDedxcorrection> Dedxcorrection{std::make_unique<TRTDedxcorrection>()};
+  TRTDedxcorrection* Dedxcorrection = new TRTDedxcorrection; 
+
+  // ____________ Compute the Write Cond Object (Dedxcorrections)  ____________
+  SG::ReadCondHandle<CondAttrListVec> readVecHandle{m_VecReadKey};
+  const CondAttrListVec* channel_values{*readVecHandle};
+  if(channel_values==nullptr) {
+      ATH_MSG_ERROR(" Problem reading TRT/Calib/ToT/ToTVectors cond object");
+      delete Dedxcorrection;
+      return StatusCode::FAILURE;
+  }
+  if(StatusCode::SUCCESS != update1( *Dedxcorrection, channel_values  )) {
+     ATH_MSG_ERROR ("Problem filling Dedxcorrection.");
+     delete Dedxcorrection;
+     return StatusCode::FAILURE;     
+  }
+
+  SG::ReadCondHandle<CondAttrListCollection> readValHandle{m_ValReadKey};
+  const CondAttrListCollection* attrListColl{*readValHandle};
+  if(attrListColl==nullptr) {
+      ATH_MSG_ERROR(" Problem reading TRT/Calib/ToT/ToTValue cond object");
+      delete Dedxcorrection;
+      return StatusCode::FAILURE;
+  }
+  if(StatusCode::SUCCESS != update2( *Dedxcorrection, attrListColl  )) {
+     ATH_MSG_ERROR ("Problem filling Dedxcorrection.");
+     delete Dedxcorrection;
+     return StatusCode::FAILURE;     
+  }
+
+ 
+  //__________ Assign range of Dedxcorrection to that of the ReadHandle___________ 
+  EventIDRange rangeW;
+
+  if(!readVecHandle.range(rangeW)) {
+        ATH_MSG_ERROR("Failed to retrieve validity range for " << readVecHandle.key());
+        delete Dedxcorrection;
+        return StatusCode::FAILURE;
+  }
+
+  // Record  CDO
+  if(writeHandle.record(rangeW,Dedxcorrection).isFailure()) {
+    ATH_MSG_ERROR("Could not record " << writeHandle.key() 
+		  << " with EventRange " << rangeW
+		  << " into Conditions Store");
+    delete Dedxcorrection;
+    return StatusCode::FAILURE;
+  }
+
+
+  return StatusCode::SUCCESS;
+}
+
+StatusCode TRTToTCondAlg::finalize()
+{
+  ATH_MSG_DEBUG("finalize " << name());
+  return StatusCode::SUCCESS;
+}
+
+StatusCode TRTToTCondAlg::update1( TRTDedxcorrection& Dedxcorrection, const CondAttrListVec* channel_values){
+
+  std::vector<std::string>  dict_names = {"para_end_corrRZLXe","para_end_corrRZ_Xe","para_end_mimicToXeXe",
+    "para_long_corrRZLXe","para_long_corrRZ_Xe","para_long_mimicToXeXe","para_short_corrRZLXe",
+    "para_short_corrRZ_Xe","para_short_mimicToXeXe","resolution_Xe","resolution_e_Xe","para_end_corrRZLAr",
+    "para_end_corrRZ_Ar","para_end_mimicToXeAr","para_long_corrRZLAr","para_long_corrRZ_Ar",
+    "para_long_mimicToXeAr","para_short_corrRZLAr","para_short_corrRZ_Ar","para_short_mimicToXeAr",
+    "resolution_Ar","resolution_e_Ar","para_end_corrRZLKr","para_end_corrRZ_Kr","para_end_mimicToXeKr",
+    "para_long_corrRZLKr","para_long_corrRZ_Kr","para_long_mimicToXeKr","para_short_corrRZLKr",
+    "para_short_corrRZ_Kr","para_short_mimicToXeKr","resolution_Kr","resolution_e_Kr"};
+
+  std::map<std::string,std::vector<float> > result_dict;
+  int dataBaseType = kNewDB;
+  ATH_MSG_DEBUG("update():: dict_names[]="<<dict_names.size()<<", channel_values[]="<<channel_values->size()<<"");
+  if(channel_values->size()<19695) dataBaseType = kOldDB; 
+
+  if(dataBaseType==kNewDB) {
+        
+      CondAttrListVec::const_iterator first_channel = channel_values->begin();
+      CondAttrListVec::const_iterator last_channel  = channel_values->end();
+
+      unsigned int current_channel = 0;
+      std::vector<float> current_array_values = {};
+
+      for (; first_channel != last_channel; ++first_channel) {
+        if (current_channel != first_channel->first){
+          result_dict[dict_names[current_channel]] = current_array_values;
+          current_channel = first_channel->first;      
+          current_array_values.clear();
+        }
+        current_array_values.push_back(first_channel->second["array_value"].data<float>());             
+      }
+                        
+      result_dict[dict_names[current_channel]] = current_array_values;
+                        
+      update_New(Dedxcorrection, result_dict);
+      ATH_MSG_DEBUG ("update():: Reading new database is done!");
+
+      return StatusCode::SUCCESS;
+                
+  } else if(dataBaseType==kOldDB) {
+        ATH_MSG_WARNING ("update():: Old COOL database tag!");
+
+        std::vector<std::string>  dict_names_old = {"resolution","resolution_e","para_long_corrRZ_MC",
+             "para_short_corrRZ_MC","para_end_corrRZ_MC","para_long_corrRZL_MC",
+             "para_short_corrRZL_MC","para_end_corrRZL_MC"};
+        
+        CondAttrListVec::const_iterator first_channel = channel_values->begin();
+        CondAttrListVec::const_iterator last_channel  = channel_values->end();
+
+        unsigned int current_channel = 0;
+        std::vector<float> current_array_values = {};
+
+        for (; first_channel != last_channel; ++first_channel) {
+            if (current_channel != first_channel->first) {
+                result_dict[dict_names_old[current_channel]] = current_array_values;
+                current_channel = first_channel->first;      
+                current_array_values.clear();
+             }
+             current_array_values.push_back(first_channel->second["array_value"].data<float>());             
+        }
+                        
+        result_dict[dict_names_old[current_channel]] = current_array_values;
+
+        update_Old(Dedxcorrection, result_dict);
+        ATH_MSG_DEBUG ("update():: Reading old database is done!");
+
+        return StatusCode::SUCCESS;
+  }
+        return StatusCode::FAILURE;
+}
+
+void TRTToTCondAlg::update_New(TRTDedxcorrection & Dedxcorrection, std::map<std::string,std::vector<float> > &result_dict) {
+  //      fill Xenon +++++++++++++++++++++++++++++++++++++++++++++++++++++++++    
+  for (unsigned int ind=0; ind < 4; ++ind) {
+    Dedxcorrection.resolution[0][ind]=result_dict["resolution_Xe"][ind];
+  }
+
+  for (unsigned int ind=0; ind < 4; ++ind) {
+    Dedxcorrection.resolution_e[0][ind]=result_dict["resolution_e_Xe"][ind];
+  }
+
+  for (unsigned int ind=0; ind < 3240; ++ind) {
+    Dedxcorrection.para_long_corrRZ_MC[0][ind]=result_dict["para_long_corrRZ_Xe"][ind];
+  }
+
+  for (unsigned int ind=0; ind < 216; ++ind) {
+    Dedxcorrection.para_short_corrRZ_MC[0][ind]=result_dict["para_short_corrRZ_Xe"][ind];
+  }
+
+  for (unsigned int ind=0; ind < 630; ++ind) {
+    Dedxcorrection.para_long_corrRZL_MC[0][ind]=result_dict["para_long_corrRZLXe"][ind];
+  }
+
+  for (unsigned int ind=0; ind < 63; ++ind) {
+    Dedxcorrection.para_short_corrRZL_MC[0][ind]=result_dict["para_short_corrRZLXe"][ind];
+  }
+
+  for (unsigned int ind=0; ind < 252; ++ind) {
+    Dedxcorrection.para_end_corrRZL_MC[0][ind]=result_dict["para_end_corrRZLXe"][ind];
+  }
+
+  for (unsigned int ind=0; ind < 3240; ++ind) {
+    Dedxcorrection.para_long_corrRZ[0][ind]=result_dict["para_long_corrRZ_Xe"][ind];
+  }
+
+  for (unsigned int ind=0; ind < 216; ++ind) {
+    Dedxcorrection.para_short_corrRZ[0][ind]=result_dict["para_short_corrRZ_Xe"][ind];
+  }
+
+  for (unsigned int ind=0; ind < 630; ++ind) {
+    Dedxcorrection.para_long_corrRZL_DATA[0][ind]=result_dict["para_long_corrRZLXe"][ind];
+  }
+
+  for (unsigned int ind=0; ind < 63; ++ind) {
+    Dedxcorrection.para_short_corrRZL_DATA[0][ind]=result_dict["para_short_corrRZLXe"][ind];
+  }
+
+  for (unsigned int ind=0; ind < 252; ++ind) {
+    Dedxcorrection.para_end_corrRZL_DATA[0][ind]=result_dict["para_end_corrRZLXe"][ind];
+  }
+
+  for (unsigned int ind=0; ind < 336; ++ind) {
+    Dedxcorrection.para_end_corrRZ[0][ind]=result_dict["para_end_corrRZ_Xe"][ind];
+  }
+
+  for (unsigned int ind=0; ind < 336; ++ind) {
+    Dedxcorrection.para_end_corrRZ_MC[0][ind]=result_dict["para_end_corrRZ_Xe"][ind];
+  }
+
+        
+                
+  for (unsigned int ind=0; ind < 560; ++ind) {
+    Dedxcorrection.para_end_mimicToXe_DATA[0][ind]=result_dict["para_end_mimicToXeXe"][ind];
+  }
+  for (unsigned int ind=0; ind < 560; ++ind) {
+    Dedxcorrection.para_end_mimicToXe_MC[0][ind]=result_dict["para_end_mimicToXeXe"][ind];
+  }
+  for (unsigned int ind=0; ind < 180; ++ind) {
+    Dedxcorrection.para_short_mimicToXe_DATA[0][ind]=result_dict["para_short_mimicToXeXe"][ind];
+  }
+  for (unsigned int ind=0; ind < 180; ++ind) {
+    Dedxcorrection.para_short_mimicToXe_MC[0][ind]=result_dict["para_short_mimicToXeXe"][ind];
+  }
+  for (unsigned int ind=0; ind < 1800; ++ind) {
+    Dedxcorrection.para_long_mimicToXe_DATA[0][ind]=result_dict["para_long_mimicToXeXe"][ind];
+  }
+  for (unsigned int ind=0; ind < 1800; ++ind) {
+    Dedxcorrection.para_long_mimicToXe_MC[0][ind]=result_dict["para_long_mimicToXeXe"][ind];
+  }
+
+  //      fill Argon +++++++++++++++++++++++++++++++++++++++++++++++++++++++++    
+  for (unsigned int ind=0; ind < 4; ++ind) {
+    Dedxcorrection.resolution[1][ind]=result_dict["resolution_Ar"][ind];
+  }
+
+  for (unsigned int ind=0; ind < 4; ++ind) {
+    Dedxcorrection.resolution_e[1][ind]=result_dict["resolution_e_Ar"][ind];
+  }
+
+  for (unsigned int ind=0; ind < 3240; ++ind) {
+    Dedxcorrection.para_long_corrRZ_MC[1][ind]=result_dict["para_long_corrRZ_Ar"][ind];
+  }
+
+  for (unsigned int ind=0; ind < 216; ++ind) {
+    Dedxcorrection.para_short_corrRZ_MC[1][ind]=result_dict["para_short_corrRZ_Ar"][ind];
+  }
+
+  for (unsigned int ind=0; ind < 630; ++ind) {
+    Dedxcorrection.para_long_corrRZL_MC[1][ind]=result_dict["para_long_corrRZLAr"][ind];
+  }
+
+  for (unsigned int ind=0; ind < 63; ++ind) {
+    Dedxcorrection.para_short_corrRZL_MC[1][ind]=result_dict["para_short_corrRZLAr"][ind];
+  }
+
+  for (unsigned int ind=0; ind < 252; ++ind) {
+    Dedxcorrection.para_end_corrRZL_MC[1][ind]=result_dict["para_end_corrRZLAr"][ind];
+  }
+
+  for (unsigned int ind=0; ind < 3240; ++ind) {
+    Dedxcorrection.para_long_corrRZ[1][ind]=result_dict["para_long_corrRZ_Ar"][ind];
+  }
+
+  for (unsigned int ind=0; ind < 216; ++ind) {
+    Dedxcorrection.para_short_corrRZ[1][ind]=result_dict["para_short_corrRZ_Ar"][ind];
+  }
+
+  for (unsigned int ind=0; ind < 630; ++ind) {
+    Dedxcorrection.para_long_corrRZL_DATA[1][ind]=result_dict["para_long_corrRZLAr"][ind];
+  }
+
+  for (unsigned int ind=0; ind < 63; ++ind) {
+    Dedxcorrection.para_short_corrRZL_DATA[1][ind]=result_dict["para_short_corrRZLAr"][ind];
+  }
+
+  for (unsigned int ind=0; ind < 252; ++ind) {
+    Dedxcorrection.para_end_corrRZL_DATA[1][ind]=result_dict["para_end_corrRZLAr"][ind];
+  }
+
+  for (unsigned int ind=0; ind < 336; ++ind) {
+    Dedxcorrection.para_end_corrRZ[1][ind]=result_dict["para_end_corrRZ_Ar"][ind];
+  }
+
+  for (unsigned int ind=0; ind < 336; ++ind) {
+    Dedxcorrection.para_end_corrRZ_MC[1][ind]=result_dict["para_end_corrRZ_Ar"][ind];
+  }
+
+        
+                
+  for (unsigned int ind=0; ind < 560; ++ind) {
+    Dedxcorrection.para_end_mimicToXe_DATA[1][ind]=result_dict["para_end_mimicToXeAr"][ind];
+  }
+  for (unsigned int ind=0; ind < 560; ++ind) {
+    Dedxcorrection.para_end_mimicToXe_MC[1][ind]=result_dict["para_end_mimicToXeAr"][ind];
+  }
+  for (unsigned int ind=0; ind < 180; ++ind) {
+    Dedxcorrection.para_short_mimicToXe_DATA[1][ind]=result_dict["para_short_mimicToXeAr"][ind];
+  }
+  for (unsigned int ind=0; ind < 180; ++ind) {
+    Dedxcorrection.para_short_mimicToXe_MC[1][ind]=result_dict["para_short_mimicToXeAr"][ind];
+  }
+  for (unsigned int ind=0; ind < 1800; ++ind) {
+    Dedxcorrection.para_long_mimicToXe_DATA[1][ind]=result_dict["para_long_mimicToXeAr"][ind];
+  }
+  for (unsigned int ind=0; ind < 1800; ++ind) {
+    Dedxcorrection.para_long_mimicToXe_MC[1][ind]=result_dict["para_long_mimicToXeAr"][ind];
+  }
+
+  //      fill Krypton +++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
+  for (unsigned int ind=0; ind < 4; ++ind) {
+    Dedxcorrection.resolution[2][ind]=result_dict["resolution_Kr"][ind];
+  }
+
+  for (unsigned int ind=0; ind < 4; ++ind) {
+    Dedxcorrection.resolution_e[2][ind]=result_dict["resolution_e_Kr"][ind];
+  }
+
+  for (unsigned int ind=0; ind < 3240; ++ind) {
+    Dedxcorrection.para_long_corrRZ_MC[2][ind]=result_dict["para_long_corrRZ_Kr"][ind];
+  }
+
+  for (unsigned int ind=0; ind < 216; ++ind) {
+    Dedxcorrection.para_short_corrRZ_MC[2][ind]=result_dict["para_short_corrRZ_Kr"][ind];
+  }
+
+  for (unsigned int ind=0; ind < 630; ++ind) {
+    Dedxcorrection.para_long_corrRZL_MC[2][ind]=result_dict["para_long_corrRZLKr"][ind];
+  }
+
+  for (unsigned int ind=0; ind < 63; ++ind) {
+    Dedxcorrection.para_short_corrRZL_MC[2][ind]=result_dict["para_short_corrRZLKr"][ind];
+  }
+
+  for (unsigned int ind=0; ind < 252; ++ind) {
+    Dedxcorrection.para_end_corrRZL_MC[2][ind]=result_dict["para_end_corrRZLKr"][ind];
+  }
+
+  for (unsigned int ind=0; ind < 3240; ++ind) {
+    Dedxcorrection.para_long_corrRZ[2][ind]=result_dict["para_long_corrRZ_Kr"][ind];
+  }
+
+  for (unsigned int ind=0; ind < 216; ++ind) {
+    Dedxcorrection.para_short_corrRZ[2][ind]=result_dict["para_short_corrRZ_Kr"][ind];
+  }
+
+  for (unsigned int ind=0; ind < 630; ++ind) {
+    Dedxcorrection.para_long_corrRZL_DATA[2][ind]=result_dict["para_long_corrRZLKr"][ind];
+  }
+
+  for (unsigned int ind=0; ind < 63; ++ind) {
+    Dedxcorrection.para_short_corrRZL_DATA[2][ind]=result_dict["para_short_corrRZLKr"][ind];
+  }
+
+  for (unsigned int ind=0; ind < 252; ++ind) {
+    Dedxcorrection.para_end_corrRZL_DATA[2][ind]=result_dict["para_end_corrRZLKr"][ind];
+  }
+
+  for (unsigned int ind=0; ind < 336; ++ind) {
+    Dedxcorrection.para_end_corrRZ[2][ind]=result_dict["para_end_corrRZ_Kr"][ind];
+  }
+
+  for (unsigned int ind=0; ind < 336; ++ind) {
+    Dedxcorrection.para_end_corrRZ_MC[2][ind]=result_dict["para_end_corrRZ_Kr"][ind];
+  }
+
+        
+                
+  for (unsigned int ind=0; ind < 560; ++ind) {
+    Dedxcorrection.para_end_mimicToXe_DATA[2][ind]=result_dict["para_end_mimicToXeKr"][ind];
+  }
+  for (unsigned int ind=0; ind < 560; ++ind) {
+    Dedxcorrection.para_end_mimicToXe_MC[2][ind]=result_dict["para_end_mimicToXeKr"][ind];
+  }
+  for (unsigned int ind=0; ind < 180; ++ind) {
+    Dedxcorrection.para_short_mimicToXe_DATA[2][ind]=result_dict["para_short_mimicToXeKr"][ind];
+  }
+  for (unsigned int ind=0; ind < 180; ++ind) {
+    Dedxcorrection.para_short_mimicToXe_MC[2][ind]=result_dict["para_short_mimicToXeKr"][ind];
+  }
+  for (unsigned int ind=0; ind < 1800; ++ind) {
+    Dedxcorrection.para_long_mimicToXe_DATA[2][ind]=result_dict["para_long_mimicToXeKr"][ind];
+  }
+  for (unsigned int ind=0; ind < 1800; ++ind) {
+    Dedxcorrection.para_long_mimicToXe_MC[2][ind]=result_dict["para_long_mimicToXeKr"][ind];
+  }
+}
+
+
+
+void TRTToTCondAlg::update_Old(TRTDedxcorrection & Dedxcorrection, std::map<std::string,std::vector<float> > &result_dict) {
+  for(int gasType = 0; gasType<3; gasType++) { // loop over gas types
+    for (unsigned int ind=0; ind < 4; ++ind) {
+      Dedxcorrection.resolution[gasType][ind]=result_dict["resolution"][ind];
+    }
+
+    for (unsigned int ind=0; ind < 4; ++ind) {
+      Dedxcorrection.resolution_e[gasType][ind]=result_dict["resolution_e"][ind];
+    }
+
+    for (unsigned int ind=0; ind < 3240; ++ind) {
+      Dedxcorrection.para_long_corrRZ_MC[gasType][ind]=result_dict["para_long_corrRZ_MC"][ind];
+    }
+
+    for (unsigned int ind=0; ind < 216; ++ind) {
+      Dedxcorrection.para_short_corrRZ_MC[gasType][ind]=result_dict["para_short_corrRZ_MC"][ind];
+    }
+
+    for (unsigned int ind=0; ind < 630; ++ind) {
+      Dedxcorrection.para_long_corrRZL_MC[gasType][ind]=result_dict["para_long_corrRZL_MC"][ind];
+    }
+
+    for (unsigned int ind=0; ind < 63; ++ind) {
+      Dedxcorrection.para_short_corrRZL_MC[gasType][ind]=result_dict["para_short_corrRZL_MC"][ind];
+    }
+
+    for (unsigned int ind=0; ind < 252; ++ind) {
+      Dedxcorrection.para_end_corrRZL_MC[gasType][ind]=result_dict["para_end_corrRZL_MC"][ind];
+    }
+
+    for (unsigned int ind=0; ind < 3240; ++ind) {
+      Dedxcorrection.para_long_corrRZ[gasType][ind]=result_dict["para_long_corrRZ_MC"][ind];
+    }
+
+    for (unsigned int ind=0; ind < 216; ++ind) {
+      Dedxcorrection.para_short_corrRZ[gasType][ind]=result_dict["para_short_corrRZ_MC"][ind];
+    }
+
+    for (unsigned int ind=0; ind < 630; ++ind) {
+      Dedxcorrection.para_long_corrRZL_DATA[gasType][ind]=result_dict["para_long_corrRZL_MC"][ind];
+    }
+
+    for (unsigned int ind=0; ind < 63; ++ind) {
+      Dedxcorrection.para_short_corrRZL_DATA[gasType][ind]=result_dict["para_short_corrRZL_MC"][ind];
+    }
+
+    for (unsigned int ind=0; ind < 252; ++ind) {
+      Dedxcorrection.para_end_corrRZL_DATA[gasType][ind]=result_dict["para_end_corrRZL_MC"][ind];
+    }
+
+    for (unsigned int ind=0; ind < 336; ++ind) {
+      Dedxcorrection.para_end_corrRZ[gasType][ind]=result_dict["para_end_corrRZ_MC"][ind];
+    }
+
+    for (unsigned int ind=0; ind < 336; ++ind) {
+      Dedxcorrection.para_end_corrRZ_MC[gasType][ind]=result_dict["para_end_corrRZ_MC"][ind];
+    }
+
+    // Setting aditional corrections
+    for (unsigned int ind=0; ind < 560; ++ind) {
+      Dedxcorrection.para_end_mimicToXe_MC[gasType][ind]   = 1.;
+      Dedxcorrection.para_end_mimicToXe_DATA[gasType][ind] = 1.;
+    }
+
+    for (unsigned int ind=0; ind < 180; ++ind) {
+      Dedxcorrection.para_short_mimicToXe_MC[gasType][ind]   = 1.;
+      Dedxcorrection.para_short_mimicToXe_DATA[gasType][ind] = 1.;
+    }
+
+    for (unsigned int ind=0; ind < 1800; ++ind) {
+      Dedxcorrection.para_long_mimicToXe_MC[gasType][ind]   = 1.;
+      Dedxcorrection.para_long_mimicToXe_DATA[gasType][ind] = 1.;
+    }
+  }
+}
+
+StatusCode TRTToTCondAlg::update2(TRTDedxcorrection& Dedxcorrection, const CondAttrListCollection* attrListColl ){
+
+  int dataBaseType = kNewDB;
+  if(attrListColl->size() < 2) dataBaseType = kOldDB;
+
+  CondAttrListCollection::const_iterator first = attrListColl->begin();
+  CondAttrListCollection::const_iterator last  = attrListColl->end();
+
+  if(dataBaseType==kNewDB) {
+     for (int index=0; first != last; ++first,++index) {
+        const coral::AttributeList& attrList = (*first).second;
+        Dedxcorrection.paraL_dEdx_p1[index] = attrList["paraL_dEdx_p1"].data<float>();
+        Dedxcorrection.paraL_dEdx_p2[index] = attrList["paraL_dEdx_p2"].data<float>();
+        Dedxcorrection.paraL_dEdx_p3[index] = attrList["paraL_dEdx_p3"].data<float>();
+        Dedxcorrection.paraL_dEdx_p4[index] = attrList["paraL_dEdx_p4"].data<float>();
+        Dedxcorrection.paraL_dEdx_p5[index] = attrList["paraL_dEdx_p5"].data<float>();
+
+        Dedxcorrection.para_dEdx_p1[index] = attrList["para_dEdx_p1"].data<float>();
+        Dedxcorrection.para_dEdx_p2[index] = attrList["para_dEdx_p2"].data<float>();
+        Dedxcorrection.para_dEdx_p3[index] = attrList["para_dEdx_p3"].data<float>();
+        Dedxcorrection.para_dEdx_p4[index] = attrList["para_dEdx_p4"].data<float>();
+        Dedxcorrection.para_dEdx_p5[index] = attrList["para_dEdx_p5"].data<float>();
+                                  
+        Dedxcorrection.norm_offset_data[index] = attrList["norm_offset_data"].data<float>();
+        Dedxcorrection.norm_slope_tot[index] = attrList["norm_slope_tot"].data<float>();  
+        Dedxcorrection.norm_slope_totl[index] = attrList["norm_slope_totl"].data<float>(); 
+        Dedxcorrection.norm_offset_tot[index] = attrList["norm_offset_tot"].data<float>(); 
+        Dedxcorrection.norm_offset_totl[index] = attrList["norm_offset_totl"].data<float>();           
+        Dedxcorrection.norm_nzero[index]=attrList["norm_nzero"].data<int>();
+     }
+  } else {
+     ATH_MSG_WARNING ("update2():: Old COOL database tag!");
+     // return update2_Old();
+     for (; first != last; ++first) {  
+        const coral::AttributeList& attrList = (*first).second;
+        for(int gasType=0; gasType<3; gasType++) {
+           Dedxcorrection.paraL_dEdx_p1[gasType] = attrList["paraL_dEdx_p1"].data<float>();
+           Dedxcorrection.paraL_dEdx_p2[gasType] = attrList["paraL_dEdx_p2"].data<float>();
+           Dedxcorrection.paraL_dEdx_p3[gasType] = attrList["paraL_dEdx_p3"].data<float>();
+           Dedxcorrection.paraL_dEdx_p4[gasType] = attrList["paraL_dEdx_p4"].data<float>();
+           Dedxcorrection.paraL_dEdx_p5[gasType] = attrList["paraL_dEdx_p5"].data<float>();
+
+           Dedxcorrection.para_dEdx_p1[gasType] = attrList["para_dEdx_p1"].data<float>();
+           Dedxcorrection.para_dEdx_p2[gasType] = attrList["para_dEdx_p2"].data<float>();
+           Dedxcorrection.para_dEdx_p3[gasType] = attrList["para_dEdx_p3"].data<float>();
+           Dedxcorrection.para_dEdx_p4[gasType] = attrList["para_dEdx_p4"].data<float>();
+           Dedxcorrection.para_dEdx_p5[gasType] = attrList["para_dEdx_p5"].data<float>();
+
+           Dedxcorrection.norm_offset_data[gasType] = attrList["norm_offset_data"].data<float>();
+           Dedxcorrection.norm_slope_tot[gasType] = attrList["norm_slope_tot"].data<float>();  
+           Dedxcorrection.norm_slope_totl[gasType] = attrList["norm_slope_totl"].data<float>(); 
+           Dedxcorrection.norm_offset_tot[gasType] = attrList["norm_offset_tot"].data<float>(); 
+           Dedxcorrection.norm_offset_totl[gasType] = attrList["norm_offset_totl"].data<float>();         
+           Dedxcorrection.norm_nzero[gasType]=attrList["norm_nzero"].data<int>(); 
+        }
+     }
+  }
+
+  return StatusCode::SUCCESS;
+}
+
+
diff --git a/InnerDetector/InDetConditions/TRT_ConditionsAlgs/src/TRTToTCondAlg.h b/InnerDetector/InDetConditions/TRT_ConditionsAlgs/src/TRTToTCondAlg.h
new file mode 100644
index 0000000000000000000000000000000000000000..f20f5586e0ed862dbe02153fbc65f3dd90f27d4b
--- /dev/null
+++ b/InnerDetector/InDetConditions/TRT_ConditionsAlgs/src/TRTToTCondAlg.h
@@ -0,0 +1,42 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef TRTTOTCONDALG_H
+#define TRTTOTCONDALG_H
+
+#include <map>
+#include <string>
+#include <vector>
+
+#include "AthenaBaseComps/AthAlgorithm.h"
+#include "StoreGate/WriteCondHandleKey.h"
+#include "AthenaPoolUtilities/CondAttrListVec.h"
+#include "AthenaPoolUtilities/CondAttrListCollection.h"
+#include "GaudiKernel/ICondSvc.h"
+#include "GaudiKernel/Property.h"
+#include "TRT_ConditionsData/TRTDedxcorrection.h"
+
+class TRTToTCondAlg : public AthAlgorithm
+{
+ public:
+  TRTToTCondAlg(const std::string& name, ISvcLocator* pSvcLocator);
+  virtual ~TRTToTCondAlg() override;
+
+  virtual StatusCode initialize() override;
+  virtual StatusCode execute() override;
+  virtual StatusCode finalize() override;
+  enum EDataBaseType {kOldDB,kNewDB};
+  StatusCode update1( TRTDedxcorrection& Dedxcorrection, const CondAttrListVec* channel_values);
+  void update_New(TRTDedxcorrection& Dedxcorrection, std::map<std::string,std::vector<float> > &result_dict) ;
+  void update_Old(TRTDedxcorrection& Dedxcollection, std::map<std::string,std::vector<float> > &result_dict) ;
+  StatusCode update2(TRTDedxcorrection& Dedxcorrection, const CondAttrListCollection* attrListColl );
+
+ private:
+  ServiceHandle<ICondSvc> m_condSvc;
+  SG::ReadCondHandleKey<CondAttrListVec> m_VecReadKey{this,"ToTVecReadKey","/TRT/Calib/ToT/ToTVectors","ToTVec in-key"};
+  SG::ReadCondHandleKey<CondAttrListCollection> m_ValReadKey{this,"ToTValReadKey","/TRT/Calib/ToT/ToTValue","ToTVal in-key"};
+  SG::WriteCondHandleKey<TRTDedxcorrection> m_WriteKey{this,"ToTWriteKey","Dedxcorrection","Dedxcorrection out-key"};
+
+};
+#endif
diff --git a/InnerDetector/InDetConditions/TRT_ConditionsAlgs/src/components/TRT_ConditionsAlgs_entries.cxx b/InnerDetector/InDetConditions/TRT_ConditionsAlgs/src/components/TRT_ConditionsAlgs_entries.cxx
index 059774c30e7eb33a42677613b0841099db9ad6d1..da65ad8321becac3ec7cca5c6c510012d9df04e1 100644
--- a/InnerDetector/InDetConditions/TRT_ConditionsAlgs/src/components/TRT_ConditionsAlgs_entries.cxx
+++ b/InnerDetector/InDetConditions/TRT_ConditionsAlgs/src/components/TRT_ConditionsAlgs_entries.cxx
@@ -2,9 +2,17 @@
 #include "TRT_ConditionsAlgs/TRTStrawAlign.h"
 #include "TRT_ConditionsAlgs/TRTStrawStatusWrite.h"
 #include "../TRTAlignCondAlg.h"
+#include "../TRTStrawCondAlg.h"
+#include "../TRTHTCondAlg.h"
+#include "../TRTToTCondAlg.h"
+#include "../TRTActiveCondAlg.h"
 
 
 DECLARE_COMPONENT( TRTCondWrite )
 DECLARE_COMPONENT( TRTStrawAlign )
 DECLARE_COMPONENT( TRTStrawStatusWrite )
 DECLARE_COMPONENT( TRTAlignCondAlg )
+DECLARE_COMPONENT( TRTStrawCondAlg )
+DECLARE_COMPONENT( TRTHTCondAlg )
+DECLARE_COMPONENT( TRTToTCondAlg )
+DECLARE_COMPONENT( TRTActiveCondAlg )
diff --git a/InnerDetector/InDetConditions/TRT_ConditionsData/CMakeLists.txt b/InnerDetector/InDetConditions/TRT_ConditionsData/CMakeLists.txt
index 4679576b69f319f21064b80ba97cc70bcd6c1d7d..8b620cc1aa28d6547c8c86a280269969afe85f21 100644
--- a/InnerDetector/InDetConditions/TRT_ConditionsData/CMakeLists.txt
+++ b/InnerDetector/InDetConditions/TRT_ConditionsData/CMakeLists.txt
@@ -8,10 +8,15 @@ atlas_subdir( TRT_ConditionsData )
 # Declare the package's dependencies:
 atlas_depends_on_subdirs( PUBLIC
                           Control/AthenaKernel
+                          Control/AthToolSupport/AsgTools
                           Database/AthenaPOOL/AthenaPoolUtilities
                           DetectorDescription/DetDescrCond/DetDescrConditions
                           DetectorDescription/Identifier
-                          GaudiKernel )
+                          GaudiKernel 
+                          PRIVATE
+                          Tracking/TrkEvent/TrkEventPrimitives)
+ 
+
 
 # External dependencies:
 find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
@@ -21,12 +26,12 @@ atlas_add_library( TRT_ConditionsData
                    src/*.cxx
                    PUBLIC_HEADERS TRT_ConditionsData
                    PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                   LINK_LIBRARIES AthenaPoolUtilities DetDescrConditions Identifier GaudiKernel
+                   LINK_LIBRARIES AthenaPoolUtilities DetDescrConditions Identifier GaudiKernel AsgTools TrkEventPrimitives
                    PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} )
 
 atlas_add_dictionary( TRT_ConditionsDataDict
                       TRT_ConditionsData/TRT_ConditionsDataDict.h
                       TRT_ConditionsData/selection.xml
                       INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                      LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaPoolUtilities DetDescrConditions Identifier GaudiKernel TRT_ConditionsData )
+                      LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaPoolUtilities DetDescrConditions Identifier GaudiKernel AsgTools TRT_ConditionsData )
 
diff --git a/InnerDetector/InDetConditions/TRT_ConditionsData/TRT_ConditionsData/ActiveFraction.h b/InnerDetector/InDetConditions/TRT_ConditionsData/TRT_ConditionsData/ActiveFraction.h
new file mode 100644
index 0000000000000000000000000000000000000000..7c4a8bd6e6670012b6e6a5c4ac8cb4d3916386f7
--- /dev/null
+++ b/InnerDetector/InDetConditions/TRT_ConditionsData/TRT_ConditionsData/ActiveFraction.h
@@ -0,0 +1,104 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef ACTIVEFRACTION_H
+#define ACTIVEFRACTION_H
+#include <vector>
+#include "AthenaKernel/CLASS_DEF.h"
+#include "AthenaKernel/CondCont.h"
+#ifndef M_PI
+#define M_PI  3.141592653589793238462643383279502884197
+#endif
+namespace TRTCond{
+  // eta,phi binned map of the active straw fraction
+  class ActiveFraction{
+  public:
+    ActiveFraction();
+    virtual ~ActiveFraction(){};
+    int findEtaBin( float eta ) const;
+    int findPhiBin( float phi ) const;
+    float getActiveFraction( float eta, float phi ) const;
+    std::vector<std::pair<float,float>> getEtaBins( ) const;
+    std::vector<std::pair<float,float>> getPhiBins( ) const;
+    void  setActiveFraction( unsigned int etaBin, unsigned int phiBin, float value);
+ 
+  private:
+    int m_nBinsPhi;
+    std::vector<std::pair<float,float> > m_etaBins;
+    std::vector<std::pair<float,float> > m_phiBins;
+    std::vector<std::vector<float> > m_activeFracTable; // [etaBin,phiBin]
+  };
+  inline ActiveFraction::ActiveFraction() {
+     m_nBinsPhi=96;
+     m_etaBins.push_back( std::make_pair(-2.1,-1.75) );
+     m_etaBins.push_back( std::make_pair(-1.75,-1.3) );
+     m_etaBins.push_back( std::make_pair(-1.3,-1.07) );
+     m_etaBins.push_back( std::make_pair(-1.07,-0.65) );
+     m_etaBins.push_back( std::make_pair(-0.65,-0.1) );
+     m_etaBins.push_back( std::make_pair(-0.1,0.) );
+     m_etaBins.push_back( std::make_pair(0.,0.1) );
+     m_etaBins.push_back( std::make_pair(0.1,0.65) );
+     m_etaBins.push_back( std::make_pair(0.65,1.07) );
+     m_etaBins.push_back( std::make_pair(1.07,1.3) );
+     m_etaBins.push_back( std::make_pair(1.3,1.75) );
+     m_etaBins.push_back( std::make_pair(1.75,2.1) );
+     float phiEdgeLow = -1. * M_PI;
+     float deltaPhi = 2. * M_PI / (1. * m_nBinsPhi) ;
+     for ( int i = 0; i < m_nBinsPhi; ++i ) {
+       m_phiBins.push_back( std::make_pair( phiEdgeLow + i*deltaPhi, phiEdgeLow + (i+1)*deltaPhi ) );
+     }
+     // Initialize the table with 1.'s
+     std::vector<float> dummyPhiVec( m_phiBins.size(), 1. );
+     std::vector<std::vector<float> > dummyTable( m_etaBins.size(), dummyPhiVec );
+     m_activeFracTable = dummyTable;
+  }
+
+  inline int ActiveFraction::findEtaBin( float eta) const {
+     int etaBin = 0;
+     for ( ; etaBin < (int)m_etaBins.size(); ++etaBin ) {
+        std::pair<float,float> theBin = m_etaBins.at(etaBin);
+        if ( eta > theBin.first && eta <= theBin.second ) break;
+     }
+     if ( etaBin == (int)m_etaBins.size() ) return -1;
+
+     return etaBin;
+  }
+
+  inline int ActiveFraction::findPhiBin( float phi) const {
+     int phiBin = 0;
+     for ( ; phiBin < (int)m_phiBins.size(); ++phiBin ) {
+	std::pair<float,float> theBin = m_phiBins.at(phiBin);
+	if ( phi > theBin.first && phi <= theBin.second ) break;
+     }
+     if ( phiBin == (int)m_phiBins.size() ) return-1;
+     return phiBin;
+  }
+
+  inline float ActiveFraction::getActiveFraction( float eta, float phi ) const {
+
+ 
+     int etaBin = findEtaBin(eta);
+     if ( etaBin < 0 ) return 1.;
+     int phiBin = findPhiBin(phi);
+     if ( phiBin < 0 ) return 1.;
+     return m_activeFracTable[etaBin][phiBin];
+  }
+  inline void ActiveFraction::setActiveFraction( unsigned int etaBin, unsigned int phiBin, float value) {
+
+     m_activeFracTable[etaBin][phiBin] = value;
+  }
+  
+  inline  std::vector<std::pair<float,float>> ActiveFraction::getEtaBins( ) const {
+    return m_etaBins;
+  }
+
+  inline  std::vector<std::pair<float,float>> ActiveFraction::getPhiBins( ) const {
+    return m_phiBins;
+  }
+
+}
+
+CLASS_DEF(TRTCond::ActiveFraction,69272917,1)
+CONDCONT_DEF(TRTCond::ActiveFraction,85974973);
+#endif
diff --git a/InnerDetector/InDetConditions/TRT_ConditionsData/TRT_ConditionsData/AliveStraws.h b/InnerDetector/InDetConditions/TRT_ConditionsData/TRT_ConditionsData/AliveStraws.h
new file mode 100644
index 0000000000000000000000000000000000000000..ae21c9b65d71deccb8882089976227abf2883be5
--- /dev/null
+++ b/InnerDetector/InDetConditions/TRT_ConditionsData/TRT_ConditionsData/AliveStraws.h
@@ -0,0 +1,42 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef ALIVESTRAWS_H
+#define ALIVESTRAWS_H
+#include "AthenaKernel/CLASS_DEF.h"
+#include "AthenaKernel/CondCont.h"
+namespace TRTCond{
+  class AliveStraws{
+  public:
+    AliveStraws() {
+       // Create arrays for alive straws
+       // These are moved to CondStore which takes care of their deletion 
+       m_stw_total = new int[7]();
+       m_stw_local = new int*[6];
+       m_stw_wheel = new int*[34];
+       for (int i=0; i<6 ; ++i) m_stw_local[i] = new int[32]();
+       for (int i=0; i<34; ++i) m_stw_wheel[i] = new int[32]();
+    }
+
+    virtual ~AliveStraws() {}
+    int  *getStwTotal() const {return m_stw_total; } 
+    int **getStwLocal() const {return m_stw_local; } 
+    int **getStwWheel() const {return m_stw_wheel; } 
+    void update(const int& i, const int& j, const int& phi) {
+
+      m_stw_total[0]                        +=1;
+      m_stw_total[i]                        +=1;
+      m_stw_local[i-1][phi]                 +=1;
+      m_stw_wheel[j][phi]                   +=1;
+    }
+
+  private:
+    int *m_stw_total;
+    int **m_stw_local;
+    int **m_stw_wheel;
+  };
+}
+CLASS_DEF(TRTCond::AliveStraws,234870469,1)
+CONDCONT_DEF(TRTCond::AliveStraws,110897079);
+#endif
diff --git a/InnerDetector/InDetConditions/TRT_ConditionsData/TRT_ConditionsData/HTcalculator.h b/InnerDetector/InDetConditions/TRT_ConditionsData/TRT_ConditionsData/HTcalculator.h
new file mode 100644
index 0000000000000000000000000000000000000000..0df1195eca650314db7048475fc9b3ca605eee9c
--- /dev/null
+++ b/InnerDetector/InDetConditions/TRT_ConditionsData/TRT_ConditionsData/HTcalculator.h
@@ -0,0 +1,82 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+#ifndef INDETTRT_HTCALCULATOR
+#define INDETTRT_HTCALCULATOR
+
+///////////////////////////////////////////////////////////////////
+// HTcalculater.h, (c) ATLAS Detector software
+///////////////////////////////////////////////////////////////////
+
+/****************************************************************************************\
+
+  This class is instantiated in TRTHTCondAlg and put on CondStore
+
+  Original creator: Simon Heisterkamp (simon.heisterkamp@cern.ch)
+  Author: Troels Petersen (petersen@nbi.dk)
+          Peter Hansen (phansen@nbi.dk)
+
+\****************************************************************************************/
+#include "TRT_ConditionsData/StorePIDinfo.h"
+#include "AthenaPoolUtilities/CondAttrListVec.h"
+#include "TrkEventPrimitives/ParticleHypothesis.h"
+#include "GaudiKernel/StatusCode.h"
+#include "AthenaKernel/CLASS_DEF.h"
+#include "AthenaKernel/CondCont.h"
+
+
+class HTcalculator {
+ public:
+
+  HTcalculator();
+  virtual ~HTcalculator();
+
+  void checkInitialization();  
+  float Limit( float prob);  
+  // set constants to hard coded defaults
+  void setDefaultCalibrationConstants();
+
+  StatusCode ReadVectorDB( const CondAttrListVec* channel_values );
+
+  float getProbHT( float pTrk, Trk::ParticleHypothesis hypothesis, int TrtPart, int GasType, int StrawLayer, float ZR, float rTrkAnode, float Occupancy, bool hasTrackPars) const;
+
+  float pHTvsPGOG(int TrtPart, int GasType, float p, float mass, float occ) const;
+
+
+
+ private:
+
+  bool m_HasBeenInitialized;
+
+  static const int N_GAS = 3;
+  static const int N_DET = 3;
+  static const int N_PAR2 = 10;
+  StorePIDinfo m_par_pHTvsPGOG_new [N_GAS][N_DET]; 	// New approach (useOccupancy = true)
+
+
+// Store in a compact way all the corrections
+  StorePIDinfo m_CpHT_B_Zee_SL_new  	[N_GAS]	[N_DET];
+  StorePIDinfo m_CpHT_B_Zmm_SL_new  	[N_GAS]	[N_DET];
+
+  StorePIDinfo m_CpHT_B_Zee_ZR_new  	[N_GAS]	[N_DET];
+  StorePIDinfo m_CpHT_B_Zmm_ZR_new  	[N_GAS]	[N_DET];
+
+  StorePIDinfo m_CpHT_B_Zee_TW_new  	[N_GAS]	[N_DET];
+  StorePIDinfo m_CpHT_B_Zmm_TW_new  	[N_GAS]	[N_DET];
+
+  StorePIDinfo m_CpHT_B_Zee_OR_new  	[N_GAS]	[N_DET];
+  StorePIDinfo m_CpHT_B_Zmm_OR_new  	[N_GAS]	[N_DET];
+
+
+  Trk::ParticleMasses        m_particlemasses;
+
+  static const int SIZE_OF_HEADER = sizeof(float) * 4;
+  static const int SIZE_OF_BLOB     = sizeof(float) *( (N_PAR2*N_DET));
+
+  bool m_datainplace;
+
+};  
+
+CLASS_DEF(HTcalculator,241669896,1)
+CONDCONT_DEF(HTcalculator,124823640);
+#endif
diff --git a/InnerDetector/InDetConditions/TRT_ConditionsData/TRT_ConditionsData/StorePIDinfo.h b/InnerDetector/InDetConditions/TRT_ConditionsData/TRT_ConditionsData/StorePIDinfo.h
new file mode 100644
index 0000000000000000000000000000000000000000..eefc1a47c86545fde7cb390e7842f02e46c99f5c
--- /dev/null
+++ b/InnerDetector/InDetConditions/TRT_ConditionsData/TRT_ConditionsData/StorePIDinfo.h
@@ -0,0 +1,30 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+#ifndef INDETTRT_STOREPIDINFO
+#define INDETTRT_STOREPIDINFO
+
+///////////////////////////////////////////////////////////////////
+// StorePIDinfo.h , (c) ATLAS Detector software
+///////////////////////////////////////////////////////////////////
+#include <vector>
+#include "GaudiKernel/StatusCode.h"
+class StorePIDinfo{
+  public:
+   StorePIDinfo();
+   StorePIDinfo(int nbins, float min, float max, std::vector<float> values);
+   ~StorePIDinfo();
+   void update (int nbins, float min, float max, std::vector<float> values );
+   void push_back ( float value );
+   StatusCode check ( int gas, int detpart) const; 
+   float GetValue ( float input	) const; 
+   float GetBinValue ( int bin ) const; 
+   int   GetBin   ( float input	) const; 
+  private:
+   unsigned int m_nbins		;
+   float m_min		;
+   float m_max		;
+   std::vector<float>  	m_values;
+};
+#endif
+
diff --git a/InnerDetector/InDetConditions/TRT_ConditionsData/TRT_ConditionsData/TRTDedxcorrection.h b/InnerDetector/InDetConditions/TRT_ConditionsData/TRT_ConditionsData/TRTDedxcorrection.h
new file mode 100644
index 0000000000000000000000000000000000000000..7084393ef3f5f893291d6aaf8b91f8aeaf6a2061
--- /dev/null
+++ b/InnerDetector/InDetConditions/TRT_ConditionsData/TRT_ConditionsData/TRTDedxcorrection.h
@@ -0,0 +1,69 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef TRTDEDXCORRECTION_H
+#define TRTDEDXCORRECTION_H
+
+
+struct TRTDedxcorrection {
+   
+  double paraL_dEdx_p1[3];
+  double paraL_dEdx_p2[3];
+  double paraL_dEdx_p3[3];
+  double paraL_dEdx_p4[3];
+  double paraL_dEdx_p5[3];
+
+  double para_dEdx_p1[3];
+  double para_dEdx_p2[3];
+  double para_dEdx_p3[3];
+  double para_dEdx_p4[3];
+  double para_dEdx_p5[3];
+
+      
+  // resolution depends on the number of hits (and is different for e)
+  double resolution[3][4];
+  double resolution_e[3][4];
+
+  // corrections for pile-up (as a function of NVtx linear behavior observed)
+  // was in principle also done separately for different detector regions
+  // should be checked in more details when high pileup data available
+
+  double norm_offset_data[3];  // offset in normalization between data and MC
+  double norm_slope_tot[3];    // nvtx dependence for ToT
+  double norm_slope_totl[3];   // nvtx dependence for ToT/L
+  double norm_offset_tot[3];   // nvtx dependence for ToT
+  double norm_offset_totl[3];  // nvtx dependence for ToT/L
+  int norm_nzero[3];           // for which average NVtx the fit parameters were determined
+
+  double para_long_corrRZ[3][3240];
+  double para_short_corrRZ[3][216];
+  double para_end_corrRZ[3][336];
+  
+  double para_long_corrRZ_MC[3][3240];
+  double para_short_corrRZ_MC[3][216];
+  double para_end_corrRZ_MC[3][336]; 
+  double para_long_corrRZL_MC[3][630];
+  double para_short_corrRZL_MC[3][144];
+  double para_end_corrRZL_MC[3][252];
+  
+  double para_long_corrRZL_DATA[3][630];
+  double para_short_corrRZL_DATA[3][63];
+  double para_end_corrRZL_DATA[3][252]; 
+
+  float para_end_mimicToXe_MC[3][560];
+  float para_end_mimicToXe_DATA[3][560];
+
+  float para_short_mimicToXe_MC[3][180];
+  float para_short_mimicToXe_DATA[3][180];
+  float para_long_mimicToXe_MC[3][1800];
+  float para_long_mimicToXe_DATA[3][1800];
+ 
+  //==============================================================  
+  
+
+};
+CLASS_DEF(TRTDedxcorrection,105466510,1)
+CONDCONT_DEF(TRTDedxcorrection,114226988);
+
+#endif  /* TRTDEDXCORRECTION_H */
diff --git a/InnerDetector/InDetRecTools/TRT_ElectronPidTools/src/TRT_ElectronPidToolRun2_HTcalculation.cxx b/InnerDetector/InDetConditions/TRT_ConditionsData/src/HTcalculator.cxx
similarity index 86%
rename from InnerDetector/InDetRecTools/TRT_ElectronPidTools/src/TRT_ElectronPidToolRun2_HTcalculation.cxx
rename to InnerDetector/InDetConditions/TRT_ConditionsData/src/HTcalculator.cxx
index 7cc9426abed75256d4c0958b4694b5d1b99a13b3..e1327d298bb0075cb5735837bc1451b1e42b4dcf 100644
--- a/InnerDetector/InDetRecTools/TRT_ElectronPidTools/src/TRT_ElectronPidToolRun2_HTcalculation.cxx
+++ b/InnerDetector/InDetConditions/TRT_ConditionsData/src/HTcalculator.cxx
@@ -1,760 +1,663 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
+#include "TRT_ConditionsData/HTcalculator.h"
+#include "AsgTools/MsgStreamMacros.h"
+
+/*****************************************************************************\
+|*%%%  Default Constructor  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*|
+\*****************************************************************************/
+
+HTcalculator::HTcalculator()
+{
+  m_datainplace = false;
+  m_HasBeenInitialized=0;
+}
+
+/*****************************************************************************\
+|*%%%  Default Destructor  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*|
+\*****************************************************************************/
+
+HTcalculator::~HTcalculator(){
+  //Nothing here yet
+}
+
+void HTcalculator::checkInitialization(){
+  if( not m_HasBeenInitialized ) {
+    //ATH_MSG_WARNING( "The HTcalculator is about to be used uninitialized - Loading default");
+    setDefaultCalibrationConstants();
+    m_HasBeenInitialized=1;
+  }
+}
+
+float HTcalculator::Limit(float prob){
+  if( prob > 1.0 ){
+    return 1.0;
+  }
+  else if( prob < 0.0 ){
+    return 0.0;
+  }
+  
+  return prob;
+}
+
+/*****************************************************************************\
+|*%%%  Get The Pobability of this hit being a Hight THreshold hit  %%%%%%%%%%*|
+\*****************************************************************************/
+
+// TrtPart: 0 = Barrel, 1 = EndcapA, 2 = EndcapB
+// GasType: 0 = Xenon,  1 = Argon,   2 = Krypton
+float HTcalculator::getProbHT(
+      float pTrk, Trk::ParticleHypothesis hypothesis,
+      int TrtPart, int GasType, int StrawLayer,
+      float ZR, float rTrkWire, float Occupancy, bool hasTrackPars = true ) const {
+
+
+  //FIXME: This setup the Troels constants. THIS OVERRIDES CURRENT DB!!!
+  // setDefaultCalibrationConstants();
+
+  float pHT = 1.0;       // Default/unit value, which ensures that unusable hits does not change probability product!
+  // Make sure that the information passed makes sense:
+  // --------------------------------------------------
+  if (pTrk < 250.0 || pTrk > 7000000.0) return pHT;
+
+  if (TrtPart < 0 || TrtPart > 2) return pHT;
+  if (GasType < 0 || GasType > 2) return pHT;
+
+  if ((TrtPart == 0 && (StrawLayer < 0 || StrawLayer > 72)) ||
+      (TrtPart == 1 && (StrawLayer < 0 || StrawLayer > 95)) ||
+      (TrtPart == 2 && (StrawLayer < 0 || StrawLayer > 63))) return pHT;
+
+  if ((TrtPart == 0 && (ZR > 720.0)) ||
+      (TrtPart  > 0 && (ZR < 630.0 || ZR > 1030.0))) return pHT;
+
+  if (rTrkWire < 0.0 || rTrkWire > 2.2) return pHT;
+
+
+  // Calculate the High Threshold probability, pHT:
+  // ----------------------------------------------
+  float correctionSL, correctionZR, correctionTW;
+  float mass = m_particlemasses.mass[hypothesis];
+  float correctionPGOG=-999.;
+  if (GasType==1 &&  TrtPart==2) {
+    //estimate EB argon straws as follows:
+    // estimate pHT using EA argon straws (GasType=1, TrtPart=1)
+    // estimate correction factors using EB xenon straws (GasType=0, TrtPart=2)
+    correctionPGOG = pHTvsPGOG(1, GasType, pTrk, mass, Occupancy);
+    GasType = 0;
+  } else {
+    correctionPGOG = pHTvsPGOG(TrtPart, GasType, pTrk, mass, Occupancy);
+  }
+
+  // Jared -- Change this ugly check, use hypothesis!
+  if (fabs(mass-0.511) < 0.1) {      // Electron! OK, ugly way but works...
+    correctionSL = m_CpHT_B_Zee_SL_new[GasType][TrtPart].GetValue(StrawLayer);
+    correctionZR = m_CpHT_B_Zee_ZR_new[GasType][TrtPart].GetValue(ZR);
+    correctionTW = m_CpHT_B_Zee_TW_new[GasType][TrtPart].GetValue(rTrkWire);
+  } else {                           // Non-electron!
+    correctionSL = m_CpHT_B_Zmm_SL_new[GasType][TrtPart].GetValue(StrawLayer);
+    correctionZR = m_CpHT_B_Zmm_ZR_new[GasType][TrtPart].GetValue(ZR);
+    correctionTW = m_CpHT_B_Zmm_TW_new[GasType][TrtPart].GetValue(rTrkWire);
+  }
+
+  // Jared - In absence of track pars, no ZR or TW information -- disable correction factors
+  if (not hasTrackPars) { correctionZR = 1.0; correctionTW = 1.0; }
+
+  // Jared - Temporarily disable ZR corrections, reproducibility issues with calibration
+  //correctionZR = 1.0;
+
+  /*
+  std::cout "check       "
+		 << "  GammaOccupan: " << correctionPGOG
+		 << "  correctionSL: " << correctionSL
+		 << "  correctionZR: " << correctionZR
+		 << "  correctionTW: " << correctionTW << std::endl;
+  */
+
+  return correctionPGOG * correctionSL * correctionZR * correctionTW;
+}
+
+// ------------------------------------------------------------------------------------------------------------ //
+// PART, GAMMA, OCCUPANCY, and GAS dependence functions:
+// ------------------------------------------------------------------------------------------------------------ //
+
+float HTcalculator::pHTvsPGOG(int TrtPart, int GasType, float p, float mass, float occ) const {
+
+  float gamma = sqrt(p*p + mass*mass) / mass;
+   
+  // The position of the upper point of linearity varies with occupancy!
+  double par1 = m_par_pHTvsPGOG_new[GasType][TrtPart].GetBinValue(1) + m_par_pHTvsPGOG_new[GasType][TrtPart].GetBinValue(6)*occ;
+  // The position of the onset varies with occupancy!
+  double par4 = m_par_pHTvsPGOG_new[GasType][TrtPart].GetBinValue(4) + m_par_pHTvsPGOG_new[GasType][TrtPart].GetBinValue(7)*occ;
+
+  // TR onset part (main part):
+  double exp_term = exp(-(log10(gamma) - par4)/m_par_pHTvsPGOG_new[GasType][TrtPart].GetBinValue(5));
+  double pHT_TR   = m_par_pHTvsPGOG_new[GasType][TrtPart].GetBinValue(2) + m_par_pHTvsPGOG_new[GasType][TrtPart].GetBinValue(3)/(1.0 + exp_term);
+
+  // dE/dx part (linear at low gamma):
+  double exp_term0 = exp(-(m_par_pHTvsPGOG_new[GasType][TrtPart].GetBinValue(0) - par4)/m_par_pHTvsPGOG_new[GasType][TrtPart].GetBinValue(5));
+  double alpha0 = m_par_pHTvsPGOG_new[GasType][TrtPart].GetBinValue(2) + m_par_pHTvsPGOG_new[GasType][TrtPart].GetBinValue(3)/(1.0 + exp_term0);
+  double beta0 = m_par_pHTvsPGOG_new[GasType][TrtPart].GetBinValue(3) / ((1.0 + exp_term0)*(1.0 + exp_term0)) * exp_term0 / m_par_pHTvsPGOG_new[GasType][TrtPart].GetBinValue(5);
+  double pHT_dEdx = alpha0 + beta0*(log10(gamma) - m_par_pHTvsPGOG_new[GasType][TrtPart].GetBinValue(0));
 
-///////////////////////////////////////////////////////////////////////////////
-//  TRT_ElectronPidToolRun2_HTcalculation.cxx, (c) ATLAS Detector software   //
-///////////////////////////////////////////////////////////////////////////////
-
-/*****************************************************************************\
-  This file contains the implementation of the class HTcalculator.
-
-  It is intended to contain all the code that is used for the calculation of
-  the likelihood of a TRT hit being from an electron based on the time over
-  threshold.
-
-  Authors:  Troels C. Petersen  (petersen@nbi.dk), 
-            Jared G. Vasquez  (jared.vasquez@yale.edu),
-
-\*****************************************************************************/
-
-#ifdef INDETTRT_ELECTRONPIDTOOLRUN2_H
-#ifndef TRT_ELECTRONPIDRUN2_HTCALCULATION_CXX
-#define TRT_ELECTRONPIDRUN2_HTCALCULATION_CXX
-
-
-InDet::TRT_ElectronPidToolRun2::StorePIDinfo::StorePIDinfo(){
-	m_nbins = 0;
-	m_min 	= -9999.9;
-	m_max	= 10000000*2;
-	m_values.clear();
-}
-
-InDet::TRT_ElectronPidToolRun2::StorePIDinfo::StorePIDinfo(int nbins, float min, float max, std::vector<float> values){
-	update (nbins, min, max, values);
-}
-
-InDet::TRT_ElectronPidToolRun2::StorePIDinfo::~StorePIDinfo(){}
-
-void InDet::TRT_ElectronPidToolRun2::StorePIDinfo::update( int nbins, float min, float max, std::vector<float> values){
-	m_nbins = nbins	;
-	m_min 	= min	;
-	m_max	= max	;
-	if (values.size()!=m_nbins){
-    		printf("  ERROR: DIFFERENT Values of n_bins and vector size!!!\n");
-	}
-	m_values.clear();
-	for (unsigned int i = 0; i<values.size(); i++ ){
-		m_values.push_back( values.at(i));
-	}
-}
-
-// THIS HAS TO BE CALLED in order!!!
-void InDet::TRT_ElectronPidToolRun2::StorePIDinfo::push_back( float value ){
-	// Just to read the DB
-      if 	(m_nbins==0) 		{
-			m_nbins = int(value)	;
-			m_min   = -9999.9	;
-			m_max   = 10000000*2	;
-			m_values.clear()	;
-      }
-      else if 	(m_min < -9999) 	m_min 	= value		;
-      else if 	(m_max >  10000000) 	m_max   = value		;
-      else	 m_values.push_back(value);
-}
-
-StatusCode InDet::TRT_ElectronPidToolRun2::StorePIDinfo::check( int gas, int detpart){
-	if 	( m_nbins == 0)
-	{
-		std::cout << "ERROR: PIDDB no bins in the DB!! Gas: " << gas << " detPart: " << detpart << std::endl;
-          	return StatusCode::FAILURE;
-	}
-	else if ( m_nbins != m_values.size() )
-	{
-		std::cout << "ERROR: PIDDB different number of numbers!!!!! " << gas << " detPart: " << detpart << std::endl;
-          	return StatusCode::FAILURE;
-	}
-	else if ( (m_max < m_min) || (m_max == m_min) )
-	{
-	 	std::cout << "ERROR: PIDDB Max is smaller or equal than min!!!" << gas << " detPart: " << detpart << std::endl;
-          	return StatusCode::FAILURE;
-	}
-        return StatusCode::SUCCESS;
-}
-
-
-float InDet::TRT_ElectronPidToolRun2::StorePIDinfo::GetValue 	( float input  ){
-	return m_values.at(	GetBin(	input	)	);
-}
-
-float InDet::TRT_ElectronPidToolRun2::StorePIDinfo::GetBinValue 	( int bin){
-	return m_values.at(	bin	);
-}
-
-int InDet::TRT_ElectronPidToolRun2::StorePIDinfo::GetBin	( float input  ){
-	if (input < m_min) 		return 0;
-        else if (input >= m_max) 	return m_nbins-1;
-	else{
-		float dr = (m_max-m_min)/m_nbins;
-		unsigned int bin = int (                       (input - m_min)/dr    ) ;
-		if 	(bin >=  m_nbins)  	printf("  ERROR: Bin number is larger than number of bins!!!\n");
-		return bin;
-	}
-	return 0;
-}
-
-/*****************************************************************************\
-|*%%%  Default Constructor  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*|
-\*****************************************************************************/
-
-InDet::TRT_ElectronPidToolRun2::HTcalculator::HTcalculator(AthAlgTool & parent):
-  BaseTRTPIDCalculator(parent, (SIZE_OF_HEADER+SIZE_OF_BLOB),"HT")
-{
-  m_datainplace = false;
-  CurrentVersion = my_CurrentVersion;
-}
-
-/*****************************************************************************\
-|*%%%  Default Destructor  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*|
-\*****************************************************************************/
-
-InDet::TRT_ElectronPidToolRun2::HTcalculator::~HTcalculator(){
-  //Nothing here yet
-}
-
-
-/*****************************************************************************\
-|*%%%  Get The Pobability of this hit being a Hight THreshold hit  %%%%%%%%%%*|
-\*****************************************************************************/
-
-// TrtPart: 0 = Barrel, 1 = EndcapA, 2 = EndcapB
-// GasType: 0 = Xenon,  1 = Argon,   2 = Krypton
-float InDet::TRT_ElectronPidToolRun2::HTcalculator::getProbHT(
-      float pTrk, Trk::ParticleHypothesis hypothesis,
-      int TrtPart, int GasType, int StrawLayer,
-      float ZR, float rTrkWire, float Occupancy, bool hasTrackPars = true ) {
-
-  checkInitialization();
-
-  //FIXME: This setup the Troels constants. THIS OVERRIDES CURRENT DB!!!
-  // setDefaultCalibrationConstants();
-
-  float pHT = 1.0;       // Default/unit value, which ensures that unusable hits does not change probability product!
-  // Make sure that the information passed makes sense:
-  // --------------------------------------------------
-  if (pTrk < 250.0 || pTrk > 7000000.0) return pHT;
-
-  if (TrtPart < 0 || TrtPart > 2) return pHT;
-  if (GasType < 0 || GasType > 2) return pHT;
-
-  if ((TrtPart == 0 && (StrawLayer < 0 || StrawLayer > 72)) ||
-      (TrtPart == 1 && (StrawLayer < 0 || StrawLayer > 95)) ||
-      (TrtPart == 2 && (StrawLayer < 0 || StrawLayer > 63))) return pHT;
-
-  if ((TrtPart == 0 && (ZR > 720.0)) ||
-      (TrtPart  > 0 && (ZR < 630.0 || ZR > 1030.0))) return pHT;
-
-  if (rTrkWire < 0.0 || rTrkWire > 2.2) return pHT;
-
-
-  // Calculate the High Threshold probability, pHT:
-  // ----------------------------------------------
-  float correctionSL, correctionZR, correctionTW;
-  float mass = m_particlemasses.mass[hypothesis];
-  float correctionPGOG=-999.;
-  if (GasType==1 &&  TrtPart==2) { 
-    //estimate EB argon straws as follows:
-    // estimate pHT using EA argon straws (GasType=1, TrtPart=1)
-    // estimate correction factors using EB xenon straws (GasType=0, TrtPart=2)
-    correctionPGOG = pHTvsPGOG(1, GasType, pTrk, mass, Occupancy);
-    GasType = 0;
-  } else {
-    correctionPGOG = pHTvsPGOG(TrtPart, GasType, pTrk, mass, Occupancy);
-  }
-
-  // Jared -- Change this ugly check, use hypothesis!
-  if (fabs(mass-0.511) < 0.1) {      // Electron! OK, ugly way but works...
-    correctionSL = m_CpHT_B_Zee_SL_new[GasType][TrtPart].GetValue(StrawLayer);
-    correctionZR = m_CpHT_B_Zee_ZR_new[GasType][TrtPart].GetValue(ZR);
-    correctionTW = m_CpHT_B_Zee_TW_new[GasType][TrtPart].GetValue(rTrkWire);
-  } else {                           // Non-electron!
-    correctionSL = m_CpHT_B_Zmm_SL_new[GasType][TrtPart].GetValue(StrawLayer);
-    correctionZR = m_CpHT_B_Zmm_ZR_new[GasType][TrtPart].GetValue(ZR);
-    correctionTW = m_CpHT_B_Zmm_TW_new[GasType][TrtPart].GetValue(rTrkWire);
-  }
-
-  // Jared - In absence of track pars, no ZR or TW information -- disable correction factors
-  if (not hasTrackPars) { correctionZR = 1.0; correctionTW = 1.0; }
-
-  // Jared - Temporarily disable ZR corrections, reproducibility issues with calibration
-  //correctionZR = 1.0;
-
-  ATH_MSG_DEBUG( "check       "
-		 << "  GammaOccupan: " << correctionPGOG
-		 << "  correctionSL: " << correctionSL
-		 << "  correctionZR: " << correctionZR
-		 << "  correctionTW: " << correctionTW 
-		 );
-  
-  // Jared - Development output 
-  //std::cout  << "check       "
-  //           << "  GammaOccupan: " << correctionPGOG
-  //           << "  correctionSL: " << correctionSL
-  //           << "  correctionZR: " << correctionZR
-  //           << "  correctionTW: " << correctionTW << std::endl;
-
-  return correctionPGOG * correctionSL * correctionZR * correctionTW;
-}
-
-// ------------------------------------------------------------------------------------------------------------ //
-// PART, GAMMA, OCCUPANCY, and GAS dependence functions:
-// ------------------------------------------------------------------------------------------------------------ //
-
-float InDet::TRT_ElectronPidToolRun2::HTcalculator::pHTvsPGOG(int TrtPart, int GasType, float p, float mass, float occ) {
-
-  float gamma = sqrt(p*p + mass*mass) / mass;
-   
-  // The position of the upper point of linearity varies with occupancy!
-  double par1 = m_par_pHTvsPGOG_new[GasType][TrtPart].GetBinValue(1) + m_par_pHTvsPGOG_new[GasType][TrtPart].GetBinValue(6)*occ;
-  // The position of the onset varies with occupancy!
-  double par4 = m_par_pHTvsPGOG_new[GasType][TrtPart].GetBinValue(4) + m_par_pHTvsPGOG_new[GasType][TrtPart].GetBinValue(7)*occ;
-
-  // TR onset part (main part):
-  double exp_term = exp(-(log10(gamma) - par4)/m_par_pHTvsPGOG_new[GasType][TrtPart].GetBinValue(5));
-  double pHT_TR   = m_par_pHTvsPGOG_new[GasType][TrtPart].GetBinValue(2) + m_par_pHTvsPGOG_new[GasType][TrtPart].GetBinValue(3)/(1.0 + exp_term);
-
-  // dE/dx part (linear at low gamma):
-  double exp_term0 = exp(-(m_par_pHTvsPGOG_new[GasType][TrtPart].GetBinValue(0) - par4)/m_par_pHTvsPGOG_new[GasType][TrtPart].GetBinValue(5));
-  double alpha0 = m_par_pHTvsPGOG_new[GasType][TrtPart].GetBinValue(2) + m_par_pHTvsPGOG_new[GasType][TrtPart].GetBinValue(3)/(1.0 + exp_term0);
-  double beta0 = m_par_pHTvsPGOG_new[GasType][TrtPart].GetBinValue(3) / sqr(1.0 + exp_term0) * exp_term0 / m_par_pHTvsPGOG_new[GasType][TrtPart].GetBinValue(5);
-  double pHT_dEdx = alpha0 + beta0*(log10(gamma) - m_par_pHTvsPGOG_new[GasType][TrtPart].GetBinValue(0));
-
   // High-gamma part (linear at high gamma):
-  double exp_term1 = exp(-(par1 - par4)/m_par_pHTvsPGOG_new[GasType][TrtPart].GetBinValue(5));
-  double alpha1 = m_par_pHTvsPGOG_new[GasType][TrtPart].GetBinValue(2) + m_par_pHTvsPGOG_new[GasType][TrtPart].GetBinValue(3)/(1.0 + exp_term1);
-  double beta1 = m_par_pHTvsPGOG_new[GasType][TrtPart].GetBinValue(3) / sqr(1.0 + exp_term1) * exp_term1 / m_par_pHTvsPGOG_new[GasType][TrtPart].GetBinValue(5);
-  double pHT_HG   = alpha1 + beta1*(log10(gamma) - par1);
-
-  double pHT_OccZero = pHT_TR;
-  if      (log10(gamma) < m_par_pHTvsPGOG_new[GasType][TrtPart].GetBinValue(0))   pHT_OccZero = pHT_dEdx;
-  else if (log10(gamma) > par1  )                                                 pHT_OccZero = pHT_HG;
-
-
-  // The occupancy dependency is included through the Anatoli formula and a quadratic fit from the muon plateau:
-  // ------------------------------------------------------------------------------------------------------------------------
-  double DeltaOcc = m_par_pHTvsPGOG_new[GasType][TrtPart].GetBinValue(8)*occ + m_par_pHTvsPGOG_new[GasType][TrtPart].GetBinValue(9)*occ*occ;
-  double pHT = pHT_OccZero + (1.0 - pHT_OccZero) * DeltaOcc;
-  
-  return pHT;
-}
-
-
-
-StatusCode InDet::TRT_ElectronPidToolRun2::HTcalculator::ReadVectorDB( const DataHandle<CondAttrListVec> channel_values){
-  ATH_MSG_INFO( "Set TRT HT PID Parameters from the Vector Database ");
-   if ( channel_values->size() < 1){
-     ATH_MSG_ERROR( "There are no channels available!!");
-          return StatusCode::FAILURE;
-   }
-
-   CondAttrListVec::const_iterator first_channel = channel_values->begin();
-   CondAttrListVec::const_iterator last_channel  = channel_values->end();
-
-   ATH_MSG_DEBUG( "There are " << channel_values->size() << "  Channels " );
-   int inichan = 0;
-   for (; first_channel != last_channel; ++first_channel) {
-     switch(first_channel->first){
-        case 0:			  // gamma_All_Xenon_All_Barrel
-		m_par_pHTvsPGOG_new [0][0].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 1 :                  // gamma_All_Xenon_All_EndcapA
-		m_par_pHTvsPGOG_new [0][1].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 2 :                  // gamma_All_Xenon_All_EndcapB
-		m_par_pHTvsPGOG_new [0][2].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 3 :                  // gamma_All_Argon_All_Barrel
-		m_par_pHTvsPGOG_new [1][0].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 4 :                  // gamma_All_Argon_All_EndcapA
-		m_par_pHTvsPGOG_new [1][1].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 5 :                  // gamma_All_Argon_All_EndcapB
-		m_par_pHTvsPGOG_new [1][2].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 6 :                  // gamma_All_Krypton_All_Barrel
-		m_par_pHTvsPGOG_new [2][0].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 7 :                  // gamma_All_Krypton_All_EndcapA
-		m_par_pHTvsPGOG_new [2][1].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 8 :                  // gamma_All_Krypton_All_EndcapB
-		m_par_pHTvsPGOG_new [2][2].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-
-	// Xenon Corrections: 
-       case 9 :                  // SL_Zee_Xenon_Electrons_Barrel
-		m_CpHT_B_Zee_SL_new [0][0].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 10 :                 // SL_Zee_Xenon_Electrons_EndcapA
-		m_CpHT_B_Zee_SL_new [0][1].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 11 :                 // SL_Zee_Xenon_Electrons_EndcapB
-		m_CpHT_B_Zee_SL_new [0][2].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 12 :                 // ZR_Zee_Xenon_Electrons_Barrel
-		m_CpHT_B_Zee_ZR_new [0][0].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 13 :                 // ZR_Zee_Xenon_Electrons_EndcapA
-		m_CpHT_B_Zee_ZR_new [0][1].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 14 :                 // ZR_Zee_Xenon_Electrons_EndcapB
-		m_CpHT_B_Zee_ZR_new [0][2].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 15 :                 // TW_Zee_Xenon_Electrons_Barrel
-		m_CpHT_B_Zee_TW_new [0][0].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 16 :                 // TW_Zee_Xenon_Electrons_EndcapA
-		m_CpHT_B_Zee_TW_new [0][1].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 17 :                 // TW_Zee_Xenon_Electrons_EndcapB
-		m_CpHT_B_Zee_TW_new [0][2].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 18 :                 // OR_Zee_Xenon_Electrons_Barrel
-		m_CpHT_B_Zee_OR_new [0][0].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 19 :                 // OR_Zee_Xenon_Electrons_EndcapA
-		m_CpHT_B_Zee_OR_new [0][1].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 20 :                 // OR_Zee_Xenon_Electrons_EndcapB
-		m_CpHT_B_Zee_OR_new [0][2].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 21 :                 // SL_Zmm_Xenon_NonElecs_Barrel
-		m_CpHT_B_Zmm_SL_new [0][0].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 22 :                 // SL_Zmm_Xenon_NonElecs_EndcapA
-		m_CpHT_B_Zmm_SL_new [0][1].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 23 :                 // SL_Zmm_Xenon_NonElecs_EndcapB
-		m_CpHT_B_Zmm_SL_new [0][2].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 24 :                 // ZR_Zmm_Xenon_NonElecs_Barrel
-		m_CpHT_B_Zmm_ZR_new [0][0].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 25 :                 // ZR_Zmm_Xenon_NonElecs_EndcapA
-		m_CpHT_B_Zmm_ZR_new [0][1].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 26 :                 // ZR_Zmm_Xenon_NonElecs_EndcapB
-		m_CpHT_B_Zmm_ZR_new [0][2].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 27 :                 // TW_Zmm_Xenon_NonElecs_Barrel
-		m_CpHT_B_Zmm_TW_new [0][0].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 28 :                 // TW_Zmm_Xenon_NonElecs_EndcapA
-		m_CpHT_B_Zmm_TW_new [0][1].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 29 :                 // TW_Zmm_Xenon_NonElecs_EndcapB
-		m_CpHT_B_Zmm_TW_new [0][2].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 30 :                 // OR_Zmm_Xenon_NonElecs_Barrel
-		m_CpHT_B_Zmm_OR_new [0][0].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 31 :                 // OR_Zmm_Xenon_NonElecs_EndcapA
-		m_CpHT_B_Zmm_OR_new [0][1].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 32 :                 // OR_Zmm_Xenon_NonElecs_EndcapB
-		m_CpHT_B_Zmm_OR_new [0][2].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-
-	// Argon Corrections: 
-        case 33 :                  // SL_Zee_Xenon_Electrons_Barrel
-		m_CpHT_B_Zee_SL_new [1][0].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 34 :                 // SL_Zee_Xenon_Electrons_EndcapA
-		m_CpHT_B_Zee_SL_new [1][1].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 35 :                 // SL_Zee_Xenon_Electrons_EndcapB
-		m_CpHT_B_Zee_SL_new [1][2].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 36 :                 // ZR_Zee_Xenon_Electrons_Barrel
-		m_CpHT_B_Zee_ZR_new [1][0].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 37 :                 // ZR_Zee_Xenon_Electrons_EndcapA
-		m_CpHT_B_Zee_ZR_new [1][1].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 38 :                 // ZR_Zee_Xenon_Electrons_EndcapB
-		m_CpHT_B_Zee_ZR_new [1][2].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 39 :                 // TW_Zee_Xenon_Electrons_Barrel
-		m_CpHT_B_Zee_TW_new [1][0].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 40 :                 // TW_Zee_Xenon_Electrons_EndcapA
-		m_CpHT_B_Zee_TW_new [1][1].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 41 :                 // TW_Zee_Xenon_Electrons_EndcapB
-		m_CpHT_B_Zee_TW_new [1][2].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 42 :                 // OR_Zee_Xenon_Electrons_Barrel
-		m_CpHT_B_Zee_OR_new [1][0].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 43 :                 // OR_Zee_Xenon_Electrons_EndcapA
-		m_CpHT_B_Zee_OR_new [1][1].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 44 :                 // OR_Zee_Xenon_Electrons_EndcapB
-		m_CpHT_B_Zee_OR_new [1][2].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 45 :                 // SL_Zmm_Xenon_NonElecs_Barrel
-		m_CpHT_B_Zmm_SL_new [1][0].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 46 :                 // SL_Zmm_Xenon_NonElecs_EndcapA
-		m_CpHT_B_Zmm_SL_new [1][1].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 47 :                 // SL_Zmm_Xenon_NonElecs_EndcapB
-		m_CpHT_B_Zmm_SL_new [1][2].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 48 :                 // ZR_Zmm_Xenon_NonElecs_Barrel
-		m_CpHT_B_Zmm_ZR_new [1][0].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 49 :                 // ZR_Zmm_Xenon_NonElecs_EndcapA
-		m_CpHT_B_Zmm_ZR_new [1][1].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 50 :                 // ZR_Zmm_Xenon_NonElecs_EndcapB
-		m_CpHT_B_Zmm_ZR_new [1][2].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 51 :                 // TW_Zmm_Xenon_NonElecs_Barrel
-		m_CpHT_B_Zmm_TW_new [1][0].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 52 :                 // TW_Zmm_Xenon_NonElecs_EndcapA
-		m_CpHT_B_Zmm_TW_new [1][1].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 53 :                 // TW_Zmm_Xenon_NonElecs_EndcapB
-		m_CpHT_B_Zmm_TW_new [1][2].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 54 :                 // OR_Zmm_Xenon_NonElecs_Barrel
-		m_CpHT_B_Zmm_OR_new [1][0].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 55 :                 // OR_Zmm_Xenon_NonElecs_EndcapA
-		m_CpHT_B_Zmm_OR_new [1][1].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 56 :                 // OR_Zmm_Xenon_NonElecs_EndcapB
-		m_CpHT_B_Zmm_OR_new [1][2].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-
-
-	// Krypton Corrections: 
-        case 57 :                  // SL_Zee_Xenon_Electrons_Barrel
-		m_CpHT_B_Zee_SL_new [2][0].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 58 :                 // SL_Zee_Xenon_Electrons_EndcapA
-		m_CpHT_B_Zee_SL_new [2][1].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 59 :                 // SL_Zee_Xenon_Electrons_EndcapB
-		m_CpHT_B_Zee_SL_new [2][2].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 60 :                 // ZR_Zee_Xenon_Electrons_Barrel
-		m_CpHT_B_Zee_ZR_new [2][0].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 61 :                 // ZR_Zee_Xenon_Electrons_EndcapA
-		m_CpHT_B_Zee_ZR_new [2][1].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 62 :                 // ZR_Zee_Xenon_Electrons_EndcapB
-		m_CpHT_B_Zee_ZR_new [2][2].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 63 :                 // TW_Zee_Xenon_Electrons_Barrel
-		m_CpHT_B_Zee_TW_new [2][0].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 64 :                 // TW_Zee_Xenon_Electrons_EndcapA
-		m_CpHT_B_Zee_TW_new [2][1].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 65 :                 // TW_Zee_Xenon_Electrons_EndcapB
-		m_CpHT_B_Zee_TW_new [2][2].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 66 :                 // OR_Zee_Xenon_Electrons_Barrel
-		m_CpHT_B_Zee_OR_new [2][0].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 67 :                 // OR_Zee_Xenon_Electrons_EndcapA
-		m_CpHT_B_Zee_OR_new [2][1].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 68 :                 // OR_Zee_Xenon_Electrons_EndcapB
-		m_CpHT_B_Zee_OR_new [2][2].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 69 :                 // SL_Zmm_Xenon_NonElecs_Barrel
-		m_CpHT_B_Zmm_SL_new [2][0].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 70 :                 // SL_Zmm_Xenon_NonElecs_EndcapA
-		m_CpHT_B_Zmm_SL_new [2][1].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 71 :                 // SL_Zmm_Xenon_NonElecs_EndcapB
-		m_CpHT_B_Zmm_SL_new [2][2].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 72 :                 // ZR_Zmm_Xenon_NonElecs_Barrel
-		m_CpHT_B_Zmm_ZR_new [2][0].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 73 :                 // ZR_Zmm_Xenon_NonElecs_EndcapA
-		m_CpHT_B_Zmm_ZR_new [2][1].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 74 :                 // ZR_Zmm_Xenon_NonElecs_EndcapB
-		m_CpHT_B_Zmm_ZR_new [2][2].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 75 :                 // TW_Zmm_Xenon_NonElecs_Barrel
-		m_CpHT_B_Zmm_TW_new [2][0].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 76 :                 // TW_Zmm_Xenon_NonElecs_EndcapA
-		m_CpHT_B_Zmm_TW_new [2][1].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 77 :                 // TW_Zmm_Xenon_NonElecs_EndcapB
-		m_CpHT_B_Zmm_TW_new [2][2].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 78 :                 // OR_Zmm_Xenon_NonElecs_Barrel
-		m_CpHT_B_Zmm_OR_new [2][0].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 79 :                 // OR_Zmm_Xenon_NonElecs_EndcapA
-		m_CpHT_B_Zmm_OR_new [2][1].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-        case 80 :                 // OR_Zmm_Xenon_NonElecs_EndcapB
-		m_CpHT_B_Zmm_OR_new [2][2].push_back(first_channel->second["array_value"].data<float>());
-		inichan += 1;
-                break;
-	}
-    }
-
-   ATH_MSG_DEBUG( "We have read " << inichan << " good channels" );
-   ATH_MSG_DEBUG( m_par_pHTvsPGOG_new [0][0].GetBinValue(0) << "\t" << m_par_pHTvsPGOG_new [0][0].GetBinValue(1) << " " << m_par_pHTvsPGOG_new [0][0].GetBinValue(2) );
-
-
-   for (int i = 0 ; i < N_DET; i++) {
-     for (int j = 0 ; j < N_GAS; j++) {
-       if (m_par_pHTvsPGOG_new[j][i].check(j,i) != StatusCode::SUCCESS) 	return StatusCode::FAILURE;
-       if (m_CpHT_B_Zee_SL_new[j][i].check(j,i) != StatusCode::SUCCESS) 	return StatusCode::FAILURE;
-       if (m_CpHT_B_Zmm_SL_new[j][i].check(j,i) != StatusCode::SUCCESS) 	return StatusCode::FAILURE;
-       if (m_CpHT_B_Zee_ZR_new[j][i].check(j,i) != StatusCode::SUCCESS) 	return StatusCode::FAILURE;
-       if (m_CpHT_B_Zmm_ZR_new[j][i].check(j,i) != StatusCode::SUCCESS) 	return StatusCode::FAILURE;
-       if (m_CpHT_B_Zee_TW_new[j][i].check(j,i) != StatusCode::SUCCESS) 	return StatusCode::FAILURE;
-       if (m_CpHT_B_Zmm_TW_new[j][i].check(j,i) != StatusCode::SUCCESS) 	return StatusCode::FAILURE;
-       if (m_CpHT_B_Zee_OR_new[j][i].check(j,i) != StatusCode::SUCCESS) 	return StatusCode::FAILURE;
-       if (m_CpHT_B_Zmm_OR_new[j][i].check(j,i) != StatusCode::SUCCESS) 	return StatusCode::FAILURE;
-    }
-   } 
-   
-   HasBeenInitialized=1;
-   UpperLimit=1.0;
-   LowerLimit=0.0;
-   ATH_MSG_INFO(  "TRT PID HT Vector DB loaded: ");
-   return StatusCode::SUCCESS;
-}
-
-
-/*****************************************************************************\
-|*%%%  Hard-coded HT Calibration Constants  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*|
-\*****************************************************************************/
-
-void InDet::TRT_ElectronPidToolRun2::HTcalculator::setDefaultCalibrationConstants(){
-  /*****************************************************************************\
-
-    This code is never called in production. It is used to set all
-    constants in the positions in the HTBlob where they are needed, and 
-    finally print out the blob as an array of numbers. This is far easier and 
-    less error prone than having a separate setter-script which might itself 
-    have a version mismatch with this code.
-
-    PLEASE REMEMBER to increment the version number precisely when you change 
-    the addresses of the various arrays inside the HTBlob, and NEVER otherwise!
-    
-  \*****************************************************************************/
-	//FIXME
-  if (m_datainplace) return;  // Just to load 1 time
-  ATH_MSG_ERROR( "Looks like HT PID DB is NOT available, so lets set hard-coded PID calibration constants. Derived from Run1 Data Zee and Zmumu 50 ns. FIXME!!");
-  HasBeenInitialized=1;
-
-  UpperLimit=1.0;
-  LowerLimit=0.0;
-
-// Expanding to a 2D fit (gamma,occupancy) for three types of gases: Xenon, Argon, Krypton:
-// ----------------------------------------------------------------------------------------
-  float par2[N_GAS][N_DET][N_PAR2] = { 
-    // Xenon Gas Parameters
-       {{ 1.0000, 3.7204, 0.0260, 0.1445, 3.0461, 0.2206, 0.0000, 0.0078, 0.0918, 0.0744},    // Barrel   Prob: 0.9992 
-        { 1.0000, 3.5836, 0.0468, 0.1475, 3.0943, 0.1303, 0.0000, 0.0089, 0.1054, 0.0472},    // EndcapA  Prob: 1.0000 
-        { 1.0000, 3.4798, 0.0433, 0.1824, 3.0730, 0.1244, 0.0000, 0.0300, 0.1007, 0.1261}},   // EndcapB  Prob: 0.8536
-    // Argon Gas Parameters 
-       {{ 1.0000, 2.8342, 0.0384, 0.0185, 2.7161, 0.0366, 0.0000, 0.0013, 0.1261, 0.1241},    // Barrel   Prob: 1.0000 
-        { 1.0000, 3.2551, 0.0388, 0.0338, 2.9090, 0.1663, 0.0000, 0.1604, 0.1100, 0.0521},    // EndcapA  Prob: 0.9970
-        { 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000}},   // EndcapB  ------------
-    // Krypton Gas Parameters (Place Holder) 
-       {{ 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000},    // Barrel   ------------
-        { 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000},    // EndcapA  ------------
-        { 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000}}};  // EndcapB  ------------
-
-  for (int i = 0 ; i < N_GAS; i++)
-    for (int j = 0 ; j < N_DET; j++)
-	m_par_pHTvsPGOG_new[i][j] .update (  10, 50, 1000000.0,   std::vector<float> (par2[i][j] , par2[i][j]  + sizeof par2[i][j] / sizeof par2[i][j][0]) );
-
-
-  const int N_SL_B  = 73;
-  const int N_SL_EA = 96;
-  const int N_SL_EB = 64;
-  const int N_ZR_B  = 36;
-  const int N_ZR_EA = 40;
-  const int N_ZR_EB = 40;
-  const int N_TW_B  = 44;
-  const int N_TW_EA = 44;
-  const int N_TW_EB = 44;
-
-  // ---------------------------------------
-  // Electrons:
-  // ---------------------------------------
-  // Straw Layer (SL):
-  double CpHT_Zee_Barrel_SL[N_SL_B] = { 0.637, 0.887, 0.966, 1.034, 1.059, 1.009, 1.131, 1.073, 1.086, 0.925, 0.890, 0.987, 0.937, 0.964, 0.976, 0.929, 1.006, 0.979, 0.992, 0.812, 0.935, 0.950, 0.984, 0.994, 1.011, 0.952, 1.051, 0.997, 1.026, 1.018, 0.978, 1.066, 1.016, 1.039, 1.040, 0.979, 1.057, 1.018, 1.032, 1.052, 0.994, 1.055, 1.023, 0.823, 1.013, 0.977, 1.051, 1.031, 0.973, 1.077, 1.025, 1.056, 1.047, 0.992, 1.085, 1.032, 1.061, 1.054, 0.998, 1.093, 1.039, 1.058, 1.056, 0.988, 1.090, 1.057, 1.046, 1.053, 0.994, 1.081, 1.041, 1.040, 1.061};
-  double CpHT_Zee_EndcapA_SL[N_SL_EA] = { 0.671, 0.802, 0.890, 0.918, 0.946, 0.963, 0.974, 0.979, 1.030, 1.023, 1.029, 1.004, 1.030, 1.037, 1.033, 1.013, 0.913, 0.968, 0.998, 0.994, 1.036, 1.032, 1.043, 1.044, 1.042, 1.009, 1.026, 1.007, 1.032, 1.046, 1.020, 1.032, 0.913, 0.955, 0.974, 0.995, 1.035, 1.042, 1.039, 1.047, 1.032, 1.036, 1.033, 1.010, 1.047, 1.049, 1.055, 1.046, 0.877, 0.938, 0.968, 0.983, 1.004, 1.010, 1.013, 1.014, 1.038, 1.031, 1.042, 1.018, 1.016, 1.049, 1.023, 1.025, 0.923, 0.978, 0.995, 1.001, 1.038, 1.042, 1.026, 1.037, 1.042, 1.062, 1.041, 1.039, 1.078, 1.058, 1.036, 1.049, 0.897, 0.965, 0.993, 0.985, 1.040, 1.068, 1.053, 1.049, 1.037, 1.050, 1.043, 1.065, 1.026, 1.058, 1.058, 1.070};
-  double CpHT_Zee_EndcapB_SL[N_SL_EB] = { 0.494, 0.771, 0.887, 0.931, 0.939, 0.989, 0.994, 1.005, 0.866, 0.971, 1.027, 1.057, 1.021, 1.056, 1.046, 1.073, 0.901, 0.992, 1.043, 1.055, 1.034, 1.087, 1.094, 1.087, 0.920, 0.995, 1.048, 1.068, 1.042, 1.075, 1.086, 1.126, 0.920, 0.987, 1.062, 1.072, 1.059, 1.096, 1.070, 1.082, 0.927, 1.020, 1.068, 1.083, 1.054, 1.089, 1.078, 1.103, 0.961, 1.050, 1.100, 1.107, 1.098, 1.124, 1.101, 1.141, 0.988, 1.106, 1.127, 1.174, 1.109, 1.134, 1.134, 1.182};
-
-  // ZR-position (ZR - Z in Barrel, R in Endcaps):
-  double CpHT_Zee_Barrel_ZR[N_ZR_B] = { 0.861, 0.901, 0.909, 0.915, 0.919, 0.924, 0.922, 0.931, 0.928, 0.937, 0.945, 0.908, 0.921, 0.959, 0.970, 0.988, 0.986, 0.999, 1.010, 1.005, 0.996, 1.005, 1.018, 0.992, 1.042, 1.076, 1.101, 1.116, 1.134, 1.157, 1.170, 1.196, 1.208, 1.230, 1.230, 1.039};
-  double CpHT_Zee_EndcapA_ZR[N_ZR_EA] = { 0.458, 0.621, 0.694, 0.758, 0.798, 0.838, 0.871, 0.900, 0.956, 0.980, 1.001, 1.006, 1.016, 1.027, 1.019, 1.038, 1.046, 1.045, 1.054, 1.064, 1.064, 1.077, 1.081, 1.089, 1.101, 1.113, 1.102, 1.113, 1.107, 1.113, 1.098, 1.105, 1.083, 1.054, 1.036, 0.994, 0.965, 0.887, 0.771, 0.575};
-  double CpHT_Zee_EndcapB_ZR[N_ZR_EB] = { 1.000, 0.754, 0.926, 0.941, 1.001, 1.001, 0.987, 1.033, 1.054, 1.060, 1.057, 1.064, 1.061, 1.067, 1.052, 1.062, 1.045, 1.057, 1.053, 1.047, 1.053, 1.050, 1.042, 1.073, 1.050, 1.050, 1.028, 0.972, 0.928, 0.896, 0.881, 0.854, 0.828, 0.793, 0.755, 0.652, 0.511, 0.291, 0.481, 1.000};
-
-  // Track-to-Wire distance (TW):
-  double CpHT_Zee_Barrel_TW[44] = { 1.233, 1.261, 1.276, 1.296, 1.307, 1.338, 1.349, 1.386, 1.395, 1.434, 1.441, 1.448, 1.440, 1.439, 1.425, 1.406, 1.388, 1.363, 1.334, 1.320, 1.295, 1.269, 1.240, 1.212, 1.183, 1.144, 1.109, 1.073, 1.028, 0.981, 0.938, 0.879, 0.817, 0.752, 0.678, 0.606, 0.531, 0.465, 0.428, 0.443, 0.504, 0.553, 0.579, 0.766};
-  double CpHT_Zee_EndcapA_TW[44] = { 1.236, 1.260, 1.291, 1.292, 1.304, 1.325, 1.354, 1.363, 1.387, 1.394, 1.409, 1.415, 1.407, 1.414, 1.405, 1.394, 1.385, 1.357, 1.345, 1.331, 1.309, 1.282, 1.252, 1.226, 1.197, 1.176, 1.135, 1.097, 1.047, 1.013, 0.946, 0.892, 0.834, 0.756, 0.696, 0.610, 0.547, 0.480, 0.444, 0.445, 0.469, 0.513, 0.584, 0.892};
-  double CpHT_Zee_EndcapB_TW[44] = { 1.186, 1.202, 1.219, 1.246, 1.257, 1.270, 1.291, 1.297, 1.307, 1.319, 1.333, 1.338, 1.340, 1.326, 1.314, 1.327, 1.321, 1.310, 1.289, 1.279, 1.266, 1.240, 1.222, 1.194, 1.168, 1.153, 1.125, 1.091, 1.033, 1.009, 0.963, 0.917, 0.846, 0.802, 0.746, 0.690, 0.615, 0.560, 0.514, 0.485, 0.478, 0.473, 0.523, 0.726};
-
-
-  // ---------------------------------------
-  // Non-Electrons (here muons):
-  // ---------------------------------------
-
-  // Straw Layer (SL):
-  double CpHT_Zmm_Barrel_SL[N_SL_B] = { 1.100, 1.186, 1.209, 1.241, 1.199, 1.174, 1.209, 1.178, 1.150, 1.053, 1.033, 1.054, 1.033, 1.029, 1.041, 1.021, 1.027, 0.992, 0.988, 0.983, 0.998, 1.022, 1.043, 1.023, 1.027, 1.016, 1.034, 1.009, 1.014, 1.022, 1.001, 1.024, 1.003, 1.010, 1.004, 0.983, 0.992, 0.978, 0.981, 1.000, 0.984, 0.974, 0.953, 0.941, 0.982, 0.990, 1.005, 0.993, 0.966, 0.997, 1.000, 0.988, 0.992, 0.969, 1.003, 0.964, 0.989, 0.961, 0.956, 0.971, 0.948, 0.963, 0.951, 0.943, 0.964, 0.965, 0.925, 0.919, 0.918, 0.928, 0.919, 0.912, 0.906};
-  double CpHT_Zmm_EndcapA_SL[N_SL_EA] = { 0.883, 0.898, 0.923, 0.899, 0.892, 0.909, 0.893, 0.925, 0.964, 0.964, 0.979, 0.949, 0.944, 0.998, 0.940, 0.937, 0.950, 0.976, 0.972, 0.950, 0.998, 1.005, 1.007, 1.028, 1.018, 0.995, 1.006, 0.998, 1.031, 1.047, 1.031, 1.015, 1.017, 0.983, 1.018, 1.018, 1.025, 1.033, 1.046, 1.069, 1.033, 1.027, 1.006, 0.982, 1.066, 1.080, 1.048, 1.058, 0.955, 0.971, 0.973, 0.992, 1.013, 1.046, 1.022, 1.029, 1.040, 1.016, 1.077, 1.024, 1.011, 1.095, 1.019, 1.045, 1.001, 1.057, 1.043, 1.022, 1.033, 1.108, 1.062, 1.110, 1.090, 1.058, 1.060, 1.099, 1.065, 1.120, 1.077, 1.060, 1.024, 1.006, 1.022, 1.007, 1.051, 1.118, 1.079, 1.118, 1.070, 1.064, 1.108, 1.127, 1.039, 1.107, 1.088, 1.154};
-  double CpHT_Zmm_EndcapB_SL[N_SL_EB] = { 0.828, 0.961, 0.941, 0.991, 0.986, 1.015, 0.993, 0.957, 0.892, 1.005, 1.100, 1.054, 0.995, 1.042, 1.022, 1.007, 0.918, 1.019, 1.056, 1.034, 0.978, 0.981, 1.014, 1.026, 0.988, 0.978, 1.062, 1.085, 1.029, 0.989, 1.067, 1.054, 0.978, 0.971, 1.051, 1.114, 1.152, 1.172, 1.034, 1.170, 1.055, 0.990, 1.112, 1.047, 1.068, 1.013, 1.089, 1.141, 0.903, 0.960, 1.138, 1.218, 0.991, 1.087, 0.997, 1.028, 1.042, 1.155, 1.060, 1.130, 1.077, 1.186, 1.006, 1.054};
-
-  // ZR-position (ZR - Z in Barrel, R in Endcaps):
-  double CpHT_Zmm_Barrel_ZR[N_ZR_B] = { 0.846, 0.874, 0.880, 0.882, 0.876, 0.887, 0.901, 0.894, 0.894, 0.903, 0.902, 0.907, 0.918, 0.934, 0.941, 0.948, 0.963, 0.969, 0.990, 0.991, 1.012, 1.019, 1.029, 1.033, 1.072, 1.088, 1.111, 1.144, 1.164, 1.192, 1.225, 1.242, 1.271, 1.314, 1.309, 1.078};
-  double CpHT_Zmm_EndcapA_ZR[N_ZR_EA] = { 0.613, 0.757, 0.783, 0.849, 0.866, 0.886, 0.915, 0.939, 0.930, 0.976, 0.969, 0.984, 0.992, 0.979, 1.006, 1.000, 1.005, 1.022, 1.020, 1.030, 1.031, 1.036, 1.053, 1.050, 1.050, 1.048, 1.065, 1.071, 1.060, 1.077, 1.067, 1.072, 1.070, 1.067, 1.090, 1.059, 1.032, 1.081, 1.011, 0.984};
-  double CpHT_Zmm_EndcapB_ZR[N_ZR_EB] = { 1.000, 1.375, 0.962, 0.702, 0.869, 0.899, 0.953, 0.905, 1.052, 1.025, 1.016, 1.009, 1.033, 0.920, 1.056, 1.031, 1.070, 1.042, 1.052, 1.066, 1.024, 1.023, 1.046, 1.046, 1.007, 1.009, 1.009, 1.024, 1.007, 0.993, 0.968, 0.997, 0.911, 0.922, 0.938, 0.921, 0.883, 0.653, 0.917, 1.000};
-
-  // Track-to-Wire distance (TWdist):
-  double CpHT_Zmm_Barrel_TW[N_TW_B] = { 1.124, 1.058, 1.065, 1.079, 1.094, 1.124, 1.141, 1.173, 1.207, 1.226, 1.250, 1.250, 1.258, 1.249, 1.258, 1.243, 1.229, 1.211, 1.206, 1.180, 1.165, 1.138, 1.123, 1.100, 1.074, 1.052, 1.014, 0.981, 0.953, 0.896, 0.866, 0.809, 0.776, 0.736, 0.690, 0.644, 0.609, 0.615, 0.680, 0.854, 1.094, 1.274, 1.208, 1.219};
-  double CpHT_Zmm_EndcapA_TW[N_TW_EA] = { 1.210, 1.161, 1.177, 1.201, 1.221, 1.244, 1.279, 1.300, 1.319, 1.341, 1.362, 1.372, 1.376, 1.378, 1.384, 1.361, 1.349, 1.334, 1.325, 1.284, 1.264, 1.250, 1.223, 1.183, 1.121, 1.104, 1.077, 1.016, 0.969, 0.912, 0.863, 0.815, 0.753, 0.662, 0.604, 0.555, 0.513, 0.490, 0.511, 0.627, 0.843, 1.019, 0.932, 0.922};
-  double CpHT_Zmm_EndcapB_TW[N_TW_EB] = { 1.132, 1.150, 1.125, 1.174, 1.170, 1.282, 1.165, 1.244, 1.287, 1.293, 1.270, 1.366, 1.317, 1.285, 1.319, 1.291, 1.304, 1.239, 1.256, 1.279, 1.212, 1.221, 1.200, 1.174, 1.143, 1.120, 1.022, 0.983, 0.938, 0.895, 0.906, 0.826, 0.766, 0.765, 0.664, 0.566, 0.553, 0.556, 0.541, 0.626, 0.780, 0.964, 0.817, 0.542};
-
-
-  // --------------------------------------------------------------
-
-
-// Same corrections for all gases:
- 
-  for (int j = 0 ; j < N_GAS; j++){
-   m_CpHT_B_Zee_SL_new     [j][0].update ( N_SL_B  ,-0.5 ,72.5 , std::vector<float> (CpHT_Zee_Barrel_SL , CpHT_Zee_Barrel_SL  + sizeof CpHT_Zee_Barrel_SL / sizeof CpHT_Zee_Barrel_SL[0])  ); 
-   m_CpHT_B_Zee_SL_new     [j][1].update ( N_SL_EA ,-0.5 ,95.5 , std::vector<float> (CpHT_Zee_EndcapA_SL, CpHT_Zee_EndcapA_SL + sizeof CpHT_Zee_EndcapA_SL/ sizeof CpHT_Zee_EndcapA_SL[0]) ); 
-   m_CpHT_B_Zee_SL_new     [j][2].update ( N_SL_EB ,-0.5 ,63.5 , std::vector<float> (CpHT_Zee_EndcapB_SL, CpHT_Zee_EndcapB_SL + sizeof CpHT_Zee_EndcapB_SL/ sizeof CpHT_Zee_EndcapB_SL[0]) ); 
-
-   m_CpHT_B_Zmm_SL_new     [j][0].update ( N_SL_B  ,-0.5 ,72.5 , std::vector<float> (CpHT_Zmm_Barrel_SL , CpHT_Zmm_Barrel_SL  + sizeof CpHT_Zmm_Barrel_SL / sizeof CpHT_Zmm_Barrel_SL[0])  ); 
-   m_CpHT_B_Zmm_SL_new     [j][1].update ( N_SL_EA ,-0.5 ,95.5 , std::vector<float> (CpHT_Zmm_EndcapA_SL, CpHT_Zmm_EndcapA_SL + sizeof CpHT_Zmm_EndcapA_SL/ sizeof CpHT_Zmm_EndcapA_SL[0]) ); 
-   m_CpHT_B_Zmm_SL_new     [j][2].update ( N_SL_EB ,-0.5 ,63.5 , std::vector<float> (CpHT_Zmm_EndcapB_SL, CpHT_Zmm_EndcapB_SL + sizeof CpHT_Zmm_EndcapB_SL/ sizeof CpHT_Zmm_EndcapB_SL[0]) ); 
-
-   m_CpHT_B_Zee_ZR_new     [j][0].update ( N_ZR_B  , 0.0  , 720.0  , std::vector<float> (CpHT_Zee_Barrel_ZR , CpHT_Zee_Barrel_ZR  + sizeof CpHT_Zee_Barrel_ZR / sizeof CpHT_Zee_Barrel_ZR[0])  ); 
-   m_CpHT_B_Zee_ZR_new     [j][1].update ( N_ZR_EA , 630.0, 1030.0 , std::vector<float> (CpHT_Zee_EndcapA_ZR, CpHT_Zee_EndcapA_ZR + sizeof CpHT_Zee_EndcapA_ZR/ sizeof CpHT_Zee_EndcapA_ZR[0]) ); 
-   m_CpHT_B_Zee_ZR_new     [j][2].update ( N_ZR_EB , 630.0, 1030.0 , std::vector<float> (CpHT_Zee_EndcapB_ZR, CpHT_Zee_EndcapB_ZR + sizeof CpHT_Zee_EndcapB_ZR/ sizeof CpHT_Zee_EndcapB_ZR[0]) ); 
-
-
-   m_CpHT_B_Zmm_ZR_new     [j][0].update ( N_ZR_B  , 0.0  , 720.0  , std::vector<float> (CpHT_Zmm_Barrel_ZR , CpHT_Zmm_Barrel_ZR  + sizeof CpHT_Zmm_Barrel_ZR / sizeof CpHT_Zmm_Barrel_ZR[0])  ); 
-   m_CpHT_B_Zmm_ZR_new     [j][1].update ( N_ZR_EA , 630.0, 1030.0 , std::vector<float> (CpHT_Zmm_EndcapA_ZR, CpHT_Zmm_EndcapA_ZR + sizeof CpHT_Zmm_EndcapA_ZR/ sizeof CpHT_Zmm_EndcapA_ZR[0]) ); 
-   m_CpHT_B_Zmm_ZR_new     [j][2].update ( N_ZR_EB , 630.0, 1030.0 , std::vector<float> (CpHT_Zmm_EndcapB_ZR, CpHT_Zmm_EndcapB_ZR + sizeof CpHT_Zmm_EndcapB_ZR/ sizeof CpHT_Zmm_EndcapB_ZR[0]) ); 
-
-   m_CpHT_B_Zee_TW_new     [j][0].update ( N_TW_B  , 0.0, 2.2, std::vector<float> (CpHT_Zee_Barrel_TW , CpHT_Zee_Barrel_TW  + sizeof CpHT_Zee_Barrel_TW / sizeof CpHT_Zee_Barrel_TW[0])  ); 
-   m_CpHT_B_Zee_TW_new     [j][1].update ( N_TW_EA , 0.0, 2.2, std::vector<float> (CpHT_Zee_EndcapA_TW, CpHT_Zee_EndcapA_TW + sizeof CpHT_Zee_EndcapA_TW/ sizeof CpHT_Zee_EndcapA_TW[0]) ); 
-   m_CpHT_B_Zee_TW_new     [j][2].update ( N_TW_EB , 0.0, 2.2, std::vector<float> (CpHT_Zee_EndcapB_TW, CpHT_Zee_EndcapB_TW + sizeof CpHT_Zee_EndcapB_TW/ sizeof CpHT_Zee_EndcapB_TW[0]) ); 
-
-   m_CpHT_B_Zmm_TW_new     [j][0].update ( N_TW_B  , 0.0, 2.2, std::vector<float> (CpHT_Zmm_Barrel_TW , CpHT_Zmm_Barrel_TW  + sizeof CpHT_Zmm_Barrel_TW / sizeof CpHT_Zmm_Barrel_TW[0])  ); 
-   m_CpHT_B_Zmm_TW_new     [j][1].update ( N_TW_EA , 0.0, 2.2, std::vector<float> (CpHT_Zmm_EndcapA_TW, CpHT_Zmm_EndcapA_TW + sizeof CpHT_Zmm_EndcapA_TW/ sizeof CpHT_Zmm_EndcapA_TW[0]) ); 
-   m_CpHT_B_Zmm_TW_new     [j][2].update ( N_TW_EB , 0.0, 2.2, std::vector<float> (CpHT_Zmm_EndcapB_TW, CpHT_Zmm_EndcapB_TW + sizeof CpHT_Zmm_EndcapB_TW/ sizeof CpHT_Zmm_EndcapB_TW[0]) ); 
-  }
- 
-
-  m_datainplace = true;
-
-}
+  double exp_term1 = exp(-(par1 - par4)/m_par_pHTvsPGOG_new[GasType][TrtPart].GetBinValue(5));
+  double alpha1 = m_par_pHTvsPGOG_new[GasType][TrtPart].GetBinValue(2) + m_par_pHTvsPGOG_new[GasType][TrtPart].GetBinValue(3)/(1.0 + exp_term1);
+  double beta1 = m_par_pHTvsPGOG_new[GasType][TrtPart].GetBinValue(3) / ((1.0 + exp_term1)*(1.0 + exp_term1)) * exp_term1 / m_par_pHTvsPGOG_new[GasType][TrtPart].GetBinValue(5);
+  double pHT_HG   = alpha1 + beta1*(log10(gamma) - par1);
+
+  double pHT_OccZero = pHT_TR;
+  if      (log10(gamma) < m_par_pHTvsPGOG_new[GasType][TrtPart].GetBinValue(0))   pHT_OccZero = pHT_dEdx;
+  else if (log10(gamma) > par1  )                                                 pHT_OccZero = pHT_HG;
+
+
+  // The occupancy dependency is included through the Anatoli formula and a quadratic fit from the muon plateau:
+  // ------------------------------------------------------------------------------------------------------------------------
+  double DeltaOcc = m_par_pHTvsPGOG_new[GasType][TrtPart].GetBinValue(8)*occ + m_par_pHTvsPGOG_new[GasType][TrtPart].GetBinValue(9)*occ*occ;
+  double pHT = pHT_OccZero + (1.0 - pHT_OccZero) * DeltaOcc;
+  
+  return pHT;
+}
+
+
+
+StatusCode HTcalculator::ReadVectorDB( const CondAttrListVec* channel_values){
+  //std::cout << "Set TRT HT PID Parameters from the Vector Database << std::endl;
+   if ( channel_values->size() < 1){
+      //ATH_MSG_ERROR(" There are no Pid channels available!!");
+      return StatusCode::FAILURE;
+   }
+
+   CondAttrListVec::const_iterator first_channel = channel_values->begin();
+   CondAttrListVec::const_iterator last_channel  = channel_values->end();
+
+   //std::cout << "There are " << channel_values->size() << "  Channels " << std::endl;
+   int inichan = 0;
+   for (; first_channel != last_channel; ++first_channel) {
+     switch(first_channel->first){
+        case 0:			  // gamma_All_Xenon_All_Barrel
+		m_par_pHTvsPGOG_new [0][0].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 1 :                  // gamma_All_Xenon_All_EndcapA
+		m_par_pHTvsPGOG_new [0][1].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 2 :                  // gamma_All_Xenon_All_EndcapB
+		m_par_pHTvsPGOG_new [0][2].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 3 :                  // gamma_All_Argon_All_Barrel
+		m_par_pHTvsPGOG_new [1][0].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 4 :                  // gamma_All_Argon_All_EndcapA
+		m_par_pHTvsPGOG_new [1][1].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 5 :                  // gamma_All_Argon_All_EndcapB
+		m_par_pHTvsPGOG_new [1][2].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 6 :                  // gamma_All_Krypton_All_Barrel
+		m_par_pHTvsPGOG_new [2][0].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 7 :                  // gamma_All_Krypton_All_EndcapA
+		m_par_pHTvsPGOG_new [2][1].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 8 :                  // gamma_All_Krypton_All_EndcapB
+		m_par_pHTvsPGOG_new [2][2].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+
+	// Xenon Corrections: 
+       case 9 :                  // SL_Zee_Xenon_Electrons_Barrel
+		m_CpHT_B_Zee_SL_new [0][0].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 10 :                 // SL_Zee_Xenon_Electrons_EndcapA
+		m_CpHT_B_Zee_SL_new [0][1].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 11 :                 // SL_Zee_Xenon_Electrons_EndcapB
+		m_CpHT_B_Zee_SL_new [0][2].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 12 :                 // ZR_Zee_Xenon_Electrons_Barrel
+		m_CpHT_B_Zee_ZR_new [0][0].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 13 :                 // ZR_Zee_Xenon_Electrons_EndcapA
+		m_CpHT_B_Zee_ZR_new [0][1].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 14 :                 // ZR_Zee_Xenon_Electrons_EndcapB
+		m_CpHT_B_Zee_ZR_new [0][2].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 15 :                 // TW_Zee_Xenon_Electrons_Barrel
+		m_CpHT_B_Zee_TW_new [0][0].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 16 :                 // TW_Zee_Xenon_Electrons_EndcapA
+		m_CpHT_B_Zee_TW_new [0][1].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 17 :                 // TW_Zee_Xenon_Electrons_EndcapB
+		m_CpHT_B_Zee_TW_new [0][2].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 18 :                 // OR_Zee_Xenon_Electrons_Barrel
+		m_CpHT_B_Zee_OR_new [0][0].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 19 :                 // OR_Zee_Xenon_Electrons_EndcapA
+		m_CpHT_B_Zee_OR_new [0][1].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 20 :                 // OR_Zee_Xenon_Electrons_EndcapB
+		m_CpHT_B_Zee_OR_new [0][2].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 21 :                 // SL_Zmm_Xenon_NonElecs_Barrel
+		m_CpHT_B_Zmm_SL_new [0][0].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 22 :                 // SL_Zmm_Xenon_NonElecs_EndcapA
+		m_CpHT_B_Zmm_SL_new [0][1].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 23 :                 // SL_Zmm_Xenon_NonElecs_EndcapB
+		m_CpHT_B_Zmm_SL_new [0][2].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 24 :                 // ZR_Zmm_Xenon_NonElecs_Barrel
+		m_CpHT_B_Zmm_ZR_new [0][0].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 25 :                 // ZR_Zmm_Xenon_NonElecs_EndcapA
+		m_CpHT_B_Zmm_ZR_new [0][1].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 26 :                 // ZR_Zmm_Xenon_NonElecs_EndcapB
+		m_CpHT_B_Zmm_ZR_new [0][2].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 27 :                 // TW_Zmm_Xenon_NonElecs_Barrel
+		m_CpHT_B_Zmm_TW_new [0][0].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 28 :                 // TW_Zmm_Xenon_NonElecs_EndcapA
+		m_CpHT_B_Zmm_TW_new [0][1].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 29 :                 // TW_Zmm_Xenon_NonElecs_EndcapB
+		m_CpHT_B_Zmm_TW_new [0][2].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 30 :                 // OR_Zmm_Xenon_NonElecs_Barrel
+		m_CpHT_B_Zmm_OR_new [0][0].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 31 :                 // OR_Zmm_Xenon_NonElecs_EndcapA
+		m_CpHT_B_Zmm_OR_new [0][1].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 32 :                 // OR_Zmm_Xenon_NonElecs_EndcapB
+		m_CpHT_B_Zmm_OR_new [0][2].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+
+	// Argon Corrections: 
+        case 33 :                  // SL_Zee_Xenon_Electrons_Barrel
+		m_CpHT_B_Zee_SL_new [1][0].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 34 :                 // SL_Zee_Xenon_Electrons_EndcapA
+		m_CpHT_B_Zee_SL_new [1][1].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 35 :                 // SL_Zee_Xenon_Electrons_EndcapB
+		m_CpHT_B_Zee_SL_new [1][2].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 36 :                 // ZR_Zee_Xenon_Electrons_Barrel
+		m_CpHT_B_Zee_ZR_new [1][0].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 37 :                 // ZR_Zee_Xenon_Electrons_EndcapA
+		m_CpHT_B_Zee_ZR_new [1][1].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 38 :                 // ZR_Zee_Xenon_Electrons_EndcapB
+		m_CpHT_B_Zee_ZR_new [1][2].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 39 :                 // TW_Zee_Xenon_Electrons_Barrel
+		m_CpHT_B_Zee_TW_new [1][0].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 40 :                 // TW_Zee_Xenon_Electrons_EndcapA
+		m_CpHT_B_Zee_TW_new [1][1].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 41 :                 // TW_Zee_Xenon_Electrons_EndcapB
+		m_CpHT_B_Zee_TW_new [1][2].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 42 :                 // OR_Zee_Xenon_Electrons_Barrel
+		m_CpHT_B_Zee_OR_new [1][0].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 43 :                 // OR_Zee_Xenon_Electrons_EndcapA
+		m_CpHT_B_Zee_OR_new [1][1].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 44 :                 // OR_Zee_Xenon_Electrons_EndcapB
+		m_CpHT_B_Zee_OR_new [1][2].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 45 :                 // SL_Zmm_Xenon_NonElecs_Barrel
+		m_CpHT_B_Zmm_SL_new [1][0].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 46 :                 // SL_Zmm_Xenon_NonElecs_EndcapA
+		m_CpHT_B_Zmm_SL_new [1][1].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 47 :                 // SL_Zmm_Xenon_NonElecs_EndcapB
+		m_CpHT_B_Zmm_SL_new [1][2].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 48 :                 // ZR_Zmm_Xenon_NonElecs_Barrel
+		m_CpHT_B_Zmm_ZR_new [1][0].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 49 :                 // ZR_Zmm_Xenon_NonElecs_EndcapA
+		m_CpHT_B_Zmm_ZR_new [1][1].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 50 :                 // ZR_Zmm_Xenon_NonElecs_EndcapB
+		m_CpHT_B_Zmm_ZR_new [1][2].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 51 :                 // TW_Zmm_Xenon_NonElecs_Barrel
+		m_CpHT_B_Zmm_TW_new [1][0].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 52 :                 // TW_Zmm_Xenon_NonElecs_EndcapA
+		m_CpHT_B_Zmm_TW_new [1][1].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 53 :                 // TW_Zmm_Xenon_NonElecs_EndcapB
+		m_CpHT_B_Zmm_TW_new [1][2].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 54 :                 // OR_Zmm_Xenon_NonElecs_Barrel
+		m_CpHT_B_Zmm_OR_new [1][0].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 55 :                 // OR_Zmm_Xenon_NonElecs_EndcapA
+		m_CpHT_B_Zmm_OR_new [1][1].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 56 :                 // OR_Zmm_Xenon_NonElecs_EndcapB
+		m_CpHT_B_Zmm_OR_new [1][2].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+
+
+	// Krypton Corrections: 
+        case 57 :                  // SL_Zee_Xenon_Electrons_Barrel
+		m_CpHT_B_Zee_SL_new [2][0].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 58 :                 // SL_Zee_Xenon_Electrons_EndcapA
+		m_CpHT_B_Zee_SL_new [2][1].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 59 :                 // SL_Zee_Xenon_Electrons_EndcapB
+		m_CpHT_B_Zee_SL_new [2][2].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 60 :                 // ZR_Zee_Xenon_Electrons_Barrel
+		m_CpHT_B_Zee_ZR_new [2][0].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 61 :                 // ZR_Zee_Xenon_Electrons_EndcapA
+		m_CpHT_B_Zee_ZR_new [2][1].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 62 :                 // ZR_Zee_Xenon_Electrons_EndcapB
+		m_CpHT_B_Zee_ZR_new [2][2].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 63 :                 // TW_Zee_Xenon_Electrons_Barrel
+		m_CpHT_B_Zee_TW_new [2][0].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 64 :                 // TW_Zee_Xenon_Electrons_EndcapA
+		m_CpHT_B_Zee_TW_new [2][1].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 65 :                 // TW_Zee_Xenon_Electrons_EndcapB
+		m_CpHT_B_Zee_TW_new [2][2].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 66 :                 // OR_Zee_Xenon_Electrons_Barrel
+		m_CpHT_B_Zee_OR_new [2][0].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 67 :                 // OR_Zee_Xenon_Electrons_EndcapA
+		m_CpHT_B_Zee_OR_new [2][1].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 68 :                 // OR_Zee_Xenon_Electrons_EndcapB
+		m_CpHT_B_Zee_OR_new [2][2].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 69 :                 // SL_Zmm_Xenon_NonElecs_Barrel
+		m_CpHT_B_Zmm_SL_new [2][0].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 70 :                 // SL_Zmm_Xenon_NonElecs_EndcapA
+		m_CpHT_B_Zmm_SL_new [2][1].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 71 :                 // SL_Zmm_Xenon_NonElecs_EndcapB
+		m_CpHT_B_Zmm_SL_new [2][2].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 72 :                 // ZR_Zmm_Xenon_NonElecs_Barrel
+		m_CpHT_B_Zmm_ZR_new [2][0].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 73 :                 // ZR_Zmm_Xenon_NonElecs_EndcapA
+		m_CpHT_B_Zmm_ZR_new [2][1].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 74 :                 // ZR_Zmm_Xenon_NonElecs_EndcapB
+		m_CpHT_B_Zmm_ZR_new [2][2].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 75 :                 // TW_Zmm_Xenon_NonElecs_Barrel
+		m_CpHT_B_Zmm_TW_new [2][0].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 76 :                 // TW_Zmm_Xenon_NonElecs_EndcapA
+		m_CpHT_B_Zmm_TW_new [2][1].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 77 :                 // TW_Zmm_Xenon_NonElecs_EndcapB
+		m_CpHT_B_Zmm_TW_new [2][2].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 78 :                 // OR_Zmm_Xenon_NonElecs_Barrel
+		m_CpHT_B_Zmm_OR_new [2][0].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 79 :                 // OR_Zmm_Xenon_NonElecs_EndcapA
+		m_CpHT_B_Zmm_OR_new [2][1].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+        case 80 :                 // OR_Zmm_Xenon_NonElecs_EndcapB
+		m_CpHT_B_Zmm_OR_new [2][2].push_back(first_channel->second["array_value"].data<float>());
+		inichan += 1;
+                break;
+	}
+    }
+
+   //std::cout << "We have read " << inichan << " good channels" << std::endl;
+   //std::cout << m_par_pHTvsPGOG_new [0][0].GetBinValue(0) << "\t" << m_par_pHTvsPGOG_new [0][0].GetBinValue(1) << " " << m_par_pHTvsPGOG_new [0][0].GetBinValue(2) << std::endl;
+
+
+   for (int i = 0 ; i < N_DET; i++) {
+     for (int j = 0 ; j < N_GAS; j++) {
+       if (m_par_pHTvsPGOG_new[j][i].check(j,i) != StatusCode::SUCCESS) 	return StatusCode::FAILURE;
+       if (m_CpHT_B_Zee_SL_new[j][i].check(j,i) != StatusCode::SUCCESS) 	return StatusCode::FAILURE;
+       if (m_CpHT_B_Zmm_SL_new[j][i].check(j,i) != StatusCode::SUCCESS) 	return StatusCode::FAILURE;
+       if (m_CpHT_B_Zee_ZR_new[j][i].check(j,i) != StatusCode::SUCCESS) 	return StatusCode::FAILURE;
+       if (m_CpHT_B_Zmm_ZR_new[j][i].check(j,i) != StatusCode::SUCCESS) 	return StatusCode::FAILURE;
+       if (m_CpHT_B_Zee_TW_new[j][i].check(j,i) != StatusCode::SUCCESS) 	return StatusCode::FAILURE;
+       if (m_CpHT_B_Zmm_TW_new[j][i].check(j,i) != StatusCode::SUCCESS) 	return StatusCode::FAILURE;
+       if (m_CpHT_B_Zee_OR_new[j][i].check(j,i) != StatusCode::SUCCESS) 	return StatusCode::FAILURE;
+       if (m_CpHT_B_Zmm_OR_new[j][i].check(j,i) != StatusCode::SUCCESS) 	return StatusCode::FAILURE;
+    }
+   } 
+  
+   m_HasBeenInitialized=1;
+   //ATH_MSG_INFO(" TRT PID HT Vector DB loaded: ");
+   return StatusCode::SUCCESS;
+}
+
+
+/*****************************************************************************\
+|*%%%  Hard-coded HT Calibration Constants  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*|
+\*****************************************************************************/
+
+void HTcalculator::setDefaultCalibrationConstants(){
+  /*****************************************************************************\
+
+    This code is never called in production. It is used to set all
+    constants in the positions in the HTBlob where they are needed, and 
+    finally print out the blob as an array of numbers. This is far easier and 
+    less error prone than having a separate setter-script which might itself 
+    have a version mismatch with this code.
+
+    PLEASE REMEMBER to increment the version number precisely when you change 
+    the addresses of the various arrays inside the HTBlob, and NEVER otherwise!
+    
+  \*****************************************************************************/
+	//FIXME
+  if (m_datainplace) return;  // Just to load 1 time
+  //std::cout << "Looks like HT PID DB is NOT available, so lets set hard-coded PID calibration constants. Derived from Run1 Data Zee and Zmumu 50 ns. FIXME!!" << std::endl;
+  m_HasBeenInitialized=1;
+
+// Expanding to a 2D fit (gamma,occupancy) for three types of gases: Xenon, Argon, Krypton:
+// ----------------------------------------------------------------------------------------
+  float par2[N_GAS][N_DET][N_PAR2] = { 
+    // Xenon Gas Parameters
+       {{ 1.0000, 3.7204, 0.0260, 0.1445, 3.0461, 0.2206, 0.0000, 0.0078, 0.0918, 0.0744},    // Barrel   Prob: 0.9992 
+        { 1.0000, 3.5836, 0.0468, 0.1475, 3.0943, 0.1303, 0.0000, 0.0089, 0.1054, 0.0472},    // EndcapA  Prob: 1.0000 
+        { 1.0000, 3.4798, 0.0433, 0.1824, 3.0730, 0.1244, 0.0000, 0.0300, 0.1007, 0.1261}},   // EndcapB  Prob: 0.8536
+    // Argon Gas Parameters 
+       {{ 1.0000, 2.8342, 0.0384, 0.0185, 2.7161, 0.0366, 0.0000, 0.0013, 0.1261, 0.1241},    // Barrel   Prob: 1.0000 
+        { 1.0000, 3.2551, 0.0388, 0.0338, 2.9090, 0.1663, 0.0000, 0.1604, 0.1100, 0.0521},    // EndcapA  Prob: 0.9970
+        { 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000}},   // EndcapB  ------------
+    // Krypton Gas Parameters (Place Holder) 
+       {{ 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000},    // Barrel   ------------
+        { 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000},    // EndcapA  ------------
+        { 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000}}};  // EndcapB  ------------
+
+  for (int i = 0 ; i < N_GAS; i++)
+    for (int j = 0 ; j < N_DET; j++)
+	m_par_pHTvsPGOG_new[i][j] .update (  10, 50, 1000000.0,   std::vector<float> (par2[i][j] , par2[i][j]  + sizeof par2[i][j] / sizeof par2[i][j][0]) );
+
+
+  const int N_SL_B  = 73;
+  const int N_SL_EA = 96;
+  const int N_SL_EB = 64;
+  const int N_ZR_B  = 36;
+  const int N_ZR_EA = 40;
+  const int N_ZR_EB = 40;
+  const int N_TW_B  = 44;
+  const int N_TW_EA = 44;
+  const int N_TW_EB = 44;
+
+  // ---------------------------------------
+  // Electrons:
+  // ---------------------------------------
+  // Straw Layer (SL):
+  double CpHT_Zee_Barrel_SL[N_SL_B] = { 0.637, 0.887, 0.966, 1.034, 1.059, 1.009, 1.131, 1.073, 1.086, 0.925, 0.890, 0.987, 0.937, 0.964, 0.976, 0.929, 1.006, 0.979, 0.992, 0.812, 0.935, 0.950, 0.984, 0.994, 1.011, 0.952, 1.051, 0.997, 1.026, 1.018, 0.978, 1.066, 1.016, 1.039, 1.040, 0.979, 1.057, 1.018, 1.032, 1.052, 0.994, 1.055, 1.023, 0.823, 1.013, 0.977, 1.051, 1.031, 0.973, 1.077, 1.025, 1.056, 1.047, 0.992, 1.085, 1.032, 1.061, 1.054, 0.998, 1.093, 1.039, 1.058, 1.056, 0.988, 1.090, 1.057, 1.046, 1.053, 0.994, 1.081, 1.041, 1.040, 1.061};
+  double CpHT_Zee_EndcapA_SL[N_SL_EA] = { 0.671, 0.802, 0.890, 0.918, 0.946, 0.963, 0.974, 0.979, 1.030, 1.023, 1.029, 1.004, 1.030, 1.037, 1.033, 1.013, 0.913, 0.968, 0.998, 0.994, 1.036, 1.032, 1.043, 1.044, 1.042, 1.009, 1.026, 1.007, 1.032, 1.046, 1.020, 1.032, 0.913, 0.955, 0.974, 0.995, 1.035, 1.042, 1.039, 1.047, 1.032, 1.036, 1.033, 1.010, 1.047, 1.049, 1.055, 1.046, 0.877, 0.938, 0.968, 0.983, 1.004, 1.010, 1.013, 1.014, 1.038, 1.031, 1.042, 1.018, 1.016, 1.049, 1.023, 1.025, 0.923, 0.978, 0.995, 1.001, 1.038, 1.042, 1.026, 1.037, 1.042, 1.062, 1.041, 1.039, 1.078, 1.058, 1.036, 1.049, 0.897, 0.965, 0.993, 0.985, 1.040, 1.068, 1.053, 1.049, 1.037, 1.050, 1.043, 1.065, 1.026, 1.058, 1.058, 1.070};
+  double CpHT_Zee_EndcapB_SL[N_SL_EB] = { 0.494, 0.771, 0.887, 0.931, 0.939, 0.989, 0.994, 1.005, 0.866, 0.971, 1.027, 1.057, 1.021, 1.056, 1.046, 1.073, 0.901, 0.992, 1.043, 1.055, 1.034, 1.087, 1.094, 1.087, 0.920, 0.995, 1.048, 1.068, 1.042, 1.075, 1.086, 1.126, 0.920, 0.987, 1.062, 1.072, 1.059, 1.096, 1.070, 1.082, 0.927, 1.020, 1.068, 1.083, 1.054, 1.089, 1.078, 1.103, 0.961, 1.050, 1.100, 1.107, 1.098, 1.124, 1.101, 1.141, 0.988, 1.106, 1.127, 1.174, 1.109, 1.134, 1.134, 1.182};
+
+  // ZR-position (ZR - Z in Barrel, R in Endcaps):
+  double CpHT_Zee_Barrel_ZR[N_ZR_B] = { 0.861, 0.901, 0.909, 0.915, 0.919, 0.924, 0.922, 0.931, 0.928, 0.937, 0.945, 0.908, 0.921, 0.959, 0.970, 0.988, 0.986, 0.999, 1.010, 1.005, 0.996, 1.005, 1.018, 0.992, 1.042, 1.076, 1.101, 1.116, 1.134, 1.157, 1.170, 1.196, 1.208, 1.230, 1.230, 1.039};
+  double CpHT_Zee_EndcapA_ZR[N_ZR_EA] = { 0.458, 0.621, 0.694, 0.758, 0.798, 0.838, 0.871, 0.900, 0.956, 0.980, 1.001, 1.006, 1.016, 1.027, 1.019, 1.038, 1.046, 1.045, 1.054, 1.064, 1.064, 1.077, 1.081, 1.089, 1.101, 1.113, 1.102, 1.113, 1.107, 1.113, 1.098, 1.105, 1.083, 1.054, 1.036, 0.994, 0.965, 0.887, 0.771, 0.575};
+  double CpHT_Zee_EndcapB_ZR[N_ZR_EB] = { 1.000, 0.754, 0.926, 0.941, 1.001, 1.001, 0.987, 1.033, 1.054, 1.060, 1.057, 1.064, 1.061, 1.067, 1.052, 1.062, 1.045, 1.057, 1.053, 1.047, 1.053, 1.050, 1.042, 1.073, 1.050, 1.050, 1.028, 0.972, 0.928, 0.896, 0.881, 0.854, 0.828, 0.793, 0.755, 0.652, 0.511, 0.291, 0.481, 1.000};
+
+  // Track-to-Wire distance (TW):
+  double CpHT_Zee_Barrel_TW[44] = { 1.233, 1.261, 1.276, 1.296, 1.307, 1.338, 1.349, 1.386, 1.395, 1.434, 1.441, 1.448, 1.440, 1.439, 1.425, 1.406, 1.388, 1.363, 1.334, 1.320, 1.295, 1.269, 1.240, 1.212, 1.183, 1.144, 1.109, 1.073, 1.028, 0.981, 0.938, 0.879, 0.817, 0.752, 0.678, 0.606, 0.531, 0.465, 0.428, 0.443, 0.504, 0.553, 0.579, 0.766};
+  double CpHT_Zee_EndcapA_TW[44] = { 1.236, 1.260, 1.291, 1.292, 1.304, 1.325, 1.354, 1.363, 1.387, 1.394, 1.409, 1.415, 1.407, 1.414, 1.405, 1.394, 1.385, 1.357, 1.345, 1.331, 1.309, 1.282, 1.252, 1.226, 1.197, 1.176, 1.135, 1.097, 1.047, 1.013, 0.946, 0.892, 0.834, 0.756, 0.696, 0.610, 0.547, 0.480, 0.444, 0.445, 0.469, 0.513, 0.584, 0.892};
+  double CpHT_Zee_EndcapB_TW[44] = { 1.186, 1.202, 1.219, 1.246, 1.257, 1.270, 1.291, 1.297, 1.307, 1.319, 1.333, 1.338, 1.340, 1.326, 1.314, 1.327, 1.321, 1.310, 1.289, 1.279, 1.266, 1.240, 1.222, 1.194, 1.168, 1.153, 1.125, 1.091, 1.033, 1.009, 0.963, 0.917, 0.846, 0.802, 0.746, 0.690, 0.615, 0.560, 0.514, 0.485, 0.478, 0.473, 0.523, 0.726};
+
+
+  // ---------------------------------------
+  // Non-Electrons (here muons):
+  // ---------------------------------------
+
+  // Straw Layer (SL):
+  double CpHT_Zmm_Barrel_SL[N_SL_B] = { 1.100, 1.186, 1.209, 1.241, 1.199, 1.174, 1.209, 1.178, 1.150, 1.053, 1.033, 1.054, 1.033, 1.029, 1.041, 1.021, 1.027, 0.992, 0.988, 0.983, 0.998, 1.022, 1.043, 1.023, 1.027, 1.016, 1.034, 1.009, 1.014, 1.022, 1.001, 1.024, 1.003, 1.010, 1.004, 0.983, 0.992, 0.978, 0.981, 1.000, 0.984, 0.974, 0.953, 0.941, 0.982, 0.990, 1.005, 0.993, 0.966, 0.997, 1.000, 0.988, 0.992, 0.969, 1.003, 0.964, 0.989, 0.961, 0.956, 0.971, 0.948, 0.963, 0.951, 0.943, 0.964, 0.965, 0.925, 0.919, 0.918, 0.928, 0.919, 0.912, 0.906};
+  double CpHT_Zmm_EndcapA_SL[N_SL_EA] = { 0.883, 0.898, 0.923, 0.899, 0.892, 0.909, 0.893, 0.925, 0.964, 0.964, 0.979, 0.949, 0.944, 0.998, 0.940, 0.937, 0.950, 0.976, 0.972, 0.950, 0.998, 1.005, 1.007, 1.028, 1.018, 0.995, 1.006, 0.998, 1.031, 1.047, 1.031, 1.015, 1.017, 0.983, 1.018, 1.018, 1.025, 1.033, 1.046, 1.069, 1.033, 1.027, 1.006, 0.982, 1.066, 1.080, 1.048, 1.058, 0.955, 0.971, 0.973, 0.992, 1.013, 1.046, 1.022, 1.029, 1.040, 1.016, 1.077, 1.024, 1.011, 1.095, 1.019, 1.045, 1.001, 1.057, 1.043, 1.022, 1.033, 1.108, 1.062, 1.110, 1.090, 1.058, 1.060, 1.099, 1.065, 1.120, 1.077, 1.060, 1.024, 1.006, 1.022, 1.007, 1.051, 1.118, 1.079, 1.118, 1.070, 1.064, 1.108, 1.127, 1.039, 1.107, 1.088, 1.154};
+  double CpHT_Zmm_EndcapB_SL[N_SL_EB] = { 0.828, 0.961, 0.941, 0.991, 0.986, 1.015, 0.993, 0.957, 0.892, 1.005, 1.100, 1.054, 0.995, 1.042, 1.022, 1.007, 0.918, 1.019, 1.056, 1.034, 0.978, 0.981, 1.014, 1.026, 0.988, 0.978, 1.062, 1.085, 1.029, 0.989, 1.067, 1.054, 0.978, 0.971, 1.051, 1.114, 1.152, 1.172, 1.034, 1.170, 1.055, 0.990, 1.112, 1.047, 1.068, 1.013, 1.089, 1.141, 0.903, 0.960, 1.138, 1.218, 0.991, 1.087, 0.997, 1.028, 1.042, 1.155, 1.060, 1.130, 1.077, 1.186, 1.006, 1.054};
+
+  // ZR-position (ZR - Z in Barrel, R in Endcaps):
+  double CpHT_Zmm_Barrel_ZR[N_ZR_B] = { 0.846, 0.874, 0.880, 0.882, 0.876, 0.887, 0.901, 0.894, 0.894, 0.903, 0.902, 0.907, 0.918, 0.934, 0.941, 0.948, 0.963, 0.969, 0.990, 0.991, 1.012, 1.019, 1.029, 1.033, 1.072, 1.088, 1.111, 1.144, 1.164, 1.192, 1.225, 1.242, 1.271, 1.314, 1.309, 1.078};
+  double CpHT_Zmm_EndcapA_ZR[N_ZR_EA] = { 0.613, 0.757, 0.783, 0.849, 0.866, 0.886, 0.915, 0.939, 0.930, 0.976, 0.969, 0.984, 0.992, 0.979, 1.006, 1.000, 1.005, 1.022, 1.020, 1.030, 1.031, 1.036, 1.053, 1.050, 1.050, 1.048, 1.065, 1.071, 1.060, 1.077, 1.067, 1.072, 1.070, 1.067, 1.090, 1.059, 1.032, 1.081, 1.011, 0.984};
+  double CpHT_Zmm_EndcapB_ZR[N_ZR_EB] = { 1.000, 1.375, 0.962, 0.702, 0.869, 0.899, 0.953, 0.905, 1.052, 1.025, 1.016, 1.009, 1.033, 0.920, 1.056, 1.031, 1.070, 1.042, 1.052, 1.066, 1.024, 1.023, 1.046, 1.046, 1.007, 1.009, 1.009, 1.024, 1.007, 0.993, 0.968, 0.997, 0.911, 0.922, 0.938, 0.921, 0.883, 0.653, 0.917, 1.000};
+
+  // Track-to-Wire distance (TWdist):
+  double CpHT_Zmm_Barrel_TW[N_TW_B] = { 1.124, 1.058, 1.065, 1.079, 1.094, 1.124, 1.141, 1.173, 1.207, 1.226, 1.250, 1.250, 1.258, 1.249, 1.258, 1.243, 1.229, 1.211, 1.206, 1.180, 1.165, 1.138, 1.123, 1.100, 1.074, 1.052, 1.014, 0.981, 0.953, 0.896, 0.866, 0.809, 0.776, 0.736, 0.690, 0.644, 0.609, 0.615, 0.680, 0.854, 1.094, 1.274, 1.208, 1.219};
+  double CpHT_Zmm_EndcapA_TW[N_TW_EA] = { 1.210, 1.161, 1.177, 1.201, 1.221, 1.244, 1.279, 1.300, 1.319, 1.341, 1.362, 1.372, 1.376, 1.378, 1.384, 1.361, 1.349, 1.334, 1.325, 1.284, 1.264, 1.250, 1.223, 1.183, 1.121, 1.104, 1.077, 1.016, 0.969, 0.912, 0.863, 0.815, 0.753, 0.662, 0.604, 0.555, 0.513, 0.490, 0.511, 0.627, 0.843, 1.019, 0.932, 0.922};
+  double CpHT_Zmm_EndcapB_TW[N_TW_EB] = { 1.132, 1.150, 1.125, 1.174, 1.170, 1.282, 1.165, 1.244, 1.287, 1.293, 1.270, 1.366, 1.317, 1.285, 1.319, 1.291, 1.304, 1.239, 1.256, 1.279, 1.212, 1.221, 1.200, 1.174, 1.143, 1.120, 1.022, 0.983, 0.938, 0.895, 0.906, 0.826, 0.766, 0.765, 0.664, 0.566, 0.553, 0.556, 0.541, 0.626, 0.780, 0.964, 0.817, 0.542};
+
+
+  // --------------------------------------------------------------
+
+
+// Same corrections for all gases:
+ 
+  for (int j = 0 ; j < N_GAS; j++){
+   m_CpHT_B_Zee_SL_new     [j][0].update ( N_SL_B  ,-0.5 ,72.5 , std::vector<float> (CpHT_Zee_Barrel_SL , CpHT_Zee_Barrel_SL  + sizeof CpHT_Zee_Barrel_SL / sizeof CpHT_Zee_Barrel_SL[0])  ); 
+   m_CpHT_B_Zee_SL_new     [j][1].update ( N_SL_EA ,-0.5 ,95.5 , std::vector<float> (CpHT_Zee_EndcapA_SL, CpHT_Zee_EndcapA_SL + sizeof CpHT_Zee_EndcapA_SL/ sizeof CpHT_Zee_EndcapA_SL[0]) ); 
+   m_CpHT_B_Zee_SL_new     [j][2].update ( N_SL_EB ,-0.5 ,63.5 , std::vector<float> (CpHT_Zee_EndcapB_SL, CpHT_Zee_EndcapB_SL + sizeof CpHT_Zee_EndcapB_SL/ sizeof CpHT_Zee_EndcapB_SL[0]) ); 
+
+   m_CpHT_B_Zmm_SL_new     [j][0].update ( N_SL_B  ,-0.5 ,72.5 , std::vector<float> (CpHT_Zmm_Barrel_SL , CpHT_Zmm_Barrel_SL  + sizeof CpHT_Zmm_Barrel_SL / sizeof CpHT_Zmm_Barrel_SL[0])  ); 
+   m_CpHT_B_Zmm_SL_new     [j][1].update ( N_SL_EA ,-0.5 ,95.5 , std::vector<float> (CpHT_Zmm_EndcapA_SL, CpHT_Zmm_EndcapA_SL + sizeof CpHT_Zmm_EndcapA_SL/ sizeof CpHT_Zmm_EndcapA_SL[0]) ); 
+   m_CpHT_B_Zmm_SL_new     [j][2].update ( N_SL_EB ,-0.5 ,63.5 , std::vector<float> (CpHT_Zmm_EndcapB_SL, CpHT_Zmm_EndcapB_SL + sizeof CpHT_Zmm_EndcapB_SL/ sizeof CpHT_Zmm_EndcapB_SL[0]) ); 
 
-#endif
-#endif
+   m_CpHT_B_Zee_ZR_new     [j][0].update ( N_ZR_B  , 0.0  , 720.0  , std::vector<float> (CpHT_Zee_Barrel_ZR , CpHT_Zee_Barrel_ZR  + sizeof CpHT_Zee_Barrel_ZR / sizeof CpHT_Zee_Barrel_ZR[0])  ); 
+   m_CpHT_B_Zee_ZR_new     [j][1].update ( N_ZR_EA , 630.0, 1030.0 , std::vector<float> (CpHT_Zee_EndcapA_ZR, CpHT_Zee_EndcapA_ZR + sizeof CpHT_Zee_EndcapA_ZR/ sizeof CpHT_Zee_EndcapA_ZR[0]) ); 
+   m_CpHT_B_Zee_ZR_new     [j][2].update ( N_ZR_EB , 630.0, 1030.0 , std::vector<float> (CpHT_Zee_EndcapB_ZR, CpHT_Zee_EndcapB_ZR + sizeof CpHT_Zee_EndcapB_ZR/ sizeof CpHT_Zee_EndcapB_ZR[0]) ); 
+
+
+   m_CpHT_B_Zmm_ZR_new     [j][0].update ( N_ZR_B  , 0.0  , 720.0  , std::vector<float> (CpHT_Zmm_Barrel_ZR , CpHT_Zmm_Barrel_ZR  + sizeof CpHT_Zmm_Barrel_ZR / sizeof CpHT_Zmm_Barrel_ZR[0])  ); 
+   m_CpHT_B_Zmm_ZR_new     [j][1].update ( N_ZR_EA , 630.0, 1030.0 , std::vector<float> (CpHT_Zmm_EndcapA_ZR, CpHT_Zmm_EndcapA_ZR + sizeof CpHT_Zmm_EndcapA_ZR/ sizeof CpHT_Zmm_EndcapA_ZR[0]) ); 
+   m_CpHT_B_Zmm_ZR_new     [j][2].update ( N_ZR_EB , 630.0, 1030.0 , std::vector<float> (CpHT_Zmm_EndcapB_ZR, CpHT_Zmm_EndcapB_ZR + sizeof CpHT_Zmm_EndcapB_ZR/ sizeof CpHT_Zmm_EndcapB_ZR[0]) ); 
+
+   m_CpHT_B_Zee_TW_new     [j][0].update ( N_TW_B  , 0.0, 2.2, std::vector<float> (CpHT_Zee_Barrel_TW , CpHT_Zee_Barrel_TW  + sizeof CpHT_Zee_Barrel_TW / sizeof CpHT_Zee_Barrel_TW[0])  ); 
+   m_CpHT_B_Zee_TW_new     [j][1].update ( N_TW_EA , 0.0, 2.2, std::vector<float> (CpHT_Zee_EndcapA_TW, CpHT_Zee_EndcapA_TW + sizeof CpHT_Zee_EndcapA_TW/ sizeof CpHT_Zee_EndcapA_TW[0]) ); 
+   m_CpHT_B_Zee_TW_new     [j][2].update ( N_TW_EB , 0.0, 2.2, std::vector<float> (CpHT_Zee_EndcapB_TW, CpHT_Zee_EndcapB_TW + sizeof CpHT_Zee_EndcapB_TW/ sizeof CpHT_Zee_EndcapB_TW[0]) ); 
+
+   m_CpHT_B_Zmm_TW_new     [j][0].update ( N_TW_B  , 0.0, 2.2, std::vector<float> (CpHT_Zmm_Barrel_TW , CpHT_Zmm_Barrel_TW  + sizeof CpHT_Zmm_Barrel_TW / sizeof CpHT_Zmm_Barrel_TW[0])  ); 
+   m_CpHT_B_Zmm_TW_new     [j][1].update ( N_TW_EA , 0.0, 2.2, std::vector<float> (CpHT_Zmm_EndcapA_TW, CpHT_Zmm_EndcapA_TW + sizeof CpHT_Zmm_EndcapA_TW/ sizeof CpHT_Zmm_EndcapA_TW[0]) ); 
+   m_CpHT_B_Zmm_TW_new     [j][2].update ( N_TW_EB , 0.0, 2.2, std::vector<float> (CpHT_Zmm_EndcapB_TW, CpHT_Zmm_EndcapB_TW + sizeof CpHT_Zmm_EndcapB_TW/ sizeof CpHT_Zmm_EndcapB_TW[0]) ); 
+  }
+ 
+
+  m_datainplace = true;
+
+}
diff --git a/InnerDetector/InDetConditions/TRT_ConditionsData/src/StorePIDinfo.cxx b/InnerDetector/InDetConditions/TRT_ConditionsData/src/StorePIDinfo.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..27b58316ae542961d05c4eea46deeadda2db452a
--- /dev/null
+++ b/InnerDetector/InDetConditions/TRT_ConditionsData/src/StorePIDinfo.cxx
@@ -0,0 +1,86 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+#include <iostream>
+#include "AsgTools/MsgStreamMacros.h"
+#include "TRT_ConditionsData/StorePIDinfo.h"
+
+StorePIDinfo::StorePIDinfo(){
+	m_nbins = 0;
+	m_min 	= -9999.9;
+	m_max	= 10000000*2;
+	m_values.clear();
+}
+
+StorePIDinfo::StorePIDinfo(int nbins, float min, float max, std::vector<float> values){
+	update (nbins, min, max, values);
+}
+
+StorePIDinfo::~StorePIDinfo(){}
+
+void StorePIDinfo::update( int nbins, float min, float max, std::vector<float> values){
+	m_nbins = nbins	;
+	m_min 	= min	;
+	m_max	= max	;
+	if (values.size()!=m_nbins){
+	  //ATH_MSG_ERROR(" Different Values of n_bins and vector size!!!")
+	}
+	m_values.clear();
+	for (unsigned int i = 0; i<values.size(); i++ ){
+		m_values.push_back( values.at(i));
+	}
+}
+
+// THIS HAS TO BE CALLED in order!!!
+void StorePIDinfo::push_back( float value ){
+	// Just to read the DB
+      if 	(m_nbins==0) 		{
+			m_nbins = int(value)	;
+			m_min   = -9999.9	;
+			m_max   = 10000000*2	;
+			m_values.clear()	;
+      }
+      else if 	(m_min < -9999) 	m_min 	= value		;
+      else if 	(m_max >  10000000) 	m_max   = value		;
+      else	 m_values.push_back(value);
+}
+
+StatusCode StorePIDinfo::check( int gas, int detpart) const{
+	if 	( m_nbins == 0)
+	{
+	  std::cout << " StorePIDinfo: No bins in the DB!! Gas: " << gas << " detPart: " << detpart << std::endl;
+          return StatusCode::FAILURE;
+	}
+	else if ( m_nbins != m_values.size() )
+	{
+	  std::cout << " Different number of PID numbers!!!!! " << gas << " detPart: " << detpart << std::endl;
+          return StatusCode::FAILURE;
+	}
+	else if ( (m_max < m_min) || (m_max == m_min) )
+	{
+	  std::cout << " Max is smaller or equal than min!!!" << gas << " detPart: " << detpart << std::endl;
+          return StatusCode::FAILURE;
+	}
+        return StatusCode::SUCCESS;
+}
+
+
+float StorePIDinfo::GetValue 	( float input  ) const {
+	return m_values.at(	GetBin(	input	)	);
+}
+
+float StorePIDinfo::GetBinValue 	( int bin) const {
+	return m_values.at(	bin	);
+}
+
+int StorePIDinfo::GetBin	( float input  ) const {
+	if (input < m_min) 		return 0;
+        else if (input >= m_max) 	return m_nbins-1;
+	else{
+		float dr = (m_max-m_min)/m_nbins;
+		unsigned int bin = int (                       (input - m_min)/dr    ) ;
+		//if 	(bin >=  m_nbins) ATH_MSG_ERROR"  Bin number is larger than number of bins!");
+		return bin;
+	}
+	return 0;
+}
diff --git a/InnerDetector/InDetConditions/TRT_ConditionsServices/TRT_ConditionsServices/ITRT_CalDbTool.h b/InnerDetector/InDetConditions/TRT_ConditionsServices/TRT_ConditionsServices/ITRT_CalDbTool.h
new file mode 100644
index 0000000000000000000000000000000000000000..a77615a98adc07a40ccbac71a221e20acffe63b5
--- /dev/null
+++ b/InnerDetector/InDetConditions/TRT_ConditionsServices/TRT_ConditionsServices/ITRT_CalDbTool.h
@@ -0,0 +1,51 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef ITRT_CALDBTOOL_H
+#define ITRT_CALDBTOOL_H
+/** @file ITRT_CalDbTool.h
+ * @brief abstract interface to TRT calibration constants
+ * @author Peter Hansen <phansen@nbi.dk>, Wouter hulsbergen
+ */
+
+#include <string>
+#include <iostream>
+#include "GaudiKernel/IAlgTool.h"
+#include "TRT_ConditionsData/ExpandedIdentifier.h"
+#include "TRT_ConditionsData/RtRelationMultChanContainer.h"
+#include "TRT_ConditionsData/StrawT0MultChanContainer.h"
+
+
+class Identifier;
+namespace TRTCond {
+  class RtRelation;
+}
+
+/** @class ITRT_CalDbTool
+ *  abstract interface to TRT calibration constants
+ */
+class ITRT_CalDbTool: virtual public IAlgTool
+{
+ public:
+  typedef TRTCond::RtRelationMultChanContainer RtRelationContainer ;
+  typedef TRTCond::StrawT0MultChanContainer StrawT0Container ;
+
+  DeclareInterfaceID(ITRT_CalDbTool, 1, 0);
+
+  virtual float getT0( const Identifier& ,  int level = TRTCond::ExpandedIdentifier::STRAW ) const = 0;
+  virtual const TRTCond::RtRelation* getRtRelation( const Identifier& , int level = TRTCond::ExpandedIdentifier::STRAW ) const  = 0;
+  virtual const TRTCond::RtRelation* getErrors( const Identifier& , int level = TRTCond::ExpandedIdentifier::STRAW ) const  = 0;
+  virtual const TRTCond::RtRelation* getSlopes( const Identifier& , int level = TRTCond::ExpandedIdentifier::STRAW ) const  = 0;
+  virtual double driftRadius(const double&, float&, const Identifier&, bool&) const = 0;
+  virtual double driftError(const double&, const Identifier&, bool&) const = 0;
+  virtual double driftSlope(const double&, const Identifier&, bool&) const = 0;
+  virtual TRTCond::ExpandedIdentifier trtcondid( const Identifier&, int level = TRTCond::ExpandedIdentifier::STRAW ) const =0;
+  virtual const RtRelationContainer* getRtContainer() const = 0;
+  virtual const RtRelationContainer* getErrContainer() const = 0;
+  virtual const RtRelationContainer* getSlopeContainer() const = 0;
+  virtual const StrawT0Container* getT0Container() const = 0 ;
+
+};
+
+#endif //  ITRT_CALDBTOOL_H
diff --git a/InnerDetector/InDetConditions/TRT_ConditionsServices/TRT_ConditionsServices/ITRT_StrawStatusSummaryTool.h b/InnerDetector/InDetConditions/TRT_ConditionsServices/TRT_ConditionsServices/ITRT_StrawStatusSummaryTool.h
new file mode 100755
index 0000000000000000000000000000000000000000..f7bb71f6ff3567ea8aa135668f09afe6e9a663b6
--- /dev/null
+++ b/InnerDetector/InDetConditions/TRT_ConditionsServices/TRT_ConditionsServices/ITRT_StrawStatusSummaryTool.h
@@ -0,0 +1,46 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef ITRT_STRAWSTATUSSUMMARYTOOL_H
+#define ITRT_STRAWSTATUSSUMMARYTOOL_H
+/** @file ITRT_StrawStatusSummaryTool.h
+ * @brief abstract interface to TRT straw status constants
+ * @author Peter Hansen <phansen@nbi.dk>
+ */
+
+#include <string>
+#include "GaudiKernel/IAlgTool.h"
+#include "TRT_ConditionsData/StrawStatusMultChanContainer.h"
+#include "TRT_ConditionsData/TRTStrawStatusData.h"
+#include "TRT_ConditionsData/StrawStatusContainer.h"
+
+class Identifier;
+namespace TRTCOND {
+  class ExpandedIdentifier;
+}
+
+/** @class ITRT_StrawStatusSummaryTool
+ abstract interface to TRT straw status constants
+*/
+class ITRT_StrawStatusSummaryTool: virtual public IAlgTool
+{
+ public:
+
+  typedef TRTCond::StrawStatusMultChanContainer StrawStatusContainer ;
+
+  DeclareInterfaceID(ITRT_StrawStatusSummaryTool, 1, 0);
+
+  virtual int getStatus(Identifier ) const =0;
+  virtual int getStatusPermanent(Identifier) const =0;
+  virtual int getStatusHT(Identifier) const =0;
+  virtual bool get_status(Identifier) const =0;
+  virtual bool get_statusHT(Identifier) const =0;
+
+  virtual const StrawStatusContainer* getStrawStatusContainer() const =0;
+  virtual const StrawStatusContainer* getStrawStatusPermanentContainer() const =0;
+  virtual const StrawStatusContainer* getStrawStatusHTContainer() const =0;
+
+};
+
+#endif //  ITRT_STRAWSTATUSSUMMARYTOOL_H
diff --git a/InnerDetector/InDetConditions/TRT_ConditionsServices/src/TRT_CalDbTool.cxx b/InnerDetector/InDetConditions/TRT_ConditionsServices/src/TRT_CalDbTool.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..7ddea9aa5213bea0d97e73c3b27d9719e46cee2b
--- /dev/null
+++ b/InnerDetector/InDetConditions/TRT_ConditionsServices/src/TRT_CalDbTool.cxx
@@ -0,0 +1,303 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+/** @file TRT_CalDbTool.cxx
+ *  @brief Tool to manage TRT Conditions data during normal reconstruction
+ *  @author Peter Hansen <phansen@nbi.dk>, Wouter Hulsberger <whulsber@cern.ch>
+ **/
+
+#include "TRT_CalDbTool.h"
+
+#include <fstream>
+#include <iostream>
+#include <iomanip>
+#include <sstream>
+
+#include "StoreGate/StoreGateSvc.h"
+#include "GaudiKernel/IToolSvc.h"
+#include "GaudiKernel/ThreadLocalContext.h"
+#include "StoreGate/ReadCondHandle.h"
+
+
+TRT_CalDbTool::TRT_CalDbTool( const std::string& type, const std::string& name, const IInterface* parent)
+  : base_class(type, name, parent),
+    m_trtId(0),
+    m_detstore("DetectorStore",name),
+    m_mutex{},
+    m_Rtcache{},
+    m_T0cache{},
+    m_Errcache{},
+    m_Slopecache{},
+    m_isGEANT4(true),
+    m_par_rtcontainerkey("/TRT/Calib/RT"),
+    m_par_errcontainerkey("/TRT/Calib/errors2d"),
+    m_par_slopecontainerkey("/TRT/Calib/slopes"),
+    m_par_t0containerkey("/TRT/Calib/T0"),
+    m_rtContainerG4(nullptr),
+    m_errContainerG4(nullptr),
+    m_slopeContainerG4(nullptr),
+    m_t0ContainerG4(nullptr)
+{
+  declareProperty("DetectorStore",m_detstore);
+  declareProperty("isGEANT4",m_isGEANT4);
+}
+
+
+StatusCode TRT_CalDbTool::initialize() 
+{
+  ATH_MSG_DEBUG( " in initialize " );
+
+  // Get StoreGate access to DetectorStore
+  if (StatusCode::SUCCESS!=m_detstore.retrieve()) {
+    ATH_MSG_FATAL("Unable to retrieve " << m_detstore.name());
+    return StatusCode::FAILURE;
+  }
+
+  // Get the TRT ID helper
+  StatusCode sc = m_detstore->retrieve(m_trtId,"TRT_ID");
+  if(sc.isFailure()) {
+    ATH_MSG_FATAL("Problem retrieving TRTID helper");
+    return StatusCode::FAILURE;
+  }
+
+  // Read keys
+
+  ATH_CHECK( m_rtReadKey.initialize() );
+  ATH_CHECK( m_errReadKey.initialize() );
+  ATH_CHECK( m_slopeReadKey.initialize() );
+  ATH_CHECK( m_t0ReadKey.initialize() );
+ 
+  if(m_isGEANT4) {
+    // processing GEANT4 simulation - revert to old non-MT style cond access
+
+      ATH_MSG_INFO("TRT_CalDbTool::initialize for simulation");
+      if(StatusCode::SUCCESS!=m_detstore->retrieve(m_rtContainerG4,m_par_rtcontainerkey)) {
+        ATH_MSG_FATAL("Could not retrieve folder " << m_par_rtcontainerkey);
+        return StatusCode::FAILURE;
+      }
+
+
+      if(StatusCode::SUCCESS!=m_detstore->retrieve(m_errContainerG4,m_par_errcontainerkey)) {
+        ATH_MSG_FATAL("Could not retrieve folder " << m_par_errcontainerkey);
+        return StatusCode::FAILURE;
+      }
+
+      if(StatusCode::SUCCESS!=m_detstore->retrieve(m_slopeContainerG4,m_par_slopecontainerkey)) {
+        ATH_MSG_FATAL("Could not retrieve folder " << m_par_slopecontainerkey);
+        return StatusCode::FAILURE;
+      }
+
+      if(StatusCode::SUCCESS!=m_detstore->retrieve(m_t0ContainerG4,m_par_t0containerkey)) {
+        ATH_MSG_FATAL("Could not retrieve folder " << m_par_t0containerkey);
+        return StatusCode::FAILURE;
+      }
+
+      if(StatusCode::SUCCESS!=m_detstore->retrieve(m_slopeContainerG4,m_par_slopecontainerkey)) {
+        ATH_MSG_FATAL("Could not retrieve folder " << m_par_slopecontainerkey);
+        return StatusCode::FAILURE;
+      }
+
+
+      if(StatusCode::SUCCESS!=m_detstore->retrieve(m_errContainerG4,m_par_errcontainerkey)) {
+        ATH_MSG_FATAL("Could not retrieve folder " << m_par_errcontainerkey);
+        return StatusCode::FAILURE;
+      }
+
+
+  } else {
+
+    ATH_MSG_INFO(" TRT_CalDbTool::initialize for data ");
+  }
+  return StatusCode::SUCCESS;
+}
+
+
+
+StatusCode TRT_CalDbTool::finalize()
+{
+  ATH_MSG_DEBUG("TRT_CalDbTool finalize method called");
+  return StatusCode::SUCCESS;
+}
+
+
+const TRT_CalDbTool::RtRelationContainer* TRT_CalDbTool::getRtContainer() const {
+
+  if(!m_isGEANT4) {
+    const EventContext& ctx{Gaudi::Hive::currentContext()};
+    static const EventContext::ContextEvt_t invalidValue{EventContext::INVALID_CONTEXT_EVT};
+    EventContext::ContextID_t slot{ctx.slot()};
+    EventContext::ContextEvt_t evt{ctx.evt()};
+    if (slot>=m_Rtcache.size()) {              // new slot?
+      std::lock_guard<std::mutex> lock{m_mutex};
+      m_Rtcache.resize(slot+1, invalidValue); // Store invalid event id in order to pass the next IF statement.
+    }
+    if (m_Rtcache[slot]!=evt) {                // not same event as last call
+      std::lock_guard<std::mutex> lock{m_mutex};
+      SG::ReadCondHandle<RtRelationContainer> rtc(m_rtReadKey); // find the right conditions
+      if (not rtc.isValid()) {
+       ATH_MSG_ERROR("Failed to retrieve " << m_rtReadKey.key());
+      }
+      m_condRt.set(*rtc);                                      // cache the pointer
+      m_Rtcache[slot] = evt;                                   // store cached event id
+    }
+    return m_condRt.get();
+  } else {
+    return m_rtContainerG4;
+  }
+}
+
+const TRT_CalDbTool::RtRelationContainer* TRT_CalDbTool::getErrContainer() const {
+
+
+  if(!m_isGEANT4) {
+    const EventContext& ctx{Gaudi::Hive::currentContext()};
+    static const EventContext::ContextEvt_t invalidValue{EventContext::INVALID_CONTEXT_EVT};
+    EventContext::ContextID_t slot{ctx.slot()};
+    EventContext::ContextEvt_t evt{ctx.evt()};
+    if (slot>=m_Errcache.size()) {              // new slot?
+      std::lock_guard<std::mutex> lock{m_mutex};
+      m_Errcache.resize(slot+1, invalidValue); // Store invalid event id in order to pass the next IF statement.
+    }
+    if (m_Errcache[slot]!=evt) {                // not same event as last call
+      std::lock_guard<std::mutex> lock{m_mutex};
+      SG::ReadCondHandle<RtRelationContainer> rtc(m_errReadKey); // find the right conditions
+      if (not rtc.isValid()) {
+        ATH_MSG_ERROR("Failed to retrieve " << m_errReadKey.key());
+      }
+      m_condErr.set(*rtc);                                      // cache the pointer
+      m_Errcache[slot] = evt;                                   // store cached event id
+    }
+    return m_condErr.get();
+  } else {
+
+    return m_errContainerG4;
+  }
+}
+
+const TRT_CalDbTool::RtRelationContainer* TRT_CalDbTool::getSlopeContainer() const {
+
+  if(!m_isGEANT4) {
+    const EventContext& ctx{Gaudi::Hive::currentContext()};
+    static const EventContext::ContextEvt_t invalidValue{EventContext::INVALID_CONTEXT_EVT};
+    EventContext::ContextID_t slot{ctx.slot()};
+    EventContext::ContextEvt_t evt{ctx.evt()};
+    if (slot>=m_Slopecache.size()) {              // new slot?
+      std::lock_guard<std::mutex> lock{m_mutex};
+      m_Slopecache.resize(slot+1, invalidValue); // Store invalid event id in order to pass the next IF statement.
+    }
+    if (m_Slopecache[slot]!=evt) {                // not same event as last call
+      std::lock_guard<std::mutex> lock{m_mutex};
+      SG::ReadCondHandle<RtRelationContainer> rtc(m_slopeReadKey); // find the right conditions
+      if (not rtc.isValid()) {
+        ATH_MSG_ERROR("Failed to retrieve " << m_slopeReadKey.key());
+      }
+      m_condSlope.set(*rtc);                                      // cache the pointer
+      m_Slopecache[slot] = evt;                                   // store cached event id
+    }
+    return m_condSlope.get();
+  } else {
+
+    return m_slopeContainerG4;
+  }
+
+}
+
+const TRT_CalDbTool::StrawT0Container* TRT_CalDbTool::getT0Container() const {
+
+  if(!m_isGEANT4) {
+    const EventContext& ctx{Gaudi::Hive::currentContext()};
+    static const EventContext::ContextEvt_t invalidValue{EventContext::INVALID_CONTEXT_EVT};
+    EventContext::ContextID_t slot{ctx.slot()};
+    EventContext::ContextEvt_t evt{ctx.evt()};
+    if (slot>=m_T0cache.size()) {              // new slot?
+      std::lock_guard<std::mutex> lock{m_mutex};
+      m_T0cache.resize(slot+1, invalidValue); // Store invalid event id in order to pass the next IF statement.
+    }
+    if (m_T0cache[slot]!=evt) {                // not same event as last call
+      std::lock_guard<std::mutex> lock{m_mutex};
+      SG::ReadCondHandle<StrawT0Container> rtc(m_t0ReadKey); // find the right conditions
+      if (not rtc.isValid()) {
+        ATH_MSG_ERROR("Failed to retrieve " << m_t0ReadKey.key());
+      }
+      m_condT0.set(*rtc);                                      // cache the pointer
+      m_T0cache[slot] = evt;                                   // store cached event id
+    }
+    return m_condT0.get();
+  } else {
+    return m_t0ContainerG4;
+  }
+
+}
+
+
+
+double TRT_CalDbTool::driftRadius(const double& time, float& t0, const Identifier& ident,bool& found) const
+{
+  // Returns a drift radius, a t0 and a success indicator,
+  // given an identifier and a time given by (leading_edge_bin+0.5)*3.125ns
+  found=true;
+  t0 = this->getT0(ident);
+  const TRTCond::RtRelation* rtr = getRtRelation(ident) ;
+  double radius = 0;
+  if (rtr != 0)
+     radius = rtr->radius( time - t0 );
+  else
+    ATH_MSG_FATAL(" cannot find an rt-relation for TRT layer_or_wheel " <<  m_trtId->layer_or_wheel(ident) << " Please check IOV ranges ");
+  
+  ATH_MSG_VERBOSE(" time " << time << " t0 " << t0 << " t " << time-t0 << " radius " << radius);
+  //
+  if(      radius<0 ) radius=0 ;
+  else if( radius>2.) radius=2.;
+
+  // add protection for the turnover:
+  if (time - t0 > 55){
+    ATH_MSG_VERBOSE(" time " << time << " t0 " << t0 << " t " << time-t0  << " > 55, check Rt derivative");
+    // Check Second Derivative.
+    if (rtr != 0){
+      if (rtr->drdt( time - t0 ) < 0 ){
+	ATH_MSG_VERBOSE(" time " << time << " t0 " << t0 << " t " << time-t0  << " and rt derivative: " <<  rtr->drdt( time - t0 ));
+	radius=2.;
+      }
+    }
+  }
+  return radius;
+}
+
+double TRT_CalDbTool::driftError( const double& time, const Identifier& ident,bool& found) const
+{
+  // Returns an error on drift radius and a success indicator,
+  // given an identifier and a drift-time in ns
+  found=true;
+  const TRTCond::RtRelation* rtr = getErrors(ident) ;
+  double error=0.;
+  if(rtr) {
+    error = rtr->radius( time );
+  } else {
+    found=false;
+    return 0;
+  }
+  ATH_MSG_VERBOSE(" time " << time  << " error on radius " << error);
+  return error;
+}
+
+double TRT_CalDbTool::driftSlope( const double& time, const Identifier& ident,bool& found) const
+{
+  // Returns an error on drift radius and a success indicator,
+  // given an identifier and a drift-time in ns
+  found=true;
+  const TRTCond::RtRelation* rtr = getSlopes(ident) ;
+  double slope=0.;
+  if(rtr) {
+    slope = rtr->radius( time );
+  } else {
+    found=false;
+    return 0;
+  }
+  ATH_MSG_VERBOSE(" time " << time << " slope on radius " << slope);
+  return slope;
+}
+
+
+
+
diff --git a/InnerDetector/InDetConditions/TRT_ConditionsServices/src/TRT_CalDbTool.h b/InnerDetector/InDetConditions/TRT_ConditionsServices/src/TRT_CalDbTool.h
new file mode 100644
index 0000000000000000000000000000000000000000..a4f2b273ed79f3431fcc06dc610caa0bb20768f7
--- /dev/null
+++ b/InnerDetector/InDetConditions/TRT_ConditionsServices/src/TRT_CalDbTool.h
@@ -0,0 +1,172 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef TRT_CALDBTOOL_H
+#define TRT_CALDBTOOL_H
+/** @file TRT_CalDbTool.h
+ * @brief  interface to TRT calibration constants
+ * @author Peter Hansen <phansen@nbi.dk>
+ */
+
+#include "TRT_ConditionsServices/ITRT_CalDbTool.h"
+// STL
+#include <mutex>
+//Gaudi includes
+#include "GaudiKernel/IInterface.h"
+#include "GaudiKernel/ToolHandle.h"
+#include "GaudiKernel/EventContext.h"
+#include "GaudiKernel/ContextSpecificPtr.h"
+#include "GaudiKernel/ICondSvc.h"
+#include "GaudiKernel/ServiceHandle.h"
+// Storegate
+#include "StoreGate/ReadCondHandleKey.h"
+#include "StoreGate/DataHandle.h"
+#include "StoreGate/StoreGateSvc.h"
+//Athena
+#include "AthenaBaseComps/AthAlgTool.h"
+// TRT
+#include "InDetIdentifier/TRT_ID.h"
+
+
+
+/** @class TRT_CalDbTool
+ *  interface to TRT calibration constants
+ */
+class TRT_CalDbTool: public extends<AthAlgTool, ITRT_CalDbTool>
+{
+ public:
+  /// typedefs, enums etc
+
+  
+  /// constructor
+  TRT_CalDbTool( const std::string& type, const std::string& name, const IInterface* parent);
+  
+  /// destructor
+  virtual ~TRT_CalDbTool() = default;
+  
+  /// tool initialize
+  virtual StatusCode initialize() override;
+
+  /// tool finalize
+  virtual StatusCode finalize() override;
+
+
+  // methods to access calibration data
+
+  /// get T0 for an identifier
+  float getT0( const Identifier& id, int level = TRTCond::ExpandedIdentifier::STRAW ) const;
+
+  /// get an rtrelation for an identifier
+  const TRTCond::RtRelation* getRtRelation( const Identifier& id, int level = TRTCond::ExpandedIdentifier::STRAW ) const;
+
+  /// get errors for an identifier
+  const TRTCond::RtRelation* getErrors( const Identifier& id, int level = TRTCond::ExpandedIdentifier::STRAW ) const;
+
+  /// get errors for an identifier
+  const TRTCond::RtRelation* getSlopes( const Identifier& id, int level = TRTCond::ExpandedIdentifier::STRAW ) const;
+  
+  /// get a drift radius for a given leading edge time
+  virtual double driftRadius(const double& time, float& t0, const Identifier& ident, bool& found) const override;
+
+  /// get a drift radius error for a given drifttime
+  virtual double driftError(const double& time, const Identifier& ident, bool& found) const override;
+
+  /// get a drift radius error for a given drifttime
+  virtual double driftSlope(const double& time, const Identifier& ident, bool& found) const override;
+
+  /// create an TRTCond::ExpandedIdentifier from a TRTID identifier
+  TRTCond::ExpandedIdentifier trtcondid( const Identifier& id, int level = TRTCond::ExpandedIdentifier::STRAW) const;
+
+  
+
+  /// access to calibration constant containers
+  virtual const RtRelationContainer* getRtContainer() const override;
+  virtual const RtRelationContainer* getErrContainer() const override;
+  virtual const RtRelationContainer* getSlopeContainer() const override;
+  virtual const StrawT0Container* getT0Container() const override;
+  
+ private:
+  const TRT_ID* m_trtId;                 //!< id helper
+  ServiceHandle<StoreGateSvc> m_detstore;
+
+  /// mutex to protect cache updates
+  mutable std::mutex m_mutex;
+  /// Cache to store events for slots
+  mutable std::vector<EventContext::ContextEvt_t> m_Rtcache;
+  mutable std::vector<EventContext::ContextEvt_t> m_T0cache;
+  mutable std::vector<EventContext::ContextEvt_t> m_Errcache;
+  mutable std::vector<EventContext::ContextEvt_t> m_Slopecache;
+  /// Pointers to conditions data
+  mutable Gaudi::Hive::ContextSpecificPtr<const RtRelationContainer> m_condRt;
+  mutable Gaudi::Hive::ContextSpecificPtr<const StrawT0Container> m_condT0;
+  mutable Gaudi::Hive::ContextSpecificPtr<const RtRelationContainer> m_condErr;
+  mutable Gaudi::Hive::ContextSpecificPtr<const RtRelationContainer> m_condSlope;
+
+  ///  ReadHandle  keys
+  SG::ReadCondHandleKey<RtRelationContainer> m_rtReadKey{this,"RtReadKeyName","/TRT/Calib/RT","r-t relation in-key"};
+  SG::ReadCondHandleKey<RtRelationContainer> m_errReadKey{this,"ErrorReadKeyName","/TRT/Calib/errors2d","error on r in-key"};
+  SG::ReadCondHandleKey<RtRelationContainer> m_slopeReadKey{this,"SlopeReadKeyName","/TRT/Calib/slopes","slope of error in-key"};
+  SG::ReadCondHandleKey<StrawT0Container> m_t0ReadKey{this,"T0ReadKeyName","/TRT/Calib/T0","t0 in-key"};
+
+  /// Used in simulation jobs
+  bool m_isGEANT4;
+
+  std::string m_par_rtcontainerkey;
+  std::string m_par_errcontainerkey;
+  std::string m_par_slopecontainerkey;
+  std::string m_par_t0containerkey;
+
+  const DataHandle<RtRelationContainer> m_rtContainerG4;
+  const DataHandle<RtRelationContainer> m_errContainerG4;
+  const DataHandle<RtRelationContainer> m_slopeContainerG4;
+  const DataHandle<StrawT0Container> m_t0ContainerG4;
+
+};
+
+////////////////////////////////////////////////////////////////////////////////////////////
+//  inline methods
+////////////////////////////////////////////////////////////////////////////////////////////
+
+inline TRTCond::ExpandedIdentifier 
+TRT_CalDbTool::trtcondid( const Identifier& id, int level) const
+{
+  return TRTCond::ExpandedIdentifier( m_trtId->barrel_ec(id),m_trtId->layer_or_wheel(id),
+				      m_trtId->phi_module(id),m_trtId->straw_layer(id),
+				      m_trtId->straw(id),level ) ;
+}
+
+inline const TRTCond::RtRelation*
+TRT_CalDbTool::getRtRelation( const Identifier& id, int level ) const 
+{ 
+  const RtRelationContainer* rc = getRtContainer();
+  if(!rc) return 0;
+  return rc->get(trtcondid(id,level)) ; 
+}
+
+inline const TRTCond::RtRelation*
+TRT_CalDbTool::getErrors( const Identifier& id, int level ) const 
+{ 
+  const RtRelationContainer* rc = getErrContainer();
+  if(!rc) return 0;
+  return rc->get(trtcondid(id,level)) ; 
+}
+
+inline const TRTCond::RtRelation*
+TRT_CalDbTool::getSlopes( const Identifier& id, int level ) const
+{
+  const RtRelationContainer* rc = getSlopeContainer();
+  if(!rc) return 0;
+  return rc->get(trtcondid(id,level)) ;
+}
+
+inline float 
+TRT_CalDbTool::getT0( const Identifier& id, int level ) const 
+{
+  const StrawT0Container* rc = getT0Container();
+  return rc->getT0(trtcondid(id,level)) ; 
+}
+
+
+
+#endif //  TRT_CALDBTOOL_H
diff --git a/InnerDetector/InDetConditions/TRT_ConditionsServices/src/TRT_HWMappingSvc.cxx b/InnerDetector/InDetConditions/TRT_ConditionsServices/src/TRT_HWMappingSvc.cxx
index 6d97ce22ff00aa93be1a078294b6fc639a7ca370..29d85fd4945bffefe7f9553d206b7550fe2b9b17 100644
--- a/InnerDetector/InDetConditions/TRT_ConditionsServices/src/TRT_HWMappingSvc.cxx
+++ b/InnerDetector/InDetConditions/TRT_ConditionsServices/src/TRT_HWMappingSvc.cxx
@@ -64,14 +64,14 @@ TRT_HWMappingSvc::~TRT_HWMappingSvc() {}
 /// Initialize
 /////
 StatusCode TRT_HWMappingSvc::initialize() {
-  msg(MSG::INFO) << "TRT_HWMappingSvc::initialize." << endmsg;
+  ATH_MSG_INFO("TRT_HWMappingSvc::initialize.");
 
   StatusCode sc(StatusCode::SUCCESS);
 
   // Retrieve the DetectorStore
   sc = m_detStore.retrieve();
   if ( sc.isFailure() ) {
-    msg(MSG::ERROR) << "Unable to retrieve " << m_detStore << endmsg;
+    ATH_MSG_ERROR("Unable to retrieve " << m_detStore);
     return sc;
   }
 
@@ -85,7 +85,7 @@ StatusCode TRT_HWMappingSvc::initialize() {
   // Get the TRTStrawNeighbourSvc
   sc = m_TRTStrawNeighbourSvc.retrieve();
   if ( sc.isFailure() ) {
-    msg(MSG::ERROR) << "Couldn't get " << m_TRTStrawNeighbourSvc << endmsg;
+    ATH_MSG_ERROR("Couldn't get " << m_TRTStrawNeighbourSvc);
     return sc;
   }
 
@@ -93,7 +93,7 @@ StatusCode TRT_HWMappingSvc::initialize() {
   IIncidentSvc* incSvc;
   sc = service( "IncidentSvc", incSvc );
   if ( sc.isFailure() ) {
-    msg(MSG::ERROR) << "Couldn't get the IncidentSvc." << endmsg;
+    ATH_MSG_ERROR("Couldn't get the IncidentSvc.");
     return sc;
   }
   incSvc->addListener( this, std::string("BeginRun") );
@@ -131,7 +131,7 @@ std::string TRT_HWMappingSvc::get_HV_CoolChanName( const Identifier ident ) {
     int hashedPad = hashThisBarrelPad( phi_module, layer_or_wheel, padNum );
     if ( m_Barrel_HV_CoolChanNames ) {
       if ( hashedPad >= (int)m_Barrel_HV_CoolChanNames->size() || hashedPad<0) {
-	msg(MSG::WARNING) << "channel request for invalid barrel HV pad." << endmsg;
+	ATH_MSG_WARNING("channel request for invalid barrel HV pad.");
 	return "";
       } else chanName = m_Barrel_HV_CoolChanNames->at(hashedPad);
     }
@@ -142,7 +142,7 @@ std::string TRT_HWMappingSvc::get_HV_CoolChanName( const Identifier ident ) {
     int hashedCell = hashThisEndcapCell( phi_module, layer_or_wheel, fourPlaneNum, cellNum );
     if ( m_EndcapA_HV_CoolChanNames ) {
       if ( hashedCell >= (int)m_EndcapA_HV_CoolChanNames->size() || hashedCell<0 ) {
-	msg(MSG::WARNING) << "channel request for invalid endcap A HV pad." << endmsg;
+	ATH_MSG_WARNING("channel request for invalid endcap A HV pad.");
 	return "";
       } else chanName = m_EndcapA_HV_CoolChanNames->at(hashedCell);
     }
@@ -153,12 +153,12 @@ std::string TRT_HWMappingSvc::get_HV_CoolChanName( const Identifier ident ) {
     int hashedCell = hashThisEndcapCell( phi_module, layer_or_wheel, fourPlaneNum, cellNum );
     if ( m_EndcapC_HV_CoolChanNames ) {
       if ( hashedCell >= (int)m_EndcapC_HV_CoolChanNames->size() || hashedCell<0) {
-	msg(MSG::WARNING) << "channel request for invalid endcap C HV pad." << endmsg;
+	ATH_MSG_WARNING("channel request for invalid endcap C HV pad.");
 	return "";
       } else chanName = m_EndcapC_HV_CoolChanNames->at(hashedCell);
     }
   } else {
-    msg(MSG::ERROR) << "Unknown Identifier (not barrel or endcap)!" << endmsg;
+    ATH_MSG_ERROR("Unknown Identifier (not barrel or endcap)!");
     return "";
   }
 
@@ -185,7 +185,7 @@ int TRT_HWMappingSvc::get_HV_CoolChanNum( const Identifier ident ) {
     int hashedPad = hashThisBarrelPad( phi_module, layer_or_wheel, padNum );
     if ( m_Barrel_HV_CoolChanNums ) {
       if ( hashedPad >= (int)m_Barrel_HV_CoolChanNums->size() || hashedPad<0 ) {
-	msg(MSG::WARNING) << "channel number request for invalid barrel HV pad." << endmsg;
+	ATH_MSG_WARNING("channel number request for invalid barrel HV pad.");
 	return -1;
       } else chanNum = m_Barrel_HV_CoolChanNums->at(hashedPad);
     }
@@ -196,7 +196,7 @@ int TRT_HWMappingSvc::get_HV_CoolChanNum( const Identifier ident ) {
     int hashedCell = hashThisEndcapCell( phi_module, layer_or_wheel, fourPlaneNum, cellNum );
     if ( m_EndcapA_HV_CoolChanNums ) {
       if ( hashedCell >= (int)m_EndcapA_HV_CoolChanNums->size() || hashedCell<0) {
-	msg(MSG::WARNING) << "channel number request for invalid endcap A HV cell." << endmsg;
+	ATH_MSG_WARNING("channel number request for invalid endcap A HV cell.");
 	return -1;
       } else chanNum = m_EndcapA_HV_CoolChanNums->at(hashedCell);
     }
@@ -207,12 +207,12 @@ int TRT_HWMappingSvc::get_HV_CoolChanNum( const Identifier ident ) {
     int hashedCell = hashThisEndcapCell( phi_module, layer_or_wheel, fourPlaneNum, cellNum );
     if ( m_EndcapC_HV_CoolChanNums ) {
       if ( hashedCell >= (int)m_EndcapC_HV_CoolChanNums->size() || hashedCell<0) {
-	msg(MSG::WARNING) << "channel number request for invalid endcap C HV cell." << endmsg;
+	ATH_MSG_WARNING("channel number request for invalid endcap C HV cell.");
 	return -1;
       } else chanNum = m_EndcapC_HV_CoolChanNums->at(hashedCell);
     }
   } else {
-    msg(MSG::ERROR) << "Unknown Identifier (not barrel or endcap)!" << endmsg;
+    ATH_MSG_ERROR("Unknown Identifier (not barrel or endcap)!");
     return -1;
   }
 
@@ -253,8 +253,7 @@ int TRT_HWMappingSvc::hashThisBarrelPad( int sector, int module, int padNum ) {
   case 1: padOffset = 42;  break;
   case 2: padOffset = 42+65; break;
   default:
-    msg(MSG::ERROR) << "Couldn't hash this pad: "
-	 << sector << "," << module << "," << padNum << endmsg;
+    ATH_MSG_ERROR("Couldn't hash this pad: " << sector << "," << module << "," << padNum);
     return -1;
   }
 
@@ -289,7 +288,7 @@ int TRT_HWMappingSvc::get_HV_EndcapCellNum( const Identifier ident ) {
   else if ( straw >= 8 && straw < 16 ) cellNum = 1;
   else if ( straw >=16 && straw < 24 ) cellNum = 2;
   else {
-    msg(MSG::WARNING) << "Straw number out of range for Endcap!" << endmsg;
+    ATH_MSG_WARNING("Straw number out of range for Endcap!");
     cellNum = -1;
   }
 
@@ -322,7 +321,7 @@ int TRT_HWMappingSvc::get_HV_Endcap4PlaneNum( const Identifier ident ) {
   else if ( straw_layer >=  8 && straw_layer < 12 ) fourPlaneWheelNum = 2;
   else if ( straw_layer >= 12 && straw_layer < 16 ) fourPlaneWheelNum = 3;
   else {
-    msg(MSG::WARNING) << "Straw layer number out of range for Endcap!" << endmsg;
+    ATH_MSG_WARNING("Straw layer number out of range for Endcap!");
     fourPlaneWheelNum = -1;
   }
 
@@ -382,7 +381,7 @@ int TRT_HWMappingSvc::hashThisEndcapCell( int sector, int wheel, int layer, int
   if ( wheel >= 0 && wheel < 6  ) wheelType = 0; // A wheel
   if ( wheel >= 6 && wheel < 14 ) wheelType = 1; // B wheel
   if ( wheelType == -1 ) {
-    msg(MSG::ERROR) << "Invalid wheel number." << endmsg;
+    ATH_MSG_ERROR("Invalid wheel number.");
     return -1;
   }
 
@@ -414,7 +413,7 @@ StatusCode TRT_HWMappingSvc::build_BarrelHVLinePadMap() {
     std::map<std::string,std::string> rawMap;
     TRTcoralClient->get_BarrelHVLinePadMap( rawMap );
     if ( rawMap.size() == 0 ) {
-      msg(MSG::WARNING) << "Retrieved and empty Barrel HV-line/pad map from database." << endmsg;
+      ATH_MSG_WARNING("Retrieved and empty Barrel HV-line/pad map from database.");
       delete TRTcoralClient;
       return StatusCode::FAILURE;
     }
@@ -456,7 +455,7 @@ StatusCode TRT_HWMappingSvc::build_BarrelHVLinePadMap() {
       // Add this channel into the map vector at the appropriate position
       // (hashed pad gives index in map vector)
       if ( hashedPad >= (int)m_Barrel_HV_CoolChanNames->size() || hashedPad<0) {
-	msg(MSG::WARNING) << "channel request for invalid barrel HV pad." << endmsg;
+	ATH_MSG_WARNING("channel request for invalid barrel HV pad.");
       }else{
         m_Barrel_HV_CoolChanNames->at(hashedPad) = chanName;
       }
@@ -622,7 +621,7 @@ StatusCode TRT_HWMappingSvc::build_BarrelHVLinePadMap() {
 	for ( padItr = padVec->begin(); padItr != padVec->end(); ++padItr ) {
 	  int hashedPad = hashThisBarrelPad( sector, module, *padItr );
           if ( hashedPad >= (int)m_Barrel_HV_CoolChanNames->size() || hashedPad<0) {
-	     msg(MSG::WARNING) << "channel request for invalid barrel HV pad." << endmsg;
+	    ATH_MSG_WARNING("channel request for invalid barrel HV pad.");
           }else{
   	     m_Barrel_HV_CoolChanNames->at(hashedPad) = chanName.str();
           }
@@ -631,21 +630,21 @@ StatusCode TRT_HWMappingSvc::build_BarrelHVLinePadMap() {
     }
   }
 
-  msg(MSG::INFO) << "TRT Barrel HV-line/pad map successfully built - "
-       << m_Barrel_HV_CoolChanNames->size() << " channels." << endmsg;
+  ATH_MSG_INFO("TRT Barrel HV-line/pad map successfully built - "
+	       << m_Barrel_HV_CoolChanNames->size() << " channels.");
 
   if ( m_buildChanNumMaps ) {
     // Get the CondAttrListCollection for the barrel
     const CondAttrListCollection* DCScondFolder = 0;
     sc = m_detStore->retrieve( DCScondFolder, m_Barrel_HV_COOLFolderName );
     if ( sc.isFailure() ) {
-      msg(MSG::WARNING) << "Couldn't retrieve folder " << m_Barrel_HV_COOLFolderName
-	   << " from DetectorStore.  Has it been loaded into IOVDbSvc?" << endmsg;
+      ATH_MSG_WARNING("Couldn't retrieve folder " << m_Barrel_HV_COOLFolderName
+		      << " from DetectorStore.  Has it been loaded into IOVDbSvc?");
       return sc;
     }
     if ( DCScondFolder->name_size() == 0 ) {
-      msg(MSG::WARNING) << "CondAttrListCollection for folder " << m_Barrel_HV_COOLFolderName
-	   << " has no channel names." << endmsg;
+      ATH_MSG_WARNING("CondAttrListCollection for folder " << m_Barrel_HV_COOLFolderName
+			<< " has no channel names.");
       return StatusCode::FAILURE;
     }
     // Loop through the channel names.
@@ -695,7 +694,7 @@ StatusCode TRT_HWMappingSvc::build_EndcapHVLinePadMaps() {
 	}
 	lineName << "S" << sectorLeft << "S" << sectorRight << "_";
 	if ( sectorLeft%2 == 0 ) {
-	  msg(MSG::WARNING) << "Mistake in sector pairing!!!" << endmsg;
+	  ATH_MSG_WARNING("Mistake in sector pairing!!!");
 	  break;
 	}
 	// Wheel
@@ -721,7 +720,7 @@ StatusCode TRT_HWMappingSvc::build_EndcapHVLinePadMaps() {
 	for ( int cellNum = 0; cellNum < 3; ++cellNum ) {
 	  int hashedCell = hashThisEndcapCell( sector, wheel, layer, cellNum );
           if ( hashedCell >= (int)m_EndcapA_HV_CoolChanNames->size() || hashedCell<0) {
-	    msg(MSG::WARNING) << "channel request for invalid endcap HV pad." << endmsg;
+	    ATH_MSG_WARNING("channel request for invalid endcap HV pad.");
           }else{
 	    m_EndcapA_HV_CoolChanNames->at(hashedCell) = lineNameA.str();
 	    m_EndcapC_HV_CoolChanNames->at(hashedCell) = lineNameC.str();
@@ -734,13 +733,13 @@ StatusCode TRT_HWMappingSvc::build_EndcapHVLinePadMaps() {
   // Apply corrections to the map
   int hashedCellToFix = hashThisEndcapCell( 5, 12, 0, 2 );
   if ( hashedCellToFix >= (int)m_EndcapA_HV_CoolChanNames->size() || hashedCellToFix<0) {
-	    msg(MSG::WARNING) << "channel request for invalid endcap HV pad." << endmsg;
+    ATH_MSG_WARNING("channel request for invalid endcap HV pad.");
   }else{
-  m_EndcapA_HV_CoolChanNames->at(hashedCellToFix) = "HVA_S7S8_WB7_B_OutputVoltage";
+    m_EndcapA_HV_CoolChanNames->at(hashedCellToFix) = "HVA_S7S8_WB7_B_OutputVoltage";
   }
-  msg(MSG::INFO) << "Endcap HV-line/pad maps successfully built - ECA: "
+  ATH_MSG_INFO("Endcap HV-line/pad maps successfully built - ECA: "
        << m_EndcapA_HV_CoolChanNames->size() << " channels; ECC: "
-       << m_EndcapC_HV_CoolChanNames->size() << " channels." << endmsg;
+	       << m_EndcapC_HV_CoolChanNames->size() << " channels.");
 
   if ( m_buildChanNumMaps ) {
 
@@ -750,13 +749,13 @@ StatusCode TRT_HWMappingSvc::build_EndcapHVLinePadMaps() {
     const CondAttrListCollection* DCScondFolder = 0;
     sc = m_detStore->retrieve( DCScondFolder, m_EndcapA_HV_COOLFolderName );
     if ( sc.isFailure() ) {
-      msg(MSG::WARNING) << "Couldn't retrieve folder " << m_EndcapA_HV_COOLFolderName
-	   << " from DetectorStore.  Has it been loaded into IOVDbSvc?" << endmsg;
+      ATH_MSG_WARNING("Couldn't retrieve folder " << m_EndcapA_HV_COOLFolderName
+		      << " from DetectorStore.  Has it been loaded into IOVDbSvc?");
       return sc;
     }
     if ( DCScondFolder->name_size() == 0 ) {
-      msg(MSG::WARNING) << "CondAttrListCollection for folder " << m_EndcapA_HV_COOLFolderName
-	   << " has no channel names." << endmsg;
+      ATH_MSG_WARNING("CondAttrListCollection for folder " << m_EndcapA_HV_COOLFolderName
+			<< " has no channel names.");
       return StatusCode::FAILURE;
     }
     // Loop through the channel names.
@@ -777,13 +776,13 @@ StatusCode TRT_HWMappingSvc::build_EndcapHVLinePadMaps() {
     DCScondFolder = 0;
     sc = m_detStore->retrieve( DCScondFolder, m_EndcapC_HV_COOLFolderName );
     if ( sc.isFailure() ) {
-      msg(MSG::WARNING) << "Couldn't retrieve folder " << m_EndcapC_HV_COOLFolderName
-	   << " from DetectorStore.  Has it been loaded into IOVDbSvc?" << endmsg;
+      ATH_MSG_WARNING("Couldn't retrieve folder " << m_EndcapC_HV_COOLFolderName
+		      << " from DetectorStore.  Has it been loaded into IOVDbSvc?");
       return sc;
     }
     if ( DCScondFolder->name_size() == 0 ) {
-      msg(MSG::WARNING) << "CondAttrListCollection for folder " << m_EndcapC_HV_COOLFolderName
-	   << " has no channel names." << endmsg;
+      ATH_MSG_WARNING("CondAttrListCollection for folder " << m_EndcapC_HV_COOLFolderName
+			<< " has no channel names.");
       return StatusCode::FAILURE;
     }
     // Loop through the channel names.
@@ -827,12 +826,12 @@ void TRT_HWMappingSvc::handle( const Incident& inc ) {
 
     sc = build_BarrelHVLinePadMap();
     if ( sc.isFailure() ) {
-      msg(MSG::ERROR) << "Error in building Barrel HV-line/pad map." << endmsg;
+      ATH_MSG_ERROR("Error in building Barrel HV-line/pad map.");
     }
 
     sc = build_EndcapHVLinePadMaps();
     if ( sc.isFailure() ) {
-      msg(MSG::ERROR) << "Error in building Endcap HV-line/pad maps." << endmsg;
+      ATH_MSG_ERROR("Error in building Endcap HV-line/pad maps.");
     }
 
     if ( m_DumpMaps ) DumpMaps();
@@ -848,39 +847,39 @@ void TRT_HWMappingSvc::handle( const Incident& inc ) {
 void TRT_HWMappingSvc::DumpMaps() {
 
   if ( m_Barrel_HV_CoolChanNames ) {
-    msg(MSG::INFO) << "Dumping TRT Barrel HV-line/pad map..." << endmsg;
+    ATH_MSG_INFO( "Dumping TRT Barrel HV-line/pad map..." );
     for ( int mapItr = 0; mapItr < (int)m_Barrel_HV_CoolChanNames->size(); ++mapItr ) {
-      msg(MSG::INFO) << mapItr << " " << m_Barrel_HV_CoolChanNames->at(mapItr) << endmsg;
+      ATH_MSG_INFO( mapItr << " " << m_Barrel_HV_CoolChanNames->at(mapItr) );
     }
   }
   if ( m_EndcapA_HV_CoolChanNames ) {
-    msg(MSG::INFO) << "Dumping TRT EndcapA HV-line/pad map..." << endmsg;
+    ATH_MSG_INFO( "Dumping TRT EndcapA HV-line/pad map..." );
     for ( int mapItr = 0; mapItr < (int)m_EndcapA_HV_CoolChanNames->size(); ++mapItr ) {
-      msg(MSG::INFO) << mapItr << " " << m_EndcapA_HV_CoolChanNames->at(mapItr) << endmsg;
+      ATH_MSG_INFO( mapItr << " " << m_EndcapA_HV_CoolChanNames->at(mapItr) );
     }
   }
   if ( m_EndcapC_HV_CoolChanNames ) {
-    msg(MSG::INFO) << "Dumping TRT EndcapC HV-line/pad map..." << endmsg;
+    ATH_MSG_INFO( "Dumping TRT EndcapC HV-line/pad map..." );
     for ( int mapItr = 0; mapItr < (int)m_EndcapC_HV_CoolChanNames->size(); ++mapItr ) {
-      msg(MSG::INFO) << mapItr << " " << m_EndcapC_HV_CoolChanNames->at(mapItr) << endmsg;
+      ATH_MSG_INFO( mapItr << " " << m_EndcapC_HV_CoolChanNames->at(mapItr) );
     }
   }
   if ( m_Barrel_HV_CoolChanNums ) {
-    msg(MSG::INFO) << "Dumping TRT Barrel HV-line/pad COOL channel numbers..." << endmsg;
+    ATH_MSG_INFO( "Dumping TRT Barrel HV-line/pad COOL channel numbers..." );
     for ( int mapItr = 0; mapItr < (int)m_Barrel_HV_CoolChanNums->size(); ++mapItr ) {
-      msg(MSG::INFO) << mapItr << " " << m_Barrel_HV_CoolChanNums->at(mapItr) << endmsg;
+      ATH_MSG_INFO( mapItr << " " << m_Barrel_HV_CoolChanNums->at(mapItr) );
     }
   }
   if ( m_EndcapA_HV_CoolChanNums ) {
-    msg(MSG::INFO) << "Dumping TRT EndcapA HV-line/pad COOL channel numbers..." << endmsg;
+    ATH_MSG_INFO( "Dumping TRT EndcapA HV-line/pad COOL channel numbers..." );
     for ( int mapItr = 0; mapItr < (int)m_EndcapA_HV_CoolChanNums->size(); ++mapItr ) {
-      msg(MSG::INFO) << mapItr << " " << m_EndcapA_HV_CoolChanNums->at(mapItr) << endmsg;
+      ATH_MSG_INFO( mapItr << " " << m_EndcapA_HV_CoolChanNums->at(mapItr) );
     }
   }
   if ( m_EndcapC_HV_CoolChanNums ) {
-    msg(MSG::INFO) << "Dumping TRT EndcapC HV-line/pad COOL channel numbers..." << endmsg;
+    ATH_MSG_INFO( "Dumping TRT EndcapC HV-line/pad COOL channel numbers..." );
     for ( int mapItr = 0; mapItr < (int)m_EndcapC_HV_CoolChanNums->size(); ++mapItr ) {
-      msg(MSG::INFO) << mapItr << " " << m_EndcapC_HV_CoolChanNums->at(mapItr) << endmsg;
+      ATH_MSG_INFO( mapItr << " " << m_EndcapC_HV_CoolChanNums->at(mapItr) );
     }
   }
 
diff --git a/InnerDetector/InDetConditions/TRT_ConditionsServices/src/TRT_StrawStatusSummaryTool.cxx b/InnerDetector/InDetConditions/TRT_ConditionsServices/src/TRT_StrawStatusSummaryTool.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..ae77b2bcbfff5c4f645f0b1e75f78a85841cbeb4
--- /dev/null
+++ b/InnerDetector/InDetConditions/TRT_ConditionsServices/src/TRT_StrawStatusSummaryTool.cxx
@@ -0,0 +1,223 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+/** @file TRT_StrawStatusSummaryTool.cxx
+ *  @brief AthTool to manage TRT StrawStatus, LT/HT occupancy, PID and track data
+ *  @author Peter Hansen <hansenph@nbi.dk>
+ **/
+
+
+
+#include <fstream>
+#include <iostream>
+#include <iomanip>
+#include <sstream>
+#include <stdio.h>
+
+#include "GaudiKernel/IToolSvc.h"
+#include "Identifier/Identifier.h"
+
+#include "TRT_ConditionsData/StrawStatusMultChanContainer.h"
+#include "TRT_ConditionsData/ExpandedIdentifier.h"
+#include "PathResolver/PathResolver.h"
+
+#include "TRT_StrawStatusSummaryTool.h"
+#include "InDetIdentifier/TRT_ID.h"
+#include "StoreGate/ReadCondHandle.h"
+
+
+
+TRT_StrawStatusSummaryTool::TRT_StrawStatusSummaryTool( const std::string& type, const std::string& name, const IInterface* parent)
+  : base_class(type, name, parent),
+    m_detStore("DetectorStore",name),
+    m_toolsvc("ToolSvc",name),
+    m_par_strawstatuscontainerkey("/TRT/Cond/Status"),
+    m_par_strawstatuspermanentcontainerkey("/TRT/Cond/StatusPermanent"),
+    m_par_strawstatusHTcontainerkey("/TRT/Cond/StatusHT"),
+    m_trtId(0),
+    m_condSvc("CondSvc",name),
+    m_statReadKey("/TRT/Cond/Status"),
+    m_permReadKey("/TRT/Cond/StatusPermanent"),
+    m_statHTReadKey("/TRT/Cond/StatusHT"),
+    m_isGEANT4(true),
+    m_strawstatusG4(nullptr),
+    m_strawstatuspermanentG4(nullptr),
+    m_strawstatusHTG4(nullptr)
+
+{
+  declareProperty("ToolSvc",m_toolsvc);
+  declareProperty("isGEANT4",m_isGEANT4);
+
+  // initialise event id cache
+  static const EventContext::ContextEvt_t invalidValue{EventContext::INVALID_CONTEXT_EVT};
+  m_evtstat.push_back(invalidValue);
+  m_evtperm.push_back(invalidValue);
+  m_evtstatHT.push_back(invalidValue);
+
+  m_strawstatuscontainer.push_back(nullptr);
+  m_strawstatuspermanentcontainer.push_back(nullptr);
+  m_strawstatusHTcontainer.push_back(nullptr);
+
+
+}
+
+
+StatusCode TRT_StrawStatusSummaryTool::initialize() 
+{
+  ATH_MSG_INFO("TRT_StrawStatusSummaryTool initialize method called");
+
+
+  // Retrieve the DetectorStore
+  if (StatusCode::SUCCESS!=m_detStore.retrieve()) {
+    ATH_MSG_FATAL("Could not retrieve " << m_detStore);
+    return StatusCode::FAILURE;
+  }
+
+  // Find ToolService
+  if (StatusCode::SUCCESS!=m_toolsvc.retrieve()) {
+    ATH_MSG_FATAL("ToolSvc not found");
+    return StatusCode::FAILURE;
+  }
+
+  // Get the TRT ID helper
+  if (StatusCode::SUCCESS!=m_detStore->retrieve(m_trtId,"TRT_ID")) {
+    ATH_MSG_FATAL("Problem retrieving TRTID helper");
+    return StatusCode::FAILURE;
+  }
+
+    // Read keys in case of normal reconstruction/digitization
+  ATH_CHECK( m_statReadKey.initialize() );
+  ATH_CHECK( m_permReadKey.initialize() );
+
+  if(!m_isGEANT4) {
+  
+    ATH_CHECK( m_statHTReadKey.initialize() );
+  }
+
+  if(m_isGEANT4) {
+    // processing GEANT4 simulation - revert to old non-MT style cond access
+
+      if(StatusCode::SUCCESS!=m_detStore->retrieve(m_strawstatusHTG4,m_par_strawstatusHTcontainerkey)) {
+        ATH_MSG_FATAL("Could not retrieve folder " << m_par_strawstatusHTcontainerkey);
+        return StatusCode::FAILURE;
+      }
+
+  }
+
+  ATH_MSG_INFO("TRT_StrawStatusSummaryTool initialized successfully  ");
+  return StatusCode::SUCCESS;
+}
+
+///////////////////////////////////////////////////
+
+
+StatusCode TRT_StrawStatusSummaryTool::finalize()
+{
+  msg(MSG::INFO) << " in finalize() " << endmsg;
+  return StatusCode::SUCCESS;
+}
+
+
+int TRT_StrawStatusSummaryTool::getStatus(Identifier offlineID) const{
+  int stat = 0;
+  int level = TRTCond::ExpandedIdentifier::STRAW ;
+  TRTCond::ExpandedIdentifier id=  TRTCond::ExpandedIdentifier( m_trtId->barrel_ec(offlineID),m_trtId->layer_or_wheel(offlineID),
+								       m_trtId->phi_module(offlineID),m_trtId->straw_layer(offlineID),
+								       m_trtId->straw(offlineID),level );
+  const StrawStatusContainer* strawstatuscontainer = getStrawStatusContainer();
+  static int countStrawStatusContainerError(0);
+  if (!strawstatuscontainer) {
+    if (countStrawStatusContainerError<5) { 
+      ATH_MSG_WARNING(" getStatus, strawstatuscontainer == 0, dead straws not set"); 
+      countStrawStatusContainerError++; 
+    }
+    return 0;
+  }
+  stat=int((*strawstatuscontainer).get(id).getstatus());
+  return stat;
+}
+
+
+
+int TRT_StrawStatusSummaryTool::getStatusPermanent(Identifier offlineID) const{
+  int stat = 0;
+  int level = TRTCond::ExpandedIdentifier::STRAW ;
+  TRTCond::ExpandedIdentifier id=  TRTCond::ExpandedIdentifier( m_trtId->barrel_ec(offlineID),m_trtId->layer_or_wheel(offlineID),
+								       m_trtId->phi_module(offlineID),m_trtId->straw_layer(offlineID),
+								       m_trtId->straw(offlineID),level );
+  const StrawStatusContainer* strawstatuspermanentcontainer = getStrawStatusPermanentContainer();
+  static int countStrawStatusContainerError(0);
+  if (!strawstatuspermanentcontainer) {
+    if (countStrawStatusContainerError<5) { ATH_MSG_WARNING(" getStatusPermanent, strawstatuspermanentcontainer == 0, dead straws not set"); 
+      countStrawStatusContainerError++; 
+    }
+    return 0;
+  }
+  stat=int((*strawstatuspermanentcontainer).get(id).getstatus());
+  return stat;
+}
+
+
+
+int TRT_StrawStatusSummaryTool::getStatusHT(Identifier offlineID) const{
+  int stat = 0;
+  int level = TRTCond::ExpandedIdentifier::STRAW ;
+  TRTCond::ExpandedIdentifier id=  TRTCond::ExpandedIdentifier( m_trtId->barrel_ec(offlineID),m_trtId->layer_or_wheel(offlineID),
+								m_trtId->phi_module(offlineID),m_trtId->straw_layer(offlineID),
+								m_trtId->straw(offlineID),level );
+  const StrawStatusContainer* strawstatusHTcontainer = getStrawStatusHTContainer();
+
+ static int countStrawStatusContainerError(0);
+ if (!strawstatusHTcontainer) {
+   if (countStrawStatusContainerError<5) { 
+     ATH_MSG_WARNING(" getStatusHT, strawstatusHTcontainer == 0, dead straws not set"); 
+     countStrawStatusContainerError++; 
+   }
+    return 0;
+ }
+ stat=int((*strawstatusHTcontainer).get(id).getstatus());
+ return stat;
+}
+
+
+///////////////////////////////////////////////////
+
+
+bool TRT_StrawStatusSummaryTool::get_status(Identifier offlineID) const{
+  const unsigned int statusbitmask = 1 << 8;// 0000001 00000000
+  ATH_MSG_VERBOSE("offlineID "<<offlineID<<" "<<getStatus(offlineID)<<" "<<((getStatus(offlineID) & statusbitmask) >> 8));
+  bool st = false, stperm=false;
+  if (getStatus(offlineID)==1) st = true;
+  else if (getStatus(offlineID)==0) st = false;
+  else {st = bool( (getStatus(offlineID) & statusbitmask) >> 8);};
+
+
+    if (getStatusPermanent(offlineID)==1) stperm = true;
+    else if (getStatusPermanent(offlineID)==0) stperm = false;
+    else {stperm = bool( (getStatusPermanent(offlineID) & statusbitmask) >> 8);};
+
+  return ( (st||stperm) );
+  
+}
+
+
+
+bool TRT_StrawStatusSummaryTool::get_statusHT(Identifier offlineID) const{
+  const unsigned int statusbitmask = 1 << 8;// 0000001 00000000
+  ATH_MSG_VERBOSE("offlineID "<<offlineID<<" "<<getStatus(offlineID)<<" "<<((getStatus(offlineID) & statusbitmask) >> 8));
+  bool stHT=false;
+
+
+    if (getStatusHT(offlineID)==1) stHT = true;
+    else if (getStatusHT(offlineID)==0) stHT = false;
+    else {stHT = bool( (getStatusHT(offlineID) & statusbitmask) >> 8);};
+
+  return ( stHT );
+
+}
+
+
+
+
+
diff --git a/InnerDetector/InDetConditions/TRT_ConditionsServices/src/TRT_StrawStatusSummaryTool.h b/InnerDetector/InDetConditions/TRT_ConditionsServices/src/TRT_StrawStatusSummaryTool.h
new file mode 100644
index 0000000000000000000000000000000000000000..c02352d3eb64eaed4df1d15b28f40d2d325e5398
--- /dev/null
+++ b/InnerDetector/InDetConditions/TRT_ConditionsServices/src/TRT_StrawStatusSummaryTool.h
@@ -0,0 +1,169 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef TRT_STRAWSTATUSSUMMARYTOOL_H
+#define TRT_STRAWSTATUSSUMMARYTOOL_H
+/** @file TRT_StrawStatusSummaryTool.h
+ * @brief interface to TRT straw status constants used in normal reconstruction
+ * @author Peter Hansen <phansen@nbi.dk>
+ */
+//STL
+#include <vector>
+//Gaudi
+#include "GaudiKernel/IInterface.h"
+#include "GaudiKernel/ToolHandle.h"
+#include "GaudiKernel/ServiceHandle.h"
+#include "GaudiKernel/ContextSpecificPtr.h"
+#include "GaudiKernel/ThreadLocalContext.h"
+#include "GaudiKernel/ICondSvc.h"
+//StoreGate
+#include "StoreGate/DataHandle.h"
+#include "StoreGate/ReadCondHandleKey.h"
+#include "StoreGate/StoreGateSvc.h"
+//Athena
+#include "AthenaBaseComps/AthAlgTool.h"
+//TRT
+#include "TRT_ConditionsServices/ITRT_StrawStatusSummaryTool.h" 
+#include "TRT_ConditionsServices/ITRT_ConditionsSvc.h"
+#include "InDetIdentifier/TRT_ID.h"
+#include "InDetReadoutGeometry/TRT_BaseElement.h"
+
+
+class TRT_StrawStatusSummaryTool: public extends<AthAlgTool, ITRT_StrawStatusSummaryTool>
+{  
+ public:
+
+  /// constructor
+  TRT_StrawStatusSummaryTool ( const std::string& type, const std::string& name, const IInterface* parent);
+  
+  /// destructor
+  virtual ~TRT_StrawStatusSummaryTool() = default;
+  
+  /// tool initialize
+  virtual StatusCode initialize() override;
+
+  /// tool finalize
+  virtual StatusCode finalize() override;
+
+
+ /// access to the status
+  int getStatus(Identifier offlineId) const;
+  int getStatusPermanent(Identifier offlineId) const;
+  int getStatusHT(Identifier offlineId) const;
+  bool get_status(Identifier offlineId) const;
+  bool get_statusHT(Identifier offlineId) const;
+
+
+  const StrawStatusContainer* getStrawStatusContainer() const;
+  const StrawStatusContainer* getStrawStatusPermanentContainer() const;
+  const StrawStatusContainer* getStrawStatusHTContainer() const;
+
+
+ private:
+  ServiceHandle<StoreGateSvc> m_detStore;
+  ServiceHandle<IToolSvc> m_toolsvc; 
+  std::string m_par_strawstatuscontainerkey;
+  std::string m_par_strawstatuspermanentcontainerkey;
+  std::string m_par_strawstatusHTcontainerkey;
+
+
+  const TRT_ID* m_trtId;
+
+  ServiceHandle<ICondSvc> m_condSvc;
+  //  ReadHandle  keys
+  SG::ReadCondHandleKey<StrawStatusContainer> m_statReadKey{this,"StatReadKeyName","in","StrawStatus in-key"};
+  SG::ReadCondHandleKey<StrawStatusContainer> m_permReadKey{this,"PermReadKeyName","in","StrawStatusPermanent in-key"};
+  SG::ReadCondHandleKey<StrawStatusContainer> m_statHTReadKey{this,"StatHTReadKeyName","in","StrawStatusHT in-key"};
+
+  // Caches
+  mutable std::vector<const StrawStatusContainer*> m_strawstatuscontainer;
+  mutable std::vector<const StrawStatusContainer*> m_strawstatuspermanentcontainer;
+  mutable std::vector<const StrawStatusContainer*> m_strawstatusHTcontainer;
+  mutable std::mutex m_cacheMutex;
+  mutable std::vector<EventContext::ContextEvt_t> m_evtstat;
+  mutable std::vector<EventContext::ContextEvt_t> m_evtperm;
+  mutable std::vector<EventContext::ContextEvt_t> m_evtstatHT;
+
+  // Used in simulation (GEANT4) jobs
+  bool m_isGEANT4;
+  const DataHandle<StrawStatusContainer> m_strawstatusG4;
+  const DataHandle<StrawStatusContainer> m_strawstatuspermanentG4;
+  const DataHandle<StrawStatusContainer> m_strawstatusHTG4;
+
+
+};
+
+
+
+////////////////////////////////////////////////////////////////////////////////////////////
+//  inline methods
+////////////////////////////////////////////////////////////////////////////////////////////
+
+
+
+
+inline const TRT_StrawStatusSummaryTool::StrawStatusContainer* TRT_StrawStatusSummaryTool::getStrawStatusContainer() const{
+
+  const EventContext& event_context=Gaudi::Hive::currentContext();
+  EventContext::ContextID_t slot=event_context.slot();
+  EventContext::ContextEvt_t event_id=event_context.evt();
+  std::lock_guard<std::mutex> lock(m_cacheMutex);
+  if(slot>=m_evtstat.size()) {
+     m_evtstat.resize(slot+1);
+     m_strawstatuscontainer.resize(slot+1);
+  }
+
+  if(m_evtstat[slot]!=event_id) {
+    SG::ReadCondHandle<StrawStatusContainer> rst(m_statReadKey,event_context);
+    m_strawstatuscontainer[slot]=(*rst);
+    m_evtstat[slot]=event_id;
+  }
+
+  return m_strawstatuscontainer[slot];
+
+}
+inline const TRT_StrawStatusSummaryTool::StrawStatusContainer* TRT_StrawStatusSummaryTool::getStrawStatusPermanentContainer() const{
+
+
+  const EventContext& event_context=Gaudi::Hive::currentContext();
+  EventContext::ContextID_t slot=event_context.slot();
+  EventContext::ContextEvt_t event_id=event_context.evt();
+  std::lock_guard<std::mutex> lock(m_cacheMutex);
+  if(slot>=m_evtperm.size()) {
+     m_evtperm.resize(slot+1);
+     m_strawstatuspermanentcontainer.resize(slot+1);
+  }
+
+  if(m_evtperm[slot]!=event_id) {
+    SG::ReadCondHandle<StrawStatusContainer> rp(m_permReadKey,event_context);
+    m_strawstatuspermanentcontainer[slot]=(*rp);
+    m_evtperm[slot]=event_id;
+  }
+
+  return m_strawstatuspermanentcontainer[slot];
+
+}
+inline const TRT_StrawStatusSummaryTool::StrawStatusContainer* TRT_StrawStatusSummaryTool::getStrawStatusHTContainer() const{
+
+  if(m_isGEANT4) {
+    return m_strawstatusHTG4.cptr();
+  }
+  const EventContext& event_context=Gaudi::Hive::currentContext();
+  EventContext::ContextID_t slot=event_context.slot();
+  EventContext::ContextEvt_t event_id=event_context.evt();
+  std::lock_guard<std::mutex> lock(m_cacheMutex);
+  if(slot>=m_evtstatHT.size()) {
+    m_evtstatHT.resize(slot+1);
+    m_strawstatusHTcontainer.resize(slot+1);
+  }
+
+  if(m_evtstatHT[slot]!=event_id) {
+    SG::ReadCondHandle<StrawStatusContainer> rht(m_statHTReadKey,event_context);
+    m_strawstatusHTcontainer[slot]=(*rht);
+    m_evtstatHT[slot]=event_id;
+  }
+
+  return m_strawstatusHTcontainer[slot];
+}
+#endif //  TRT_STRAWSTATUSSUMMARYTOOL_H
diff --git a/InnerDetector/InDetConditions/TRT_ConditionsServices/src/components/TRT_ConditionsServices_entries.cxx b/InnerDetector/InDetConditions/TRT_ConditionsServices/src/components/TRT_ConditionsServices_entries.cxx
index 7d9fd439da62f010a10498d7508207536b719546..99790a8f0d5f28576cc6da3589bd039862fcc8df 100644
--- a/InnerDetector/InDetConditions/TRT_ConditionsServices/src/components/TRT_ConditionsServices_entries.cxx
+++ b/InnerDetector/InDetConditions/TRT_ConditionsServices/src/components/TRT_ConditionsServices_entries.cxx
@@ -2,11 +2,13 @@
 #include "src/TRT_ConditionsTestSvc.h"
 #include "src/TRT_AlignDbSvc.h"
 #include "src/TRT_CalDbSvc.h"
+#include "src/TRT_CalDbTool.h"
 #include "src/TRT_StrawAlignDbSvc.h"
 #include "src/TRT_DCS_ConditionsSvc.h"
 #include "src/TRT_HWMappingSvc.h"
 #include "src/TRT_StrawNeighbourSvc.h"
 #include "src/TRT_StrawStatusSummarySvc.h"
+#include "src/TRT_StrawStatusSummaryTool.h"
 #ifndef SIMULATIONBASE
 #include "src/TRT_ByteStream_ConditionsSvc.h"
 #endif
@@ -16,11 +18,13 @@ DECLARE_COMPONENT( TRT_ConditionsSummarySvc )
 DECLARE_COMPONENT( TRT_ConditionsTestSvc )
 DECLARE_COMPONENT( TRT_AlignDbSvc )
 DECLARE_COMPONENT( TRT_CalDbSvc )
+DECLARE_COMPONENT( TRT_CalDbTool )
 DECLARE_COMPONENT( TRT_StrawAlignDbSvc )
 DECLARE_COMPONENT( TRT_DCS_ConditionsSvc )
 DECLARE_COMPONENT( TRT_HWMappingSvc )
 DECLARE_COMPONENT( TRT_StrawNeighbourSvc )
 DECLARE_COMPONENT( TRT_StrawStatusSummarySvc )
+DECLARE_COMPONENT( TRT_StrawStatusSummaryTool )
 #ifndef SIMULATIONBASE
 DECLARE_COMPONENT( TRT_ByteStream_ConditionsSvc )
 #endif
diff --git a/InnerDetector/InDetDigitization/BCM_Digitization/python/BCM_DigitizationConfigNew.py b/InnerDetector/InDetDigitization/BCM_Digitization/python/BCM_DigitizationConfigNew.py
index 22fc5f896eb3a43eb2dd20e3b5ed816dc9733ef0..296e3690b5685b6e75b9621ae206258a79dfcf99 100755
--- a/InnerDetector/InDetDigitization/BCM_Digitization/python/BCM_DigitizationConfigNew.py
+++ b/InnerDetector/InDetDigitization/BCM_Digitization/python/BCM_DigitizationConfigNew.py
@@ -2,9 +2,9 @@
 
 Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 """
-from AthenaCommon import CfgMgr
 from RngComps.RandomServices import RNG, AthEngines
-from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
+from PileUpComps.PileUpCompsConf import PileUpXingFolder
+from BCM_Digitization.BCM_DigitizationConf import BCM_DigitizationTool, BCM_Digitization
 
 # The earliest and last bunch crossing times for which interactions will be sent
 # to the BCM Digitization code.
@@ -14,18 +14,24 @@ def BCM_FirstXing():
 def BCM_LastXing():
     return 0
 
-def BCM_DigitizationToolCfg(configFlags, name="BCM_DigitizationTool", **kwargs):
-    """Return tuple (ComponentAccumulator, tool) configured for BCM Digitization"""
-    acc = ComponentAccumulator()
-    # Configure the random engine
-    Engine = configFlags.Random.Engine
-    acc.merge(RNG(Engine))
-    # Build the argument dict
+def BCM_RangeCfg(flags, name="BCM_Range" , **kwargs):
+    """Return a BCM configured PileUpXingFolder tool"""
+    kwargs.setdefault("FirstXing", BCM_FirstXing())
+    kwargs.setdefault("LastXing",  BCM_LastXing())
+    # Default 0 no dataproxy reset
+    kwargs.setdefault("CacheRefreshFrequency", 1.0)
+    kwargs.setdefault("ItemList", ["SiHitCollection#BCMHits"])
+    return PileUpXingFolder(name, **kwargs)
+
+def BCM_DigitizationToolCfg(flags, name="BCM_DigitizationTool", **kwargs):
+    """Return a ComponentAccumulator with configured BCM_DigitizationTool"""
+    # take initial ComponentAccumulator from RNG
+    acc = RNG(flags.Random.Engine)
     kwargs.setdefault("RndmSvc", "AthRNGSvc")
     kwargs.setdefault("HitCollName", "BCMHits")
     kwargs.setdefault("OutputRDOKey", "BCM_RDOs")
     kwargs.setdefault("OutputSDOKey", "BCM_SDO_Map")
-    if configFlags.Digitization.DoInnerDetectorNoise:
+    if flags.Digitization.DoInnerDetectorNoise:
         kwargs.setdefault("ModNoise", [90.82] * 8)
     else:
         kwargs.setdefault("ModNoise", [0.0] * 8)
@@ -38,40 +44,28 @@ def BCM_DigitizationToolCfg(configFlags, name="BCM_DigitizationTool", **kwargs):
     kwargs.setdefault("EffDistanceParam", 4.0)
     kwargs.setdefault("EffSharpnessParam", 0.11)
     kwargs.setdefault("TimeDelay", 9.0)
-    if configFlags.Digitization.DoXingByXingPileUp:
+    if flags.Digitization.DoXingByXingPileUp:
         kwargs.setdefault("FirstXing", BCM_FirstXing())
         kwargs.setdefault("LastXing",  BCM_LastXing())
-    # Make the tool
-    tool = CfgMgr.BCM_DigitizationTool(name, **kwargs)
-    return (acc, tool)
+    acc.setPrivateTools(BCM_DigitizationTool(name, **kwargs))
+    return acc
 
-def BCM_DigitizationCfg(configFlags, name="BCM_OverlayDigitization", **kwargs):
-    """Return a ComponentAccumulator with BCM Digitization algorithm"""
-    acc, tool = BCM_DigitizationToolCfg(configFlags, **kwargs)
-    kwargs.setdefault("DigitizationTool", tool)
-    alg = CfgMgr.BCM_Digitization(name, **kwargs)
-    acc.addEventAlgo(alg)
+def BCM_DigitizationCfg(flags, name="BCM_OverlayDigitization", **kwargs):
+    """Return a ComponentAccumulator with configured BCM_Digitization algorithm"""
+    acc = BCM_DigitizationToolCfg(flags, **kwargs)
+    kwargs.setdefault("DigitizationTool", acc.popPrivateTools())
+    acc.addEventAlgo(BCM_Digitization(name, **kwargs))
     return acc
 
-def BCM_OverlayDigitizationToolCfg(configFlags, name="BCM_OverlayDigitizationTool", **kwargs):
-    """Return tuple (ComponentAccumulator, tool) configured for BCM Overlay Digitization"""
-    kwargs.setdefault("EvtStore", configFlags.Overlay.Legacy.EventStore)
-    return BCM_DigitizationToolCfg(configFlags, name, **kwargs)
+def BCM_OverlayDigitizationToolCfg(flags, name="BCM_OverlayDigitizationTool", **kwargs):
+    """Return ComponentAccumulator with BCM_DigitizationTool configured for Overlay"""
+    kwargs.setdefault("EvtStore", flags.Overlay.Legacy.EventStore)
+    return BCM_DigitizationToolCfg(flags, name, **kwargs)
 
-def BCM_OverlayDigitizationCfg(configFlags, name="BCM_OverlayDigitization", **kwargs):
-    """Return a ComponentAccumulator with BCM Overlay Digitization algorithm"""
-    acc, tool = BCM_OverlayDigitizationToolCfg(configFlags, **kwargs)
-    kwargs.setdefault("DigitizationTool", tool)
-    alg = CfgMgr.BCM_Digitization(name, **kwargs)
-    acc.addEventAlgo(alg)
+def BCM_OverlayDigitizationCfg(flags, name="BCM_OverlayDigitization", **kwargs):
+    """Return a ComponentAccumulator with BCM_Digitization algorithm configured for Overlay"""
+    acc = BCM_OverlayDigitizationToolCfg(flags, **kwargs)
+    kwargs.setdefault("DigitizationTool", acc.popPrivateTools())
+    acc.addEventAlgo(BCM_Digitization(name, **kwargs))
     return acc
 
-def getBCM_Range(name="BCM_Range" , **kwargs):
-    """Return a configured PileUpXingFolder tool"""
-    # This is the time of the xing in ns 
-    kwargs.setdefault("FirstXing", BCM_FirstXing())
-    kwargs.setdefault("LastXing",  BCM_LastXing())
-    # Default 0 no dataproxy reset
-    kwargs.setdefault("CacheRefreshFrequency", 1.0)
-    kwargs.setdefault("ItemList", ["SiHitCollection#BCMHits"])
-    return CfgMgr.PileUpXingFolder(name, **kwargs)
diff --git a/InnerDetector/InDetDigitization/BCM_Digitization/test/BCM_DigitizationConfigNew_test.py b/InnerDetector/InDetDigitization/BCM_Digitization/test/BCM_DigitizationConfigNew_test.py
index f79e4fb5b2dfdd1913a984e9061a1eb3eb186aec..75ffbf152f2dfa7652ede3e1d2de79657d081c18 100755
--- a/InnerDetector/InDetDigitization/BCM_Digitization/test/BCM_DigitizationConfigNew_test.py
+++ b/InnerDetector/InDetDigitization/BCM_Digitization/test/BCM_DigitizationConfigNew_test.py
@@ -12,24 +12,36 @@ from AthenaConfiguration.MainServicesConfig import MainServicesSerialCfg
 from AthenaConfiguration.TestDefaults import defaultTestFiles
 from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
 from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
-from BCM_Digitization.BCM_DigitizationConfigNew import BCM_DigitizationCfg
 from Digitization.DigitizationConfigFlags import createDigitizationCfgFlags
 from OverlayCommonAlgs.OverlayConfigFlags import createOverlayCfgFlags
-from TrigUpgradeTest.InDetConfig import InDetGMConfig # FIXME This module would ideally be located somewhere else
+from PixelGeoModel.PixelGeoModelConfig import PixelGeometryCfg
+from BCM_Digitization.BCM_DigitizationConfigNew import (
+    BCM_RangeCfg, BCM_DigitizationToolCfg, BCM_DigitizationCfg,
+    BCM_OverlayDigitizationToolCfg, BCM_OverlayDigitizationCfg,
+)
 
 # Set up logging and new style config
 log.setLevel(DEBUG)
 Configurable.configurableRun3Behavior = True
 # Configure
-ConfigFlags.Input.Files = defaultTestFiles.HITS
-ConfigFlags.Output.RDOFileName = "myRDO.pool.root"
 ConfigFlags.join(createDigitizationCfgFlags())
 ConfigFlags.join(createOverlayCfgFlags())
+ConfigFlags.Input.Files = defaultTestFiles.HITS
+ConfigFlags.Output.RDOFileName = "myRDO.pool.root"
+ConfigFlags.GeoModel.Align.Dynamic = False
 ConfigFlags.lock()
+# Function tests
+tool = BCM_RangeCfg(ConfigFlags)
+tacc = BCM_DigitizationToolCfg(ConfigFlags)
+tacc.merge(BCM_OverlayDigitizationToolCfg(ConfigFlags))
+tacc.merge(BCM_DigitizationToolCfg(ConfigFlags))
+tacc.merge(BCM_OverlayDigitizationCfg(ConfigFlags))
+# reset to prevent errors on deletion
+tacc.__init__()
 # Construct our accumulator to run
 acc = MainServicesSerialCfg()
 acc.merge(PoolReadCfg(ConfigFlags))
-acc.merge(InDetGMConfig(ConfigFlags)) # FIXME This sets up the whole ID geometry would be nicer just to set up min required for BCM
+acc.merge(PixelGeometryCfg(ConfigFlags))
 # Add configuration to write HITS pool file
 outConfig = OutputStreamCfg(ConfigFlags, "RDO",
     ItemList=["InDetSimDataCollection#*", "BCM_RDO_Container#*"])
diff --git a/InnerDetector/InDetDigitization/SCT_Digitization/CMakeLists.txt b/InnerDetector/InDetDigitization/SCT_Digitization/CMakeLists.txt
index 9430fcedfd7d4f9ad595dd06fe8f0651a8492970..a58ce83124e605d1804c30fa14e2ca09afe4fa13 100644
--- a/InnerDetector/InDetDigitization/SCT_Digitization/CMakeLists.txt
+++ b/InnerDetector/InDetDigitization/SCT_Digitization/CMakeLists.txt
@@ -45,6 +45,10 @@ atlas_add_component( SCT_Digitization
 atlas_add_test( SCT_DigitizationConfigNew_test
                 SCRIPT test/SCT_DigitizationConfigNew_test.py
                 PROPERTIES TIMEOUT 300 )
+atlas_add_test( SCT_DigitizationMT_test
+                SCRIPT Digi_tf.py --inputHITSFile /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/DigitizationTests/HITS.04919495._001041.pool.root.1 --conditionsTag default:OFLCOND-RUN12-SDR-25 --digiSeedOffset1 170 --digiSeedOffset2 170 --geometryVersion ATLAS-R2-2015-03-01-00 --DataRunNumber 222525 --outputRDOFile mc15_2015_ttbar.RDO.pool.root --preInclude HITtoRDO:SimulationJobOptions/preInclude.SCTOnlyConfig.py,Digitization/ForceUseOfAlgorithms.py --postInclude Digitization/FixDataDependenciesForMT.py --skipEvents 0  --maxEvents 100 --athenaopts '--threads 10'
+                PROPERTIES TIMEOUT 600
+                ENVIRONMENT THREADS=10 )
 
 # Install files from the package:
 atlas_install_headers( SCT_Digitization )
diff --git a/InnerDetector/InDetDigitization/SCT_Digitization/python/SCT_DigitizationConfigNew.py b/InnerDetector/InDetDigitization/SCT_Digitization/python/SCT_DigitizationConfigNew.py
index d54410fc56e1893d1ce5bf36c6c52773a2f456ca..7c6daebcf8f027444037293299ef9244bc5bdfcf 100644
--- a/InnerDetector/InDetDigitization/SCT_Digitization/python/SCT_DigitizationConfigNew.py
+++ b/InnerDetector/InDetDigitization/SCT_Digitization/python/SCT_DigitizationConfigNew.py
@@ -48,16 +48,17 @@ def SCT_DigitizationCommonCfg(flags, name="SCT_DigitizationToolCommon", **kwargs
         kwargs.setdefault("LastXing", SCT_LastXing() )
     tool = SCT_DigitizationTool(name, **kwargs)
     # attach ToolHandles
-    frontAcc, frontTool = SCT_FrontEndCfg(flags)
-    tool.FrontEnd = frontTool
-    surfAcc, surfTool = SCT_SurfaceChargesGeneratorCfg(flags)
-    tool.SurfaceChargesGenerator = surfTool
+    frontAcc = SCT_FrontEndCfg(flags)
+    tool.FrontEnd = frontAcc.popPrivateTools()
+    surfAcc = SCT_SurfaceChargesGeneratorCfg(flags)
+    tool.SurfaceChargesGenerator = surfAcc.popPrivateTools()
     tool.RandomDisabledCellGenerator = SCT_RandomDisabledCellGeneratorCfg(flags)
     acc.mergeAll([frontAcc, surfAcc])
-    return acc, tool
+    acc.setPrivateTools(tool)
+    return acc
 
 def SCT_DigitizationToolCfg(flags, name="SCT_DigitizationTool", **kwargs):
-    """Return configured digitization tool"""
+    """Return a ComponentAccumulator with configured SCT digitization tool"""
     if flags.Digitization.PileUpPremixingForMT:
         kwargs.setdefault("OutputObjectName", flags.Overlay.BkgPrefix + "SCT_RDOs")
         kwargs.setdefault("OutputSDOName", flags.Overlay.BkgPrefix + "SCT_SDO_Map")
@@ -68,21 +69,21 @@ def SCT_DigitizationToolCfg(flags, name="SCT_DigitizationTool", **kwargs):
     return SCT_DigitizationCommonCfg(flags, name, **kwargs)
 
 def SCT_DigitizationToolHSCfg(flags, name="SCT_DigitizationToolHS", **kwargs):
-    """Return hard scatter configured digitization tool"""
+    """Return a ComponentAccumulator with hard scatter configured SCT digitization tool"""
     kwargs.setdefault("OutputObjectName", "SCT_RDOs")
     kwargs.setdefault("OutputSDOName", "SCT_SDO_Map")
     kwargs.setdefault("HardScatterSplittingMode", 1)
     return SCT_DigitizationCommonCfg(flags, name, **kwargs)
 
 def SCT_DigitizationToolPUCfg(flags, name="SCT_DigitizationToolPU",**kwargs):
-    """Return pileup configured digitization tool"""
+    """Return a ComponentAccumulator with pileup configured SCT digitization tool"""
     kwargs.setdefault("OutputObjectName", "SCT_PU_RDOs")
     kwargs.setdefault("OutputSDOName", "SCT_PU_SDO_Map")
     kwargs.setdefault("HardScatterSplittingMode", 2)
     return SCT_DigitizationCommonCfg(flags, name, **kwargs)
 
 def SCT_DigitizationToolOverlayCfg(flags, name="SCT_OverlayDigitizationTool",**kwargs):
-    """Return overlay configured digitization tool"""
+    """Return a ComponentAccumulator with overlay configured SCT digitization tool"""
     acc = ComponentAccumulator()
     if flags.Overlay.Legacy.MT:
         kwargs.setdefault("InputSingleHitsName", "SCT_Hits")
@@ -93,12 +94,11 @@ def SCT_DigitizationToolOverlayCfg(flags, name="SCT_OverlayDigitizationTool",**k
         kwargs.setdefault("OutputObjectName", flags.Overlay.Legacy.EventStore + "+SCT_RDOs")
         kwargs.setdefault("OutputSDOName", flags.Overlay.Legacy.EventStore + "+SCT_SDO_Map")
     kwargs.setdefault("HardScatterSplittingMode", 0)
-    CommonAcc, tool = SCT_DigitizationCommonCfg(flags, name, **kwargs)
-    acc.merge(CommonAcc)
-    return acc, tool
+    acc.merge(SCT_DigitizationCommonCfg(flags, name, **kwargs))
+    return acc
 
 def SCT_DigitizationToolSplitNoMergePUCfg(flags, name="SCT_DigitizationToolSplitNoMergePU",**kwargs):
-    """Return no merged pileup configured digitization tool"""
+    """Return a ComponentAccumulator with merged pileup configured SCT digitization tool"""
     kwargs.setdefault("InputObjectName", "PileupSCT_Hits")
     kwargs.setdefault("HardScatterSplittingMode", 0)
     kwargs.setdefault("OutputObjectName", "SCT_PU_RDOs")
@@ -128,7 +128,7 @@ def SCT_AmpCfg(flags, name="SCT_Amp", **kwargs):
     return SCT_Amp(name, **kwargs)
 
 def SCT_SurfaceChargesGeneratorCfg(flags, name="SCT_SurfaceChargesGenerator", **kwargs):
-    """Return configured (detailed) surface charges tool, conditioned on flags"""
+    """Return a ComponentAccumulator with configured surface charges tool"""
     acc = ComponentAccumulator()
     kwargs.setdefault("FixedTime", -999)
     kwargs.setdefault("SubtractTime", -999)
@@ -142,19 +142,21 @@ def SCT_SurfaceChargesGeneratorCfg(flags, name="SCT_SurfaceChargesGenerator", **
     # experimental SCT_DetailedSurfaceChargesGenerator config dropped here
     tool = SCT_SurfaceChargesGenerator(name, **kwargs)
     tool.RadDamageSummaryTool = SCT_RadDamageSummaryTool()
-    DCSCondAcc, DCSCondTool = SCT_DCSConditionsCfg(flags)
-    SiliCondAcc, SiliCondTool = SCT_SiliconConditionsCfg(flags, DCSConditionsTool=DCSCondTool)
-    SiliPropsAcc, SiliPropsTool = SCT_SiPropertiesCfg(flags, SiConditionsTool=SiliCondTool)
-    LorentzAcc, LorentzTool = SCT_LorentzAngleCfg(flags)
+    DCSCondAcc = SCT_DCSConditionsCfg(flags)
+    DCSCondTool = DCSCondAcc.popPrivateTools()
+    SiliCondAcc = SCT_SiliconConditionsCfg(flags, DCSConditionsTool=DCSCondTool)
+    SiliCondTool = SiliCondAcc.popPrivateTools()
+    SiliPropsAcc = SCT_SiPropertiesCfg(flags, SiConditionsTool=SiliCondTool)
+    LorentzAcc = SCT_LorentzAngleCfg(flags)
     tool.SiConditionsTool = SiliCondTool
-    tool.SiPropertiesTool = SiliPropsTool
-    tool.LorentzAngleTool = LorentzTool
+    tool.SiPropertiesTool = SiliPropsAcc.popPrivateTools()
+    tool.LorentzAngleTool = LorentzAcc.popPrivateTools()
     acc.mergeAll([DCSCondAcc, SiliCondAcc, SiliPropsAcc, LorentzAcc])
-    return acc, tool
+    acc.setPrivateTools(tool)
+    return acc
 
 def SCT_FrontEndCfg(flags, name="SCT_FrontEnd", **kwargs):
-    """Return configured ComponentAccumulator with front-end electronics tool"""
-    acc = ComponentAccumulator()
+    """Return a ComponentAccumulator with configured front-end electronics tool"""
     # Setup noise treament in SCT_FrontEnd
     # To set the mean noise values for the different module types
     # Default values set at 0 degrees, plus/minus ~5 enc per plus/minus degree
@@ -185,9 +187,8 @@ def SCT_FrontEndCfg(flags, name="SCT_FrontEnd", **kwargs):
     # Use Calibration data from Conditions DB, still for testing purposes only
     kwargs.setdefault("UseCalibData", True)
     # Setup the ReadCalibChip folders and Svc
-    readAcc, readTool = SCT_ReadCalibChipDataCfg(flags)
-    kwargs.setdefault("SCT_ReadCalibChipDataTool", readTool)
-    acc.merge(readAcc)
+    acc = SCT_ReadCalibChipDataCfg(flags)
+    kwargs.setdefault("SCT_ReadCalibChipDataTool", acc.popPrivateTools())
     # DataCompressionMode: 1 is level mode x1x (default), 2 is edge mode 01x, 3 is expanded any hit xxx
     if flags.Digitization.PileUpPremixing:
         kwargs.setdefault("DataCompressionMode", 3)
@@ -202,10 +203,11 @@ def SCT_FrontEndCfg(flags, name="SCT_FrontEnd", **kwargs):
         kwargs.setdefault("DataReadOutMode", 0)
     else:
         kwargs.setdefault("DataReadOutMode", 1)
-    return acc, SCT_FrontEnd(name, **kwargs)
+    acc.setPrivateTools(SCT_FrontEnd(name, **kwargs))
+    return acc
 
 def SCT_FrontEndPileupCfg(flags, name="PileupSCT_FrontEnd", **kwargs):
-    """Return pileup-configured ComponentAccumulator with front-end electronics tool"""
+    """Return a ComponentAccumulator with pileup-configured front-end electronics tool"""
     kwargs.setdefault("NoiseBarrel", 0.0)
     kwargs.setdefault("NoiseBarrel3", 0.0)
     kwargs.setdefault("NoiseInners", 0.0)
@@ -221,8 +223,8 @@ def SCT_FrontEndPileupCfg(flags, name="PileupSCT_FrontEnd", **kwargs):
     kwargs.setdefault("NoiseOn", False)
     return SCT_FrontEndCfg(flags, name, **kwargs)
 
-def SiliconRangeCfg(flags, name="SiliconRange", **kwargs):
-    """Return a configured PileUpXingFolder tool"""
+def SCT_RangeCfg(flags, name="SiliconRange", **kwargs):
+    """Return an SCT configured PileUpXingFolder tool"""
     kwargs.setdefault("FirstXing", SCT_FirstXing())
     kwargs.setdefault("LastXing", SCT_LastXing())
     kwargs.setdefault("CacheRefreshFrequency", 1.0) # default 0 no dataproxy reset
@@ -233,8 +235,8 @@ def SCT_DigitizationCfg(toolCfg, flags, name="SCT_Digitization", **kwargs):
     """Return a ComponentAccumulator with toolCfg type SCT digitization"""
     acc = ComponentAccumulator()
     if "DigitizationTool" not in kwargs:
-        toolAcc, tool = toolCfg(flags)
-        kwargs["DigitizationTool"] = tool
+        toolAcc = toolCfg(flags)
+        kwargs["DigitizationTool"] = toolAcc.popPrivateTools()
         acc.merge(toolAcc)
     alg = SCT_Digitization(name, **kwargs)
     acc.addEventAlgo(alg)
diff --git a/InnerDetector/InDetDigitization/SCT_Digitization/test/SCT_DigitizationConfigNew_test.py b/InnerDetector/InDetDigitization/SCT_Digitization/test/SCT_DigitizationConfigNew_test.py
index 334c611412167bff8baa220242436d18ec520933..258d622052992de55df8fa894206bc1dd88cf65a 100755
--- a/InnerDetector/InDetDigitization/SCT_Digitization/test/SCT_DigitizationConfigNew_test.py
+++ b/InnerDetector/InDetDigitization/SCT_Digitization/test/SCT_DigitizationConfigNew_test.py
@@ -18,7 +18,7 @@ from SCT_Digitization.SCT_DigitizationConfigNew import (
     SCT_FrontEndCfg, SCT_FrontEndPileupCfg, SCT_DigitizationCommonCfg, SCT_DigitizationToolCfg,
     SCT_DigitizationToolGeantinoTruthCfg, SCT_DigitizationToolHSCfg, SCT_DigitizationToolPUCfg,
     SCT_DigitizationToolSplitNoMergePUCfg, SCT_DigitizationToolOverlayCfg, SCT_DigitizationHSCfg,
-    SCT_DigitizationPUCfg, SCT_DigitizationOverlayCfg, SiliconRangeCfg,
+    SCT_DigitizationPUCfg, SCT_DigitizationOverlayCfg, SCT_RangeCfg,
 )
 from Digitization.DigitizationConfigFlags import createDigitizationCfgFlags
 from OverlayCommonAlgs.OverlayConfigFlags import createOverlayCfgFlags
@@ -35,28 +35,26 @@ ConfigFlags.GeoModel.Align.Dynamic = False
 ConfigFlags.Concurrency.NumThreads = 1
 ConfigFlags.lock()
 # Function tests
-acc1, tool = SCT_DigitizationCommonCfg(ConfigFlags)
-acc2, tool = SCT_DigitizationToolCfg(ConfigFlags)
-acc3, tool = SCT_DigitizationToolHSCfg(ConfigFlags)
-acc4, tool = SCT_DigitizationToolPUCfg(ConfigFlags)
-acc5, tool = SCT_DigitizationToolOverlayCfg(ConfigFlags)
-acc6, tool = SCT_DigitizationToolSplitNoMergePUCfg(ConfigFlags)
-acc7, tool = SCT_DigitizationToolGeantinoTruthCfg(ConfigFlags)
+tacc = SCT_DigitizationCommonCfg(ConfigFlags)
+tacc.merge(SCT_DigitizationToolCfg(ConfigFlags))
+tacc.merge(SCT_DigitizationToolHSCfg(ConfigFlags))
+tacc.merge(SCT_DigitizationToolPUCfg(ConfigFlags))
+tacc.merge(SCT_DigitizationToolOverlayCfg(ConfigFlags))
+tacc.merge(SCT_DigitizationToolSplitNoMergePUCfg(ConfigFlags))
+tacc.merge(SCT_DigitizationToolGeantinoTruthCfg(ConfigFlags))
 tool = SCT_RandomDisabledCellGeneratorCfg(ConfigFlags)
 tool = SCT_AmpCfg(ConfigFlags)
-acc8, tool = SCT_SurfaceChargesGeneratorCfg(ConfigFlags)
-acc9, tool = SCT_FrontEndCfg(ConfigFlags)
-accA, tool = SCT_FrontEndPileupCfg(ConfigFlags)
-tool = SiliconRangeCfg(ConfigFlags)
-accB = SCT_DigitizationHSCfg(ConfigFlags)
-accC = SCT_DigitizationPUCfg(ConfigFlags)
-accD = SCT_DigitizationOverlayCfg(ConfigFlags)
-acc1.mergeAll([acc2, acc3, acc4, acc5, acc6, acc7, acc8, acc9, accA, accB, accC, accD])
-acc1.wasMerged()
+tacc.merge(SCT_SurfaceChargesGeneratorCfg(ConfigFlags))
+tacc.merge(SCT_FrontEndCfg(ConfigFlags))
+tacc.merge(SCT_FrontEndPileupCfg(ConfigFlags))
+tool = SCT_RangeCfg(ConfigFlags)
+tacc.merge(SCT_DigitizationHSCfg(ConfigFlags))
+tacc.merge(SCT_DigitizationPUCfg(ConfigFlags))
+tacc.merge(SCT_DigitizationOverlayCfg(ConfigFlags))
+# reset to prevent errors on deletion
+tacc.__init__()
 # Construct our accumulator to run
 acc = MainServicesSerialCfg()
-from StoreGate.StoreGateConf import StoreGateSvc # FIXME remove this once athena is fixed
-acc.addService(StoreGateSvc("ConditionStore"))
 acc.merge(PoolReadCfg(ConfigFlags))
 acc.merge(SCT_DigitizationHSCfg(ConfigFlags))
 # Add configuration to write HITS pool file
diff --git a/InnerDetector/InDetExample/InDetRecExample/python/TRTCommon.py b/InnerDetector/InDetExample/InDetRecExample/python/TRTCommon.py
index 28707794b778ef572ad823dba6c2b2f25920e434..f58ad7628d7f1eee395ce678de06f6abef274936 100644
--- a/InnerDetector/InDetExample/InDetRecExample/python/TRTCommon.py
+++ b/InnerDetector/InDetExample/InDetRecExample/python/TRTCommon.py
@@ -9,6 +9,7 @@ def _args( kwargs, **extra_kwargs) :
 def getInDetTRT_dEdxTool(**kwargs) :
     InDetTRT_dEdxTool = None
 
+
     from InDetRecExample.InDetJobProperties import InDetFlags
     from AthenaCommon.DetFlags import DetFlags
     if DetFlags.haveRIO.TRT_on() and not InDetFlags.doSLHC() and not InDetFlags.doHighPileup() :
diff --git a/InnerDetector/InDetExample/InDetRecExample/share/ConfiguredInDetPreProcessingTRT.py b/InnerDetector/InDetExample/InDetRecExample/share/ConfiguredInDetPreProcessingTRT.py
index 798cb07f16439a08e01b9f1b9c6c50114d1ed808..440eecb5779fc523d4ba1bb5ced710c091565b3d 100644
--- a/InnerDetector/InDetExample/InDetRecExample/share/ConfiguredInDetPreProcessingTRT.py
+++ b/InnerDetector/InDetExample/InDetRecExample/share/ConfiguredInDetPreProcessingTRT.py
@@ -37,6 +37,17 @@ class ConfiguredInDetPreProcessingTRT:
             collection = InDetKeys.TRT_DriftCirclesUncalibrated()
             if InDetFlags.doSplitReco() :
                collectionPU = InDetKeys.TRT_PU_DriftCirclesUncalibrated()
+         # Calibration DB Service
+         from TRT_ConditionsServices.TRT_ConditionsServicesConf import TRT_CalDbTool
+         InDetTRTCalDbTool = TRT_CalDbTool(name = "TRT_CalDbTool")
+
+
+         # --- set Data/MC flag
+         if globalflags.DataSource != 'geant4' :
+             InDetTRTCalDbTool.isGEANT4 = False
+         else :
+             InDetTRTCalDbTool.isGEANT4 = True
+
          #
          # --- TRT_DriftFunctionTool
          #
@@ -44,7 +55,7 @@ class ConfiguredInDetPreProcessingTRT:
 
          from TRT_DriftFunctionTool.TRT_DriftFunctionToolConf import TRT_DriftFunctionTool
          InDetTRT_DriftFunctionTool = TRT_DriftFunctionTool(name                = prefix+"DriftFunctionTool",
-                                                            TRTCalDbTool        = InDetTRTCalDbSvc)
+                                                            TRTCalDbTool        = InDetTRTCalDbTool)
          # --- overwrite for uncalibrated DC production
          if (not useTimeInfo) or InDetFlags.noTRTTiming():
             InDetTRT_DriftFunctionTool.DummyMode      = True
@@ -56,6 +67,7 @@ class ConfiguredInDetPreProcessingTRT:
          else :
              InDetTRT_DriftFunctionTool.IsMC = True
 
+
          # --- overwrite for calibration of MC
          if usePhase and jobproperties.Beam.beamType()=='cosmics' and globalflags.DataSource == "geant4":
             InDetTRT_DriftFunctionTool.AllowDigiVersionOverride = True
@@ -76,10 +88,25 @@ class ConfiguredInDetPreProcessingTRT:
                                                               -0.29828, -0.21344, -0.322892, -0.386718, -0.534751, -0.874178, -1.231799, -1.503689, -1.896464, -2.385958]
          InDetTRT_DriftFunctionTool.ToTCorrectionsEndcapAr = [0., 5.514777, 3.342712, 2.056626, 1.08293693, 0.3907979, -0.082819, -0.457485, -0.599706, -0.427493, 
                                                               -0.328962, -0.403399, -0.663656, -1.029428, -1.46008, -1.919092, -2.151582, -2.285481, -2.036822, -2.15805]
+         # Second calibration DB Service in case pile-up and physics hits have different calibrations
+         if DetFlags.overlay.TRT_on() :
+             InDetTRTCalDbTool2 = TRT_CalDbTool(name = "TRT_CalDbTool2")
+             InDetTRTCalDbTool2.IsGEANT4 = True
+             InDetTRTCalDbTool2.RtFolderName = "/TRT/Calib/MC/RT"             
+             InDetTRTCalDbTool2.T0FolderName = "/TRT/Calib/MC/T0"             
+             InDetTRT_DriftFunctionTool.TRTCalDbTool2 = InDetTRTCalDbTool2
+             InDetTRT_DriftFunctionTool.IsOverlay = True
+             InDetTRT_DriftFunctionTool.IsMC = False
 
          ToolSvc += InDetTRT_DriftFunctionTool
          if (InDetFlags.doPrintConfigurables()):
             print InDetTRT_DriftFunctionTool
+
+         # Straw status DB Tool
+         from TRT_ConditionsServices.TRT_ConditionsServicesConf import TRT_StrawStatusSummaryTool
+         InDetTRTStrawStatusSummaryTool = TRT_StrawStatusSummaryTool(name = "TRT_StrawStatusSummaryTool",
+                                                                     isGEANT4=(globalflags.DataSource == 'geant4'))
+
          #
          # --- TRT_DriftCircleTool
          #
@@ -109,8 +136,7 @@ class ConfiguredInDetPreProcessingTRT:
          InDetTRT_DriftCircleTool = InDet__TRT_DriftCircleTool(name                            = prefix+"DriftCircleTool",
                                                                TRTDriftFunctionTool            = InDetTRT_DriftFunctionTool,
                                                                TrtDescrManageLocation          = InDetKeys.TRT_Manager(),
-                                                               ConditionsSummaryTool           = InDetTRTStrawStatusSummarySvc,
-                                                               #used to be InDetTRTConditionsSummaryService,
+                                                               ConditionsSummaryTool           = InDetTRTStrawStatusSummaryTool,
                                                                UseConditionsStatus             = True,
                                                                UseConditionsHTStatus           = True,
                                                                SimpleOutOfTimePileupSupression = InDetFlags.doCosmics(),
@@ -180,8 +206,8 @@ class ConfiguredInDetPreProcessingTRT:
           from TRT_ElectronPidTools.TRT_ElectronPidToolsConf import InDet__TRT_LocalOccupancy
           InDetTRT_LocalOccupancy = InDet__TRT_LocalOccupancy(  name 		= "InDet_TRT_LocalOccupancy",
 								isTrigger	= False,
-                                                                TRTDriftFunctionTool = InDetTRT_DriftFunctionTool
-	  )
+                                                                TRTCalDbTool = InDetTRTCalDbTool,
+                                                                TRTStrawStatusSummaryTool = InDetTRTStrawStatusSummaryTool)
 
           ToolSvc += InDetTRT_LocalOccupancy
           if (InDetFlags.doPrintConfigurables()):
diff --git a/InnerDetector/InDetExample/InDetRecExample/share/InDetRecConditionsAccess.py b/InnerDetector/InDetExample/InDetRecExample/share/InDetRecConditionsAccess.py
index 4cb832a1e9b43c3506346b9bf0cb5a134a437426..d8c6262ce6b62800fe7f5333b38243b11d521d7c 100644
--- a/InnerDetector/InDetExample/InDetRecExample/share/InDetRecConditionsAccess.py
+++ b/InnerDetector/InDetExample/InDetRecExample/share/InDetRecConditionsAccess.py
@@ -348,13 +348,12 @@ if DetFlags.haveRIO.TRT_on():
 
 		# Added for run2. Clean the unsed ones!!!
     if not conddb.folderRequested( "/TRT/Calib/PID_vector" ):
-        conddb.addFolderSplitOnline("TRT","/TRT/Onl/Calib/PID_vector", "/TRT/Calib/PID_vector")
-
+        conddb.addFolderSplitOnline("TRT","/TRT/Onl/Calib/PID_vector", "/TRT/Calib/PID_vector",className='CondAttrListVec')
     if not conddb.folderRequested( "/TRT/Calib/ToT/ToTVectors"):
-       conddb.addFolderSplitOnline( "TRT", "/TRT/Onl/Calib/ToT/ToTVectors", "/TRT/Calib/ToT/ToTVectors")
+       conddb.addFolderSplitOnline( "TRT", "/TRT/Onl/Calib/ToT/ToTVectors", "/TRT/Calib/ToT/ToTVectors",className='CondAttrListVec')
 
     if not conddb.folderRequested( "/TRT/Calib/ToT/ToTValue"):
-       conddb.addFolderSplitOnline( "TRT", "/TRT/Onl/Calib/ToT/ToTValue", "/TRT/Calib/ToT/ToTValue")
+       conddb.addFolderSplitOnline( "TRT", "/TRT/Onl/Calib/ToT/ToTValue", "/TRT/Calib/ToT/ToTValue",className='CondAttrListCollection')
 
 
     #
@@ -389,6 +388,41 @@ if DetFlags.haveRIO.TRT_on():
     if (InDetFlags.doPrintConfigurables()):
         print InDetTRTStrawStatusSummarySvc
     InDetTRTConditionsServices.append(InDetTRTStrawStatusSummarySvc)
+
+    # Straw status tool
+    from TRT_ConditionsServices.TRT_ConditionsServicesConf import TRT_StrawStatusSummaryTool
+    InDetTRTStrawStatusSummaryTool = TRT_StrawStatusSummaryTool(name = "TRT_StrawStatusSummaryTool",
+                                                            isGEANT4 = useOldStyle)
+    # Alive straws algorithm
+    from TRT_ConditionsAlgs.TRT_ConditionsAlgsConf import TRTStrawCondAlg
+    TRTStrawCondAlg = TRTStrawCondAlg(name = "TRTStrawCondAlg",
+                                      TRTStrawStatusSummaryTool = InDetTRTStrawStatusSummaryTool,
+                                      isGEANT4 = useOldStyle)
+    # Active Fraction algorithm
+    from TRT_ConditionsAlgs.TRT_ConditionsAlgsConf import TRTActiveCondAlg
+    TRTActiveCondAlg = TRTActiveCondAlg(name = "TRTActiveCondAlg",
+                                      TRTStrawStatusSummaryTool = InDetTRTStrawStatusSummaryTool)
+
+    # HT probability algorithm
+    from TRT_ConditionsAlgs.TRT_ConditionsAlgsConf import TRTHTCondAlg
+    TRTHTCondAlg = TRTHTCondAlg(name = "TRTHTCondAlg")
+
+    # dEdx probability algorithm
+    from TRT_ConditionsAlgs.TRT_ConditionsAlgsConf import TRTToTCondAlg
+    TRTToTCondAlg = TRTToTCondAlg(name = "TRTToTCondAlg")
+
+    # Condition algorithms for straw conditions
+    if not hasattr(condSeq, "TRTStrawCondAlg"):
+        condSeq += TRTStrawCondAlg
+    if not hasattr(condSeq, "TRTActiveCondAlg"):
+        condSeq += TRTActiveCondAlg
+
+    # Condition algorithms for Pid
+    if not hasattr(condSeq, "TRTHTCondAlg"):
+        condSeq += TRTHTCondAlg
+    if not hasattr(condSeq, "TRTToTCondAlg"):
+        condSeq += TRTToTCondAlg
+
     
     # Services which only run on raw data
     if (globalflags.InputFormat() == 'bytestream' and globalflags.DataSource() == 'data'):
@@ -425,9 +459,4 @@ if DetFlags.haveRIO.TRT_on():
     if (InDetFlags.doPrintConfigurables()):
         print InDetTRTConditionsSummaryService 
 
-    from TRT_RecoConditionsServices.TRT_RecoConditionsServicesConf import TRT_ActiveFractionSvc
-    InDetTRT_ActiveFractionSvc = TRT_ActiveFractionSvc(name = "InDetTRTActiveFractionSvc")
-
-    ServiceMgr += InDetTRT_ActiveFractionSvc
-    if (InDetFlags.doPrintConfigurables()):
-        print InDetTRT_ActiveFractionSvc
+        
diff --git a/InnerDetector/InDetExample/InDetRecExample/share/InDetRecLoadTools.py b/InnerDetector/InDetExample/InDetRecExample/share/InDetRecLoadTools.py
index fe6329886ca02ea3c56510969f69995d3b08cd93..9ae64155d2b48b9d381a5ffe827679d6c7dff746 100755
--- a/InnerDetector/InDetExample/InDetRecExample/share/InDetRecLoadTools.py
+++ b/InnerDetector/InDetExample/InDetRecExample/share/InDetRecLoadTools.py
@@ -943,20 +943,20 @@ if InDetFlags.loadSummaryTool():
     if DetFlags.haveRIO.TRT_on() and not InDetFlags.doSLHC() and not InDetFlags.doHighPileup() \
             and not InDetFlags.useExistingTracksAsInput(): # TRT_RDOs (used byt the TRT_LocalOccupancy tool) are not present in ESD
 
-        isMC = False
-        if globalflags.DataSource == "geant4" :
-            isMC = True
-
-        from TRT_DriftFunctionTool.TRT_DriftFunctionToolConf import TRT_DriftFunctionTool
-        InDetTRT_DriftFunctionTool = TRT_DriftFunctionTool(       name   = "InDetTRT_DriftFunctionTool",
-                                                                  IsMC   = isMC )
-        ToolSvc += InDetTRT_DriftFunctionTool
+        from TRT_ConditionsServices.TRT_ConditionsServicesConf import TRT_CalDbTool
+        InDetTRTCalDbTool = TRT_CalDbTool(name = "TRT_CalDbTool",
+                                          isGEANT4=(globalflags.DataSource == 'geant4'))
+        # Straw status DB Tool
+        from TRT_ConditionsServices.TRT_ConditionsServicesConf import TRT_StrawStatusSummaryTool
+        InDetTRTStrawStatusSummaryTool = TRT_StrawStatusSummaryTool(name = "TRT_StrawStatusSummaryTool",
+                                                                    isGEANT4=(globalflags.DataSource == 'geant4'))
 
         from TRT_ElectronPidTools.TRT_ElectronPidToolsConf import InDet__TRT_LocalOccupancy
         InDetTRT_LocalOccupancy = InDet__TRT_LocalOccupancy(	  name 				="InDet_TRT_LocalOccupancy",
-                                                                  isTrigger			= False, 
-                                                                  TRTDriftFunctionTool          = InDetTRT_DriftFunctionTool
-        )
+                                                                  isTrigger			= False,
+                                                                  TRTCalDbTool = InDetTRTCalDbTool,
+                                                                  TRTStrawStatusSummaryTool = InDetTRTStrawStatusSummaryTool )
+
         ToolSvc += InDetTRT_LocalOccupancy
         if (InDetFlags.doPrintConfigurables()):
          print InDetTRT_LocalOccupancy
@@ -964,9 +964,11 @@ if InDetFlags.loadSummaryTool():
         from TRT_ElectronPidTools.TRT_ElectronPidToolsConf import InDet__TRT_ElectronPidToolRun2
         InDetTRT_ElectronPidTool = InDet__TRT_ElectronPidToolRun2(name   = "InDetTRT_ElectronPidTool",
                                                                   TRT_LocalOccupancyTool 	= InDetTRT_LocalOccupancy,
+                                                                  TRTStrawSummaryTool     	= InDetTRTStrawStatusSummaryTool,
                                                                   isData = (globalflags.DataSource == 'data'))
 
 
+
         ToolSvc += InDetTRT_ElectronPidTool
         if (InDetFlags.doPrintConfigurables()):
          print InDetTRT_ElectronPidTool
@@ -974,6 +976,7 @@ if InDetFlags.loadSummaryTool():
 
     import InDetRecExample.TRTCommon
     InDetTRT_dEdxTool = InDetRecExample.TRTCommon.getInDetTRT_dEdxTool()
+
     if (InDetTRT_dEdxTool != None and InDetFlags.doPrintConfigurables()):
         print InDetTRT_dEdxTool
 
@@ -1159,10 +1162,6 @@ if InDetFlags.doPattern():
                                                                MinOffsetDCs           = 5,
                                                                UseNewParameterization = True,  # Use Thomas's new parameterization by default
                                                                UseActiveFractionSvc   = DetFlags.haveRIO.TRT_on())
-    if (DetFlags.haveRIO.TRT_on()):
-        InDetTRTDriftCircleCut.TrtConditionsSvc = InDetTRT_ActiveFractionSvc
-    else:
-        InDetTRTDriftCircleCut.TrtConditionsSvc = None        
     
     ToolSvc += InDetTRTDriftCircleCut
     if (InDetFlags.doPrintConfigurables()):
@@ -1238,10 +1237,6 @@ if InDetFlags.doPattern() and DetFlags.haveRIO.TRT_on():
                                                                                  MinOffsetDCs           = 5,
                                                                                  UseNewParameterization = InDetNewTrackingCuts.useNewParameterizationTRT(),  # Use new parameterization only for high lumi
                                                                                  UseActiveFractionSvc   = DetFlags.haveRIO.TRT_on())
-        if (DetFlags.haveRIO.TRT_on()):
-            InDetTRTDriftCircleCutForPatternReco.TrtConditionsSvc = InDetTRT_ActiveFractionSvc
-        else:
-            InDetTRTDriftCircleCutForPatternReco.TrtConditionsSvc = None        
             
         ToolSvc += InDetTRTDriftCircleCutForPatternReco
         if (InDetFlags.doPrintConfigurables()):
diff --git a/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigCommonTools.py b/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigCommonTools.py
index ef65af23e24011086a67320a12926eb5bfe7a220..dc72b64fff9e94ccb488688a2148d361ed1a9208 100644
--- a/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigCommonTools.py
+++ b/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigCommonTools.py
@@ -12,22 +12,60 @@ ___version___ = "$Id: $"
 from InDetTrigRecExample.InDetTrigConditionsAccess import TRT_ConditionsSetup
 from AthenaCommon.AppMgr import ToolSvc
 from AthenaCommon.GlobalFlags import globalflags
+from AthenaCommon.DetFlags import DetFlags
 
-# TRT_DriftFunctionTool
+# --- set Data/MC flag
 isMC = False
 if globalflags.DataSource == "geant4" :
     isMC = True
 
+# Calibration DB Service
+from TRT_ConditionsServices.TRT_ConditionsServicesConf import TRT_CalDbTool
+InDetTRTCalDbTool = TRT_CalDbTool(name = "TRT_CalDbTool")
+
+
+if(isMC) :
+    InDetTRTCalDbTool.isGEANT4 = True
+else :
+    InDetTRTCalDbTool.isGEANT4 = False
+
+
+# TRT_DriftFunctionTool
 from TRT_DriftFunctionTool.TRT_DriftFunctionToolConf import TRT_DriftFunctionTool
 
 InDetTrigTRT_DriftFunctionTool = TRT_DriftFunctionTool(name = "InDetTrigTRT_DriftFunctionTool",
+                                                       TRTCalDbTool        = InDetTRTCalDbTool,
                                                        AllowDataMCOverride = True,
                                                        ForceData = True,
-                                                       IsMC = isMC,
-                                                       TRTCalDbTool = "TRT_CalDbSvc/TRT_CalDbSvc" )
+                                                       IsMC = isMC)
+
+# Second calibration DB Service in case pile-up and physics hits have different calibrations
+if DetFlags.overlay.TRT_on() :
+
+    InDetTrigTRTCalDbTool2 = TRT_CalDbTool(name = "TRT_CalDbSvc2")
+    InDetTrigTRTCalDbTool2.IsGEANT4 = True
+    InDetTrigTRTCalDbTool2.RtFolderName = "/TRT/Calib/MC/RT"             
+    InDetTrigTRTCalDbTool2.T0FolderName = "/TRT/Calib/MC/T0"             
+    InDetTrigTRT_DriftFunctionTool.TRTCalDbTool2 = InDetTrigTRTCalDbTool2
+    InDetTrigTRT_DriftFunctionTool.IsOverlay = True
+    InDetTrigTRT_DriftFunctionTool.IsMC = False
+
+# --- set HT corrections
+InDetTrigTRT_DriftFunctionTool.HTCorrectionBarrelXe = 1.5205
+InDetTrigTRT_DriftFunctionTool.HTCorrectionEndcapXe = 1.2712
+InDetTrigTRT_DriftFunctionTool.HTCorrectionBarrelAr = 1.5205
+InDetTrigTRT_DriftFunctionTool.HTCorrectionEndcapAr = 1.2712
+         
+# --- set ToT corrections
+InDetTrigTRT_DriftFunctionTool.ToTCorrectionsBarrelXe = [0., 4.358121, 3.032195, 1.631892, 0.7408397, -0.004113, -0.613288, -0.73758, -0.623346, -0.561229,-0.29828, -0.21344, -0.322892, -0.386718, -0.534751, -0.874178, -1.231799, -1.503689, -1.896464, -2.385958]
+InDetTrigTRT_DriftFunctionTool.ToTCorrectionsEndcapXe = [0., 5.514777, 3.342712, 2.056626, 1.08293693, 0.3907979, -0.082819, -0.457485, -0.599706, -0.427493, -0.328962, -0.403399, -0.663656, -1.029428, -1.46008, -1.919092, -2.151582, -2.285481, -2.036822, -2.15805]
+InDetTrigTRT_DriftFunctionTool.ToTCorrectionsBarrelAr = [0., 4.358121, 3.032195, 1.631892, 0.7408397, -0.004113, -0.613288, -0.73758, -0.623346, -0.561229, -0.29828, -0.21344, -0.322892, -0.386718, -0.534751, -0.874178, -1.231799, -1.503689, -1.896464, -2.385958]
+InDetTrigTRT_DriftFunctionTool.ToTCorrectionsEndcapAr = [0., 5.514777, 3.342712, 2.056626, 1.08293693, 0.3907979, -0.082819, -0.457485, -0.599706, -0.427493, -0.328962, -0.403399, -0.663656, -1.029428, -1.46008, -1.919092, -2.151582, -2.285481, -2.036822, -2.15805]
+
 
 ToolSvc += InDetTrigTRT_DriftFunctionTool
 
+
 # TRT_RodDecoder
 from TRT_RawDataByteStreamCnv.TRT_RawDataByteStreamCnvConf import TRT_RodDecoder
 
@@ -35,6 +73,11 @@ InDetTrigTRTRodDecoder = TRT_RodDecoder(name = "InDetTrigTRTRodDecoder",
                                         LoadCompressTableDB = (globalflags.DataSource() != 'geant4'))
 ToolSvc += InDetTrigTRTRodDecoder
 
+# Straw status DB Tool
+from TRT_ConditionsServices.TRT_ConditionsServicesConf import TRT_StrawStatusSummaryTool
+InDetTRTStrawStatusSummaryTool = TRT_StrawStatusSummaryTool(name = "TRT_StrawStatusSummaryTool",
+                                           isGEANT4=(globalflags.DataSource == 'geant4'))
+
 # TRT_DriftCircleTool
 from TRT_DriftCircleTool.TRT_DriftCircleToolConf import InDet__TRT_DriftCircleTool
 #these settings offline keeps for MC
@@ -55,6 +98,7 @@ if  globalflags.DataSource != 'data':
   
 InDetTrigTRT_DriftCircleTool = InDet__TRT_DriftCircleTool( name = "InDetTrigTRT_DriftCircleTool",
                                                            TRTDriftFunctionTool = InDetTrigTRT_DriftFunctionTool,
+                                                           ConditionsSummaryTool           = InDetTRTStrawStatusSummaryTool,
                                                            UseConditionsStatus  = True,
                                                            UseConditionsHTStatus  = True,
                                                            SimpleOutOfTimePileupSupression = True,
@@ -90,11 +134,6 @@ if InDetTrigFlags.InDet25nsec():
 #    InDetTRT_DriftCircleTool.SimpleOutOfTimePileupSupression=False 
 
 
-InDetTrigTRT_DriftCircleTool.ConditionsSummaryTool= \
-    "TRT_StrawStatusSummarySvc/"+TRT_ConditionsSetup.instanceName("InDetTRTStrawStatusSummarySvc")
-#    "TRT_ConditionsSummarySvc/"+TRT_ConditionsSetup.instanceName("InDetTRTConditionsSummaryService")
-
 ToolSvc += InDetTrigTRT_DriftCircleTool
 print InDetTrigTRT_DriftCircleTool
 
-
diff --git a/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigConditions.py b/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigConditions.py
index a6e0389c9113d00a6c13ccfe75854787c40d6b38..195901186832f0d24ef17451fa4a3708464bb08c 100644
--- a/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigConditions.py
+++ b/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigConditions.py
@@ -531,6 +531,37 @@ class TRTConditionsServicesSetup:
     if not conddb.folderRequested('/TRT/Cond/StatusHT'):
       conddb.addFolderSplitOnline("TRT","/TRT/Onl/Cond/StatusHT","/TRT/Cond/StatusHT",className='TRTCond::StrawStatusMultChanContainer')
 
+    # Straw status tool
+    from TRT_ConditionsServices.TRT_ConditionsServicesConf import TRT_StrawStatusSummaryTool
+    InDetTRTStrawStatusSummaryTool = TRT_StrawStatusSummaryTool(name = "TRT_StrawStatusSummaryTool",
+                                                            isGEANT4 = self._isMC)
+    # Alive straws algorithm
+    from TRT_ConditionsAlgs.TRT_ConditionsAlgsConf import TRTStrawCondAlg
+    TRTStrawCondAlg = TRTStrawCondAlg(name = "TRTStrawCondAlg",
+                                      TRTStrawStatusSummaryTool = InDetTRTStrawStatusSummaryTool,
+                                      isGEANT4 = self._isMC)
+    # Active Fraction algorithm
+    from TRT_ConditionsAlgs.TRT_ConditionsAlgsConf import TRTActiveCondAlg
+    TRTActiveCondAlg = TRTActiveCondAlg(name = "TRTActiveCondAlg",
+                                      TRTStrawStatusSummaryTool = InDetTRTStrawStatusSummaryTool)
+
+
+    # HT probability algorithm
+    from TRT_ConditionsAlgs.TRT_ConditionsAlgsConf import TRTHTCondAlg
+    TRTHTCondAlg = TRTHTCondAlg(name = "TRTHTCondAlg")
+
+
+    from AthenaCommon.AlgSequence import AthSequencer
+    condSeq = AthSequencer("AthCondSeq")
+
+    # Condition algorithms for straw conditions
+    if not hasattr(condSeq, "TRTStrawCondAlg"):
+        condSeq += TRTStrawCondAlg
+    if not hasattr(condSeq, "TRTActiveCondAlg"):
+        condSeq += TRTActiveCondAlg
+    # Condition algorithms for Pid
+    if not hasattr(condSeq, "TRTHTCondAlg"):
+        condSeq += TRTHTCondAlg
 
 
     from AthenaCommon.GlobalFlags import globalflags
@@ -594,12 +625,6 @@ class TRTConditionsServicesSetup:
     if self._print:
       print InDetTRTConditionsSummaryService 
 
-    from TRT_RecoConditionsServices.TRT_RecoConditionsServicesConf import TRT_ActiveFractionSvc
-    InDetTRT_ActiveFractionSvc = TRT_ActiveFractionSvc(name=self.instanceName("InDetTRTActiveFractionSvc"),
-                                                       #missing link to TRTSummarySvc
-                                                       )
-    ServiceMgr += InDetTRT_ActiveFractionSvc
-
 
   def instanceName(self, toolname):
     return self.prefix+toolname
diff --git a/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigRecLoadTools.py b/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigRecLoadTools.py
index d9c5eb709bce514e4350f0064a94cc425f110b4a..c999a1ce38a9df675975cc0c0cdfde9ae91e850f 100755
--- a/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigRecLoadTools.py
+++ b/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigRecLoadTools.py
@@ -740,34 +740,38 @@ if InDetTrigFlags.loadSummaryTool():
      conddb.addFolderSplitOnline("TRT","/TRT/Onl/Calib/PID_RToT","/TRT/Calib/PID_RToT")
   if not (conddb.folderRequested("/TRT/Calib/PID_vector") or \
             conddb.folderRequested("/TRT/Onl/Calib/PID_vector")):
-    conddb.addFolderSplitOnline("TRT","/TRT/Onl/Calib/PID_vector","/TRT/Calib/PID_vector")
+    conddb.addFolderSplitOnline("TRT","/TRT/Onl/Calib/PID_vector","/TRT/Calib/PID_vector",className='CondAttrListVec')
   if not (conddb.folderRequested("/TRT/Calib/ToT/ToTVectors") or \
             conddb.folderRequested("/TRT/Onl/Calib/ToT/ToTVectors")):
-    conddb.addFolderSplitOnline("TRT","/TRT/Onl/Calib/ToT/ToTVectors","/TRT/Calib/ToT/ToTVectors")
+    conddb.addFolderSplitOnline("TRT","/TRT/Onl/Calib/ToT/ToTVectors","/TRT/Calib/ToT/ToTVectors",className='CondAttrListVec')
   if not (conddb.folderRequested("/TRT/Calib/ToT/ToTValue") or \
             conddb.folderRequested("/TRT/Onl/Calib/ToT/ToTValue")):
-    conddb.addFolderSplitOnline("TRT","/TRT/Onl/Calib/ToT/ToTValue","/TRT/Calib/ToT/ToTValue")
- 
- #    from AthenaCommon.GlobalFlags import globalflags
-  #    if globalflags.DataSource() == 'data':
-  #      conddb.addOverride("/TRT/Onl/Calib/PID_vector"  ,"TRTOnlCalibPID_vector-ES1-UPD1-00-00-01")
-     #else:
-     #  conddb.addOverride("/TRT/Onl/Calib/PID_vector","TRTCalibPID_vector_MC_OnSetMC_CorrMC_noZR_00-01")
+    conddb.addFolderSplitOnline("TRT","/TRT/Onl/Calib/ToT/ToTValue","/TRT/Calib/ToT/ToTValue",className='CondAttrListCollection')
+  from AthenaCommon.GlobalFlags import globalflags
 
   from TRT_ElectronPidTools.TRT_ElectronPidToolsConf import InDet__TRT_ElectronPidToolRun2,InDet__TRT_LocalOccupancy
-  from AthenaCommon.GlobalFlags import globalflags
   from InDetTrigRecExample.InDetTrigConditionsAccess import TRT_ConditionsSetup
-
-  InDetTrigTRT_LocalOccupancy = InDet__TRT_LocalOccupancy(name ="InDetTrigTRT_LocalOccupancy",
-                                                          isTrigger=True,
+  # Calibration DB Tool
+  from TRT_ConditionsServices.TRT_ConditionsServicesConf import TRT_CalDbTool
+  InDetTRTCalDbTool = TRT_CalDbTool(name = "TRT_CalDbTool",
+                                    isGEANT4=(globalflags.DataSource == 'geant4'))
+  # Straw status DB Tool
+  from TRT_ConditionsServices.TRT_ConditionsServicesConf import TRT_StrawStatusSummaryTool
+  InDetTRTStrawStatusSummaryTool = TRT_StrawStatusSummaryTool(name = "TRT_StrawStatusSummaryTool",
+                                                              isGEANT4=(globalflags.DataSource == 'geant4'))
+
+  from TRT_ElectronPidTools.TRT_ElectronPidToolsConf import InDet__TRT_LocalOccupancy
+  InDetTrigTRT_LocalOccupancy = InDet__TRT_LocalOccupancy(name ="InDet_TRT_LocalOccupancy",
+                                                          isTrigger = True,
                                                           TRT_RDOContainerName="TRT_RDOs_EF",
-                                                          TRTStrawSummarySvc=TRT_ConditionsSetup.instanceName('InDetTRTStrawStatusSummarySvc'),
-                                                          )
+                                                          TRTCalDbTool = InDetTRTCalDbTool,
+                                                          TRTStrawStatusSummaryTool = InDetTRTStrawStatusSummaryTool)
   ToolSvc += InDetTrigTRT_LocalOccupancy
+
   
   InDetTrigTRT_ElectronPidTool = InDet__TRT_ElectronPidToolRun2(name   = "InDetTrigTRT_ElectronPidTool",
                                                                 TRT_LocalOccupancyTool = InDetTrigTRT_LocalOccupancy,
-                                                                TRTStrawSummarySvc=TRT_ConditionsSetup.instanceName('InDetTRTStrawStatusSummarySvc'),
+                                                                TRTStrawSummaryTool= InDetTRTStrawStatusSummaryTool,
                                                                 OccupancyUsedInPID = True,
                                                                 isData = (globalflags.DataSource == 'data'))
 
@@ -775,6 +779,8 @@ if InDetTrigFlags.loadSummaryTool():
   if (InDetTrigFlags.doPrintConfigurables()):
     print      InDetTrigTRT_ElectronPidTool
 
+
+ 
   #
   # Configurable version of TrkTrackSummaryTool
   #
@@ -856,13 +862,9 @@ if InDetTrigFlags.doNewTracking() or InDetTrigFlags.doBackTracking() or InDetTri
 # TRT segment minimum number of drift circles tool
 #
 
-from InDetTrigRecExample.InDetTrigConditionsAccess import TRT_ConditionsSetup
-InDetTrigTRT_ActiveFractionSvc = TRT_ConditionsSetup.instanceName("InDetTRTActiveFractionSvc")
-
 from InDetTrackSelectorTool.InDetTrackSelectorToolConf import InDet__InDetTrtDriftCircleCutTool
 InDetTrigTRTDriftCircleCut = InDet__InDetTrtDriftCircleCutTool(
   name             = 'InDetTrigTRTDriftCircleCut',
-  TrtConditionsSvc = InDetTrigTRT_ActiveFractionSvc,
   MinOffsetDCs     = 5,
   UseNewParameterization = True,
   UseActiveFractionSvc   = True #DetFlags.haveRIO.TRT_on()  # Use Thomas's new parameterization by default
@@ -874,7 +876,6 @@ if (InDetTrigFlags.doPrintConfigurables()):
 
 InDetTrigTRTDriftCircleCutForPatt = InDet__InDetTrtDriftCircleCutTool(
   name             = 'InDetTrigTRTDriftCircleCutForPatt',
-  TrtConditionsSvc = InDetTrigTRT_ActiveFractionSvc,
   MinOffsetDCs     = 5,
   UseNewParameterization = InDetTrigCutValues.useNewParameterizationTRT(),
   UseActiveFractionSvc   = True #DetFlags.haveRIO.TRT_on()  # Use Thomas's new parameterization by default
diff --git a/InnerDetector/InDetRecTools/InDetTrackSelectorTool/InDetTrackSelectorTool/InDetTrtDriftCircleCutTool.h b/InnerDetector/InDetRecTools/InDetTrackSelectorTool/InDetTrackSelectorTool/InDetTrtDriftCircleCutTool.h
index 291aabe9785a1b9d68d8dba1b295cc8d97f831db..0fc7bf0d33c129eb7b7f5846cd58aa2a42e26b90 100644
--- a/InnerDetector/InDetRecTools/InDetTrackSelectorTool/InDetTrackSelectorTool/InDetTrtDriftCircleCutTool.h
+++ b/InnerDetector/InDetRecTools/InDetTrackSelectorTool/InDetTrackSelectorTool/InDetTrtDriftCircleCutTool.h
@@ -7,8 +7,9 @@
 
 #include "AthenaBaseComps/AthAlgTool.h"
 #include "GaudiKernel/ToolHandle.h"
-#include "GaudiKernel/ServiceHandle.h"
 #include "InDetRecToolInterfaces/ITrtDriftCircleCutTool.h"
+#include "TRT_ConditionsData/ActiveFraction.h"
+#include "StoreGate/ReadCondHandleKey.h"
 
 /**
  * A tool to be used for trt segment pre-selection
@@ -17,7 +18,6 @@
  * April 2009
  */
 
-class ITRT_ActiveFractionSvc;
 
 namespace InDet{
 
@@ -39,8 +39,7 @@ namespace InDet{
       
     private:
       
-      ServiceHandle<ITRT_ActiveFractionSvc>       m_trtCondSvc;   //!< TRT active fraction service
-
+      SG::ReadCondHandleKey<TRTCond::ActiveFraction> m_strawReadKey{this,"ActiveWriteKey","ActiveFraction","ActiveFraction in-key"};
       /** Properties for track selection:all cuts are ANDed */
       int  m_minOffset;  //!< Minimum number of TRT drit circles required
       bool m_param;      //!< Use the new or the old parameterization
diff --git a/InnerDetector/InDetRecTools/InDetTrackSelectorTool/src/InDetTrtDriftCircleCutTool.cxx b/InnerDetector/InDetRecTools/InDetTrackSelectorTool/src/InDetTrtDriftCircleCutTool.cxx
index 5400c2e1cc6ea147a6a5a7d2b612ff45777742ff..d46a2587db7dcda0eec247e2f059ff127582a73f 100644
--- a/InnerDetector/InDetRecTools/InDetTrackSelectorTool/src/InDetTrtDriftCircleCutTool.cxx
+++ b/InnerDetector/InDetRecTools/InDetTrackSelectorTool/src/InDetTrtDriftCircleCutTool.cxx
@@ -1,29 +1,23 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "InDetTrackSelectorTool/InDetTrtDriftCircleCutTool.h"
-#include "InDetRecToolInterfaces/ITRT_ActiveFractionSvc.h"
+#include "StoreGate/ReadCondHandle.h"
 
 StatusCode  InDet::InDetTrtDriftCircleCutTool::initialize()
 {
   StatusCode sc = AthAlgTool::initialize();
 
-  /* Get the trt active fraction tool */
-  if(m_useTRT){
-    if ( m_trtCondSvc.retrieve().isFailure() ) {
-      msg(MSG::ERROR) << "Failed to retrieve tool " << m_trtCondSvc << endmsg;
-      return StatusCode::FAILURE;
-    } else {
-      msg(MSG::INFO) << "Retrieved tool " << m_trtCondSvc << endmsg;
-    }
-  }
 
   if(sc.isFailure()){
     msg(MSG::ERROR)<<" Unable to initialize the AlgTool"<<endmsg;
     return StatusCode::FAILURE;
   }
 
+    // Read key
+   ATH_CHECK( m_strawReadKey.initialize() );
+ 
   return StatusCode::SUCCESS;
 }
     
@@ -35,13 +29,11 @@ StatusCode InDet::InDetTrtDriftCircleCutTool::finalize()
     
 InDet::InDetTrtDriftCircleCutTool::InDetTrtDriftCircleCutTool(const std::string& t, const std::string& n, const IInterface*  p)
   :AthAlgTool(t,n,p),
-   m_trtCondSvc("TRT_ActiveFractionSvc",n),
    m_minOffset(0),
    m_param(false),
    m_useTRT(true)
 {
   declareInterface<ITrtDriftCircleCutTool>(this);
-  declareProperty("TrtConditionsSvc",       m_trtCondSvc);
   declareProperty("MinOffsetDCs",           m_minOffset );
   declareProperty("UseNewParameterization", m_param     );
   declareProperty("UseActiveFractionSvc",   m_useTRT    );
@@ -74,12 +66,17 @@ int InDet::InDetTrtDriftCircleCutTool::minNumberDCs(const Trk::TrackParameters*
     
     double eta = fabs(trkp->momentum().eta());
 
+    SG::ReadCondHandle<TRTCond::ActiveFraction> strawReadHandle{m_strawReadKey};
+    const TRTCond::ActiveFraction* actF{*strawReadHandle};
+
     for(int i=0; i!=6; ++i) {
       if(eta <= TrtEtaBin[i+1]) {
 	double diff = eta;
 	double nDiffTRT = TrtA[i]+TrtB[i]*diff+TrtC[i]*diff*diff+TrtD[i]*diff*diff*diff-TrtO[i];
 	double activeF = 1.;
-	if(m_useTRT) activeF = m_trtCondSvc->getActiveFraction(trkp);
+        float phi = trkp->momentum().phi();
+        float eta = trkp->momentum().eta();
+	if(m_useTRT) activeF = actF->getActiveFraction(eta,phi);
         nDiffTRT = nDiffTRT*activeF;
 	if (nDiffTRT>=1) return int(nDiffTRT);
 	else return int(m_minOffset);
diff --git a/InnerDetector/InDetRecTools/TRT_DriftCircleTool/TRT_DriftCircleTool/TRT_DriftCircleTool.h b/InnerDetector/InDetRecTools/TRT_DriftCircleTool/TRT_DriftCircleTool/TRT_DriftCircleTool.h
index 3e46870de3cd72b780dc8cc4f9b6c7b1ca01e47d..f1a63aba74375b560334049f8db94b202ecaed2e 100755
--- a/InnerDetector/InDetRecTools/TRT_DriftCircleTool/TRT_DriftCircleTool/TRT_DriftCircleTool.h
+++ b/InnerDetector/InDetRecTools/TRT_DriftCircleTool/TRT_DriftCircleTool/TRT_DriftCircleTool.h
@@ -22,11 +22,11 @@
 #include "TrkPrepRawData/PrepRawDataCLASS_DEF.h"
 #include "GaudiKernel/ToolHandle.h"
 #include "GaudiKernel/ServiceHandle.h"
-#include "TRT_ConditionsServices/ITRT_StrawStatusSummarySvc.h"
+#include "TRT_ConditionsServices/ITRT_StrawStatusSummaryTool.h"
 
 #include "StoreGate/ReadHandleKey.h"
 #include "xAODEventInfo/EventInfo.h"
-class ITRT_StrawSummarySvc;
+class ITRT_StrawSummaryTool;
 class ITRT_DriftFunctionTool;
 class IInDetConditionsSvc;
 class TRT_ID;
@@ -77,7 +77,7 @@ public:
   ///////////////////////////////////////////////////////////////////
   SG::ReadHandleKey<xAOD::EventInfo> m_eventInfoKey {this,"xAODEventInfoKey","EventInfo","RHK to retrieve xAOD::EventInfo" }; //!< key to retrieve eventinfo
   ToolHandle< ITRT_DriftFunctionTool > m_driftFunctionTool; //!< DriftFunctionTool
-  ServiceHandle<ITRT_StrawStatusSummarySvc> m_ConditionsSummary; //!< The ConditionsSummaryTool
+  ToolHandle<ITRT_StrawStatusSummaryTool> m_ConditionsSummary; //!< The ConditionsSummaryTool
 //  ServiceHandle<ITRT_ConditionsSvc> m_ConditionsSummary; //!< The ConditionsSummaryTool
 //  ServiceHandle< IInDetConditionsSvc> m_ConditionsSummary; //!< The ConditionsSummaryTool
   bool                                 m_useConditionsStatus;     //!< Shall the ConditionsSummaryTool be used?
diff --git a/InnerDetector/InDetRecTools/TRT_DriftCircleTool/src/TRT_DriftCircleTool.cxx b/InnerDetector/InDetRecTools/TRT_DriftCircleTool/src/TRT_DriftCircleTool.cxx
index 54d321749197a87661da7cf53052e9fbb4a8e7f0..7693f1a997da3587c9b350827343edf4f41537fc 100755
--- a/InnerDetector/InDetRecTools/TRT_DriftCircleTool/src/TRT_DriftCircleTool.cxx
+++ b/InnerDetector/InDetRecTools/TRT_DriftCircleTool/src/TRT_DriftCircleTool.cxx
@@ -24,9 +24,7 @@
 #include "TRT_DriftFunctionTool/ITRT_DriftFunctionTool.h"
 #include "InDetReadoutGeometry/TRT_DetectorManager.h"
 #include "InDetIdentifier/TRT_ID.h"
-//#include "InDetConditionsSummaryService/IInDetConditionsSvc.h"
-//#include "TRT_ConditionsServices/ITRT_ConditionsSvc.h"
-#include "TRT_ConditionsServices/ITRT_StrawStatusSummarySvc.h"
+#include "TRT_ConditionsServices/ITRT_StrawStatusSummaryTool.h"
 
 #include "GeoPrimitives/GeoPrimitives.h"
 #include "EventPrimitives/EventPrimitives.h"
@@ -42,7 +40,7 @@ InDet::TRT_DriftCircleTool::TRT_DriftCircleTool(const std::string& t,
 						const IInterface*  p ):
   AthAlgTool(t,n,p),
   m_driftFunctionTool("TRT_DriftFunctionTool"),
-  m_ConditionsSummary("InDetTRTConditionsSummaryService",n),
+  m_ConditionsSummary("TRT_StrawStatusSummaryTool",this),
   m_useConditionsStatus(false),
   m_useConditionsHTStatus(false),
   m_useToTCorrection(false),
diff --git a/InnerDetector/InDetRecTools/TRT_DriftFunctionTool/TRT_DriftFunctionTool/TRT_DriftFunctionTool.h b/InnerDetector/InDetRecTools/TRT_DriftFunctionTool/TRT_DriftFunctionTool/TRT_DriftFunctionTool.h
index b625f1611a5863c3a995e8b6c0325a9afed797bc..5564a86b88814700e3c938b08baebd7eb038d4ea 100755
--- a/InnerDetector/InDetRecTools/TRT_DriftFunctionTool/TRT_DriftFunctionTool/TRT_DriftFunctionTool.h
+++ b/InnerDetector/InDetRecTools/TRT_DriftFunctionTool/TRT_DriftFunctionTool/TRT_DriftFunctionTool.h
@@ -18,15 +18,13 @@
 #include <string>
 #include "AthenaBaseComps/AthAlgTool.h"
 #include "TRT_DriftFunctionTool/ITRT_DriftFunctionTool.h"
-
-class ITRT_CalDbSvc;
+#include "TRT_ConditionsServices/ITRT_CalDbTool.h"
 class TRT_ID;
 
 
 #include "InDetReadoutGeometry/TRT_DetectorManager.h"
-#include "GaudiKernel/ServiceHandle.h"
+#include "GaudiKernel/ToolHandle.h"
 #include "GaudiKernel/ICondSvc.h"
-#include "StoreGate/ReadCondHandleKey.h"
 #include "StoreGate/DataHandle.h"
 // AttributeList
 #include "AthenaPoolUtilities/CondAttrListCollection.h"
@@ -99,9 +97,8 @@ public:
 private:
   
   /** Tool to fetch data from database */
-  ServiceHandle< ITRT_CalDbSvc >   m_TRTCalDbSvc;
-  ServiceHandle< ITRT_CalDbSvc >   m_TRTCalDbSvc2;
-
+  ToolHandle< ITRT_CalDbTool >   m_TRTCalDbTool;
+  ToolHandle< ITRT_CalDbTool >   m_TRTCalDbTool2;
 
   /** DetectorManager and helper */
   const InDetDD::TRT_DetectorManager* m_manager{};
diff --git a/InnerDetector/InDetRecTools/TRT_DriftFunctionTool/src/TRT_DriftFunctionTool.cxx b/InnerDetector/InDetRecTools/TRT_DriftFunctionTool/src/TRT_DriftFunctionTool.cxx
index 8ac2c340e2d2fe275757d85b3a8e7723580da49a..d76490b9b03b07f0136640cde0fae33beb595446 100755
--- a/InnerDetector/InDetRecTools/TRT_DriftFunctionTool/src/TRT_DriftFunctionTool.cxx
+++ b/InnerDetector/InDetRecTools/TRT_DriftFunctionTool/src/TRT_DriftFunctionTool.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 ///////////////////////////////////////////////////////////////////
@@ -22,8 +22,6 @@
 #include "InDetReadoutGeometry/TRT_DetectorManager.h"
 #include "InDetReadoutGeometry/TRT_Numerology.h"
 #include "InDetReadoutGeometry/Version.h"
-#include "StoreGate/ReadCondHandle.h"
-#include "TRT_ConditionsServices/ITRT_CalDbSvc.h"
 
 #include "CLHEP/Units/SystemOfUnits.h"
 
@@ -38,8 +36,8 @@ TRT_DriftFunctionTool::TRT_DriftFunctionTool(const std::string& type,
 				     const std::string& name,
 				     const IInterface* parent)
   : AthAlgTool(type, name, parent),
-    m_TRTCalDbSvc("TRT_CalDbSvc",name),
-    m_TRTCalDbSvc2("",name),
+    m_TRTCalDbTool("TRT_CalDbTool",this),
+    m_TRTCalDbTool2("",this),
     m_drifttimeperbin(3.125 * CLHEP::ns),
     m_error(0.17),
     m_drifttimeperhalfbin(0.), // set later
@@ -81,8 +79,8 @@ TRT_DriftFunctionTool::TRT_DriftFunctionTool(const std::string& type,
   declareProperty("UniversalError",m_uni_error);
   declareProperty("DummyMode",m_dummy);
   declareProperty("ErrorFudgeFactor",m_err_fudge);
-  declareProperty("TRTCalDbTool", m_TRTCalDbSvc);
-  declareProperty("TRTCalDbTool2", m_TRTCalDbSvc2);
+  declareProperty("TRTCalDbTool", m_TRTCalDbTool);
+  declareProperty("TRTCalDbTool2", m_TRTCalDbTool2);
   declareProperty("DriftFunctionFile", m_inputfile);
   declareProperty("TrtDescrManageLocation",m_trt_mgr_location);
   declareProperty("ToTCorrectionsBarrelXe",m_tot_corrections_barrel_Xe);
@@ -315,19 +313,19 @@ double TRT_DriftFunctionTool::driftRadius(double rawtime, Identifier id, double&
     {
       double radius = 0.; 
       if (!m_isoverlay){ //standard case
-	radius = m_TRTCalDbSvc->driftRadius(crawtime,ft0,cid,isOK);
+	radius = m_TRTCalDbTool->driftRadius(crawtime,ft0,cid,isOK);
 	t0=ft0 + m_t0_shift;
       }
       else{ //overlay case
-	radius = m_TRTCalDbSvc->driftRadius(rawtime,ft0,cid,isOK);// no m_t0_shift in rawtime, and use data TRTCalDbSvc
+	radius = m_TRTCalDbTool->driftRadius(rawtime,ft0,cid,isOK);// no m_t0_shift in rawtime, and use data TRTCalDbSvc
 	t0=ft0;
 	bool mcdigit = word & (1<<31);
 	if (mcdigit ){
 	  //check if it's a MC digit, and if so apply other calibration
-	  ATH_MSG_DEBUG ("Overlay TRTCalDbSvc  gave  radius: "<<radius<<", t0: "<<t0);
-	  radius = m_TRTCalDbSvc2->driftRadius(crawtime,ft0,cid,isOK);//t0_shift in crawtime, and use MC TRTCalDbSvc(2)
+	  ATH_MSG_DEBUG ("Overlay TRTCalDbTool  gave  radius: "<<radius<<", t0: "<<t0);
+	  radius = m_TRTCalDbTool2->driftRadius(crawtime,ft0,cid,isOK);//t0_shift in crawtime, and use MC TRTCalDbSvc(2)
 	  t0=ft0 + m_t0_shift;
-	  ATH_MSG_DEBUG ("Overlay TRTCalDbSvc2 gives radius: "<<radius<<", t0: "<<t0);                                                                
+	  ATH_MSG_DEBUG ("Overlay TRTCalDbTool2 gives radius: "<<radius<<", t0: "<<t0);                                                                
 	}   
       }
       double drifttime = rawtime-t0;
@@ -391,17 +389,17 @@ double TRT_DriftFunctionTool::errorOfDriftRadius(double drifttime, Identifier id
   if(m_force_universal_errors && m_uni_error!=0) return m_uni_error;
   bool founderr=true;
   bool foundslope=true;
-  double error = m_TRTCalDbSvc->driftError(drifttime,id,founderr);
-  double slope = m_TRTCalDbSvc->driftSlope(drifttime,id,foundslope);
+  double error = m_TRTCalDbTool->driftError(drifttime,id,founderr);
+  double slope = m_TRTCalDbTool->driftSlope(drifttime,id,foundslope);
   bool mcdigit = word & (1<<31);
   if (m_isoverlay && mcdigit ){
     //check if it's a MC digit, and if so apply other calibration
-    ATH_MSG_DEBUG ("Overlay TRTCalDbSvc gave error: "<<error<<", found="<<founderr);
-    error = m_TRTCalDbSvc2->driftError(drifttime,id,founderr);
-    ATH_MSG_DEBUG ("Overlay TRTCalDbSvc2 gives error: "<<error<<", found="<<founderr);
-    ATH_MSG_DEBUG ("Overlay TRTCalDbSvc gave slope: "<<slope<<", found="<<foundslope);
-    slope = m_TRTCalDbSvc2->driftSlope(drifttime,id,foundslope);
-    ATH_MSG_DEBUG ("Overlay TRTCalDbSvc2 gives slope: "<<slope<<", found="<<foundslope);
+    ATH_MSG_DEBUG ("Overlay TRTCalDbTool gave error: "<<error<<", found="<<founderr);
+    error = m_TRTCalDbTool2->driftError(drifttime,id,founderr);
+    ATH_MSG_DEBUG ("Overlay TRTCalDbTool2 gives error: "<<error<<", found="<<founderr);
+    ATH_MSG_DEBUG ("Overlay TRTCalDbTool gave slope: "<<slope<<", found="<<foundslope);
+    slope = m_TRTCalDbTool2->driftSlope(drifttime,id,foundslope);
+    ATH_MSG_DEBUG ("Overlay TRTCalDbTool2 gives slope: "<<slope<<", found="<<foundslope);
   }
 
   if(founderr && foundslope) {
@@ -459,21 +457,21 @@ void TRT_DriftFunctionTool::setupRtRelationData()
   //Setting up for data
   ATH_MSG_DEBUG(" Setting up for data ");
 
-  ATH_MSG_DEBUG(" Using TRTCalDbSvc ");
-  if ( m_TRTCalDbSvc.retrieve().isFailure() ) {
-    ATH_MSG_FATAL(m_TRTCalDbSvc.propertyName() <<
-		  ": Failed to retrieve service " << m_TRTCalDbSvc.type());
+  ATH_MSG_DEBUG(" Using TRTCalDbTool ");
+  if ( m_TRTCalDbTool.retrieve().isFailure() ) {
+    ATH_MSG_FATAL(m_TRTCalDbTool.propertyName() <<
+		  ": Failed to retrieve service " << m_TRTCalDbTool.type());
     return;
     
   } else {
-    ATH_MSG_DEBUG(m_TRTCalDbSvc.propertyName() <<
-		  ": Retrieved service " << m_TRTCalDbSvc.type());
+    ATH_MSG_DEBUG(m_TRTCalDbTool.propertyName() <<
+		  ": Retrieved service " << m_TRTCalDbTool.type());
   }
 
   if (m_isoverlay){
-    ATH_MSG_INFO("Using TRTCalDbSvc2 for overlay ! ");
-    if ( m_TRTCalDbSvc2.retrieve().isFailure() ) {
-      ATH_MSG_FATAL(m_TRTCalDbSvc2.propertyName() <<": Failed to retrieveservice " << m_TRTCalDbSvc2.type());
+    ATH_MSG_INFO("Using TRTCalDbTool2 for overlay ! ");
+    if ( m_TRTCalDbTool2.retrieve().isFailure() ) {
+      ATH_MSG_FATAL(m_TRTCalDbTool2.propertyName() <<": Failed to retrieveservice " << m_TRTCalDbTool2.type());
       return;
     }
   }
diff --git a/InnerDetector/InDetRecTools/TRT_ElectronPidTools/CMakeLists.txt b/InnerDetector/InDetRecTools/TRT_ElectronPidTools/CMakeLists.txt
index c164a70c58b8c76391588bb335c37d80f16ec5dd..7e01b33a1b078131f5d3845b6d13f0d002c22cfa 100644
--- a/InnerDetector/InDetRecTools/TRT_ElectronPidTools/CMakeLists.txt
+++ b/InnerDetector/InDetRecTools/TRT_ElectronPidTools/CMakeLists.txt
@@ -15,6 +15,7 @@ atlas_depends_on_subdirs( PUBLIC
                           InnerDetector/InDetRecTools/TRT_DriftFunctionTool
                           Tracking/TrkEvent/TrkEventPrimitives
                           Tracking/TrkTools/TrkToolInterfaces
+                          InnerDetector/InDetConditions/TRT_ConditionsData
                           PRIVATE
                           Control/StoreGate
                           DetectorDescription/Identifier
@@ -36,7 +37,7 @@ atlas_add_component( TRT_ElectronPidTools
                      src/*.cxx
                      src/components/*.cxx
                      INCLUDE_DIRS ${CORAL_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${CORAL_LIBRARIES} AthenaBaseComps AthenaPoolUtilities GaudiKernel TRT_ConditionsServicesLib InDetPrepRawData TrkEventPrimitives TrkToolInterfaces Identifier InDetIdentifier InDetRawData InDetRIO_OnTrack TrkSurfaces TrkMeasurementBase TrkParameters TrkRIO_OnTrack TrkTrack )
+                     LINK_LIBRARIES ${CORAL_LIBRARIES} AthenaBaseComps AthenaPoolUtilities GaudiKernel TRT_ConditionsServicesLib InDetPrepRawData TrkEventPrimitives TrkToolInterfaces Identifier InDetIdentifier InDetRawData InDetRIO_OnTrack TrkSurfaces TrkMeasurementBase TrkParameters TrkRIO_OnTrack TrkTrack TRT_ConditionsData)
 
 # Install files from the package:
 atlas_install_headers( TRT_ElectronPidTools )
diff --git a/InnerDetector/InDetRecTools/TRT_ElectronPidTools/TRT_ElectronPidTools/TRT_ElectronPidToolRun2.h b/InnerDetector/InDetRecTools/TRT_ElectronPidTools/TRT_ElectronPidTools/TRT_ElectronPidToolRun2.h
index 50696480bb4866bc1fe4f61eb6972bf27effeb5f..dad3c13029b90c9e16b5ec38f7b0e61ff27a719a 100644
--- a/InnerDetector/InDetRecTools/TRT_ElectronPidTools/TRT_ElectronPidTools/TRT_ElectronPidToolRun2.h
+++ b/InnerDetector/InDetRecTools/TRT_ElectronPidTools/TRT_ElectronPidTools/TRT_ElectronPidToolRun2.h
@@ -14,18 +14,17 @@
 #include "AthenaBaseComps/AthAlgTool.h"
 #include "GaudiKernel/ITHistSvc.h"
 #include "GaudiKernel/ToolHandle.h"
-#include "GaudiKernel/ServiceHandle.h"
-
+#include "StoreGate/ReadCondHandleKey.h"
 
 #include "TrkToolInterfaces/ITRT_ElectronPidTool.h"
 #include "TRT_ElectronPidTools/ITRT_ElectronToTTool.h"
+#include "TRT_ConditionsData/HTcalculator.h"
 #include "TrkEventPrimitives/ParticleHypothesis.h"
 
 #include "TRT_ElectronPidTools/ITRT_LocalOccupancy.h"
 
-#include "TRT_ConditionsServices/ITRT_StrawStatusSummarySvc.h"
+#include "TRT_ConditionsServices/ITRT_StrawStatusSummaryTool.h"
 
-//#include "TRT_ToT_Tools/ITRT_ToT_dEdx.h"
 
 #include <vector>
 #include <string>
@@ -39,12 +38,8 @@ namespace InDet{
 	class ITRT_LocalOccupancy;
 }
 
+class ITRT_StrawSummaryTool;
 
-// Troels (Sep 2014):
-class ITRT_StrawSummarySvc;
-
-
-//class IChronoStatSvc;
 class ITRT_ToT_dEdx;
 
 namespace Trk {
@@ -106,21 +101,10 @@ namespace InDet
     //double GetD(double R_track) const;
 
   private:
-    // Update of database entries.
-    StatusCode update( IOVSVC_CALLBACK_ARGS );        
-    //
-    /////////////////////////////////////////////////////////////////////////////////////////////////////
-    
-    /** Probability functions used in calculation */
-    // Also used extenally by the Atlfast simulation to get pHT:
-    //virtual double probHT(double momentum, Trk::ParticleHypothesis, int HitPart, double HitDepth, double TrkAnodeDist, double eta, double phi);
-    
-    // //possibly used by Atlfast in the future
-    //virtual double probToT(double momentum, Trk::ParticleHypothesis, int ToT, double TrkAnodeDist, double eta);
     
     bool m_DATA;
 
-    //Check valid TRT straw:
+      //Check valid TRT straw:
     bool CheckGeometry(int BEC, int Layer, int Strawlayer) const;
 
     //Turn the Bitpattern into a human readable string
@@ -130,28 +114,18 @@ namespace InDet
     int CountLTBitPattern(unsigned int bitpattern);
     int CountHTBitPattern(unsigned int bitpattern);
 
-    //    IChronoStatSvc  *m_timingProfile;
-
- 
+    double inline sqr(double a) {return a*a;} 
 
     const TRT_ID*              m_trtId;               // TRT ID helper (identifying barrel/wheels and global position)
     const InDetDD::TRT_DetectorManager* m_TRTdetMgr;  // TRT detector manager (to get ID helper)
-    // StoreGateSvc*              p_detstore;            // Detector store.
     Trk::ParticleMasses        m_particlemasses;      // Particle masses. (initalized in default constructor)
     unsigned int               m_minTRThits;          // Minimum number of TRT hits to give PID.
     bool                       m_OccupancyUsedInPID;   // DEPRECATED!!!
 
-    public:
-     class HTcalculator;
-    private:
-     HTcalculator & m_HTcalc;
-
-    public:
-     class StorePIDinfo;
-
     ToolHandle<ITRT_ToT_dEdx> m_TRTdEdxTool;     //!< the track selector tool
     ToolHandle<InDet::ITRT_LocalOccupancy> m_LocalOccTool;     //!< the track selector tool
-    ServiceHandle<ITRT_StrawStatusSummarySvc> m_TRTStrawSummarySvc;
+    ToolHandle<ITRT_StrawStatusSummaryTool> m_TRTStrawSummaryTool;
+    SG::ReadCondHandleKey<HTcalculator> m_HTReadKey{this,"HTcalculator","HTcalculator","HTcalculator in-key"};
 
    }; 
 } // end of namespace
diff --git a/InnerDetector/InDetRecTools/TRT_ElectronPidTools/TRT_ElectronPidTools/TRT_ElectronPidToolRun2_HTcalculation.h b/InnerDetector/InDetRecTools/TRT_ElectronPidTools/TRT_ElectronPidTools/TRT_ElectronPidToolRun2_HTcalculation.h
deleted file mode 100644
index a539b3d62c9984be4fb6d5844592a3dbf82455df..0000000000000000000000000000000000000000
--- a/InnerDetector/InDetRecTools/TRT_ElectronPidTools/TRT_ElectronPidTools/TRT_ElectronPidToolRun2_HTcalculation.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-///////////////////////////////////////////////////////////////////
-// TRT_ElectronPidToolRun2_HTcalculation.h, (c) ATLAS Detector software
-///////////////////////////////////////////////////////////////////
-
-/****************************************************************************************\
-
-  This class is only instantiated once in the constuctor of the Pid Tool.
-  It was created in order to encapsulate the code that is used for 
-  the HT calulation that forms part of the Pid Tool.
-  It is not true singleton as this was deemed unnecessary.
-
-  Original creator: Simon Heisterkamp (simon.heisterkamp@cern.ch)
-  Author: Troels Petersen (petersen@nbi.dk)
-
-\****************************************************************************************/
-#include "AthenaPoolUtilities/CondAttrListVec.h"
-#include "AthenaKernel/MsgStreamMember.h"
-#include <vector>
-
-class InDet::TRT_ElectronPidToolRun2::StorePIDinfo{
-  public:
-   StorePIDinfo();
-   StorePIDinfo(int nbins, float min, float max, std::vector<float> values);
-   ~StorePIDinfo();
-   void update (int nbins, float min, float max, std::vector<float> values );
-   void push_back ( float value );
-   StatusCode check ( int gas, int detpart); 
-   float GetValue ( float input	); 
-   float GetBinValue ( int bin ); 
-   int   GetBin   ( float input	); 
-  private:
-   unsigned int m_nbins		;
-   float m_min		;
-   float m_max		;
-   std::vector<float>  	m_values;
-};
-
-
-class InDet::TRT_ElectronPidToolRun2::HTcalculator : public InDet::BaseTRTPIDCalculator {
- public:
-
-  static const int my_CurrentVersion = 4;
-
-  HTcalculator(AthAlgTool&);
-  virtual ~HTcalculator();
-  
-  // set constants to hard coded defaults
-  void setDefaultCalibrationConstants();
-
-  StatusCode ReadVectorDB( const DataHandle<CondAttrListVec> channel_values );
-
-  //void PrintBlob();
-  //bool FillBlob(const unsigned char*);
-
-  float getProbHT( float pTrk, Trk::ParticleHypothesis hypothesis, int TrtPart, int GasType, int StrawLayer, float ZR, float rTrkAnode, float Occupancy, bool hasTrackPars);
-//  float pHTvsP(int TrtPart, float p, float mass);
-  float pHTvsPGOG(int TrtPart, int GasType, float p, float mass, float occ);
-
-  MsgStream& msg (MSG::Level lvl) const { return m_msg << lvl; }
-  bool msgLvl (MSG::Level lvl)    { return m_msg.get().level() <= lvl; }
-
- private:
-  // as long has reading from database does not work well yet, do this check:
-  //bool HasDataBeenInitialized;
-  //void checkIntialization();
-
-  double inline sqr(double a) {return a*a;}
-
-  static const int N_GAS = 3;
-  static const int N_DET = 3;
-  static const int N_PAR2 = 10;
-  StorePIDinfo m_par_pHTvsPGOG_new [N_GAS][N_DET]; 	// New approach (useOccupancy = true)
-
-
-// Store in a compact way all the corrections
-  StorePIDinfo m_CpHT_B_Zee_SL_new  	[N_GAS]	[N_DET];
-  StorePIDinfo m_CpHT_B_Zmm_SL_new  	[N_GAS]	[N_DET];
-
-  StorePIDinfo m_CpHT_B_Zee_ZR_new  	[N_GAS]	[N_DET];
-  StorePIDinfo m_CpHT_B_Zmm_ZR_new  	[N_GAS]	[N_DET];
-
-  StorePIDinfo m_CpHT_B_Zee_TW_new  	[N_GAS]	[N_DET];
-  StorePIDinfo m_CpHT_B_Zmm_TW_new  	[N_GAS]	[N_DET];
-
-  StorePIDinfo m_CpHT_B_Zee_OR_new  	[N_GAS]	[N_DET];
-  StorePIDinfo m_CpHT_B_Zmm_OR_new  	[N_GAS]	[N_DET];
-
-
-  Trk::ParticleMasses        m_particlemasses;
-
-  static const int SIZE_OF_HEADER = sizeof(float) * 4;
-  static const int SIZE_OF_BLOB     = sizeof(float) *( (N_PAR2*N_DET));
-
-  bool m_datainplace;
-
-  mutable Athena::MsgStreamMember m_msg;
-};  
diff --git a/InnerDetector/InDetRecTools/TRT_ElectronPidTools/TRT_ElectronPidTools/TRT_LocalOccupancy.h b/InnerDetector/InDetRecTools/TRT_ElectronPidTools/TRT_ElectronPidTools/TRT_LocalOccupancy.h
index 635e72a6687317468e88d38e5dd77e4c90978b15..a6d904a2084f49338c17223988fb11025e4c8c8c 100644
--- a/InnerDetector/InDetRecTools/TRT_ElectronPidTools/TRT_ElectronPidTools/TRT_LocalOccupancy.h
+++ b/InnerDetector/InDetRecTools/TRT_ElectronPidTools/TRT_ElectronPidTools/TRT_LocalOccupancy.h
@@ -15,21 +15,20 @@
 #include "GaudiKernel/ToolHandle.h"
 
 #include "TrkTrack/Track.h"
-#include "TRT_ConditionsServices/ITRT_StrawStatusSummarySvc.h"
+#include "TRT_ConditionsServices/ITRT_CalDbTool.h"
+#include "TRT_ConditionsServices/ITRT_StrawStatusSummaryTool.h"
 
 #include "InDetPrepRawData/TRT_DriftCircleContainer.h"
-#include "TRT_DriftFunctionTool/ITRT_DriftFunctionTool.h"
 #include "SGTools/CLASS_DEF.h"
 
 #include "StoreGate/ReadHandleKey.h"
+#include "StoreGate/ReadCondHandleKey.h"
 #include "InDetRawData/TRT_RDO_Container.h"
-
+#include "TRT_ConditionsData/AliveStraws.h"
 #include <vector>
 
 class AtlasDetectorID;
-class ITRT_StrawStatusSummarySvc ;
 class TRT_ID;
-class ITRT_DriftFunctionTool;
 
 namespace Trk{
 	class Track;
@@ -115,10 +114,11 @@ namespace InDet
 
    /** External tools:  */
    const TRT_ID *m_TRTHelper;
+   ToolHandle< ITRT_CalDbTool > m_CalDbTool; //!< CalDbTool
+   ToolHandle< ITRT_StrawStatusSummaryTool > m_StrawStatusSummaryTool; //!< StrawStatusSummaryTool   
    SG::ReadHandleKey<TRT_RDO_Container> m_trt_rdo_location{ this, "TRT_RDOContainerName", "TRT_RDOs", "m_trt_rdo_location" };
    SG::ReadHandleKey<TRT_DriftCircleContainer> m_trt_driftcircles{ this, "TRT_DriftCircleCollection", "TRT_DriftCircles", "m_trt_driftcircles" };
-   ServiceHandle<ITRT_StrawStatusSummarySvc> m_TRTStrawStatusSummarySvc;
-   ToolHandle< ITRT_DriftFunctionTool > m_driftFunctionTool; //!< DriftFunctionTool
+   SG::ReadCondHandleKey<TRTCond::AliveStraws> m_strawReadKey{this,"AliveStraws","AliveStraws","AliveStraws in-key"};
 
    bool m_isTrigger;
    bool m_T0Shift; // choice to use T0shift or not
diff --git a/InnerDetector/InDetRecTools/TRT_ElectronPidTools/src/TRT_ElectronPidToolRun2.cxx b/InnerDetector/InDetRecTools/TRT_ElectronPidTools/src/TRT_ElectronPidToolRun2.cxx
index 3fbdb6abfd9fb217616ad45319c7bb1cb40342c6..e859139b26b57be2f25799ef3469145de2ffe632 100644
--- a/InnerDetector/InDetRecTools/TRT_ElectronPidTools/src/TRT_ElectronPidToolRun2.cxx
+++ b/InnerDetector/InDetRecTools/TRT_ElectronPidTools/src/TRT_ElectronPidToolRun2.cxx
@@ -1,514 +1,480 @@
+
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
-///////////////////////////////////////////////////////////////////
-// TRT_ElectronPidToolRun2.cxx, (c) ATLAS Detector software
-///////////////////////////////////////////////////////////////////
-
-
-#include "TRT_ElectronPidTools/BaseTRTPIDCalculator.h"
-#include "TRT_ElectronPidTools/TRT_ElectronPidToolRun2.h"
-#include "TRT_ElectronPidTools/TRT_ElectronPidToolRun2_HTcalculation.h"
-
-// StoreGate, Athena, and Database stuff:
-#include "Identifier/Identifier.h"
-#include "AthenaPoolUtilities/CondAttrListCollection.h"
-#include "AthenaPoolUtilities/AthenaAttributeList.h"
-#include "CoralBase/AttributeListSpecification.h"
-#include "CoralBase/Blob.h"
-#include "AthenaPoolUtilities/CondAttrListVec.h"
-// Tracking:
-#include "TrkTrack/Track.h"
-#include "TrkTrack/TrackStateOnSurface.h"
-#include "TrkMeasurementBase/MeasurementBase.h"
-#include "TrkRIO_OnTrack/RIO_OnTrack.h"
-#include "TrkParameters/TrackParameters.h"
-#include "TrkSurfaces/Surface.h"
-#include "TrkTrack/TrackInfo.h"
-
-// Drift circles and TRT identifiers:
-#include "InDetRIO_OnTrack/TRT_DriftCircleOnTrack.h"
-#include "InDetIdentifier/TRT_ID.h"
-
-// ToT Tool Interface
-#include "TRT_ToT_Tools/ITRT_ToT_dEdx.h"
-
-// Particle masses
-
-// Math functions:
-#include <cmath>
-
-//STL includes
-#include <sstream>
-
-//#define TRTDBG ATH_MSG_INFO("To line "<<__LINE__);
-//#define TRTDBG 0;
-
-#include "TRT_ElectronPidToolRun2_HTcalculation.cxx"
-
-
-/*****************************************************************************\
-|*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*|
-|*%%%  PID Tool Constructor  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*|
-|*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*|
-\*****************************************************************************/
-
-InDet::TRT_ElectronPidToolRun2::TRT_ElectronPidToolRun2(const std::string& t, const std::string& n, const IInterface* p )
-  :
-  AthAlgTool(t,n,p),
-  m_trtId(nullptr),
-  m_TRTdetMgr(nullptr),
-  m_minTRThits(5),
-  m_HTcalc(*(new HTcalculator(*this))),
-  m_TRTdEdxTool("TRT_ToT_dEdx"),
-  m_LocalOccTool(),
-  m_TRTStrawSummarySvc("InDetTRTStrawStatusSummarySvc",n)
-{
-  declareInterface<ITRT_ElectronPidTool>(this);
-  declareInterface<ITRT_ElectronToTTool>(this);
-  declareProperty("MinimumTRThitsForIDpid", m_minTRThits);
-  declareProperty("TRT_ToT_dEdx_Tool", m_TRTdEdxTool);
-  declareProperty("TRT_LocalOccupancyTool", m_LocalOccTool);
-  declareProperty("isData", m_DATA = true);
-  declareProperty("TRTStrawSummarySvc",    m_TRTStrawSummarySvc);
-  declareProperty("OccupancyUsedInPID", m_OccupancyUsedInPID=true);
-}
-
-
-/*****************************************************************************\
-|*%%%  PID Tool Destructor  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*|
-\*****************************************************************************/
-
-InDet::TRT_ElectronPidToolRun2::~TRT_ElectronPidToolRun2()
-{
-  delete &m_HTcalc;
-}
-
-/*****************************************************************************\
-|*%%%  Initialisation  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*|
-\*****************************************************************************/
-
-StatusCode InDet::TRT_ElectronPidToolRun2::initialize()
-{
-  StatusCode sc = AthAlgTool::initialize();
-  if (sc.isFailure()) return sc;
-
-  // Get the TRT Identifier-helper:
-  CHECK (detStore()->retrieve(m_trtId, "TRT_ID"));
-
-  // Register callback function for cache updates - HT:
-  const DataHandle<CondAttrListVec> aptr;;
-  if (StatusCode::SUCCESS == detStore()->regFcn(&InDet::TRT_ElectronPidToolRun2::update,this, aptr, "/TRT/Calib/PID_vector" )) {
-    ATH_MSG_DEBUG ("Registered callback for TRT_ElectronPidToolRun2 - HT.");
-  } else {
-    ATH_MSG_ERROR ("Callback registration failed for TRT_ElectronPidToolRun2 - HT! ");
-  }
-
-  /* Get the TRT_ToT_dEdx tool */
-  CHECK( m_TRTdEdxTool.retrieve() );
-
-  CHECK( m_LocalOccTool.retrieve() );
-
-  CHECK( m_TRTStrawSummarySvc.retrieve() );
-  if ( !m_TRTStrawSummarySvc.empty()) ATH_MSG_INFO( "Retrieved tool " << m_TRTStrawSummarySvc);
-
-  ATH_MSG_INFO ("initialize() successful in " << name());
-  return StatusCode::SUCCESS;
-}
-
-
-
-/*****************************************************************************\
-|*%%%  Finalisation  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*|
-\*****************************************************************************/
-
-StatusCode InDet::TRT_ElectronPidToolRun2::finalize()
-{
-  return AthAlgTool::finalize();
-}
-
-/* Jared - remove ToTcalc
-double InDet::TRT_ElectronPidToolRun2::GetD(double R_Track)const {
-  R_Track=fabs(R_Track);
-  if(R_Track>2.) return 0;
-  return 2. * sqrt( 4. - R_Track * R_Track );
-}
-
-double InDet::TRT_ElectronPidToolRun2::GetToT(unsigned int bitpattern, double HitZ, double HitR, int BEC, int Layer, int Strawlayer)const {
-  return -999.99; //ToTcalc.GetToT( bitpattern, HitZ, HitR, BEC, Layer, Strawlayer);
-}
-*/
-
-// Kept for backward compatibility.
-// See TRT_ElectronPidTools-01-00-28 for the full (commented) code.
-std::vector<float> InDet::TRT_ElectronPidToolRun2::electronProbability_old(const Trk::Track& track)
-{
-  // Simply return values without calculation
-  std::vector<float> PIDvalues(4);
-  PIDvalues[0] = 0.5;
-  PIDvalues[1] = 0.5;
-  PIDvalues[2] = 0.0;
-  PIDvalues[3] = 0.5;
-  const Trk::TrackParameters* perigee = track.perigeeParameters();
-  if (!perigee) { return PIDvalues; }
-  return PIDvalues;
-}
-
-
-/*****************************************************************************\
-|*%%%  electronProbability - The interface method during reconstruction  %%%%*|
-\*****************************************************************************/
-
-std::vector<float>
-InDet::TRT_ElectronPidToolRun2::electronProbability(const Trk::Track& track) const {
-
-  //ATH_MSG_INFO("started electronProbabaility");
-  //Initialize the return vector
-  std::vector<float> PIDvalues(5);
-  float & prob_El_Comb      = PIDvalues[0] = 0.5;
-  float & prob_El_HT        = PIDvalues[1] = 0.5;
-  float & prob_El_ToT       = PIDvalues[2] = 0.5;
-  float & prob_El_Brem      = PIDvalues[3] = 0.5;
-  float & occ_local         = PIDvalues[4] = 0.0;
-
-  //  float & dEdx              = PIDvalues[2] = 0.0;
-  float dEdx = 0.0;
-
-  // Check for perigee:
-  const Trk::TrackParameters* perigee = track.perigeeParameters();
-  if (!perigee) return PIDvalues;
-
-  // Get parameters at perigee and check that they are reasonable:
-  const Amg::VectorX& parameterVector = perigee->parameters();
-  double qOverP = parameterVector[Trk::qOverP];
-  double theta  = parameterVector[Trk::theta];
-  double phi    = parameterVector[Trk::phi];
-
-  // Check the parameters are reasonable:
-  if (tan(theta/2.0) < 0.0001) {
-    ATH_MSG_DEBUG ("  Track has negative theta or is VERY close to beampipe! (tan(theta/2) < 0.0001). Returning default Pid values.");
-    return PIDvalues;
-  }
-
-  if (qOverP == 0.0) {
-    ATH_MSG_DEBUG ("  Track momentum infinite! (i.e. q/p = 0). Returning default Pid values.");
-    return PIDvalues;
-  }
-
-  double pTrk = fabs(1.0 / qOverP);
-  double pT   = pTrk * sin(theta);
-  double eta  = -log(tan(theta/2.0));
-
-  // Check the tool to get the local occupancy (i.e. for the track in question):
-  occ_local = m_LocalOccTool->LocalOccupancy(track);
-
-  ATH_MSG_DEBUG ("");
-  ATH_MSG_DEBUG ("");
-  ATH_MSG_DEBUG ("check---------------------------------------------------------------------------------------");
-  ATH_MSG_DEBUG ("check  Got track:   pT: " << pT << "   eta: " << eta << "   phi: " << phi);
-  ATH_MSG_DEBUG ("check---------------------------------------------------------------------------------------");
- 
-  // Jared - Development Output... 
-  /*
-  std::cout << "check---------------------------------------------------------------------------------------" << std::endl;
-  std::cout << "check  Got track:   pT: " << pT << "   eta: " << eta << "   phi: " << phi << std::endl;
-  std::cout << "check---------------------------------------------------------------------------------------" << std::endl;
-  */
-
-  // For calculation of HT probability:
-  double pHTel_prod = 1.0;
-  double pHTpi_prod = 1.0;
-
-  // ------------------------------------------------------------------------------------
-  // Loop over TRT hits on track, and calculate HT and R-ToT probability:
-  // ------------------------------------------------------------------------------------
-
-  unsigned int nTRThits     = 0;
-  unsigned int nTRThitsHTMB = 0;
-
-  // Check for track states:
-  const DataVector<const Trk::TrackStateOnSurface>* recoTrackStates = track.trackStateOnSurfaces();
-  if (not recoTrackStates) {
-    ATH_MSG_DEBUG("track.trackStateOnSurfaces() was zero");
-    //m_timingProfile->chronoStop("Tool::electronProb");
-    return PIDvalues;
-  }
-
-  DataVector<const Trk::TrackStateOnSurface>::const_iterator tsosIter    = recoTrackStates->begin();
-  DataVector<const Trk::TrackStateOnSurface>::const_iterator tsosIterEnd = recoTrackStates->end();
-
-  // Loop over track states on surfaces (i.e. generalized hits):
-  for ( ; tsosIter != tsosIterEnd; ++tsosIter) {
-
-    const Trk::MeasurementBase *measurement = (*tsosIter)->measurementOnTrack();
-    if (!measurement) continue;
-
-    // Get drift circle (ensures that hit is from TRT):
-    const InDet::TRT_DriftCircleOnTrack *driftcircle = dynamic_cast<const InDet::TRT_DriftCircleOnTrack*>(measurement);
-    if (!driftcircle) continue;
-
-    // From now (May 2015) onwards, we ONLY USE MIDDLE HT BIT:
-    bool isHTMB  = ((driftcircle->prepRawData()->getWord() & 0x00020000) > 0) ? true : false; 
-
-    nTRThits++;
-    if (isHTMB) nTRThitsHTMB++;
-
-
-    // ------------------------------------------------------------------------------------
-    // Get the necessary input for the probability calculations:
-    // ------------------------------------------------------------------------------------
-    Identifier DCid = driftcircle->identify();
-
-    // Part of TRT hit belongs to (TrtPart = 0: Barrel, 1: EndcapA, 2: EndcapB).
-    int TrtPart = 0;                      // 0: Barrel, 1: EndcapA, 2: EndcapB
-    if (abs(m_trtId->barrel_ec(DCid)) == 2)
-      TrtPart = (m_trtId->layer_or_wheel(DCid) < 6) ? 1 : 2;
-
-    // Get Straw Layer (Barrel: 0-72, EndcapA: 0-95 (16 layers in 6 modules), EndcapB: 0-63 (8 layers in 8 modules)):
-    int StrawLayer = 0;
-    if (TrtPart == 0) {
-      // Barrel:
-      if      (m_trtId->layer_or_wheel(DCid) == 0) StrawLayer = m_trtId->straw_layer(DCid);
-      else if (m_trtId->layer_or_wheel(DCid) == 1) StrawLayer = 19 + m_trtId->straw_layer(DCid);
-      else                                         StrawLayer = 19 + 24 + m_trtId->straw_layer(DCid);
-    } else {
-      // Endcap:
-      if (m_trtId->layer_or_wheel(DCid) < 6) StrawLayer = 16*m_trtId->layer_or_wheel(DCid) + m_trtId->straw_layer(DCid);
-      else                                   StrawLayer = 8*(m_trtId->layer_or_wheel(DCid)-6) + m_trtId->straw_layer(DCid);
-    }
-
-    // Get Z (Barrel) or R (Endcap) location of the hit, and distance from track to wire (i.e. anode) in straw:
-    double HitZ, HitR, rTrkWire;
-    bool hasTrackParameters= true; // Keep track of this for HT prob calculation
-    if ((*tsosIter)->trackParameters()) {
-      // If we have precise information (from hit), get that:
-      const Amg::Vector3D& gp = driftcircle->globalPosition();
-      HitR = gp.perp();
-      HitZ = gp.z();
-      rTrkWire = fabs((*tsosIter)->trackParameters()->parameters()[Trk::driftRadius]);
-    } else {
-      // Otherwise just use the straw coordinates:
-      hasTrackParameters = false; // Jared - pass this to HT calculation
-      HitZ = driftcircle->associatedSurface().center().z();
-      HitR = driftcircle->associatedSurface().center().perp();
-      rTrkWire = 0;
-    }
-
-
-    // ------------------------------------------------------------------------------------
-    // Collection and checks of input variables for HT probability calculation:
-    // ------------------------------------------------------------------------------------
-
-    int SL_max[3] = {73, 96, 64};
-    if (StrawLayer > SL_max[TrtPart]  ||  StrawLayer < 0) {
-      ATH_MSG_WARNING("  StrawLayer was outside allowed range!  TrtPart = " << TrtPart << "  SL = " << StrawLayer);
-      continue;
-    }
-
-    double ZRpos[3] = {fabs(HitZ), HitR, HitR};
-    double ZRpos_min[3] = {  0.0,  630.0,  630.0};
-    double ZRpos_max[3] = {720.0, 1030.0, 1030.0};
-    if (ZRpos[TrtPart] > ZRpos_max[TrtPart]) {
-      ATH_MSG_WARNING("  ZRpos was above allowed range - adjusted!  TrtPart = " << TrtPart << "  ZRpos = " << ZRpos[TrtPart]);
-      ZRpos[TrtPart] = ZRpos_max[TrtPart] - 0.001;
-    }
-    if (ZRpos[TrtPart] < ZRpos_min[TrtPart]) {
-      ATH_MSG_WARNING("  ZRpos was below allowed range - adjusted!  TrtPart = " << TrtPart << "  ZRpos = " << ZRpos[TrtPart]);
-      ZRpos[TrtPart] = ZRpos_min[TrtPart] + 0.001;
-    }
-
-    if (rTrkWire > 2.2) rTrkWire = 2.175;   // Happens once in a while - no need for warning!
-
-    if (occ_local > 1.0  ||  occ_local < 0.0) {
-      ATH_MSG_WARNING("  Occupancy was outside allowed range!  TrtPart = " << TrtPart << "  Occupancy = " << occ_local);
-      continue;
-    }
-
-    // ------------------------------------------------------------------------------------
-    // Calculate the HT probability:
-    // ------------------------------------------------------------------------------------
-
-    // getStatusHT returns enum {Undefined, Dead, Good, Xenon, Argon, Krypton, EmulatedArgon, EmulatedKrypton}.
-    // Our representation of 'GasType' is 0:Xenon, 1:Argon, 2:Krypton
-    int GasType=0; // Xenon is default
-    if (!m_TRTStrawSummarySvc.empty()) {
-      int stat = m_TRTStrawSummarySvc->getStatusHT(DCid);
-      if       ( stat==2 || stat==3 ) { GasType = 0; } // Xe
-      else if  ( stat==1 || stat==4 ) { GasType = 1; } // Ar
-      else if  ( stat==5 )            { GasType = 1; } // Kr -- ESTIMATED AS AR UNTIL PID IS TUNED TO HANDLE KR
-      else if  ( stat==6 )            { GasType = 1; } // Emulated Ar
-      else if  ( stat==7 )            { GasType = 1; } // Emulated Kr -- ESTIMATED AS AR UNTIL PID IS TUNED TO HANDLE KR
-      else { ATH_MSG_FATAL ("getStatusHT = " << stat << ", must be 'Good(2)||Xenon(3)' or 'Dead(1)||Argon(4)' or 'Krypton(5)' or 'EmulatedArgon(6)' or 'EmulatedKr(7)'!");
-             throw std::exception();
-           }
-    }
-
-    ATH_MSG_DEBUG ("check Hit: " << nTRThits << "  TrtPart: " << TrtPart << "  GasType: " << GasType << "  SL: " << StrawLayer
-             << "  ZRpos: " << ZRpos[TrtPart] << "  TWdist: " << rTrkWire << "  Occ_Local: " << occ_local << "  HTMB: " << isHTMB );
-
-
-    // Jared - Development Output... 
-    /*
-    std::cout << "check Hit: " << nTRThits << "  TrtPart: " << TrtPart << "  GasType: " << GasType << "  SL: " << StrawLayer
-             << "  ZRpos: " << ZRpos[TrtPart] << "  TWdist: " << rTrkWire << "  Occ_Local: " << occ_local 
-            << "  HTMB: " << isHTMB << std::endl;
-            */
-
-    // Then call pHT functions with these values:
-    // ------------------------------------------
-    double pHTel = m_HTcalc.getProbHT( pTrk, Trk::electron, TrtPart, GasType, StrawLayer, ZRpos[TrtPart], rTrkWire, occ_local, hasTrackParameters);
-    double pHTpi = m_HTcalc.getProbHT( pTrk, Trk::pion,     TrtPart, GasType, StrawLayer, ZRpos[TrtPart], rTrkWire, occ_local, hasTrackParameters);
-
-    if (pHTel > 0.999 || pHTpi > 0.999 || pHTel < 0.001 || pHTpi < 0.001) {
-      ATH_MSG_DEBUG("  pHT outside allowed range!  pHTel = " << pHTel << "  pHTpi = " << pHTpi << "     TrtPart: " << TrtPart << "  SL: " << StrawLayer << "  ZRpos: " << ZRpos[TrtPart] << "  TWdist: " << rTrkWire << "  Occ_Local: " << occ_local);
-      continue;
-    }
-
-    if (pHTel > 0.80 || pHTpi > 0.50 || pHTel < 0.025 || pHTpi < 0.010) {
-      ATH_MSG_DEBUG("  pHT has abnormal value!  pHTel = " << pHTel << "  pHTpi = " << pHTpi << "     TrtPart: " << TrtPart << "  SL: " << StrawLayer << "  ZRpos: " << ZRpos[TrtPart] << "  TWdist: " << rTrkWire << "  Occ_Local: " << occ_local);
-      continue;
-    }
-
-    // From now (May 2015) onwards, we ONLY USE MIDDLE HT BIT:
-    if (isHTMB) {pHTel_prod *=     pHTel;  pHTpi_prod *=     pHTpi;}
-    else        {pHTel_prod *= 1.0-pHTel;  pHTpi_prod *= 1.0-pHTpi;}
-    ATH_MSG_DEBUG ("check         pHT(el): " << pHTel << "  pHT(pi): " << pHTpi );
-    
-    // Jared - Development Output... 
-    //std::cout << "check         pHT(el): " << pHTel << "  pHT(pi): " << pHTpi << std::endl;
-
-  }//of loop over hits
-
-
-  // If number of hits is adequate (default is 5 hits), calculate HT and ToT probability.
-  if (not (nTRThits >= m_minTRThits)) return PIDvalues;
-
-  // Calculate electron probability (HT)
-  prob_El_HT = pHTel_prod / (pHTel_prod + pHTpi_prod);
-
-  ATH_MSG_DEBUG ("check---------------------------------------------------------------------------------------");
-  ATH_MSG_DEBUG ("check  nTRThits: " << nTRThits << "  : " << nTRThitsHTMB << "  pHTel_prod: " << pHTel_prod << "  pHTpi_prod: " << pHTpi_prod << "  probEl: " << prob_El_HT);
-  ATH_MSG_DEBUG ("check---------------------------------------------------------------------------------------");
-  ATH_MSG_DEBUG ("");
-  ATH_MSG_DEBUG ("");
-    
-  // Jared - Development Output... 
-  /*
-  std::cout << "check---------------------------------------------------------------------------------------" << std::endl;
-  std::cout << "check  nTRThits: " << nTRThits << "  : " << nTRThitsHTMB << "  pHTel_prod: " << pHTel_prod << "  pHTpi_prod: " << pHTpi_prod << "  probEl: " << prob_El_HT << std::endl;
-  std::cout << "check---------------------------------------------------------------------------------------" << std::endl;
-  std::cout << std::endl << std::endl;
-  */
-
-  // Jared - ToT Implementation
-  dEdx = m_TRTdEdxTool->dEdx( &track, true, false, true); // Divide by L, exclude HT hits 
-  double usedHits = m_TRTdEdxTool->usedHits( &track, true, false);
-  prob_El_ToT = m_TRTdEdxTool->getTest( dEdx, pTrk, Trk::electron, Trk::pion, usedHits, true ); 
-  
-  // Limit the probability values the upper and lower limits that are given/trusted for each part:
-  double limProbHT = m_HTcalc.Limit(prob_El_HT); 
-  double limProbToT = m_HTcalc.Limit(prob_El_ToT); 
-  
-  // Calculate the combined probability, assuming no correlations (none are expected).
-  prob_El_Comb = (limProbHT * limProbToT ) / ( (limProbHT * limProbToT) + ( (1.0-limProbHT) * (1.0-limProbToT)) );
-  
-  // Troels: VERY NASTY NAMING, BUT AGREED UPON FOR NOW (for debugging, 27. NOV. 2014):
-  prob_El_Brem = pHTel_prod; // decorates electron LH to el brem for now... (still used?) 
-
-  //std::cout << "Prob_HT = " << prob_El_HT << "   Prob_ToT = " << prob_El_ToT << "   Prob_Comb = " << prob_El_Comb << std::endl;
-     
-  return PIDvalues;  
-}
-
-/* ----------------------------------------------------------------------------------- */
-// Callback function to update constants from database: 
-/* ----------------------------------------------------------------------------------- */
-
-StatusCode InDet::TRT_ElectronPidToolRun2::update( IOVSVC_CALLBACK_ARGS_P(I,keys) ) {
-
-  ATH_MSG_DEBUG ("Updating constants for the TRT_ElectronPidToolRun2! ");
-
-  // Callback function to update HT onset parameter cache when condDB data changes:
-  for(std::list<std::string>::const_iterator key=keys.begin(); key != keys.end(); ++key)
-    ATH_MSG_DEBUG("IOVCALLBACK for key " << *key << " number " << I);
-
-	// NEW reading from DB
-  StatusCode sc = StatusCode::SUCCESS;
-  ATH_MSG_INFO("HT Calculator : Reading vector format");
-
-  const DataHandle<CondAttrListVec> channel_values;
-  if (StatusCode::SUCCESS == detStore()->retrieve(channel_values, "/TRT/Calib/PID_vector" )){
-        sc = m_HTcalc.ReadVectorDB(        channel_values  );
-  } else {
-        ATH_MSG_ERROR ("Problem reading condDB object. HT Calculator.");
-  }
-
-  return sc;
-}
-
-/*****************************************************************************\
-|*%%%  TRT straw address check, done once per hit.  %%%%%%%%%%%%%%%%%%%%%%%%%*|
-|*%%%  Nowhere else are these numbers checked. If this is deemed  %%%%%%%%%%%*|
-|*%%%  unnecessary it can be taken out by simply letting the function %%%%%%%*|
-|*%%%  return true every time  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*|
-\*****************************************************************************/
-
-bool InDet::TRT_ElectronPidToolRun2::CheckGeometry(int BEC, int Layer, int StrawLayer) const {
-
-  //first check that the BEC is valid:
-  if(not ( BEC==-2 || BEC ==-1 || BEC==1 || BEC==2)){
-    ATH_MSG_ERROR("Found a wrong TRT part: "<<BEC<<" expected one of (-2,-1,1,2)");
-    return false;
-  }
-  const int part = abs(BEC)-1;
-
-  //next check that the layer is valid
-  if( Layer < 0){
-    ATH_MSG_ERROR("Found a negative TRT Layer");
-    return false; //must be positive
-  }
-  
-  static const int nlayers[2]={3,14};
-  
-  if( not ( Layer < nlayers[part] ) ){
-    ATH_MSG_ERROR("Found TRT Layer index "<<Layer<<" in part "<<BEC<<" but part only has "<<nlayers[part]<<" layers.");
-    return false;
-  }
-
-  //and finally check that the StrawLayer is valid:
-  if( StrawLayer < 0){
-    ATH_MSG_ERROR("Found a negative TRT StrawLayer");
-    return false; //must be positive
-  }
-  
-  static const int strawsPerBEC[2][14]={{19,24,30, 0, 0, 0,0,0,0,0,0,0,0,0},
-                                        {16,16,16,16,16,16,8,8,8,8,8,8,8,8}};
-  
-  if(not(StrawLayer < strawsPerBEC[part][Layer])){
-    ATH_MSG_ERROR("TRT part "<<BEC<<" Layer "<<Layer<<" only has "<<strawsPerBEC[part][Layer]<<" straws. Found index "<<StrawLayer);
-    return false;
-  }
-  
-  return true;
-}
-
-/*****************************************************************************\
-|*%%%  Auxiliary function to return the HT probability to Atlfast  %%%%%%%%%%*|
-|*%%%  a geometry check is performed every time here  %%%%%%%%%%%%%%%%%%%%%%%*|
-\*****************************************************************************/
-
-double InDet::TRT_ElectronPidToolRun2::probHT( const double /*pTrk*/, const Trk::ParticleHypothesis /*hypothesis*/, const int HitPart, const int Layer, const int StrawLayer) const {
-  if (not CheckGeometry(HitPart,Layer,StrawLayer) ){
-    ATH_MSG_ERROR("TRT geometry fail. Returning default value.");
-    return 0.5;
-  }
-  //return m_HTcalc.getProbHT(pTrk, hypothesis, HitPart, Layer, StrawLayer);
-  // FIXME
-  return 1.0;//m_HTcalc.getProbHT(pTrk, hypothesis, HitPart, Layer, StrawLayer);
-}
-
-
-double InDet::TRT_ElectronPidToolRun2::probHTRun2( float pTrk, Trk::ParticleHypothesis hypothesis, int TrtPart, int GasType, int StrawLayer, float ZR, float rTrkWire, float Occupancy ) const {
-   return m_HTcalc.getProbHT( pTrk, hypothesis, TrtPart, GasType, StrawLayer, ZR, rTrkWire, Occupancy );
-}
+///////////////////////////////////////////////////////////////////
+// TRT_ElectronPidToolRun2.cxx, (c) ATLAS Detector software
+///////////////////////////////////////////////////////////////////
+
+
+#include "TRT_ElectronPidTools/BaseTRTPIDCalculator.h"
+#include "TRT_ElectronPidTools/TRT_ElectronPidToolRun2.h"
+
+// StoreGate, Athena, and Database stuff:
+#include "Identifier/Identifier.h"
+#include "AthenaPoolUtilities/CondAttrListCollection.h"
+#include "AthenaPoolUtilities/AthenaAttributeList.h"
+#include "CoralBase/AttributeListSpecification.h"
+#include "CoralBase/Blob.h"
+#include "AthenaPoolUtilities/CondAttrListVec.h"
+#include "StoreGate/ReadCondHandle.h"
+
+// Tracking:
+#include "TrkTrack/Track.h"
+#include "TrkTrack/TrackStateOnSurface.h"
+#include "TrkMeasurementBase/MeasurementBase.h"
+#include "TrkRIO_OnTrack/RIO_OnTrack.h"
+#include "TrkParameters/TrackParameters.h"
+#include "TrkSurfaces/Surface.h"
+#include "TrkTrack/TrackInfo.h"
+
+// Drift circles and TRT identifiers:
+#include "InDetRIO_OnTrack/TRT_DriftCircleOnTrack.h"
+#include "InDetIdentifier/TRT_ID.h"
+
+// ToT Tool Interface
+#include "TRT_ToT_Tools/ITRT_ToT_dEdx.h"
+
+// Particle masses
+
+// Math functions:
+#include <cmath>
+
+//STL includes
+#include <sstream>
+
+//#define TRTDBG ATH_MSG_INFO("To line "<<__LINE__);
+//#define TRTDBG 0;
+
+//#include "TRT_ElectronPidToolRun2_HTcalculation.cxx"
+
+
+/*****************************************************************************\
+|*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*|
+|*%%%  PID Tool Constructor  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*|
+|*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*|
+\*****************************************************************************/
+
+InDet::TRT_ElectronPidToolRun2::TRT_ElectronPidToolRun2(const std::string& t, const std::string& n, const IInterface* p )
+  :
+  AthAlgTool(t,n,p),
+  m_trtId(nullptr),
+  m_TRTdetMgr(nullptr),
+  m_minTRThits(5),
+  m_TRTdEdxTool("TRT_ToT_dEdx"),
+  m_LocalOccTool(),
+  m_TRTStrawSummaryTool("InDetTRTStrawStatusSummaryTool",this)
+{
+  declareInterface<ITRT_ElectronPidTool>(this);
+  declareInterface<ITRT_ElectronToTTool>(this);
+  declareProperty("MinimumTRThitsForIDpid", m_minTRThits);
+  declareProperty("TRT_ToT_dEdx_Tool", m_TRTdEdxTool);
+  declareProperty("TRT_LocalOccupancyTool", m_LocalOccTool);
+  declareProperty("isData", m_DATA = true);
+  declareProperty("TRTStrawSummaryTool",    m_TRTStrawSummaryTool);
+  declareProperty("OccupancyUsedInPID", m_OccupancyUsedInPID=true);
+}
+
+
+/*****************************************************************************\
+|*%%%  PID Tool Destructor  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*|
+\*****************************************************************************/
+
+InDet::TRT_ElectronPidToolRun2::~TRT_ElectronPidToolRun2()
+{}
+
+/*****************************************************************************\
+|*%%%  Initialisation  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*|
+\*****************************************************************************/
+
+StatusCode InDet::TRT_ElectronPidToolRun2::initialize()
+{
+  StatusCode sc = AthAlgTool::initialize();
+  if (sc.isFailure()) return sc;
+
+  // Get the TRT Identifier-helper:
+  CHECK (detStore()->retrieve(m_trtId, "TRT_ID"));
+
+  /* Get the TRT_ToT_dEdx tool */
+  CHECK( m_TRTdEdxTool.retrieve() );
+
+  CHECK( m_LocalOccTool.retrieve() );
+
+  ATH_CHECK( m_HTReadKey.initialize() );
+
+  CHECK( m_TRTStrawSummaryTool.retrieve() );
+  if ( !m_TRTStrawSummaryTool.empty()) ATH_MSG_INFO( "Retrieved tool " << m_TRTStrawSummaryTool);
+
+  ATH_MSG_INFO ("initialize() successful in " << name());
+  return StatusCode::SUCCESS;
+}
+
+
+
+/*****************************************************************************\
+|*%%%  Finalisation  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*|
+\*****************************************************************************/
+
+StatusCode InDet::TRT_ElectronPidToolRun2::finalize()
+{
+  return AthAlgTool::finalize();
+}
+
+// Kept for backward compatibility.
+// See TRT_ElectronPidTools-01-00-28 for the full (commented) code.
+std::vector<float> InDet::TRT_ElectronPidToolRun2::electronProbability_old(const Trk::Track& track)
+{
+  // Simply return values without calculation
+  std::vector<float> PIDvalues(4);
+  PIDvalues[0] = 0.5;
+  PIDvalues[1] = 0.5;
+  PIDvalues[2] = 0.0;
+  PIDvalues[3] = 0.5;
+  const Trk::TrackParameters* perigee = track.perigeeParameters();
+  if (!perigee) { return PIDvalues; }
+  return PIDvalues;
+}
+
+
+/*****************************************************************************\
+|*%%%  electronProbability - The interface method during reconstruction  %%%%*|
+\*****************************************************************************/
+
+std::vector<float>
+InDet::TRT_ElectronPidToolRun2::electronProbability(const Trk::Track& track) const {
+
+ // Get the probability calculator
+ SG::ReadCondHandle<HTcalculator> readHandle{m_HTReadKey};
+ HTcalculator* HTcalc = const_cast<HTcalculator*>(*readHandle);
+ // make sure some calibration is available
+ if(HTcalc==nullptr) ATH_MSG_WARNING ("  No Pid calibration from the DB.");
+ HTcalc->checkInitialization();
+
+
+  //Initialize the return vector
+  std::vector<float> PIDvalues(5);
+  float & prob_El_Comb      = PIDvalues[0] = 0.5;
+  float & prob_El_HT        = PIDvalues[1] = 0.5;
+  float & prob_El_ToT       = PIDvalues[2] = 0.5;
+  float & prob_El_Brem      = PIDvalues[3] = 0.5;
+  float & occ_local         = PIDvalues[4] = 0.0;
+
+  float dEdx = 0.0;
+
+  // Check for perigee:
+  const Trk::TrackParameters* perigee = track.perigeeParameters();
+  if (!perigee) return PIDvalues;
+
+  // Get parameters at perigee and check that they are reasonable:
+  const Amg::VectorX& parameterVector = perigee->parameters();
+  double qOverP = parameterVector[Trk::qOverP];
+  double theta  = parameterVector[Trk::theta];
+  double phi    = parameterVector[Trk::phi];
+
+  // Check the parameters are reasonable:
+  if (tan(theta/2.0) < 0.0001) {
+    ATH_MSG_DEBUG ("  Track has negative theta or is VERY close to beampipe! (tan(theta/2) < 0.0001). Returning default Pid values.");
+    return PIDvalues;
+  }
+
+  if (qOverP == 0.0) {
+    ATH_MSG_DEBUG ("  Track momentum infinite! (i.e. q/p = 0). Returning default Pid values.");
+    return PIDvalues;
+  }
+
+  double pTrk = fabs(1.0 / qOverP);
+  double pT   = pTrk * sin(theta);
+  double eta  = -log(tan(theta/2.0));
+
+  // Check the tool to get the local occupancy (i.e. for the track in question):
+  occ_local = m_LocalOccTool->LocalOccupancy(track);
+
+  ATH_MSG_DEBUG ("");
+  ATH_MSG_DEBUG ("");
+  ATH_MSG_DEBUG ("check---------------------------------------------------------------------------------------");
+  ATH_MSG_DEBUG ("check  Got track:   pT: " << pT << "   eta: " << eta << "   phi: " << phi);
+  ATH_MSG_DEBUG ("check---------------------------------------------------------------------------------------");
+ 
+  // Jared - Development Output... 
+  /*
+  std::cout << "check---------------------------------------------------------------------------------------" << std::endl;
+  std::cout << "check  Got track:   pT: " << pT << "   eta: " << eta << "   phi: " << phi << std::endl;
+  std::cout << "check---------------------------------------------------------------------------------------" << std::endl;
+  */
+  // For calculation of HT probability:
+  double pHTel_prod = 1.0;
+  double pHTpi_prod = 1.0;
+
+  // ------------------------------------------------------------------------------------
+  // Loop over TRT hits on track, and calculate HT and R-ToT probability:
+  // ------------------------------------------------------------------------------------
+
+  unsigned int nTRThits     = 0;
+  unsigned int nTRThitsHTMB = 0;
+
+
+  // Check for track states:
+  const DataVector<const Trk::TrackStateOnSurface>* recoTrackStates = track.trackStateOnSurfaces();
+  if (not recoTrackStates) {
+    ATH_MSG_DEBUG("track.trackStateOnSurfaces() was zero");
+    //m_timingProfile->chronoStop("Tool::electronProb");
+    return PIDvalues;
+  }
+
+  DataVector<const Trk::TrackStateOnSurface>::const_iterator tsosIter    = recoTrackStates->begin();
+  DataVector<const Trk::TrackStateOnSurface>::const_iterator tsosIterEnd = recoTrackStates->end();
+
+  // Loop over track states on surfaces (i.e. generalized hits):
+  for ( ; tsosIter != tsosIterEnd; ++tsosIter) {
+
+    const Trk::MeasurementBase *measurement = (*tsosIter)->measurementOnTrack();
+    if (!measurement) continue;
+
+    // Get drift circle (ensures that hit is from TRT):
+    const InDet::TRT_DriftCircleOnTrack *driftcircle = dynamic_cast<const InDet::TRT_DriftCircleOnTrack*>(measurement);
+    if (!driftcircle) continue;
+
+    // From now (May 2015) onwards, we ONLY USE MIDDLE HT BIT:
+    bool isHTMB  = ((driftcircle->prepRawData()->getWord() & 0x00020000) > 0) ? true : false;
+
+    nTRThits++;
+    if (isHTMB) nTRThitsHTMB++;
+
+
+    // ------------------------------------------------------------------------------------
+    // Get the necessary input for the probability calculations:
+    // ------------------------------------------------------------------------------------
+    Identifier DCid = driftcircle->identify();
+
+    // Part of TRT hit belongs to (TrtPart = 0: Barrel, 1: EndcapA, 2: EndcapB).
+    int TrtPart = 0;                      // 0: Barrel, 1: EndcapA, 2: EndcapB
+    if (abs(m_trtId->barrel_ec(DCid)) == 2)
+      TrtPart = (m_trtId->layer_or_wheel(DCid) < 6) ? 1 : 2;
+
+    // Get Straw Layer (Barrel: 0-72, EndcapA: 0-95 (16 layers in 6 modules), EndcapB: 0-63 (8 layers in 8 modules)):
+    int StrawLayer = 0;
+    if (TrtPart == 0) {
+      // Barrel:
+      if      (m_trtId->layer_or_wheel(DCid) == 0) StrawLayer = m_trtId->straw_layer(DCid);
+      else if (m_trtId->layer_or_wheel(DCid) == 1) StrawLayer = 19 + m_trtId->straw_layer(DCid);
+      else                                         StrawLayer = 19 + 24 + m_trtId->straw_layer(DCid);
+    } else {
+      // Endcap:
+      if (m_trtId->layer_or_wheel(DCid) < 6) StrawLayer = 16*m_trtId->layer_or_wheel(DCid) + m_trtId->straw_layer(DCid);
+      else                                   StrawLayer = 8*(m_trtId->layer_or_wheel(DCid)-6) + m_trtId->straw_layer(DCid);
+    }
+
+    // Get Z (Barrel) or R (Endcap) location of the hit, and distance from track to wire (i.e. anode) in straw:
+    double HitZ, HitR, rTrkWire;
+    bool hasTrackParameters= true; // Keep track of this for HT prob calculation
+    if ((*tsosIter)->trackParameters()) {
+      // If we have precise information (from hit), get that:
+      const Amg::Vector3D& gp = driftcircle->globalPosition();
+      HitR = gp.perp();
+      HitZ = gp.z();
+      rTrkWire = fabs((*tsosIter)->trackParameters()->parameters()[Trk::driftRadius]);
+    } else {
+      // Otherwise just use the straw coordinates:
+      hasTrackParameters = false; // Jared - pass this to HT calculation
+      HitZ = driftcircle->associatedSurface().center().z();
+      HitR = driftcircle->associatedSurface().center().perp();
+      rTrkWire = 0;
+    }
+
+
+    // ------------------------------------------------------------------------------------
+    // Collection and checks of input variables for HT probability calculation:
+    // ------------------------------------------------------------------------------------
+
+    int SL_max[3] = {73, 96, 64};
+    if (StrawLayer > SL_max[TrtPart]  ||  StrawLayer < 0) {
+      ATH_MSG_WARNING("  StrawLayer was outside allowed range!  TrtPart = " << TrtPart << "  SL = " << StrawLayer);
+      continue;
+    }
+
+    double ZRpos[3] = {fabs(HitZ), HitR, HitR};
+    double ZRpos_min[3] = {  0.0,  630.0,  630.0};
+    double ZRpos_max[3] = {720.0, 1030.0, 1030.0};
+    if (ZRpos[TrtPart] > ZRpos_max[TrtPart]) {
+      ATH_MSG_WARNING("  ZRpos was above allowed range - adjusted!  TrtPart = " << TrtPart << "  ZRpos = " << ZRpos[TrtPart]);
+      ZRpos[TrtPart] = ZRpos_max[TrtPart] - 0.001;
+    }
+    if (ZRpos[TrtPart] < ZRpos_min[TrtPart]) {
+      ATH_MSG_WARNING("  ZRpos was below allowed range - adjusted!  TrtPart = " << TrtPart << "  ZRpos = " << ZRpos[TrtPart]);
+      ZRpos[TrtPart] = ZRpos_min[TrtPart] + 0.001;
+    }
+
+    if (rTrkWire > 2.2) rTrkWire = 2.175;   // Happens once in a while - no need for warning!
+
+    if (occ_local > 1.0  ||  occ_local < 0.0) {
+      ATH_MSG_WARNING("  Occupancy was outside allowed range!  TrtPart = " << TrtPart << "  Occupancy = " << occ_local);
+      continue;
+    }
+
+    // ------------------------------------------------------------------------------------
+    // Calculate the HT probability:
+    // ------------------------------------------------------------------------------------
+
+    // getStatusHT returns enum {Undefined, Dead, Good, Xenon, Argon, Krypton, EmulatedArgon, EmulatedKrypton}.
+    // Our representation of 'GasType' is 0:Xenon, 1:Argon, 2:Krypton
+    int GasType=0; // Xenon is default
+    if (!m_TRTStrawSummaryTool.empty()) {
+      int stat = m_TRTStrawSummaryTool->getStatusHT(DCid);
+      if       ( stat==2 || stat==3 ) { GasType = 0; } // Xe
+      else if  ( stat==1 || stat==4 ) { GasType = 1; } // Ar
+      else if  ( stat==5 )            { GasType = 1; } // Kr -- ESTIMATED AS AR UNTIL PID IS TUNED TO HANDLE KR
+      else if  ( stat==6 )            { GasType = 1; } // Emulated Ar
+      else if  ( stat==7 )            { GasType = 1; } // Emulated Kr -- ESTIMATED AS AR UNTIL PID IS TUNED TO HANDLE KR
+      else { ATH_MSG_FATAL ("getStatusHT = " << stat << ", must be 'Good(2)||Xenon(3)' or 'Dead(1)||Argon(4)' or 'Krypton(5)' or 'EmulatedArgon(6)' or 'EmulatedKr(7)'!");
+             throw std::exception();
+           }
+    }
+
+    ATH_MSG_DEBUG ("check Hit: " << nTRThits << "  TrtPart: " << TrtPart << "  GasType: " << GasType << "  SL: " << StrawLayer
+             << "  ZRpos: " << ZRpos[TrtPart] << "  TWdist: " << rTrkWire << "  Occ_Local: " << occ_local << "  HTMB: " << isHTMB );
+
+
+    // Jared - Development Output... 
+    /*    
+    std::cout << "check Hit: " << nTRThits << "  TrtPart: " << TrtPart << "  GasType: " << GasType << "  SL: " << StrawLayer
+             << "  ZRpos: " << ZRpos[TrtPart] << "  TWdist: " << rTrkWire << "  Occ_Local: " << occ_local 
+            << "  HTMB: " << isHTMB << std::endl;
+    */
+
+    // Then call pHT functions with these values:
+    // ------------------------------------------
+
+
+    double pHTel = HTcalc->getProbHT( pTrk, Trk::electron, TrtPart, GasType, StrawLayer, ZRpos[TrtPart], rTrkWire, occ_local, hasTrackParameters);
+    double pHTpi = HTcalc->getProbHT( pTrk, Trk::pion,     TrtPart, GasType, StrawLayer, ZRpos[TrtPart], rTrkWire, occ_local, hasTrackParameters);
+
+    if (pHTel > 0.999 || pHTpi > 0.999 || pHTel < 0.001 || pHTpi < 0.001) {
+      ATH_MSG_DEBUG("  pHT outside allowed range!  pHTel = " << pHTel << "  pHTpi = " << pHTpi << "     TrtPart: " << TrtPart << "  SL: " << StrawLayer << "  ZRpos: " << ZRpos[TrtPart] << "  TWdist: " << rTrkWire << "  Occ_Local: " << occ_local);
+      continue;
+    }
+
+    if (pHTel > 0.80 || pHTpi > 0.50 || pHTel < 0.025 || pHTpi < 0.010) {
+      ATH_MSG_DEBUG("  pHT has abnormal value!  pHTel = " << pHTel << "  pHTpi = " << pHTpi << "     TrtPart: " << TrtPart << "  SL: " << StrawLayer << "  ZRpos: " << ZRpos[TrtPart] << "  TWdist: " << rTrkWire << "  Occ_Local: " << occ_local);
+      continue;
+    }
+
+    // From now (May 2015) onwards, we ONLY USE MIDDLE HT BIT:
+    if (isHTMB) {pHTel_prod *=     pHTel;  pHTpi_prod *=     pHTpi;}
+    else        {pHTel_prod *= 1.0-pHTel;  pHTpi_prod *= 1.0-pHTpi;}
+    ATH_MSG_DEBUG ("check         pHT(el): " << pHTel << "  pHT(pi): " << pHTpi );
+    
+    // Jared - Development Output... 
+    
+    //std::cout << "check         pHT(el): " << pHTel << "  pHT(pi): " << pHTpi << std::endl;
+    
+  }//of loop over hits
+
+
+  // If number of hits is adequate (default is 5 hits), calculate HT and ToT probability.
+  if (not (nTRThits >= m_minTRThits)) return PIDvalues;
+
+  // Calculate electron probability (HT)
+  prob_El_HT = pHTel_prod / (pHTel_prod + pHTpi_prod);
+
+  ATH_MSG_DEBUG ("check---------------------------------------------------------------------------------------");
+  ATH_MSG_DEBUG ("check  nTRThits: " << nTRThits << "  : " << nTRThitsHTMB << "  pHTel_prod: " << pHTel_prod << "  pHTpi_prod: " << pHTpi_prod << "  probEl: " << prob_El_HT);
+  ATH_MSG_DEBUG ("check---------------------------------------------------------------------------------------");
+  ATH_MSG_DEBUG ("");
+  ATH_MSG_DEBUG ("");
+    
+  // Jared - Development Output... 
+  /*
+  std::cout << "check---------------------------------------------------------------------------------------" << std::endl;
+  std::cout << "check  nTRThits: " << nTRThits << "  : " << nTRThitsHTMB << "  pHTel_prod: " << pHTel_prod << "  pHTpi_prod: " << pHTpi_prod << "  probEl: " << prob_El_HT << std::endl;
+  std::cout << "check---------------------------------------------------------------------------------------" << std::endl;
+  std::cout << std::endl << std::endl;
+  */
+
+  // Jared - ToT Implementation
+  dEdx = m_TRTdEdxTool->dEdx( &track, true, false, true); // Divide by L, exclude HT hits
+  double usedHits = m_TRTdEdxTool->usedHits( &track, true, false);
+  prob_El_ToT = m_TRTdEdxTool->getTest( dEdx, pTrk, Trk::electron, Trk::pion, usedHits, true ); 
+  
+  // Limit the probability values the upper and lower limits that are given/trusted for each part:
+  double limProbHT = HTcalc->Limit(prob_El_HT); 
+  double limProbToT = HTcalc->Limit(prob_El_ToT); 
+  
+  // Calculate the combined probability, assuming no correlations (none are expected).
+  prob_El_Comb = (limProbHT * limProbToT ) / ( (limProbHT * limProbToT) + ( (1.0-limProbHT) * (1.0-limProbToT)) );
+  
+  // Troels: VERY NASTY NAMING, BUT AGREED UPON FOR NOW (for debugging, 27. NOV. 2014):
+  prob_El_Brem = pHTel_prod; // decorates electron LH to el brem for now... (still used?) 
+  
+  //std::cout << "Prob_HT = " << prob_El_HT << "   Prob_ToT = " << prob_El_ToT << "   Prob_Comb = " << prob_El_Comb << std::endl;
+     
+  return PIDvalues;
+}
+
+
+/*****************************************************************************\
+|*%%%  TRT straw address check, done once per hit.  %%%%%%%%%%%%%%%%%%%%%%%%%*|
+|*%%%  Nowhere else are these numbers checked. If this is deemed  %%%%%%%%%%%*|
+|*%%%  unnecessary it can be taken out by simply letting the function %%%%%%%*|
+|*%%%  return true every time  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*|
+\*****************************************************************************/
+
+bool InDet::TRT_ElectronPidToolRun2::CheckGeometry(int BEC, int Layer, int StrawLayer) const {
+
+  //first check that the BEC is valid:
+  if(not ( BEC==-2 || BEC ==-1 || BEC==1 || BEC==2)){
+    ATH_MSG_ERROR("Found a wrong TRT part: "<<BEC<<" expected one of (-2,-1,1,2)");
+    return false;
+  }
+  const int part = abs(BEC)-1;
+
+  //next check that the layer is valid
+  if( Layer < 0){
+    ATH_MSG_ERROR("Found a negative TRT Layer");
+    return false; //must be positive
+  }
+  
+  static const int nlayers[2]={3,14};
+  
+  if( not ( Layer < nlayers[part] ) ){
+    ATH_MSG_ERROR("Found TRT Layer index "<<Layer<<" in part "<<BEC<<" but part only has "<<nlayers[part]<<" layers.");
+    return false;
+  }
+
+  //and finally check that the StrawLayer is valid:
+  if( StrawLayer < 0){
+    ATH_MSG_ERROR("Found a negative TRT StrawLayer");
+    return false; //must be positive
+  }
+  
+  static const int strawsPerBEC[2][14]={{19,24,30, 0, 0, 0,0,0,0,0,0,0,0,0},
+                                        {16,16,16,16,16,16,8,8,8,8,8,8,8,8}};
+  
+  if(not(StrawLayer < strawsPerBEC[part][Layer])){
+    ATH_MSG_ERROR("TRT part "<<BEC<<" Layer "<<Layer<<" only has "<<strawsPerBEC[part][Layer]<<" straws. Found index "<<StrawLayer);
+    return false;
+  }
+  
+  return true;
+}
+
+/*****************************************************************************\
+|*%%%  Auxiliary function to return the HT probability to Atlfast  %%%%%%%%%%*|
+|*%%%  a geometry check is performed every time here  %%%%%%%%%%%%%%%%%%%%%%%*|
+\*****************************************************************************/
+
+double InDet::TRT_ElectronPidToolRun2::probHT( const double /*pTrk*/, const Trk::ParticleHypothesis /*hypothesis*/, const int HitPart, const int Layer, const int StrawLayer) const {
+  if (not CheckGeometry(HitPart,Layer,StrawLayer) ){
+    ATH_MSG_ERROR("TRT geometry fail. Returning default value.");
+    return 0.5;
+  }
+
+  return 1.0;
+}
+
+
+double InDet::TRT_ElectronPidToolRun2::probHTRun2( float pTrk, Trk::ParticleHypothesis hypothesis, int TrtPart, int GasType, int StrawLayer, float ZR, float rTrkWire, float Occupancy ) const {
+    SG::ReadCondHandle<HTcalculator> readHandle{m_HTReadKey};
+    bool hasTrackPar=true;
+    return (*readHandle)->getProbHT( pTrk, hypothesis, TrtPart, GasType, StrawLayer, ZR, rTrkWire, Occupancy, hasTrackPar );
+}
diff --git a/InnerDetector/InDetRecTools/TRT_ElectronPidTools/src/TRT_LocalOccupancy.cxx b/InnerDetector/InDetRecTools/TRT_ElectronPidTools/src/TRT_LocalOccupancy.cxx
index aca757faf83ce6f543921e3cddd9750e6f53e804..1c7de3fd9e7c381c710eb1f314a917388d999b7f 100644
--- a/InnerDetector/InDetRecTools/TRT_ElectronPidTools/src/TRT_LocalOccupancy.cxx
+++ b/InnerDetector/InDetRecTools/TRT_ElectronPidTools/src/TRT_LocalOccupancy.cxx
@@ -1,3 +1,4 @@
+
 /*
   Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
@@ -29,6 +30,7 @@
 
 // ReadHandle
 #include "StoreGate/ReadHandle.h"
+#include "StoreGate/ReadCondHandle.h"
 
 //STL includes
 #include <sstream>
@@ -45,18 +47,17 @@ TRT_LocalOccupancy::TRT_LocalOccupancy(const std::string& t,
   :
   base_class(t,n,p),
   m_TRTHelper(nullptr),
-  m_TRTStrawStatusSummarySvc("InDetTRTStrawStatusSummarySvc", n),
-  m_driftFunctionTool("TRT_DriftFunctionTool")  
+  m_CalDbTool("TRT_CalDbTool",this),    
+  m_StrawStatusSummaryTool("TRT_StrawStatusSummaryTool",this)
 {
-  //declareProperty("isData", m_DATA = true);
- declareProperty("TRTStrawSummarySvc",   m_TRTStrawStatusSummarySvc);
  declareProperty("isTrigger",            m_isTrigger = false);
  declareProperty("includeT0Shift",       m_T0Shift = true);
  declareProperty("LowGate",              m_lowGate  = 14.0625*CLHEP::ns);
  declareProperty("HighGate",             m_highGate = 42.1875*CLHEP::ns);
  declareProperty("LowWideGate",          m_lowWideGate  = 20.3125*CLHEP::ns);
  declareProperty("HighWideGate",        m_highWideGate = 54.6875*CLHEP::ns);
- declareProperty("TRTDriftFunctionTool", m_driftFunctionTool);
+ declareProperty("TRTCalDbTool", m_CalDbTool);
+ declareProperty("TRTStrawStatusSummaryTool", m_StrawStatusSummaryTool);
 }
 
 // =======================================================================
@@ -70,20 +71,23 @@ StatusCode TRT_LocalOccupancy::initialize()
   // The TRT helper: 
   CHECK( detStore()->retrieve(m_TRTHelper, "TRT_ID") );
 
+  // access to t0 and straw status
   if (m_T0Shift) {
-    CHECK( m_driftFunctionTool.retrieve() );
+    CHECK( m_CalDbTool.retrieve());
   }
   else { //use wider validity gate if no T0 shift
     m_lowGate  = m_lowWideGate ;
     m_highGate = m_highWideGate ;
   }  
-  CHECK ( m_TRTStrawStatusSummarySvc.retrieve() );
+  CHECK( m_StrawStatusSummaryTool.retrieve());
+
   
   ATH_MSG_INFO ("initialize() successful in " << name());
 
   //Initlalize ReadHandleKey
   ATH_CHECK( m_trt_rdo_location.initialize() );
   ATH_CHECK( m_trt_driftcircles.initialize() );
+  ATH_CHECK( m_strawReadKey.initialize() );
 
   return StatusCode::SUCCESS;
 }
@@ -209,8 +213,8 @@ std::map<int, double>  TRT_LocalOccupancy::getDetectorOccupancy( const TRT_RDO_C
         Identifier  rdo_id  = (*r)->identify    ()                          ;
         
         //Check if straw is OK
-        if((m_TRTStrawStatusSummarySvc->getStatus(rdo_id) != TRTCond::StrawStatus::Good)
-            || (m_TRTStrawStatusSummarySvc->getStatusPermanent(rdo_id))) {
+        if((m_StrawStatusSummaryTool->getStatus(rdo_id) != TRTCond::StrawStatus::Good)
+            || (m_StrawStatusSummaryTool->getStatusPermanent(rdo_id))) {
           continue;
         }
 
@@ -231,8 +235,7 @@ std::map<int, double>  TRT_LocalOccupancy::getDetectorOccupancy( const TRT_RDO_C
             if(tdcvalue==7 || tdcvalue==15) mask>>=1; 
           } 
           if(!(tdcvalue==0 || tdcvalue==24)) {
-            double dummy_rawrad=0. ; bool dummy_isOK=true;
-            m_driftFunctionTool->driftRadius(dummy_rawrad,rdo_id,t0,dummy_isOK);
+            t0 =  m_CalDbTool->getT0(rdo_id);
           }
         }
 
@@ -243,7 +246,11 @@ std::map<int, double>  TRT_LocalOccupancy::getDetectorOccupancy( const TRT_RDO_C
     }
   }
 
-  int*  straws = m_TRTStrawStatusSummarySvc->getStwTotal();
+  SG::ReadCondHandle<TRTCond::AliveStraws> strawHandle{m_strawReadKey};
+  const TRTCond::AliveStraws* strawCounts{*strawHandle};
+
+
+  int*  straws = strawCounts->getStwTotal();
     
             
   occResults[-1] = (double)hitCounter[-1]/(double)straws[1];
@@ -288,8 +295,8 @@ TRT_LocalOccupancy::countHitsNearTrack (OccupancyData& data,
 	      if (!*r)                                continue;
 	      Identifier   rdo_id  = (*r)->identify    ()                          ;
 	      
-	      if((m_TRTStrawStatusSummarySvc->getStatus(rdo_id) != TRTCond::StrawStatus::Good)
-		 || (m_TRTStrawStatusSummarySvc->getStatusPermanent(rdo_id))) {
+	      if((m_StrawStatusSummaryTool->getStatus(rdo_id) != TRTCond::StrawStatus::Good)
+		 || (m_StrawStatusSummaryTool->getStatusPermanent(rdo_id))) {
 		continue;
 	      }
 
@@ -314,9 +321,7 @@ TRT_LocalOccupancy::countHitsNearTrack (OccupancyData& data,
 		    if(tdcvalue==7 || tdcvalue==15) mask>>=1; 
 		  } 
 		if(!(tdcvalue==0 || tdcvalue==24)) {
-		  double dummy_rawrad=0. ; bool dummy_isOK=true;
-		  m_driftFunctionTool->driftRadius(dummy_rawrad,rdo_id,t0,dummy_isOK);
-		  //	  double dummy_radius = m_driftFunctionTool->driftRadius(dummy_rawrad,rdo_id,t0,dummy_isOK);
+                  t0 =  m_CalDbTool->getT0(rdo_id);
 		}
 	      }
 
@@ -518,9 +523,13 @@ TRT_LocalOccupancy::makeData() const
     ATH_MSG_WARNING("No TRT Drift Circles in StoreGate");
   }
 
+
   // count live straws
-  data->m_stw_total 		=  m_TRTStrawStatusSummarySvc->getStwTotal();
-  data->m_stw_local 		=  m_TRTStrawStatusSummarySvc->getStwLocal();
+  SG::ReadCondHandle<TRTCond::AliveStraws> strawHandle{m_strawReadKey};
+  const TRTCond::AliveStraws* strawCounts{*strawHandle};
+
+  data->m_stw_total 		=  strawCounts->getStwTotal();
+  data->m_stw_local 		=  strawCounts->getStwLocal();
   
   // Calculate Occs:
   for (int i=0; i<NTOTAL; ++i) {
@@ -550,9 +559,11 @@ std::unique_ptr<TRT_LocalOccupancy::OccupancyData>
 TRT_LocalOccupancy::makeDataTrigger() const
 {
   auto data = std::make_unique<OccupancyData>();
+  SG::ReadCondHandle<TRTCond::AliveStraws> strawHandle{m_strawReadKey};
+  const TRTCond::AliveStraws* strawCounts{*strawHandle};
 
-  data->m_stw_local 		=  m_TRTStrawStatusSummarySvc->getStwLocal();
-  data->m_stw_wheel 		=  m_TRTStrawStatusSummarySvc->getStwWheel();
+  data->m_stw_local 		=  strawCounts->getStwLocal();
+  data->m_stw_wheel 	        =  strawCounts->getStwWheel();
 
   for (int i=0; i<5; ++i){
     for (int j=0; j<NLOCALPHI; ++j){
diff --git a/InnerDetector/InDetRecTools/TRT_ToT_Tools/TRT_ToT_Tools/TRT_ToT_dEdx.h b/InnerDetector/InDetRecTools/TRT_ToT_Tools/TRT_ToT_Tools/TRT_ToT_dEdx.h
index c1b7b5081720e20ecd6591f9b36ef757ae7cd693..b6d9e3da08c7a7089632c9afc6a20de1f6b568c4 100644
--- a/InnerDetector/InDetRecTools/TRT_ToT_Tools/TRT_ToT_Tools/TRT_ToT_dEdx.h
+++ b/InnerDetector/InDetRecTools/TRT_ToT_Tools/TRT_ToT_Tools/TRT_ToT_dEdx.h
@@ -21,7 +21,9 @@
 #include "TRT_ConditionsServices/ITRT_StrawStatusSummarySvc.h"
 
 #include "StoreGate/ReadHandleKey.h"
+#include "StoreGate/ReadCondHandleKey.h"
 #include "xAODEventInfo/EventInfo.h"
+#include "TRT_ConditionsData/TRTDedxcorrection.h"
 
 
 /*
@@ -36,7 +38,7 @@
 
 class TRT_ID;
 class IChronoStatSvc;
-class ITRT_StrawSummarySvc;
+class ITRT_StrawSummaryTool;
 
 namespace InDetDD {
   class TRT_DetectorManager;
@@ -313,13 +315,8 @@ public:
   EGasType gasTypeInStraw(const InDet::TRT_DriftCircleOnTrack *driftcircle) const; 
       
 private:
-   
-  /** callbacks for calibration constants DB **/
-  StatusCode update(int&, std::list<std::string>&); 
-  void update_New(std::map<std::string,std::vector<float> > &result_dict);
-  void update_Old(std::map<std::string,std::vector<float> > &result_dict);
-  StatusCode update2(int&, std::list<std::string>&);
 
+  SG::ReadCondHandleKey<TRTDedxcorrection> m_ReadKey{this,"Dedxcorrection","Dedxcorrection","Dedx constants in-key"};   
 
   /**
    * @brief function to compute correction factor in endcap region
@@ -449,6 +446,7 @@ public:
 private:
   bool isData() const;
   mutable bool m_isDataSet;
+
   
 };
 
diff --git a/InnerDetector/InDetRecTools/TRT_ToT_Tools/src/TRT_ToT_dEdx.cxx b/InnerDetector/InDetRecTools/TRT_ToT_Tools/src/TRT_ToT_dEdx.cxx
index 63eee31608c8889d77e28716b5d9c1a9ce60a88e..0bd32f385a8d4e0738217740f2d79cb065189789 100644
--- a/InnerDetector/InDetRecTools/TRT_ToT_Tools/src/TRT_ToT_dEdx.cxx
+++ b/InnerDetector/InDetRecTools/TRT_ToT_Tools/src/TRT_ToT_dEdx.cxx
@@ -22,12 +22,9 @@
 
 #include "TF1.h"
 
-#include "AthenaPoolUtilities/CondAttrListCollection.h"
-#include "AthenaPoolUtilities/AthenaAttributeList.h"
-#include "CoralBase/AttributeListSpecification.h"
-#include "AthenaPoolUtilities/CondAttrListVec.h"
 #include "StoreGate/DataHandle.h"
 #include "StoreGate/ReadHandle.h"
+#include "StoreGate/ReadCondHandle.h"
 
 // constructor
 TRT_ToT_dEdx::TRT_ToT_dEdx(const std::string& t, const std::string& n, const IInterface* p)
@@ -126,23 +123,9 @@ StatusCode TRT_ToT_dEdx::initialize()
     ATH_MSG_DEBUG ("Can not find ChronoStatSvc name="<<m_timingProfile );
   }
  
-  const DataHandle<CondAttrListVec> aptr;
-  std::string folderName = {"/TRT/Calib/ToT/ToTVectors"};
-  if (StatusCode::SUCCESS == detStore->regFcn(&TRT_ToT_dEdx::update,this,aptr,folderName)){
-    ATH_MSG_DEBUG ("Registered callback for ToT");
-  }else{
-    ATH_MSG_ERROR ("Callback registration failed for /TRT/Calib/ToT/ToTVectors ");
-  }
-
-  const DataHandle<CondAttrListCollection> affectedRegionH;
-  if (detStore->regFcn(&TRT_ToT_dEdx::update2,this,affectedRegionH,"/TRT/Calib/ToT/ToTValue").isSuccess()){
-    ATH_MSG_DEBUG ( "Registered callback for  /TRT/Calib/ToT/ToTValue " );
-  }else{
-    ATH_MSG_WARNING ( "Cannot register callback for /TRT/Calib/ToT/ToTValue " );
-  }
-
-  // Initialize ReadHandleKey
+  // Initialize ReadHandleKey and ReadCondHandleKey
   ATH_CHECK(m_eventInfoKey.initialize());
+  ATH_CHECK(m_ReadKey.initialize());
 
   //|-TRTStrawSummarySvc     = ServiceHandle('InDetTRTStrawStatusSummarySvc')
   sc = m_TRTStrawSummarySvc.retrieve();
@@ -197,488 +180,6 @@ StatusCode TRT_ToT_dEdx::finalize()
 
 
 
-// callback for DB for arrays
-StatusCode TRT_ToT_dEdx::update(int& /*i*/ , std::list<std::string>& /*l*/) 
-{
-  StoreGateSvc* detStore = 0;
-  StatusCode sc = service( "DetectorStore", detStore );
-
-  std::vector<std::string>  dict_names = {"para_end_corrRZLXe","para_end_corrRZ_Xe","para_end_mimicToXeXe","para_long_corrRZLXe","para_long_corrRZ_Xe","para_long_mimicToXeXe","para_short_corrRZLXe","para_short_corrRZ_Xe","para_short_mimicToXeXe","resolution_Xe","resolution_e_Xe","para_end_corrRZLAr","para_end_corrRZ_Ar","para_end_mimicToXeAr","para_long_corrRZLAr","para_long_corrRZ_Ar","para_long_mimicToXeAr","para_short_corrRZLAr","para_short_corrRZ_Ar","para_short_mimicToXeAr","resolution_Ar","resolution_e_Ar","para_end_corrRZLKr","para_end_corrRZ_Kr","para_end_mimicToXeKr","para_long_corrRZLKr","para_long_corrRZ_Kr","para_long_mimicToXeKr","para_short_corrRZLKr","para_short_corrRZ_Kr","para_short_mimicToXeKr","resolution_Kr","resolution_e_Kr"};
-  std::map<std::string,std::vector<float> > result_dict;
-
-  const DataHandle<CondAttrListVec> channel_values;
-
-  if (StatusCode::SUCCESS == detStore->retrieve(channel_values, "/TRT/Calib/ToT/ToTVectors" ))
-    {
-      int dataBaseType = kNewDB;
-      ATH_MSG_DEBUG("update():: dict_names[]="<<dict_names.size()<<", channel_values[]="<<channel_values->size()<<"");
-      if(channel_values->size()<19695) 
-        dataBaseType = kOldDB; 
-
-      if(dataBaseType==kNewDB) 
-        {
-          CondAttrListVec::const_iterator first_channel = channel_values->begin();
-          CondAttrListVec::const_iterator last_channel  = channel_values->end();
-
-          unsigned int current_channel = 0;
-          std::vector<float> current_array_values = {};
-
-          for (; first_channel != last_channel; ++first_channel) {
-            if (current_channel != first_channel->first){
-              result_dict[dict_names[current_channel]] = current_array_values;
-              current_channel = first_channel->first;      
-              current_array_values.clear();
-            }
-            current_array_values.push_back(first_channel->second["array_value"].data<float>());             
-          }
-                        
-          result_dict[dict_names[current_channel]] = current_array_values;
-                        
-          update_New(result_dict);
-          ATH_MSG_DEBUG ("update():: Reading new database is done!");
-
-          return StatusCode::SUCCESS;
-                
-        } else 
-        if(dataBaseType==kOldDB) 
-          {
-            ATH_MSG_WARNING ("update():: Old COOL database tag!");
-
-            std::vector<std::string>  dict_names_old = {"resolution","resolution_e","para_long_corrRZ_MC","para_short_corrRZ_MC","para_end_corrRZ_MC","para_long_corrRZL_MC","para_short_corrRZL_MC","para_end_corrRZL_MC"};
-        
-            CondAttrListVec::const_iterator first_channel = channel_values->begin();
-            CondAttrListVec::const_iterator last_channel  = channel_values->end();
-
-            unsigned int current_channel = 0;
-            std::vector<float> current_array_values = {};
-
-            for (; first_channel != last_channel; ++first_channel) 
-              {
-                if (current_channel != first_channel->first)
-                  {
-                    result_dict[dict_names_old[current_channel]] = current_array_values;
-                    current_channel = first_channel->first;      
-                    current_array_values.clear();
-                  }
-                current_array_values.push_back(first_channel->second["array_value"].data<float>());             
-              }
-                        
-            result_dict[dict_names_old[current_channel]] = current_array_values;
-
-            update_Old(result_dict);
-            ATH_MSG_DEBUG ("update():: Reading old database is done!");
-
-            return StatusCode::SUCCESS;
-          }
-        else {
-          ATH_MSG_ERROR ("Problem reading condDB object. dataBaseType="<<dataBaseType<<"");
-          return StatusCode::FAILURE;
-        }
-    }
-  else {
-    ATH_MSG_ERROR ("Problem reading condDB object. -");
-    return StatusCode::FAILURE;
-  }
-}
-
-
-
-void TRT_ToT_dEdx::update_New(std::map<std::string,std::vector<float> > &result_dict) 
-{
-  //      fill Xenon +++++++++++++++++++++++++++++++++++++++++++++++++++++++++    
-  for (unsigned int ind=0; ind < 4; ++ind) {
-    Dedxcorrection::resolution[0][ind]=result_dict["resolution_Xe"][ind];
-  }
-
-  for (unsigned int ind=0; ind < 4; ++ind) {
-    Dedxcorrection::resolution_e[0][ind]=result_dict["resolution_e_Xe"][ind];
-  }
-
-  for (unsigned int ind=0; ind < 3240; ++ind) {
-    Dedxcorrection::para_long_corrRZ_MC[0][ind]=result_dict["para_long_corrRZ_Xe"][ind];
-  }
-
-  for (unsigned int ind=0; ind < 216; ++ind) {
-    Dedxcorrection::para_short_corrRZ_MC[0][ind]=result_dict["para_short_corrRZ_Xe"][ind];
-  }
-
-  for (unsigned int ind=0; ind < 630; ++ind) {
-    Dedxcorrection::para_long_corrRZL_MC[0][ind]=result_dict["para_long_corrRZLXe"][ind];
-  }
-
-  for (unsigned int ind=0; ind < 63; ++ind) {
-    Dedxcorrection::para_short_corrRZL_MC[0][ind]=result_dict["para_short_corrRZLXe"][ind];
-  }
-
-  for (unsigned int ind=0; ind < 252; ++ind) {
-    Dedxcorrection::para_end_corrRZL_MC[0][ind]=result_dict["para_end_corrRZLXe"][ind];
-  }
-
-  for (unsigned int ind=0; ind < 3240; ++ind) {
-    Dedxcorrection::para_long_corrRZ[0][ind]=result_dict["para_long_corrRZ_Xe"][ind];
-  }
-
-  for (unsigned int ind=0; ind < 216; ++ind) {
-    Dedxcorrection::para_short_corrRZ[0][ind]=result_dict["para_short_corrRZ_Xe"][ind];
-  }
-
-  for (unsigned int ind=0; ind < 630; ++ind) {
-    Dedxcorrection::para_long_corrRZL_DATA[0][ind]=result_dict["para_long_corrRZLXe"][ind];
-  }
-
-  for (unsigned int ind=0; ind < 63; ++ind) {
-    Dedxcorrection::para_short_corrRZL_DATA[0][ind]=result_dict["para_short_corrRZLXe"][ind];
-  }
-
-  for (unsigned int ind=0; ind < 252; ++ind) {
-    Dedxcorrection::para_end_corrRZL_DATA[0][ind]=result_dict["para_end_corrRZLXe"][ind];
-  }
-
-  for (unsigned int ind=0; ind < 336; ++ind) {
-    Dedxcorrection::para_end_corrRZ[0][ind]=result_dict["para_end_corrRZ_Xe"][ind];
-  }
-
-  for (unsigned int ind=0; ind < 336; ++ind) {
-    Dedxcorrection::para_end_corrRZ_MC[0][ind]=result_dict["para_end_corrRZ_Xe"][ind];
-  }
-
-        
-                
-  for (unsigned int ind=0; ind < 560; ++ind) {
-    Dedxcorrection::para_end_mimicToXe_DATA[0][ind]=result_dict["para_end_mimicToXeXe"][ind];
-  }
-  for (unsigned int ind=0; ind < 560; ++ind) {
-    Dedxcorrection::para_end_mimicToXe_MC[0][ind]=result_dict["para_end_mimicToXeXe"][ind];
-  }
-  for (unsigned int ind=0; ind < 180; ++ind) {
-    Dedxcorrection::para_short_mimicToXe_DATA[0][ind]=result_dict["para_short_mimicToXeXe"][ind];
-  }
-  for (unsigned int ind=0; ind < 180; ++ind) {
-    Dedxcorrection::para_short_mimicToXe_MC[0][ind]=result_dict["para_short_mimicToXeXe"][ind];
-  }
-  for (unsigned int ind=0; ind < 1800; ++ind) {
-    Dedxcorrection::para_long_mimicToXe_DATA[0][ind]=result_dict["para_long_mimicToXeXe"][ind];
-  }
-  for (unsigned int ind=0; ind < 1800; ++ind) {
-    Dedxcorrection::para_long_mimicToXe_MC[0][ind]=result_dict["para_long_mimicToXeXe"][ind];
-  }
-
-  //      fill Argon +++++++++++++++++++++++++++++++++++++++++++++++++++++++++    
-  for (unsigned int ind=0; ind < 4; ++ind) {
-    Dedxcorrection::resolution[1][ind]=result_dict["resolution_Ar"][ind];
-  }
-
-  for (unsigned int ind=0; ind < 4; ++ind) {
-    Dedxcorrection::resolution_e[1][ind]=result_dict["resolution_e_Ar"][ind];
-  }
-
-  for (unsigned int ind=0; ind < 3240; ++ind) {
-    Dedxcorrection::para_long_corrRZ_MC[1][ind]=result_dict["para_long_corrRZ_Ar"][ind];
-  }
-
-  for (unsigned int ind=0; ind < 216; ++ind) {
-    Dedxcorrection::para_short_corrRZ_MC[1][ind]=result_dict["para_short_corrRZ_Ar"][ind];
-  }
-
-  for (unsigned int ind=0; ind < 630; ++ind) {
-    Dedxcorrection::para_long_corrRZL_MC[1][ind]=result_dict["para_long_corrRZLAr"][ind];
-  }
-
-  for (unsigned int ind=0; ind < 63; ++ind) {
-    Dedxcorrection::para_short_corrRZL_MC[1][ind]=result_dict["para_short_corrRZLAr"][ind];
-  }
-
-  for (unsigned int ind=0; ind < 252; ++ind) {
-    Dedxcorrection::para_end_corrRZL_MC[1][ind]=result_dict["para_end_corrRZLAr"][ind];
-  }
-
-  for (unsigned int ind=0; ind < 3240; ++ind) {
-    Dedxcorrection::para_long_corrRZ[1][ind]=result_dict["para_long_corrRZ_Ar"][ind];
-  }
-
-  for (unsigned int ind=0; ind < 216; ++ind) {
-    Dedxcorrection::para_short_corrRZ[1][ind]=result_dict["para_short_corrRZ_Ar"][ind];
-  }
-
-  for (unsigned int ind=0; ind < 630; ++ind) {
-    Dedxcorrection::para_long_corrRZL_DATA[1][ind]=result_dict["para_long_corrRZLAr"][ind];
-  }
-
-  for (unsigned int ind=0; ind < 63; ++ind) {
-    Dedxcorrection::para_short_corrRZL_DATA[1][ind]=result_dict["para_short_corrRZLAr"][ind];
-  }
-
-  for (unsigned int ind=0; ind < 252; ++ind) {
-    Dedxcorrection::para_end_corrRZL_DATA[1][ind]=result_dict["para_end_corrRZLAr"][ind];
-  }
-
-  for (unsigned int ind=0; ind < 336; ++ind) {
-    Dedxcorrection::para_end_corrRZ[1][ind]=result_dict["para_end_corrRZ_Ar"][ind];
-  }
-
-  for (unsigned int ind=0; ind < 336; ++ind) {
-    Dedxcorrection::para_end_corrRZ_MC[1][ind]=result_dict["para_end_corrRZ_Ar"][ind];
-  }
-
-        
-                
-  for (unsigned int ind=0; ind < 560; ++ind) {
-    Dedxcorrection::para_end_mimicToXe_DATA[1][ind]=result_dict["para_end_mimicToXeAr"][ind];
-  }
-  for (unsigned int ind=0; ind < 560; ++ind) {
-    Dedxcorrection::para_end_mimicToXe_MC[1][ind]=result_dict["para_end_mimicToXeAr"][ind];
-  }
-  for (unsigned int ind=0; ind < 180; ++ind) {
-    Dedxcorrection::para_short_mimicToXe_DATA[1][ind]=result_dict["para_short_mimicToXeAr"][ind];
-  }
-  for (unsigned int ind=0; ind < 180; ++ind) {
-    Dedxcorrection::para_short_mimicToXe_MC[1][ind]=result_dict["para_short_mimicToXeAr"][ind];
-  }
-  for (unsigned int ind=0; ind < 1800; ++ind) {
-    Dedxcorrection::para_long_mimicToXe_DATA[1][ind]=result_dict["para_long_mimicToXeAr"][ind];
-  }
-  for (unsigned int ind=0; ind < 1800; ++ind) {
-    Dedxcorrection::para_long_mimicToXe_MC[1][ind]=result_dict["para_long_mimicToXeAr"][ind];
-  }
-
-  //      fill Krypton +++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
-  for (unsigned int ind=0; ind < 4; ++ind) {
-    Dedxcorrection::resolution[2][ind]=result_dict["resolution_Kr"][ind];
-  }
-
-  for (unsigned int ind=0; ind < 4; ++ind) {
-    Dedxcorrection::resolution_e[2][ind]=result_dict["resolution_e_Kr"][ind];
-  }
-
-  for (unsigned int ind=0; ind < 3240; ++ind) {
-    Dedxcorrection::para_long_corrRZ_MC[2][ind]=result_dict["para_long_corrRZ_Kr"][ind];
-  }
-
-  for (unsigned int ind=0; ind < 216; ++ind) {
-    Dedxcorrection::para_short_corrRZ_MC[2][ind]=result_dict["para_short_corrRZ_Kr"][ind];
-  }
-
-  for (unsigned int ind=0; ind < 630; ++ind) {
-    Dedxcorrection::para_long_corrRZL_MC[2][ind]=result_dict["para_long_corrRZLKr"][ind];
-  }
-
-  for (unsigned int ind=0; ind < 63; ++ind) {
-    Dedxcorrection::para_short_corrRZL_MC[2][ind]=result_dict["para_short_corrRZLKr"][ind];
-  }
-
-  for (unsigned int ind=0; ind < 252; ++ind) {
-    Dedxcorrection::para_end_corrRZL_MC[2][ind]=result_dict["para_end_corrRZLKr"][ind];
-  }
-
-  for (unsigned int ind=0; ind < 3240; ++ind) {
-    Dedxcorrection::para_long_corrRZ[2][ind]=result_dict["para_long_corrRZ_Kr"][ind];
-  }
-
-  for (unsigned int ind=0; ind < 216; ++ind) {
-    Dedxcorrection::para_short_corrRZ[2][ind]=result_dict["para_short_corrRZ_Kr"][ind];
-  }
-
-  for (unsigned int ind=0; ind < 630; ++ind) {
-    Dedxcorrection::para_long_corrRZL_DATA[2][ind]=result_dict["para_long_corrRZLKr"][ind];
-  }
-
-  for (unsigned int ind=0; ind < 63; ++ind) {
-    Dedxcorrection::para_short_corrRZL_DATA[2][ind]=result_dict["para_short_corrRZLKr"][ind];
-  }
-
-  for (unsigned int ind=0; ind < 252; ++ind) {
-    Dedxcorrection::para_end_corrRZL_DATA[2][ind]=result_dict["para_end_corrRZLKr"][ind];
-  }
-
-  for (unsigned int ind=0; ind < 336; ++ind) {
-    Dedxcorrection::para_end_corrRZ[2][ind]=result_dict["para_end_corrRZ_Kr"][ind];
-  }
-
-  for (unsigned int ind=0; ind < 336; ++ind) {
-    Dedxcorrection::para_end_corrRZ_MC[2][ind]=result_dict["para_end_corrRZ_Kr"][ind];
-  }
-
-        
-                
-  for (unsigned int ind=0; ind < 560; ++ind) {
-    Dedxcorrection::para_end_mimicToXe_DATA[2][ind]=result_dict["para_end_mimicToXeKr"][ind];
-  }
-  for (unsigned int ind=0; ind < 560; ++ind) {
-    Dedxcorrection::para_end_mimicToXe_MC[2][ind]=result_dict["para_end_mimicToXeKr"][ind];
-  }
-  for (unsigned int ind=0; ind < 180; ++ind) {
-    Dedxcorrection::para_short_mimicToXe_DATA[2][ind]=result_dict["para_short_mimicToXeKr"][ind];
-  }
-  for (unsigned int ind=0; ind < 180; ++ind) {
-    Dedxcorrection::para_short_mimicToXe_MC[2][ind]=result_dict["para_short_mimicToXeKr"][ind];
-  }
-  for (unsigned int ind=0; ind < 1800; ++ind) {
-    Dedxcorrection::para_long_mimicToXe_DATA[2][ind]=result_dict["para_long_mimicToXeKr"][ind];
-  }
-  for (unsigned int ind=0; ind < 1800; ++ind) {
-    Dedxcorrection::para_long_mimicToXe_MC[2][ind]=result_dict["para_long_mimicToXeKr"][ind];
-  }
-}
-
-
-
-void TRT_ToT_dEdx::update_Old(std::map<std::string,std::vector<float> > &result_dict)
-{
-  for(int gasType = 0; gasType<3; gasType++) { // loop over gas types
-    for (unsigned int ind=0; ind < 4; ++ind) {
-      Dedxcorrection::resolution[gasType][ind]=result_dict["resolution"][ind];
-    }
-
-    for (unsigned int ind=0; ind < 4; ++ind) {
-      Dedxcorrection::resolution_e[gasType][ind]=result_dict["resolution_e"][ind];
-    }
-
-    for (unsigned int ind=0; ind < 3240; ++ind) {
-      Dedxcorrection::para_long_corrRZ_MC[gasType][ind]=result_dict["para_long_corrRZ_MC"][ind];
-    }
-
-    for (unsigned int ind=0; ind < 216; ++ind) {
-      Dedxcorrection::para_short_corrRZ_MC[gasType][ind]=result_dict["para_short_corrRZ_MC"][ind];
-    }
-
-    for (unsigned int ind=0; ind < 630; ++ind) {
-      Dedxcorrection::para_long_corrRZL_MC[gasType][ind]=result_dict["para_long_corrRZL_MC"][ind];
-    }
-
-    for (unsigned int ind=0; ind < 63; ++ind) {
-      Dedxcorrection::para_short_corrRZL_MC[gasType][ind]=result_dict["para_short_corrRZL_MC"][ind];
-    }
-
-    for (unsigned int ind=0; ind < 252; ++ind) {
-      Dedxcorrection::para_end_corrRZL_MC[gasType][ind]=result_dict["para_end_corrRZL_MC"][ind];
-    }
-
-    for (unsigned int ind=0; ind < 3240; ++ind) {
-      Dedxcorrection::para_long_corrRZ[gasType][ind]=result_dict["para_long_corrRZ_MC"][ind];
-    }
-
-    for (unsigned int ind=0; ind < 216; ++ind) {
-      Dedxcorrection::para_short_corrRZ[gasType][ind]=result_dict["para_short_corrRZ_MC"][ind];
-    }
-
-    for (unsigned int ind=0; ind < 630; ++ind) {
-      Dedxcorrection::para_long_corrRZL_DATA[gasType][ind]=result_dict["para_long_corrRZL_MC"][ind];
-    }
-
-    for (unsigned int ind=0; ind < 63; ++ind) {
-      Dedxcorrection::para_short_corrRZL_DATA[gasType][ind]=result_dict["para_short_corrRZL_MC"][ind];
-    }
-
-    for (unsigned int ind=0; ind < 252; ++ind) {
-      Dedxcorrection::para_end_corrRZL_DATA[gasType][ind]=result_dict["para_end_corrRZL_MC"][ind];
-    }
-
-    for (unsigned int ind=0; ind < 336; ++ind) {
-      Dedxcorrection::para_end_corrRZ[gasType][ind]=result_dict["para_end_corrRZ_MC"][ind];
-    }
-
-    for (unsigned int ind=0; ind < 336; ++ind) {
-      Dedxcorrection::para_end_corrRZ_MC[gasType][ind]=result_dict["para_end_corrRZ_MC"][ind];
-    }
-
-    // Setting aditional corrections
-    for (unsigned int ind=0; ind < 560; ++ind) {
-      Dedxcorrection::para_end_mimicToXe_MC[gasType][ind]   = 1.;
-      Dedxcorrection::para_end_mimicToXe_DATA[gasType][ind] = 1.;
-    }
-
-    for (unsigned int ind=0; ind < 180; ++ind) {
-      Dedxcorrection::para_short_mimicToXe_MC[gasType][ind]   = 1.;
-      Dedxcorrection::para_short_mimicToXe_DATA[gasType][ind] = 1.;
-    }
-
-    for (unsigned int ind=0; ind < 1800; ++ind) {
-      Dedxcorrection::para_long_mimicToXe_MC[gasType][ind]   = 1.;
-      Dedxcorrection::para_long_mimicToXe_DATA[gasType][ind] = 1.;
-    }
-  }
-}
-
-
-
-// callback for DB for scalar values
-StatusCode TRT_ToT_dEdx::update2(int& /*i*/, std::list<std::string>& /*l*/ )
-{
-  const CondAttrListCollection* attrListColl = 0;
-  StoreGateSvc* detStore = 0;
-  StatusCode sc = service( "DetectorStore", detStore );
-
-  if (StatusCode::SUCCESS == detStore->retrieve(attrListColl, "/TRT/Calib/ToT/ToTValue" ))
-    {
-      int dataBaseType = kNewDB;
-      if(attrListColl->size() < 2) dataBaseType = kOldDB;
-
-      CondAttrListCollection::const_iterator first = attrListColl->begin();
-      CondAttrListCollection::const_iterator last  = attrListColl->end();
-
-      if(dataBaseType==kNewDB) 
-        {
-          for (int index=0; first != last; ++first,++index) 
-            {
-              const coral::AttributeList& attrList = (*first).second;
-              Dedxcorrection::paraL_dEdx_p1[index] = attrList["paraL_dEdx_p1"].data<float>();
-              Dedxcorrection::paraL_dEdx_p2[index] = attrList["paraL_dEdx_p2"].data<float>();
-              Dedxcorrection::paraL_dEdx_p3[index] = attrList["paraL_dEdx_p3"].data<float>();
-              Dedxcorrection::paraL_dEdx_p4[index] = attrList["paraL_dEdx_p4"].data<float>();
-              Dedxcorrection::paraL_dEdx_p5[index] = attrList["paraL_dEdx_p5"].data<float>();
-
-              Dedxcorrection::para_dEdx_p1[index] = attrList["para_dEdx_p1"].data<float>();
-              Dedxcorrection::para_dEdx_p2[index] = attrList["para_dEdx_p2"].data<float>();
-              Dedxcorrection::para_dEdx_p3[index] = attrList["para_dEdx_p3"].data<float>();
-              Dedxcorrection::para_dEdx_p4[index] = attrList["para_dEdx_p4"].data<float>();
-              Dedxcorrection::para_dEdx_p5[index] = attrList["para_dEdx_p5"].data<float>();
-                                  
-              Dedxcorrection::norm_offset_data[index] = attrList["norm_offset_data"].data<float>();
-              Dedxcorrection::norm_slope_tot[index] = attrList["norm_slope_tot"].data<float>();  
-              Dedxcorrection::norm_slope_totl[index] = attrList["norm_slope_totl"].data<float>(); 
-              Dedxcorrection::norm_offset_tot[index] = attrList["norm_offset_tot"].data<float>(); 
-              Dedxcorrection::norm_offset_totl[index] = attrList["norm_offset_totl"].data<float>();           
-              Dedxcorrection::norm_nzero[index]=attrList["norm_nzero"].data<int>();
-            }
-        } 
-      else 
-        {
-          ATH_MSG_WARNING ("update2():: Old COOL database tag!");
-          // return update2_Old();
-          for (; first != last; ++first) {  
-            const coral::AttributeList& attrList = (*first).second;
-            for(int gasType=0; gasType<3; gasType++)
-              {
-                Dedxcorrection::paraL_dEdx_p1[gasType] = attrList["paraL_dEdx_p1"].data<float>();
-                Dedxcorrection::paraL_dEdx_p2[gasType] = attrList["paraL_dEdx_p2"].data<float>();
-                Dedxcorrection::paraL_dEdx_p3[gasType] = attrList["paraL_dEdx_p3"].data<float>();
-                Dedxcorrection::paraL_dEdx_p4[gasType] = attrList["paraL_dEdx_p4"].data<float>();
-                Dedxcorrection::paraL_dEdx_p5[gasType] = attrList["paraL_dEdx_p5"].data<float>();
-
-                Dedxcorrection::para_dEdx_p1[gasType] = attrList["para_dEdx_p1"].data<float>();
-                Dedxcorrection::para_dEdx_p2[gasType] = attrList["para_dEdx_p2"].data<float>();
-                Dedxcorrection::para_dEdx_p3[gasType] = attrList["para_dEdx_p3"].data<float>();
-                Dedxcorrection::para_dEdx_p4[gasType] = attrList["para_dEdx_p4"].data<float>();
-                Dedxcorrection::para_dEdx_p5[gasType] = attrList["para_dEdx_p5"].data<float>();
-
-                Dedxcorrection::norm_offset_data[gasType] = attrList["norm_offset_data"].data<float>();
-                Dedxcorrection::norm_slope_tot[gasType] = attrList["norm_slope_tot"].data<float>();  
-                Dedxcorrection::norm_slope_totl[gasType] = attrList["norm_slope_totl"].data<float>(); 
-                Dedxcorrection::norm_offset_tot[gasType] = attrList["norm_offset_tot"].data<float>(); 
-                Dedxcorrection::norm_offset_totl[gasType] = attrList["norm_offset_totl"].data<float>();         
-                Dedxcorrection::norm_nzero[gasType]=attrList["norm_nzero"].data<int>(); 
-              }
-          }
-        }
-    } else {
-    ATH_MSG_ERROR ("Problem reading condDB object. -");
-    return StatusCode::FAILURE;
-  }
-
-  return StatusCode::SUCCESS;
-}
-
-
 
 bool TRT_ToT_dEdx::isGood_Hit(const Trk::TrackStateOnSurface *itr) const
 {
@@ -1057,6 +558,15 @@ double TRT_ToT_dEdx::getProb(EGasType gasType, const double dEdx_obs, const doub
         
   ATH_MSG_DEBUG("getProb():: gasTypeInStraw = "<<gasType<<"");
 
+  SG::ReadCondHandle<TRTDedxcorrection> readHandle{m_ReadKey};
+  const TRTDedxcorrection* Dedxcorrection{*readHandle};
+  if(Dedxcorrection==nullptr)
+    {
+      ATH_MSG_ERROR(" getProb: Could not find any Dedxcorrection in CondStore. Return zero.");
+      return 0;
+    }
+
+
   if(gasType==kUnset)
     {
       ATH_MSG_DEBUG("getProb():: gasTypeInStraw set kUnset that is not allowed! Use gasTypeInStraw(*itr) to get gas type info for that hit first!");
@@ -1073,9 +583,9 @@ double TRT_ToT_dEdx::getProb(EGasType gasType, const double dEdx_obs, const doub
     dEdx_pred= dEdx_pred/correct;
   }
 
-  double Resolution = Dedxcorrection::resolution[gasType][0]+Dedxcorrection::resolution[gasType][1]*(nUsedHits+0.5)+Dedxcorrection::resolution[gasType][2]*(nUsedHits+0.5)*(nUsedHits+0.5)+Dedxcorrection::resolution[gasType][3]*(nUsedHits+0.5)*(nUsedHits+0.5)*(nUsedHits+0.5);
+  double Resolution = Dedxcorrection->resolution[gasType][0]+Dedxcorrection->resolution[gasType][1]*(nUsedHits+0.5)+Dedxcorrection->resolution[gasType][2]*(nUsedHits+0.5)*(nUsedHits+0.5)+Dedxcorrection->resolution[gasType][3]*(nUsedHits+0.5)*(nUsedHits+0.5)*(nUsedHits+0.5);
   if(hypothesis==Trk::electron){
-    Resolution = Dedxcorrection::resolution_e[gasType][0]+Dedxcorrection::resolution_e[gasType][1]*(nUsedHits+0.5)+Dedxcorrection::resolution_e[gasType][2]*(nUsedHits+0.5)*(nUsedHits+0.5)+Dedxcorrection::resolution_e[gasType][3]*(nUsedHits+0.5)*(nUsedHits+0.5)*(nUsedHits+0.5);
+    Resolution = Dedxcorrection->resolution_e[gasType][0]+Dedxcorrection->resolution_e[gasType][1]*(nUsedHits+0.5)+Dedxcorrection->resolution_e[gasType][2]*(nUsedHits+0.5)*(nUsedHits+0.5)+Dedxcorrection->resolution_e[gasType][3]*(nUsedHits+0.5)*(nUsedHits+0.5)*(nUsedHits+0.5);
   }
 
   double prob =exp( -0.5 * ( ( ( dEdx_obs - dEdx_pred ) / (Resolution*dEdx_pred) ) * 
@@ -1129,6 +639,14 @@ double TRT_ToT_dEdx::predictdEdx(EGasType gasType, const double pTrk, Trk::Parti
 
   ATH_MSG_DEBUG("predictdEdx(): gasTypeInStraw = "<<gasType<<"");
 
+  SG::ReadCondHandle<TRTDedxcorrection> readHandle{m_ReadKey};
+  const TRTDedxcorrection* Dedxcorrection{*readHandle};
+  if(Dedxcorrection==nullptr)
+    {
+      ATH_MSG_ERROR(" predictdEdx: Could not find any Dedxcorrection in CondStore. Return zero.");
+      return 0;
+    }
+
   if(gasType==kUnset)
     {
       ATH_MSG_DEBUG("predictdEdx():: gasTypeInStraw set kUnset that is not allowed! Use gasTypeInStraw(*itr) to get gas type info for that hit first!");
@@ -1145,15 +663,15 @@ double TRT_ToT_dEdx::predictdEdx(EGasType gasType, const double pTrk, Trk::Parti
   // do we want to throw an assertion here?
   if(pTrk<100)return 0; 
   if(divideByL){    
-    if(Dedxcorrection::paraL_dEdx_p3[gasType]+1./( std::pow( betaGamma, Dedxcorrection::paraL_dEdx_p5[gasType]))<=0) return 0;
-    return Dedxcorrection::paraL_dEdx_p1[gasType]/std::pow( sqrt( (betaGamma*betaGamma)/(1.+(betaGamma*betaGamma)) ), Dedxcorrection::paraL_dEdx_p4[gasType])  * 
-      (Dedxcorrection::paraL_dEdx_p2[gasType] - std::pow( sqrt( (betaGamma*betaGamma)/(1.+(betaGamma*betaGamma)) ), Dedxcorrection::paraL_dEdx_p4[gasType] ) 
-       - log(Dedxcorrection::paraL_dEdx_p3[gasType]+1./( std::pow( betaGamma, Dedxcorrection::paraL_dEdx_p5[gasType]) ) ) );
+    if(Dedxcorrection->paraL_dEdx_p3[gasType]+1./( std::pow( betaGamma, Dedxcorrection->paraL_dEdx_p5[gasType]))<=0) return 0;
+    return Dedxcorrection->paraL_dEdx_p1[gasType]/std::pow( sqrt( (betaGamma*betaGamma)/(1.+(betaGamma*betaGamma)) ), Dedxcorrection->paraL_dEdx_p4[gasType])  * 
+      (Dedxcorrection->paraL_dEdx_p2[gasType] - std::pow( sqrt( (betaGamma*betaGamma)/(1.+(betaGamma*betaGamma)) ), Dedxcorrection->paraL_dEdx_p4[gasType] ) 
+       - log(Dedxcorrection->paraL_dEdx_p3[gasType]+1./( std::pow( betaGamma, Dedxcorrection->paraL_dEdx_p5[gasType]) ) ) );
   }else {
-    if(Dedxcorrection::para_dEdx_p3[gasType]+1./( std::pow( betaGamma, Dedxcorrection::para_dEdx_p5[gasType]) )<=0)return 0; 
-    return Dedxcorrection::para_dEdx_p1[gasType]/std::pow( sqrt( (betaGamma*betaGamma)/(1.+(betaGamma*betaGamma)) ), Dedxcorrection::para_dEdx_p4[gasType])  * 
-      (Dedxcorrection::para_dEdx_p2[gasType] - std::pow( sqrt( (betaGamma*betaGamma)/(1.+(betaGamma*betaGamma)) ), Dedxcorrection::para_dEdx_p4[gasType] ) 
-       - log(Dedxcorrection::para_dEdx_p3[gasType]+1./( std::pow( betaGamma, Dedxcorrection::para_dEdx_p5[gasType]) ) ) );
+    if(Dedxcorrection->para_dEdx_p3[gasType]+1./( std::pow( betaGamma, Dedxcorrection->para_dEdx_p5[gasType]) )<=0)return 0; 
+    return Dedxcorrection->para_dEdx_p1[gasType]/std::pow( sqrt( (betaGamma*betaGamma)/(1.+(betaGamma*betaGamma)) ), Dedxcorrection->para_dEdx_p4[gasType])  * 
+      (Dedxcorrection->para_dEdx_p2[gasType] - std::pow( sqrt( (betaGamma*betaGamma)/(1.+(betaGamma*betaGamma)) ), Dedxcorrection->para_dEdx_p4[gasType] ) 
+       - log(Dedxcorrection->para_dEdx_p3[gasType]+1./( std::pow( betaGamma, Dedxcorrection->para_dEdx_p5[gasType]) ) ) );
   }
   //return 0;  
 }
@@ -1166,6 +684,14 @@ double TRT_ToT_dEdx::mass(const Trk::TrackStateOnSurface *itr, const double pTrk
 
   ATH_MSG_DEBUG("mass(): gasTypeInStraw = "<<gasType<<"");
 
+  SG::ReadCondHandle<TRTDedxcorrection> readHandle{m_ReadKey};
+  const TRTDedxcorrection* Dedxcorrection{*readHandle};
+  if(Dedxcorrection==nullptr)
+    {
+      ATH_MSG_ERROR(" mass: Could not find any Dedxcorrection in CondStore. Return zero.");
+      return 0;
+    }
+
   if(gasType==kUnset)
     {
       ATH_MSG_WARNING("mass():: gasTypeInStraw set kUnset that is not allowed! Use gasTypeInStraw(*itr) to get gas type info for that hit first!");
@@ -1183,8 +709,8 @@ double TRT_ToT_dEdx::mass(const Trk::TrackStateOnSurface *itr, const double pTrk
   
   TF1 blumRolandi( "BR", blumRolandiFunction.c_str(), 0.7, 100000);
 
-  blumRolandi.SetParameters(Dedxcorrection::para_dEdx_p1[gasType],Dedxcorrection::para_dEdx_p2[gasType],Dedxcorrection::para_dEdx_p3[gasType],Dedxcorrection::para_dEdx_p4[gasType],Dedxcorrection::para_dEdx_p5[gasType], 1. ); 
-  //blumRolandi.SetParameters(&Dedxcorrection::para_dEdx_BB);
+  blumRolandi.SetParameters(Dedxcorrection->para_dEdx_p1[gasType],Dedxcorrection->para_dEdx_p2[gasType],Dedxcorrection->para_dEdx_p3[gasType],Dedxcorrection->para_dEdx_p4[gasType],Dedxcorrection->para_dEdx_p5[gasType], 1. ); 
+  //blumRolandi.SetParameters(&Dedxcorrection->para_dEdx_BB);
   double betaGamma = blumRolandi.GetX(dEdx, bg_min, bg_max); 
   
   ATH_MSG_DEBUG("mass():: return "<<pTrk/betaGamma<<"");
@@ -1253,19 +779,28 @@ double TRT_ToT_dEdx::getToT(unsigned int BitPattern) const
 
 double TRT_ToT_dEdx::correctNormalization(bool divideLength,bool scaledata, double nVtx) const
 {
+  SG::ReadCondHandle<TRTDedxcorrection> readHandle{m_ReadKey};
+  const TRTDedxcorrection* Dedxcorrection{*readHandle};
+  if(Dedxcorrection==nullptr)
+    {
+      ATH_MSG_ERROR(" correctNormalization: Could not find any Dedxcorrection in CondStore. Return zero.");
+      return 0;
+    }
+
+
   EGasType gasType = static_cast<EGasType> (m_useTrackPartWithGasType);
   if(m_useTrackPartWithGasType==kUnset)
     gasType=kXenon;
-  if(nVtx<=0)nVtx=Dedxcorrection::norm_nzero[gasType];
-  double slope = Dedxcorrection::norm_slope_tot[gasType];
-  double offset = Dedxcorrection::norm_offset_tot[gasType];
+  if(nVtx<=0)nVtx=Dedxcorrection->norm_nzero[gasType];
+  double slope = Dedxcorrection->norm_slope_tot[gasType];
+  double offset = Dedxcorrection->norm_offset_tot[gasType];
   if(divideLength){
-    slope = Dedxcorrection::norm_slope_tot[gasType];
-    offset = Dedxcorrection::norm_offset_tot[gasType];
+    slope = Dedxcorrection->norm_slope_tot[gasType];
+    offset = Dedxcorrection->norm_offset_tot[gasType];
   } 
-  double shift = Dedxcorrection::norm_offset_data[gasType];
+  double shift = Dedxcorrection->norm_offset_data[gasType];
   if(!scaledata)shift = 0;
-  return (slope*Dedxcorrection::norm_nzero[gasType]+offset)/(slope*nVtx+offset+shift);
+  return (slope*Dedxcorrection->norm_nzero[gasType]+offset)/(slope*nVtx+offset+shift);
 }
 
 
@@ -1569,6 +1104,14 @@ double TRT_ToT_dEdx::fitFuncBarrelShort_corrRZ(EGasType gasType, double driftRad
 
 double TRT_ToT_dEdx::fitFuncPol_corrRZ(EGasType gasType, int parameter, double driftRadius, int Layer, int Strawlayer, int sign, int set) const
 {
+
+  SG::ReadCondHandle<TRTDedxcorrection> readHandle{m_ReadKey};
+  const TRTDedxcorrection* Dedxcorrection{*readHandle};
+  if(Dedxcorrection==nullptr)
+    {
+      ATH_MSG_ERROR(" fitFuncPol_corrRZ: Could not find any Dedxcorrection in CondStore. Return zero.");
+      return 0;
+    }
   
   double a = 0;
   double b = 0;
@@ -1584,55 +1127,55 @@ double TRT_ToT_dEdx::fitFuncPol_corrRZ(EGasType gasType, int parameter, double d
       //int parId=0;
       //parId=0;
       //if(sign>0)parId=1620;  // FIXME: parId is not used
-      a = Dedxcorrection::para_long_corrRZ[gasType][(6*parameter+0)*30*3+Layer*30+Strawlayer+offset];
-      b = Dedxcorrection::para_long_corrRZ[gasType][(6*parameter+1)*30*3+Layer*30+Strawlayer+offset];
-      c = Dedxcorrection::para_long_corrRZ[gasType][(6*parameter+2)*30*3+Layer*30+Strawlayer+offset];
-      d = Dedxcorrection::para_long_corrRZ[gasType][(6*parameter+3)*30*3+Layer*30+Strawlayer+offset];
-      e = Dedxcorrection::para_long_corrRZ[gasType][(6*parameter+4)*30*3+Layer*30+Strawlayer+offset];
-      f = Dedxcorrection::para_long_corrRZ[gasType][(6*parameter+5)*30*3+Layer*30+Strawlayer+offset];
+      a = Dedxcorrection->para_long_corrRZ[gasType][(6*parameter+0)*30*3+Layer*30+Strawlayer+offset];
+      b = Dedxcorrection->para_long_corrRZ[gasType][(6*parameter+1)*30*3+Layer*30+Strawlayer+offset];
+      c = Dedxcorrection->para_long_corrRZ[gasType][(6*parameter+2)*30*3+Layer*30+Strawlayer+offset];
+      d = Dedxcorrection->para_long_corrRZ[gasType][(6*parameter+3)*30*3+Layer*30+Strawlayer+offset];
+      e = Dedxcorrection->para_long_corrRZ[gasType][(6*parameter+4)*30*3+Layer*30+Strawlayer+offset];
+      f = Dedxcorrection->para_long_corrRZ[gasType][(6*parameter+5)*30*3+Layer*30+Strawlayer+offset];
      
     }else if (set ==1) { // short straws in barrel
       if(sign > 0) offset+=108;
-      a = Dedxcorrection::para_short_corrRZ[gasType][(6*parameter+0)*9+Layer+offset];
-      b = Dedxcorrection::para_short_corrRZ[gasType][(6*parameter+1)*9+Layer+offset];
-      c = Dedxcorrection::para_short_corrRZ[gasType][(6*parameter+2)*9+Layer+offset];
-      d = Dedxcorrection::para_short_corrRZ[gasType][(6*parameter+3)*9+Layer+offset];
-      e = Dedxcorrection::para_short_corrRZ[gasType][(6*parameter+4)*9+Layer+offset];
-      f = Dedxcorrection::para_short_corrRZ[gasType][(6*parameter+5)*9+Layer+offset];
+      a = Dedxcorrection->para_short_corrRZ[gasType][(6*parameter+0)*9+Layer+offset];
+      b = Dedxcorrection->para_short_corrRZ[gasType][(6*parameter+1)*9+Layer+offset];
+      c = Dedxcorrection->para_short_corrRZ[gasType][(6*parameter+2)*9+Layer+offset];
+      d = Dedxcorrection->para_short_corrRZ[gasType][(6*parameter+3)*9+Layer+offset];
+      e = Dedxcorrection->para_short_corrRZ[gasType][(6*parameter+4)*9+Layer+offset];
+      f = Dedxcorrection->para_short_corrRZ[gasType][(6*parameter+5)*9+Layer+offset];
     }else{  // straws in endcap
       if(sign >0) Layer+=14;
-      a = Dedxcorrection::para_end_corrRZ[gasType][(6*parameter+0)*28+Layer];
-      b = Dedxcorrection::para_end_corrRZ[gasType][(6*parameter+1)*28+Layer];
-      c = Dedxcorrection::para_end_corrRZ[gasType][(6*parameter+2)*28+Layer];
-      d = Dedxcorrection::para_end_corrRZ[gasType][(6*parameter+3)*28+Layer];
-      e = Dedxcorrection::para_end_corrRZ[gasType][(6*parameter+4)*28+Layer];
-      f = Dedxcorrection::para_end_corrRZ[gasType][(6*parameter+5)*28+Layer];
+      a = Dedxcorrection->para_end_corrRZ[gasType][(6*parameter+0)*28+Layer];
+      b = Dedxcorrection->para_end_corrRZ[gasType][(6*parameter+1)*28+Layer];
+      c = Dedxcorrection->para_end_corrRZ[gasType][(6*parameter+2)*28+Layer];
+      d = Dedxcorrection->para_end_corrRZ[gasType][(6*parameter+3)*28+Layer];
+      e = Dedxcorrection->para_end_corrRZ[gasType][(6*parameter+4)*28+Layer];
+      f = Dedxcorrection->para_end_corrRZ[gasType][(6*parameter+5)*28+Layer];
     }
   }else{
     if(set==0){ // long straws in barrel
       if(sign > 0) offset=1620;
-      a = Dedxcorrection::para_long_corrRZ_MC[gasType][(6*parameter+0)*30*3+Layer*30+Strawlayer+offset];
-      b = Dedxcorrection::para_long_corrRZ_MC[gasType][(6*parameter+1)*30*3+Layer*30+Strawlayer+offset];
-      c = Dedxcorrection::para_long_corrRZ_MC[gasType][(6*parameter+2)*30*3+Layer*30+Strawlayer+offset];
-      d = Dedxcorrection::para_long_corrRZ_MC[gasType][(6*parameter+3)*30*3+Layer*30+Strawlayer+offset];
-      e = Dedxcorrection::para_long_corrRZ_MC[gasType][(6*parameter+4)*30*3+Layer*30+Strawlayer+offset];
-      f = Dedxcorrection::para_long_corrRZ_MC[gasType][(6*parameter+5)*30*3+Layer*30+Strawlayer+offset];
+      a = Dedxcorrection->para_long_corrRZ_MC[gasType][(6*parameter+0)*30*3+Layer*30+Strawlayer+offset];
+      b = Dedxcorrection->para_long_corrRZ_MC[gasType][(6*parameter+1)*30*3+Layer*30+Strawlayer+offset];
+      c = Dedxcorrection->para_long_corrRZ_MC[gasType][(6*parameter+2)*30*3+Layer*30+Strawlayer+offset];
+      d = Dedxcorrection->para_long_corrRZ_MC[gasType][(6*parameter+3)*30*3+Layer*30+Strawlayer+offset];
+      e = Dedxcorrection->para_long_corrRZ_MC[gasType][(6*parameter+4)*30*3+Layer*30+Strawlayer+offset];
+      f = Dedxcorrection->para_long_corrRZ_MC[gasType][(6*parameter+5)*30*3+Layer*30+Strawlayer+offset];
     }else if (set ==1) { // short straws in barrel
       if(sign > 0) offset+=108;
-      a = Dedxcorrection::para_short_corrRZ_MC[gasType][(6*parameter+0)*9+Layer+offset];
-      b = Dedxcorrection::para_short_corrRZ_MC[gasType][(6*parameter+1)*9+Layer+offset];
-      c = Dedxcorrection::para_short_corrRZ_MC[gasType][(6*parameter+2)*9+Layer+offset];
-      d = Dedxcorrection::para_short_corrRZ_MC[gasType][(6*parameter+3)*9+Layer+offset];
-      e = Dedxcorrection::para_short_corrRZ_MC[gasType][(6*parameter+4)*9+Layer+offset];
-      f = Dedxcorrection::para_short_corrRZ_MC[gasType][(6*parameter+5)*9+Layer+offset];
+      a = Dedxcorrection->para_short_corrRZ_MC[gasType][(6*parameter+0)*9+Layer+offset];
+      b = Dedxcorrection->para_short_corrRZ_MC[gasType][(6*parameter+1)*9+Layer+offset];
+      c = Dedxcorrection->para_short_corrRZ_MC[gasType][(6*parameter+2)*9+Layer+offset];
+      d = Dedxcorrection->para_short_corrRZ_MC[gasType][(6*parameter+3)*9+Layer+offset];
+      e = Dedxcorrection->para_short_corrRZ_MC[gasType][(6*parameter+4)*9+Layer+offset];
+      f = Dedxcorrection->para_short_corrRZ_MC[gasType][(6*parameter+5)*9+Layer+offset];
     }else{  // straws in endcap
       if(sign >0) Layer+=14;
-      a = Dedxcorrection::para_end_corrRZ_MC[gasType][(6*parameter+0)*28+Layer];
-      b = Dedxcorrection::para_end_corrRZ_MC[gasType][(6*parameter+1)*28+Layer];
-      c = Dedxcorrection::para_end_corrRZ_MC[gasType][(6*parameter+2)*28+Layer];
-      d = Dedxcorrection::para_end_corrRZ_MC[gasType][(6*parameter+3)*28+Layer];
-      e = Dedxcorrection::para_end_corrRZ_MC[gasType][(6*parameter+4)*28+Layer];
-      f = Dedxcorrection::para_end_corrRZ_MC[gasType][(6*parameter+5)*28+Layer];
+      a = Dedxcorrection->para_end_corrRZ_MC[gasType][(6*parameter+0)*28+Layer];
+      b = Dedxcorrection->para_end_corrRZ_MC[gasType][(6*parameter+1)*28+Layer];
+      c = Dedxcorrection->para_end_corrRZ_MC[gasType][(6*parameter+2)*28+Layer];
+      d = Dedxcorrection->para_end_corrRZ_MC[gasType][(6*parameter+3)*28+Layer];
+      e = Dedxcorrection->para_end_corrRZ_MC[gasType][(6*parameter+4)*28+Layer];
+      f = Dedxcorrection->para_end_corrRZ_MC[gasType][(6*parameter+5)*28+Layer];
     }    
   }
   return a+b*r+c*r*r+d*r*r*r+e*r*r*r*r+f*r*r*r*r*r;
@@ -1645,29 +1188,37 @@ double TRT_ToT_dEdx::fitFuncEndcap_corrRZL(EGasType gasType, double driftRadius,
    * T(r,R) = T0(r)+ a(r)*R
    */
 
+  SG::ReadCondHandle<TRTDedxcorrection> readHandle{m_ReadKey};
+  const TRTDedxcorrection* Dedxcorrection{*readHandle};
+  if(Dedxcorrection==nullptr)
+    {
+      ATH_MSG_ERROR(" fitFuncEndcap_corrRZL: Could not find any Dedxcorrection in CondStore. Return zero.");
+      return 0;
+    }
+
   double r = fabs(driftRadius);
   double a,b,c,d,e,f,g,h,i;  
   if(sign >0) Layer+=14;
   if(isData()){
-    a = Dedxcorrection::para_end_corrRZL_DATA[gasType][(0)*28+Layer];
-    b = Dedxcorrection::para_end_corrRZL_DATA[gasType][(1)*28+Layer];
-    c = Dedxcorrection::para_end_corrRZL_DATA[gasType][(2)*28+Layer];
-    d = Dedxcorrection::para_end_corrRZL_DATA[gasType][(3)*28+Layer];
-    e = Dedxcorrection::para_end_corrRZL_DATA[gasType][(4)*28+Layer];
-    f = Dedxcorrection::para_end_corrRZL_DATA[gasType][(5)*28+Layer];  
-    g = Dedxcorrection::para_end_corrRZL_DATA[gasType][(6)*28+Layer];  
-    h = Dedxcorrection::para_end_corrRZL_DATA[gasType][(7)*28+Layer];  
-    i = Dedxcorrection::para_end_corrRZL_DATA[gasType][(8)*28+Layer];  
+    a = Dedxcorrection->para_end_corrRZL_DATA[gasType][(0)*28+Layer];
+    b = Dedxcorrection->para_end_corrRZL_DATA[gasType][(1)*28+Layer];
+    c = Dedxcorrection->para_end_corrRZL_DATA[gasType][(2)*28+Layer];
+    d = Dedxcorrection->para_end_corrRZL_DATA[gasType][(3)*28+Layer];
+    e = Dedxcorrection->para_end_corrRZL_DATA[gasType][(4)*28+Layer];
+    f = Dedxcorrection->para_end_corrRZL_DATA[gasType][(5)*28+Layer];  
+    g = Dedxcorrection->para_end_corrRZL_DATA[gasType][(6)*28+Layer];  
+    h = Dedxcorrection->para_end_corrRZL_DATA[gasType][(7)*28+Layer];  
+    i = Dedxcorrection->para_end_corrRZL_DATA[gasType][(8)*28+Layer];  
   }else{
-    a = Dedxcorrection::para_end_corrRZL_MC[gasType][(0)*28+Layer];
-    b = Dedxcorrection::para_end_corrRZL_MC[gasType][(1)*28+Layer];
-    c = Dedxcorrection::para_end_corrRZL_MC[gasType][(2)*28+Layer];
-    d = Dedxcorrection::para_end_corrRZL_MC[gasType][(3)*28+Layer];
-    e = Dedxcorrection::para_end_corrRZL_MC[gasType][(4)*28+Layer];
-    f = Dedxcorrection::para_end_corrRZL_MC[gasType][(5)*28+Layer];  
-    g = Dedxcorrection::para_end_corrRZL_MC[gasType][(6)*28+Layer];  
-    h = Dedxcorrection::para_end_corrRZL_MC[gasType][(7)*28+Layer];  
-    i = Dedxcorrection::para_end_corrRZL_MC[gasType][(8)*28+Layer]; 
+    a = Dedxcorrection->para_end_corrRZL_MC[gasType][(0)*28+Layer];
+    b = Dedxcorrection->para_end_corrRZL_MC[gasType][(1)*28+Layer];
+    c = Dedxcorrection->para_end_corrRZL_MC[gasType][(2)*28+Layer];
+    d = Dedxcorrection->para_end_corrRZL_MC[gasType][(3)*28+Layer];
+    e = Dedxcorrection->para_end_corrRZL_MC[gasType][(4)*28+Layer];
+    f = Dedxcorrection->para_end_corrRZL_MC[gasType][(5)*28+Layer];  
+    g = Dedxcorrection->para_end_corrRZL_MC[gasType][(6)*28+Layer];  
+    h = Dedxcorrection->para_end_corrRZL_MC[gasType][(7)*28+Layer];  
+    i = Dedxcorrection->para_end_corrRZL_MC[gasType][(8)*28+Layer]; 
   } 
 
   double T1    = b*r+c*r*r+d*r*r*r+e*r*r*r*r+f*r*r*r*r*r;
@@ -1683,45 +1234,52 @@ double TRT_ToT_dEdx::fitFuncBarrel_corrRZL(EGasType gasType, double driftRadius,
   /*
    * T(r,z) = T0(r)+ b(r)*z*z 
    */
+  SG::ReadCondHandle<TRTDedxcorrection> readHandle{m_ReadKey};
+  const TRTDedxcorrection* Dedxcorrection{*readHandle};
+  if(Dedxcorrection==nullptr)
+    {
+      ATH_MSG_ERROR(" fitFuncBarrel_corrRZL: Could not find any Dedxcorrection in CondStore. Return zero.");
+      return 0;
+    }
 
   double a,b,c,d,e,f,g;  
 
   if(Layer==0 && Strawlayer<9){ // short straws
     if(isData()){
-      a = Dedxcorrection::para_short_corrRZL_DATA[gasType][(0)*9+Strawlayer];
-      b = Dedxcorrection::para_short_corrRZL_DATA[gasType][(1)*9+Strawlayer];
-      c = Dedxcorrection::para_short_corrRZL_DATA[gasType][(2)*9+Strawlayer];
-      d = Dedxcorrection::para_short_corrRZL_DATA[gasType][(3)*9+Strawlayer];
-      e = Dedxcorrection::para_short_corrRZL_DATA[gasType][(4)*9+Strawlayer];
-      f = Dedxcorrection::para_short_corrRZL_DATA[gasType][(5)*9+Strawlayer];
-      g = Dedxcorrection::para_short_corrRZL_DATA[gasType][(6)*9+Strawlayer];
+      a = Dedxcorrection->para_short_corrRZL_DATA[gasType][(0)*9+Strawlayer];
+      b = Dedxcorrection->para_short_corrRZL_DATA[gasType][(1)*9+Strawlayer];
+      c = Dedxcorrection->para_short_corrRZL_DATA[gasType][(2)*9+Strawlayer];
+      d = Dedxcorrection->para_short_corrRZL_DATA[gasType][(3)*9+Strawlayer];
+      e = Dedxcorrection->para_short_corrRZL_DATA[gasType][(4)*9+Strawlayer];
+      f = Dedxcorrection->para_short_corrRZL_DATA[gasType][(5)*9+Strawlayer];
+      g = Dedxcorrection->para_short_corrRZL_DATA[gasType][(6)*9+Strawlayer];
     }else{
-      a = Dedxcorrection::para_short_corrRZL_MC[gasType][(0)*9+Strawlayer];
-      b = Dedxcorrection::para_short_corrRZL_MC[gasType][(1)*9+Strawlayer];
-      c = Dedxcorrection::para_short_corrRZL_MC[gasType][(2)*9+Strawlayer];
-      d = Dedxcorrection::para_short_corrRZL_MC[gasType][(3)*9+Strawlayer];
-      e = Dedxcorrection::para_short_corrRZL_MC[gasType][(4)*9+Strawlayer];
-      f = Dedxcorrection::para_short_corrRZL_MC[gasType][(5)*9+Strawlayer];
-      g = Dedxcorrection::para_short_corrRZL_MC[gasType][(6)*9+Strawlayer];
+      a = Dedxcorrection->para_short_corrRZL_MC[gasType][(0)*9+Strawlayer];
+      b = Dedxcorrection->para_short_corrRZL_MC[gasType][(1)*9+Strawlayer];
+      c = Dedxcorrection->para_short_corrRZL_MC[gasType][(2)*9+Strawlayer];
+      d = Dedxcorrection->para_short_corrRZL_MC[gasType][(3)*9+Strawlayer];
+      e = Dedxcorrection->para_short_corrRZL_MC[gasType][(4)*9+Strawlayer];
+      f = Dedxcorrection->para_short_corrRZL_MC[gasType][(5)*9+Strawlayer];
+      g = Dedxcorrection->para_short_corrRZL_MC[gasType][(6)*9+Strawlayer];
     }
     
   }else{
     if(isData()){
-      a = Dedxcorrection::para_long_corrRZL_DATA[gasType][(0)*30*3+Layer*30+Strawlayer];
-      b = Dedxcorrection::para_long_corrRZL_DATA[gasType][(1)*30*3+Layer*30+Strawlayer];
-      c = Dedxcorrection::para_long_corrRZL_DATA[gasType][(2)*30*3+Layer*30+Strawlayer];
-      d = Dedxcorrection::para_long_corrRZL_DATA[gasType][(3)*30*3+Layer*30+Strawlayer];
-      e = Dedxcorrection::para_long_corrRZL_DATA[gasType][(4)*30*3+Layer*30+Strawlayer];
-      f = Dedxcorrection::para_long_corrRZL_DATA[gasType][(5)*30*3+Layer*30+Strawlayer];
-      g = Dedxcorrection::para_long_corrRZL_DATA[gasType][(6)*30*3+Layer*30+Strawlayer];
+      a = Dedxcorrection->para_long_corrRZL_DATA[gasType][(0)*30*3+Layer*30+Strawlayer];
+      b = Dedxcorrection->para_long_corrRZL_DATA[gasType][(1)*30*3+Layer*30+Strawlayer];
+      c = Dedxcorrection->para_long_corrRZL_DATA[gasType][(2)*30*3+Layer*30+Strawlayer];
+      d = Dedxcorrection->para_long_corrRZL_DATA[gasType][(3)*30*3+Layer*30+Strawlayer];
+      e = Dedxcorrection->para_long_corrRZL_DATA[gasType][(4)*30*3+Layer*30+Strawlayer];
+      f = Dedxcorrection->para_long_corrRZL_DATA[gasType][(5)*30*3+Layer*30+Strawlayer];
+      g = Dedxcorrection->para_long_corrRZL_DATA[gasType][(6)*30*3+Layer*30+Strawlayer];
     }else{
-      a = Dedxcorrection::para_long_corrRZL_MC[gasType][(0)*30*3+Layer*30+Strawlayer];
-      b = Dedxcorrection::para_long_corrRZL_MC[gasType][(1)*30*3+Layer*30+Strawlayer];
-      c = Dedxcorrection::para_long_corrRZL_MC[gasType][(2)*30*3+Layer*30+Strawlayer];
-      d = Dedxcorrection::para_long_corrRZL_MC[gasType][(3)*30*3+Layer*30+Strawlayer];
-      e = Dedxcorrection::para_long_corrRZL_MC[gasType][(4)*30*3+Layer*30+Strawlayer];
-      f = Dedxcorrection::para_long_corrRZL_MC[gasType][(5)*30*3+Layer*30+Strawlayer];
-      g = Dedxcorrection::para_long_corrRZL_MC[gasType][(6)*30*3+Layer*30+Strawlayer];
+      a = Dedxcorrection->para_long_corrRZL_MC[gasType][(0)*30*3+Layer*30+Strawlayer];
+      b = Dedxcorrection->para_long_corrRZL_MC[gasType][(1)*30*3+Layer*30+Strawlayer];
+      c = Dedxcorrection->para_long_corrRZL_MC[gasType][(2)*30*3+Layer*30+Strawlayer];
+      d = Dedxcorrection->para_long_corrRZL_MC[gasType][(3)*30*3+Layer*30+Strawlayer];
+      e = Dedxcorrection->para_long_corrRZL_MC[gasType][(4)*30*3+Layer*30+Strawlayer];
+      f = Dedxcorrection->para_long_corrRZL_MC[gasType][(5)*30*3+Layer*30+Strawlayer];
+      g = Dedxcorrection->para_long_corrRZL_MC[gasType][(6)*30*3+Layer*30+Strawlayer];
     }
   }
   double z = fabs(zPosition);
@@ -1979,6 +1537,15 @@ int TRT_ToT_dEdx::TrailingEdge_v3(unsigned int BitPattern) const
  
 double TRT_ToT_dEdx::mimicToXeHit_Endcap(EGasType gasType, double driftRadius, int Layer, int sign) const
 {
+  SG::ReadCondHandle<TRTDedxcorrection> readHandle{m_ReadKey};
+  const TRTDedxcorrection* Dedxcorrection{*readHandle};
+  if(Dedxcorrection==nullptr)
+    {
+      ATH_MSG_ERROR(" mimicToXeHit_Endcap: Could not find any Dedxcorrection in CondStore. Return zero.");
+      return 0;
+    }
+
+
   double r = fabs(driftRadius); 
   double a; 
 
@@ -1994,9 +1561,9 @@ double TRT_ToT_dEdx::mimicToXeHit_Endcap(EGasType gasType, double driftRadius, i
   int side = 0; // A side
   if(sign <0) side =1; // C side
   if(isData())
-    a = Dedxcorrection::para_end_mimicToXe_DATA[gasType][(side*14+Layer)*20+(rBin)];
+    a = Dedxcorrection->para_end_mimicToXe_DATA[gasType][(side*14+Layer)*20+(rBin)];
   else
-    a = Dedxcorrection::para_end_mimicToXe_MC[gasType][(side*14+Layer)*20+(rBin)];
+    a = Dedxcorrection->para_end_mimicToXe_MC[gasType][(side*14+Layer)*20+(rBin)];
 
   ATH_MSG_DEBUG("mimicToXeHit_Endcap():: isData = " << isData() << " gasTypeInStraw = " << gasType
                 << " side = " << side << " Layer = " << Layer << " rBin = " << rBin <<" BINPOS = " << (side*14+Layer)*20+(rBin) 
@@ -2007,6 +1574,15 @@ double TRT_ToT_dEdx::mimicToXeHit_Endcap(EGasType gasType, double driftRadius, i
 
 double TRT_ToT_dEdx::mimicToXeHit_Barrel(EGasType gasType, double driftRadius, int Layer, int Strawlayer) const 
 {
+
+  SG::ReadCondHandle<TRTDedxcorrection> readHandle{m_ReadKey};
+  const TRTDedxcorrection* Dedxcorrection{*readHandle};
+  if(Dedxcorrection==nullptr)
+    {
+      ATH_MSG_ERROR(" mimicToXeHit_Barrel: Could not find any Dedxcorrection in CondStore. Return zero.");
+      return 0;
+    }
+
   double r = fabs(driftRadius); 
   double a;  
 
@@ -2021,14 +1597,14 @@ double TRT_ToT_dEdx::mimicToXeHit_Barrel(EGasType gasType, double driftRadius, i
 
   if(Layer==0 && Strawlayer<9){ // short straws
     if(isData())
-      a = Dedxcorrection::para_short_mimicToXe_DATA[gasType][Strawlayer*20+(rBin)];
+      a = Dedxcorrection->para_short_mimicToXe_DATA[gasType][Strawlayer*20+(rBin)];
     else
-      a = Dedxcorrection::para_short_mimicToXe_MC[gasType][Strawlayer*20+(rBin)];
+      a = Dedxcorrection->para_short_mimicToXe_MC[gasType][Strawlayer*20+(rBin)];
   }else{
     if(isData())
-      a = Dedxcorrection::para_long_mimicToXe_DATA[gasType][Layer*30*20+Strawlayer*20+(rBin)];
+      a = Dedxcorrection->para_long_mimicToXe_DATA[gasType][Layer*30*20+Strawlayer*20+(rBin)];
     else
-      a = Dedxcorrection::para_long_mimicToXe_MC[gasType][Layer*30*20+Strawlayer*20+(rBin)];
+      a = Dedxcorrection->para_long_mimicToXe_MC[gasType][Layer*30*20+Strawlayer*20+(rBin)];
   }
 
   ATH_MSG_DEBUG("mimicToXeHit_Barrel():: isData = " << isData() << " Layer = " << Layer << " Strawlayer = " << Strawlayer << " rBin = " << rBin << " a = " << a << "" );
diff --git a/LArCalorimeter/LArCnv/LArTPCnv/LArTPCnv/selection.xml b/LArCalorimeter/LArCnv/LArTPCnv/LArTPCnv/selection.xml
index 5228a17c90b44254d3f673ba773e872bc7d4d4ce..ccb76447cff76c25a031c3689e72c6f20e993871 100644
--- a/LArCalorimeter/LArCnv/LArTPCnv/LArTPCnv/selection.xml
+++ b/LArCalorimeter/LArCnv/LArTPCnv/LArTPCnv/selection.xml
@@ -11,8 +11,9 @@
   <class name="LArNoisyROSummary_p3" id="7801CF21-F2F2-4E87-9B87-744F31A37D1B"/>
   <class name="LArNoisyROSummary_p4" id="8F9E9A44-699E-4056-96CC-555ADA1179D4"/>
   <class name="LArNoisyROSummary_p5" id="4AE11DAE-F40C-4B90-B105-0A7BA5D29C1D"/>
-  <class name="std::pair<unsigned int, std::vector<int> >" />
   <class name="std::vector<std::pair<unsigned int, std::vector<int> > >" />
+  <!-- pair<unsigned,vector<int> > and associated pair_base -->
+  <class pattern="std::*pair*<unsigned int*std::vector<int*" />
 
 
 </lcgdict>
diff --git a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/MuonEventTPCnv/selection.xml b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/MuonEventTPCnv/selection.xml
index dc4a7e95d883c7d92ff0a455c83bb193a62fd1dd..fb43f5fc8c99d347b9a02a2288f7ccfdaf9f98a8 100755
--- a/MuonSpectrometer/MuonCnv/MuonEventTPCnv/MuonEventTPCnv/selection.xml
+++ b/MuonSpectrometer/MuonCnv/MuonEventTPCnv/MuonEventTPCnv/selection.xml
@@ -87,7 +87,7 @@
 
     <!-- MuonChamberT0s -->
     <class name="Muon::ChamberT0s_p1" id="67E3F1AE-6254-4B29-8D61-5F17D0C19BB2"/>
-    <class name="std::pair< unsigned int, float>"/>
+    <class pattern="std::*pair*<unsigned int*float>"/>
     <class name="std::vector< std::pair< unsigned int, float> >"/>
     
     <!-- MuonDigitContainer -->
@@ -103,9 +103,9 @@
 
     <class name="Muon::MuonSimData_p1" />
     <class name="Muon::MuonMCData_p1" />
-    <class name="std::pair<HepMcParticleLink_p1, Muon::MuonMCData_p1>" />
+    <class pattern="std::*pair*<HepMcParticleLink_p1, Muon::MuonMCData_p1>" />
     <class name="std::vector<std::pair<HepMcParticleLink_p1, Muon::MuonMCData_p1> >" />
-    <class name="std::pair<unsigned int, Muon::MuonSimData_p1>" />
+    <class pattern="std::*pair*<unsigned int, Muon::MuonSimData_p1>" />
     <class name="std::vector< std::pair<unsigned int, Muon::MuonSimData_p1> >" />
     <class name="Muon::MuonSimDataCollection_p1" id="0605B4A3-3744-4486-B39D-F9C9E809D868"/>
 
@@ -118,9 +118,9 @@
 
     <class name="Muon::CscSimData_p1" />
     <class name="Muon::CscMcData_p1" />
-    <class name="std::pair<HepMcParticleLink_p1, Muon::CscMcData_p1>" />
+    <class pattern="std::*pair*<HepMcParticleLink_p1, Muon::CscMcData_p1>" />
     <class name="std::vector<std::pair<HepMcParticleLink_p1, Muon::CscMcData_p1> >" />
-    <class name="std::pair<unsigned int, Muon::CscSimData_p1>" />
+    <class pattern="std::*pair*<unsigned int, Muon::CscSimData_p1>" />
     <class name="std::vector< std::pair<unsigned int, Muon::CscSimData_p1> >" />
     <class name="Muon::CscSimDataCollection_p1" id="DD2A8397-4435-4DA2-AD14-ADD7294694B2"/>
     
diff --git a/MuonSpectrometer/MuonConfig/python/MuonSegmentFindingConfig.py b/MuonSpectrometer/MuonConfig/python/MuonSegmentFindingConfig.py
index 1638457f065987dde501a94503b5a8fdc4b72f7d..4dba5351d37e3164d5a690065f41d5fc7f3c6a98 100644
--- a/MuonSpectrometer/MuonConfig/python/MuonSegmentFindingConfig.py
+++ b/MuonSpectrometer/MuonConfig/python/MuonSegmentFindingConfig.py
@@ -244,7 +244,6 @@ def MdtDriftCircleOnTrackCreatorAdjustableT0(flags,**kwargs):
     kwargs.setdefault("TimingMode", 3)
     kwargs.setdefault("DoTofCorrection", True)
     kwargs.setdefault("TimeWindowSetting", mdtCalibWindowNumber('Collision_data'))
-    kwargs.setdefault("MuonTofTool", AdjustableT0Tool(flags))
     return MdtDriftCircleOnTrackCreator(name,**kwargs)
 
 def AdjustableT0Tool(flags,**kwargs):
@@ -373,7 +372,6 @@ def DCMathSegmentMakerCfg(flags, **kwargs):
     # ToolHandle<MuonEDMPrinterTool>            m_printer;         //<! printer helper tool
     # ToolHandle<MuonEDMHelperTool>             m_helper;          //<! printer helper tool
     # ToolHandle<IMdtSegmentFinder>             m_segmentFinder;   //<! segment finder tool MdtSegmentFinder
-    # mutable ToolHandle<AdjT0::IAdjustableT0Tool>      m_tofTool;         //<! tof tool
     # ToolHandle<IMuonSegmentFittingTool>       m_segmentFitter;   //<! segment fitting tool
     # ToolHandle<IMuonSegmentSelectionTool>     m_segmentSelectionTool; //<! segment selection tool
     # ToolHandle<IDCSLFitProvider>              m_dcslFitProvider;
@@ -408,13 +406,11 @@ def DCMathSegmentMakerCfg(flags, **kwargs):
         kwargs.setdefault("RecoverBadRpcCabling", True)
 
     if doSegmentT0Fit:
-        tof_tool = AdjustableT0Tool(flags)
         acc, mdt_creator = MuonConfig.MuonRIO_OnTrackCreatorConfig.MdtDriftCircleOnTrackCreatorCfg(flags, name="MdtDriftCircleOnTrackCreatorAdjustableT0", TimingMode=3, \
-                   DoTofCorrection=True, TimeWindowSetting=mdtCalibWindowNumber('Collision_data'), MuonTofTool=tof_tool)
+                   DoTofCorrection=True, TimeWindowSetting=mdtCalibWindowNumber('Collision_data'))
         acc.addPublicTool(mdt_creator)
         result.merge(acc)
         kwargs.setdefault("MdtCreatorT0", mdt_creator) # TODO - is this correct? 
-        kwargs.setdefault("TofTool", tof_tool(flags))
         mdt_math_segment_finder = MdtMathSegmentFinder(flags, doSegmentT0Fit=True)
     else:
         mdt_math_segment_finder = MdtMathSegmentFinder(flags)
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRIO_OnTrackCreators/MdtDriftCircleOnTrackCreator/MdtDriftCircleOnTrackCreator/MdtDriftCircleOnTrackCreator.h b/MuonSpectrometer/MuonReconstruction/MuonRIO_OnTrackCreators/MdtDriftCircleOnTrackCreator/MdtDriftCircleOnTrackCreator/MdtDriftCircleOnTrackCreator.h
index 0d45a2ecf0c8f1a2bf9a6e95308cfdb30726b48d..48ac14b1f951e46d35f6ca140d0a4796ac043c05 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonRIO_OnTrackCreators/MdtDriftCircleOnTrackCreator/MdtDriftCircleOnTrackCreator/MdtDriftCircleOnTrackCreator.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonRIO_OnTrackCreators/MdtDriftCircleOnTrackCreator/MdtDriftCircleOnTrackCreator/MdtDriftCircleOnTrackCreator.h
@@ -102,6 +102,7 @@ namespace Muon {
       virtual const MdtDriftCircleOnTrack* createRIO_OnTrack( const MdtPrepData& prd,
                                                               const Amg::Vector3D& globalPos,
                                                               const Amg::Vector3D* gdir = 0,
+							      float t0Shift = 0,
                                                               const MuonDriftCircleErrorStrategy* strategy = 0 ) const;
 
       /** @brief Update of the sign of the drift radius. The method creates a new MdtDriftCircleOnTrack, the old input MdtDriftCircleOnTrack is 
@@ -172,10 +173,11 @@ namespace Muon {
       
       /** preform the mdt calibration */
       CalibrationOutput getLocalMeasurement( const MdtPrepData& DC, 
-                                            const Amg::Vector3D& gpos,
-                                            const Amg::Vector3D* gdir,
-                                            MdtCalibrationSvcInput& inputData,
-                                            const MuonDriftCircleErrorStrategy* strategy = 0 ) const;
+					     const Amg::Vector3D& gpos,
+					     const Amg::Vector3D* gdir,
+					     MdtCalibrationSvcInput& inputData,
+					     const MuonDriftCircleErrorStrategy* strategy = 0,
+					     float t0Shift = 0) const;
       
       /** currently returns 0. */
       double getTriggerTime() const { return 0.; }
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRIO_OnTrackCreators/MdtDriftCircleOnTrackCreator/src/MdtDriftCircleOnTrackCreator.cxx b/MuonSpectrometer/MuonReconstruction/MuonRIO_OnTrackCreators/MdtDriftCircleOnTrackCreator/src/MdtDriftCircleOnTrackCreator.cxx
index abe0da0b57fdd0d3e37afc5125b1566e0dabe5a6..22ef2b8d54c04b85d86f84fbc798e374109cff51 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonRIO_OnTrackCreators/MdtDriftCircleOnTrackCreator/src/MdtDriftCircleOnTrackCreator.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonRIO_OnTrackCreators/MdtDriftCircleOnTrackCreator/src/MdtDriftCircleOnTrackCreator.cxx
@@ -167,16 +167,8 @@ StatusCode Muon::MdtDriftCircleOnTrackCreator::initialize()
   }
   
   if( m_timeCorrectionType == COSMICS_TOF ){
-    if( m_tofTool.empty() ) {
-      ATH_MSG_ERROR( "The time of flight tool is not configured. Please check your configuration" );
-      return StatusCode::FAILURE;
-    }
-    if( m_tofTool.retrieve().isSuccess() ){
-      ATH_MSG_DEBUG("Retrieved " << m_tofTool );
-    }else{
-      ATH_MSG_ERROR( "Could not get " << m_tofTool );
-      return StatusCode::FAILURE;
-    }
+    if( m_tofTool.empty() ) ATH_MSG_DEBUG("no TOF tool, TOF will be calculated directly from T0 shift provided");
+    else ATH_CHECK(m_tofTool.retrieve());
     if( !m_errorStrategy.creationParameter(MuonDriftCircleErrorStrategy::TofCorrection) ){
       ATH_MSG_WARNING( "Detected bad default configuration, using Cosmic TOF witout time of flight corrections does not work" );
     }
@@ -200,6 +192,7 @@ const Muon::MdtDriftCircleOnTrack* Muon::MdtDriftCircleOnTrackCreator::createRIO
                                                                                          const MdtPrepData& mdtPrd,
                                                                                          const Amg::Vector3D& GP, 
                                                                                          const Amg::Vector3D* GD,
+											 float t0Shift,
                                                                                          const MuonDriftCircleErrorStrategy* strategy ) const
 {
   const MuonDriftCircleErrorStrategy* myStrategy = 0==strategy?&m_errorStrategy:strategy;
@@ -262,7 +255,7 @@ const Muon::MdtDriftCircleOnTrack* Muon::MdtDriftCircleOnTrackCreator::createRIO
   inputData.trackDirection = GD;
   inputData.nominalWireSurface = nominalSurf;
   inputData.wireSurface = saggedSurf;
-  CalibrationOutput calibOutput = getLocalMeasurement( mdtPrd, GP, GD,inputData, myStrategy ); 
+  CalibrationOutput calibOutput = getLocalMeasurement( mdtPrd, GP, GD,inputData, myStrategy, t0Shift );
   // This basically determines the error etc and is where the bulk of the work is done.
   
   // hack to determine whether we are before or after the spectrum, until we sort this out properly 
@@ -365,7 +358,8 @@ Muon::MdtDriftCircleOnTrackCreator::getLocalMeasurement(const MdtPrepData& DC,
                                                         const Amg::Vector3D& gpos,
                                                         const Amg::Vector3D* /**gdir*/,
                                                         MdtCalibrationSvcInput& inputData,
-                                                        const MuonDriftCircleErrorStrategy* strategy ) const
+                                                        const MuonDriftCircleErrorStrategy* strategy,
+							float t0Shift) const
 {
   const MuonDriftCircleErrorStrategy* myStrategy = 0==strategy?&m_errorStrategy:strategy;
   
@@ -416,7 +410,8 @@ Muon::MdtDriftCircleOnTrackCreator::getLocalMeasurement(const MdtPrepData& DC,
         break;
       case COSMICS_TOF:
         // case for normal cosmic data with rpc trigger or simulation including TOF
-        inputData.tof = m_tofTool->timeOfFlight( DC.identify(), gpos );
+        if(!m_tofTool.empty()) inputData.tof = m_tofTool->timeOfFlight( DC.identify(), gpos );
+	else inputData.tof=t0Shift+gpos.mag()/299.792458;
         ATH_MSG_VERBOSE( " running in COSMICS_TOF mode, tof: " << inputData.tof );
         break;
       default:
@@ -504,7 +499,7 @@ const Muon::MdtDriftCircleOnTrack* Muon::MdtDriftCircleOnTrackCreator::correct(
     return 0;
   }
   
-  return createRIO_OnTrack(*mdtPrd,tp.position(),&tp.momentum(),strategy);
+  return createRIO_OnTrack(*mdtPrd,tp.position(),&tp.momentum(),0,strategy);
 }
 
 
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonRecTools.py b/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonRecTools.py
index f7077514bfc4410e18c60c47f83b21a145d87089..27c0e32e054565a3c1d66040bed06b39aa9a1cad 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonRecTools.py
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonRecTools.py
@@ -137,7 +137,6 @@ def MdtDriftCircleOnTrackCreatorAdjustableT0(name="MdtDriftCircleOnTrackCreatorA
     kwargs.setdefault("TimingMode", 3)
     kwargs.setdefault("DoTofCorrection", True)
     kwargs.setdefault("TimeWindowSetting", mdtCalibWindowNumber('Collision_data'))
-    kwargs.setdefault("MuonTofTool", "AdjustableT0Tool")
     return MdtDriftCircleOnTrackCreator(name,**kwargs)
 
 # default RIO_OnTrackCreator for muons
@@ -399,7 +398,6 @@ def DCMathSegmentMaker(name='DCMathSegmentMaker',extraFlags=None,**kwargs):
 
     if doSegmentT0Fit:
         kwargs.setdefault("MdtCreatorT0", "MdtDriftCircleOnTrackCreatorAdjustableT0")
-        kwargs.setdefault("TofTool", "AdjustableT0Tool")
         kwargs.setdefault("MdtSegmentFinder", "MdtMathT0FitSegmentFinder" )
     else:
         kwargs.setdefault("MdtSegmentFinder", "MdtMathSegmentFinder")
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonRecToolInterfaces/MuonRecToolInterfaces/IMdtDriftCircleOnTrackCreator.h b/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonRecToolInterfaces/MuonRecToolInterfaces/IMdtDriftCircleOnTrackCreator.h
index 5d93e85f006bed8917a0c1d4c3dbdbf02667773b..9f80aef3a186e6cd1f66e4826b4b8bab18134472 100755
--- a/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonRecToolInterfaces/MuonRecToolInterfaces/IMdtDriftCircleOnTrackCreator.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonRecToolInterfaces/MuonRecToolInterfaces/IMdtDriftCircleOnTrackCreator.h
@@ -39,6 +39,7 @@ namespace Muon {
         virtual const MdtDriftCircleOnTrack* createRIO_OnTrack( const MdtPrepData& DC, 
                                                                 const Amg::Vector3D& GP,
                                                                 const Amg::Vector3D* GD = 0,
+								float t0Shift = 0,
                                                                 const MuonDriftCircleErrorStrategy* strategy = 0 ) const = 0;
 
         /** @brief Update of the sign of the drift radius. 
diff --git a/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/DCMathSegmentMaker/src/DCMathSegmentMaker.cxx b/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/DCMathSegmentMaker/src/DCMathSegmentMaker.cxx
index 867bd91307670257d0a3bd8249959883cf4011ca..24f4704c94d82a514e9d2ad5485853c842bad001 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/DCMathSegmentMaker/src/DCMathSegmentMaker.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/DCMathSegmentMaker/src/DCMathSegmentMaker.cxx
@@ -65,7 +65,6 @@
 #include "MuonReadoutGeometry/MuonDetectorManager.h"
 #include "MuonIdHelpers/MdtIdHelper.h"
 
-#include "MuonRecToolInterfaces/IAdjustableT0Tool.h"
 #include "EventPrimitives/EventPrimitivesHelpers.h"
 #include "EventPrimitives/EventPrimitivesToStringConverter.h"
 #include "GeoPrimitives/GeoPrimitivesToStringConverter.h"
@@ -89,7 +88,6 @@ namespace Muon {
     m_printer("Muon::MuonEDMPrinterTool/MuonEDMPrinterTool"),
     m_helper("Muon::MuonEDMHelperTool/MuonEDMHelperTool"),
     m_segmentFinder("Muon::MdtMathSegmentFinder/MdtMathSegmentFinder"),
-    m_tofTool(""),
     m_segmentFitter("Muon::MuonSegmentFittingTool/MuonSegmentFittingTool"),
     m_segmentSelectionTool("Muon::MuonSegmentSelectionTool/MuonSegmentSelectionTool"),
     m_dcslFitProvider(""),
@@ -108,7 +106,6 @@ namespace Muon {
     declareProperty("EDMPrinter", m_printer);
     declareProperty("EDMHelper", m_helper);    
     declareProperty("MdtSegmentFinder",     m_segmentFinder);
-    declareProperty("TofTool",     m_tofTool);
     declareProperty("SegmentFitter", m_segmentFitter);
     declareProperty("SegmentSelector", m_segmentSelectionTool);
     declareProperty("DCFitProvider", m_dcslFitProvider );
@@ -162,10 +159,6 @@ namespace Muon {
     ATH_CHECK( m_segmentFinder.retrieve() );
     ATH_CHECK( m_segmentSelectionTool.retrieve() );
     
-    if( !m_tofTool.empty() ){
-      ATH_CHECK( m_tofTool.retrieve() );
-    }
-
     if( m_refitParameters ){
       ATH_CHECK( m_segmentFitter.retrieve() );
     }
@@ -1772,14 +1765,13 @@ namespace Muon {
       Trk::DriftCircleSide side = locPos[Trk::driftRadius] < 0 ? Trk::LEFT : Trk::RIGHT;
 	  
       const MdtDriftCircleOnTrack* constDC = 0;
-      bool hasT0 = segment.hasT0Shift() && !m_tofTool.empty();
+      bool hasT0 = segment.hasT0Shift();
       if( !hasT0 ){
 	//ATH_MSG_VERBOSE(" recalibrate MDT hit");
 	constDC = m_mdtCreator->createRIO_OnTrack(*riodc->prepRawData(),mdtGP,&gdir);
       }else{
 	ATH_MSG_VERBOSE(" recalibrate MDT hit with shift " << segment.t0Shift());
-	m_tofTool->ResetSetTShift( segment.t0Shift() );
-	constDC = m_mdtCreatorT0->createRIO_OnTrack(*riodc->prepRawData(),mdtGP,&gdir);
+	constDC = m_mdtCreatorT0->createRIO_OnTrack(*riodc->prepRawData(),mdtGP,&gdir,segment.t0Shift());
       }
       
       if( !constDC ){
diff --git a/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/DCMathSegmentMaker/src/DCMathSegmentMaker.h b/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/DCMathSegmentMaker/src/DCMathSegmentMaker.h
index 85ee4c8c08a965db21b83c88102a147816535379..55ed24d9f2088a9923370032433c0a161f8a84f2 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/DCMathSegmentMaker/src/DCMathSegmentMaker.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/DCMathSegmentMaker/src/DCMathSegmentMaker.h
@@ -49,10 +49,6 @@ namespace MuonGM {
   class MuonDetectorManager;
 }
 
-namespace AdjT0 {
-  class IAdjustableT0Tool;
-}
-
 namespace Muon {
   class IMuonCompetingClustersOnTrackCreator;
   class IMdtDriftCircleOnTrackCreator;
@@ -408,7 +404,6 @@ class MdtDriftCircleOnTrack;
     ToolHandle<MuonEDMPrinterTool>            m_printer;         //<! printer helper tool
     ToolHandle<MuonEDMHelperTool>             m_helper;          //<! printer helper tool
     ToolHandle<IMdtSegmentFinder>             m_segmentFinder;   //<! segment finder tool
-    mutable ToolHandle<AdjT0::IAdjustableT0Tool>      m_tofTool;         //<! tof tool
     ToolHandle<IMuonSegmentFittingTool>       m_segmentFitter;   //<! segment fitting tool
     ToolHandle<IMuonSegmentSelectionTool>     m_segmentSelectionTool; //<! segment selection tool
     ToolHandle<IDCSLFitProvider>              m_dcslFitProvider;
diff --git a/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackSteeringTools/src/MooTrackBuilder.cxx b/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackSteeringTools/src/MooTrackBuilder.cxx
index f6d016633b8623a787207637d650224f70c024f4..59fa6f0b916e67ce9b52dac1b27ae7cdbcc7bda0 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackSteeringTools/src/MooTrackBuilder.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackSteeringTools/src/MooTrackBuilder.cxx
@@ -23,7 +23,6 @@
 #include "MuonRecHelperTools/MuonEDMHelperTool.h"
 #include "MuonRecHelperTools/MuonEDMPrinterTool.h"
 #include "MuonIdHelpers/MuonIdHelperTool.h"
-#include "MuonRecToolInterfaces/IAdjustableT0Tool.h"
 
 #include "MuonRecToolInterfaces/IMuonCompetingClustersOnTrackCreator.h"
 #include "MuonRecToolInterfaces/IMdtDriftCircleOnTrackCreator.h"
@@ -64,7 +63,6 @@ namespace Muon {
     m_muonChamberHoleRecoverTool("Muon::MuonChamberHoleRecoveryTool/MuonChamberHoleRecoveryTool"),
     m_trackExtrapolationTool("Muon::MuonTrackExtrapolationTool/MuonTrackExtrapolationTool"),
     m_errorOptimisationTool(""),
-    m_tofTool(""),
     m_magFieldSvc("AtlasFieldSvc",n),
     m_magFieldProperties(Trk::FullField),
     m_ncalls(0),
@@ -83,7 +81,6 @@ namespace Muon {
     declareProperty("MdtRotCreator",m_mdtRotCreator,"Tool to recalibrate MdtDriftCircleOnTrack objects");
     declareProperty("CompetingClustersCreator",m_compRotCreator,"Tool to create CompetingMuonClustersOnTrack objects");
     declareProperty("Propagator",m_propagator,"propagator");
-    declareProperty("TofTool",     m_tofTool);
     declareProperty("MagFieldSvc",    m_magFieldSvc );
     declareProperty("IdHelper",m_idHelper);
     declareProperty("HitRecoveryTool",m_hitRecoverTool);
@@ -108,7 +105,6 @@ namespace Muon {
 
     ATH_CHECK( m_fitter.retrieve() );
     ATH_CHECK( m_slFitter.retrieve() );
-    if( !m_tofTool.empty() ) ATH_CHECK( m_tofTool.retrieve() );
     ATH_CHECK(m_magFieldSvc.retrieve() );
     if( !m_errorOptimisationTool.empty() ) ATH_CHECK( m_errorOptimisationTool.retrieve() );
     ATH_CHECK( m_candidateHandler.retrieve() );
@@ -147,36 +143,6 @@ namespace Muon {
     return m_errorOptimisationTool->optimiseErrors(track);
   }
 
-  Trk::Track* MooTrackBuilder::refit( const MuPatTrack& trkCan ) const {
-
-    if( !trkCan.hasMomentum() || !m_magFieldSvc->toroidOn() ) return m_slFitter->refit(trkCan);
- 
-    // if configured to use t0s check whether there are any segments with fitted T0
-    if( !m_tofTool.empty() ){
-      m_tofTool->ResetSetTShift( 0. );
-      std::vector<MuPatSegment*>::const_iterator sit = trkCan.segments().begin();
-      std::vector<MuPatSegment*>::const_iterator sit_end = trkCan.segments().end();
-      for( ;sit!=sit_end;++sit ){
-        
-        // sanity checks
-        if( !*sit || !(*sit)->segment ) continue;
-        
-        // check whether segment has T0
-        if( !(*sit)->segment->hasFittedT0() ) continue;
-        std::set<Identifier> chIds = m_helper->chamberIds(*(*sit)->segment);
-        for( std::set<Identifier>::iterator chit = chIds.begin();chit!=chIds.end();++chit ){
-          const Identifier& id = *chit;
-          int ieta = m_idHelper->mdtIdHelper().stationEta(id);
-          int iphi = m_idHelper->mdtIdHelper().stationPhi(id);
-          m_tofTool->SetStatTShift(m_idHelper->chamberNameString(id),ieta,iphi,-(*sit)->segment->time());
-          ATH_MSG_DEBUG(" Adding t0 swift: " << m_idHelper->toStringChamber(id) << "  --- " << (*sit)->segment->time() );
-        }
-      }
-    }
-
-    return refit(trkCan.track());
-  }
-
   MuPatTrack* MooTrackBuilder::refine( MuPatTrack& track ) const {
     
     Trk::Track* finalTrack = m_hitRecoverTool->recover(track.track());
diff --git a/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackSteeringTools/src/MooTrackBuilder.h b/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackSteeringTools/src/MooTrackBuilder.h
index 4122f12edfd2198d6cbda44de6b861473866866b..4d99054b30bf7d4e1fa36f2757672865df0b2729 100644
--- a/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackSteeringTools/src/MooTrackBuilder.h
+++ b/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackSteeringTools/src/MooTrackBuilder.h
@@ -25,10 +25,6 @@
 
 class MsgStream;
 
-namespace AdjT0 {
-  class IAdjustableT0Tool;
-}
- 
 namespace Trk {
   class Track;
   class PrepRawData;
@@ -98,12 +94,6 @@ namespace Muon {
     /** @brief access to tool interface */
     static const InterfaceID& interfaceID() { return IID_MooTrackBuilder; }
 
-    /** @brief refit candidate
-        @param trkCan the candidate
-        @return a pointer to the resulting track, will return zero if combination failed. Ownership passed to user.
-    */
-    Trk::Track* refit( const MuPatTrack& trkCan ) const;
-
     /** @brief refit track 
         @param track the track
         @return a pointer to the resulting track, will return zero if combination failed. Ownership passed to user.
@@ -280,7 +270,6 @@ namespace Muon {
     ToolHandle<IMuonTrackExtrapolationTool> m_trackExtrapolationTool; //<! track extrapolation tool
 
     ToolHandle<IMuonErrorOptimisationTool> m_errorOptimisationTool;
-    mutable ToolHandle<AdjT0::IAdjustableT0Tool>   m_tofTool;   //<! tof tool
     ServiceHandle<MagField::IMagFieldSvc>  m_magFieldSvc; 
     Trk::MagneticFieldProperties           m_magFieldProperties; //!< magnetic field properties
 
diff --git a/MuonSpectrometer/MuonSimData/MuonSimData/selection.xml b/MuonSpectrometer/MuonSimData/MuonSimData/selection.xml
index 14af4046cf6f01580ad4a89662403610f54cf1d2..27a524cc001746e93294a29ffdf4621bde4e4a63 100644
--- a/MuonSpectrometer/MuonSimData/MuonSimData/selection.xml
+++ b/MuonSpectrometer/MuonSimData/MuonSimData/selection.xml
@@ -2,13 +2,13 @@
  <class name="MuonSimDataCollection" id="5B50C32E-A036-4B49-AC97-716E53210BE2" />
      <class name="MuonSimData" />
      <class name="MuonMCData" />     
-     <class name="std::pair< HepMcParticleLink ,MuonMCData>" /> 
+     <class pattern="std::*pair*<HepMcParticleLink,MuonMCData>" /> 
      <class name="std::vector<std::pair< HepMcParticleLink , MuonMCData> >" />
      <class name="std::map<Identifier,MuonSimData>" />
  <class name="CscSimDataCollection" id="250EC949-F98B-4F74-9034-178847D1B622" />
      <class name="CscSimData" />
      <class name="CscMcData" />     
-     <class name="std::pair< HepMcParticleLink,CscMcData>" /> 
+     <class pattern="std::*pair*<HepMcParticleLink,CscMcData>" /> 
      <class name="std::vector<std::pair< HepMcParticleLink,CscMcData> >" />
      <class name="std::map<Identifier,CscSimData>" />
 
diff --git a/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_tau_fromesd.sh b/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_tau_fromesd.sh
new file mode 100755
index 0000000000000000000000000000000000000000..ac59da15fd7d1cfe0eb16d5b92cada611dde0bdc
--- /dev/null
+++ b/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_tau_fromesd.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+#
+# art-description: Athena runs topoclustering from an ESD file
+# art-type: grid
+# art-include: 21.0/Athena
+# art-include: 21.0-TrigMC/Athena
+# art-include: master/Athena
+# art-include: 21.3/Athena
+# art-include: 21.9/Athena
+
+athena tauRec/run_tau_standalone.py
+echo "art-result: $?"
diff --git a/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_tau_fromesd_MT_oneThread.sh b/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_tau_fromesd_MT_oneThread.sh
new file mode 100755
index 0000000000000000000000000000000000000000..70c89fe1b5fbde143046f8d34e6af9da1953d1f3
--- /dev/null
+++ b/Reconstruction/RecExample/RecExRecoTest/test/test_recexreco_art_tau_fromesd_MT_oneThread.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+#
+# art-description: Athena runs topoclustering from an ESD file
+# art-type: grid
+# art-include: master/Athena
+
+athena --threads=1 tauRec/run_tau_standalone.py
+echo "art-result: $?"
diff --git a/Reconstruction/egamma/egammaAlgs/python/EMBremCollectionBuilder.py b/Reconstruction/egamma/egammaAlgs/python/EMBremCollectionBuilder.py
index ba1341fc1159ed198955c0ba16d068c013e89e4a..9f486b387a82d8d2684f7ebdebf257b48f64dc6f 100644
--- a/Reconstruction/egamma/egammaAlgs/python/EMBremCollectionBuilder.py
+++ b/Reconstruction/egamma/egammaAlgs/python/EMBremCollectionBuilder.py
@@ -107,27 +107,34 @@ class egammaBremCollectionBuilder ( egammaAlgsConf.EMBremCollectionBuilder ) :
         GSFBuildTRT_ElectronPidTool = None
         if DetFlags.haveRIO.TRT_on() and not InDetFlags.doSLHC() and not InDetFlags.doHighPileup() :
          
-            isMC = False
-            if globalflags.DataSource == "geant4" :
-                isMC = True
-            from TRT_DriftFunctionTool.TRT_DriftFunctionToolConf import TRT_DriftFunctionTool
-            InDetTRT_DriftFunctionTool = TRT_DriftFunctionTool(name      = "InDetTRT_DriftFunctionTool",
-                                                               IsMC      = isMC)
-            ToolSvc += InDetTRT_DriftFunctionTool
-            
+
+            # Calibration DB Service
+            from TRT_ConditionsServices.TRT_ConditionsServicesConf import TRT_CalDbTool
+            InDetTRTCalDbTool = TRT_CalDbTool(name = "TRT_CalDbTool",
+                                          isGEANT4=(globalflags.DataSource == 'geant4'))
+            # Straw status DB Tool
+            from TRT_ConditionsServices.TRT_ConditionsServicesConf import TRT_StrawStatusSummaryTool
+            InDetTRTStrawStatusSummaryTool = TRT_StrawStatusSummaryTool(name = "TRT_StrawStatusSummaryTool",
+                                                                    isGEANT4=(globalflags.DataSource == 'geant4'))
+
    
             from TRT_ElectronPidTools.TRT_ElectronPidToolsConf import InDet__TRT_LocalOccupancy
             GSFBuildTRT_LocalOccupancy = InDet__TRT_LocalOccupancy(name ="GSF_TRT_LocalOccupancy",
-                                                                   TRTDriftFunctionTool = InDetTRT_DriftFunctionTool)
+                                                                   isTrigger			= False,
+                                                                   TRTCalDbTool = InDetTRTCalDbTool,
+                                                                   TRTStrawStatusSummaryTool = InDetTRTStrawStatusSummaryTool )
+
             ToolSvc += GSFBuildTRT_LocalOccupancy
             
             from TRT_ElectronPidTools.TRT_ElectronPidToolsConf import InDet__TRT_ElectronPidToolRun2
             GSFBuildTRT_ElectronPidTool = InDet__TRT_ElectronPidToolRun2(name   = "GSFBuildTRT_ElectronPidTool",
                                                                          TRT_LocalOccupancyTool = GSFBuildTRT_LocalOccupancy,
+                                                                         TRTStrawSummaryTool    = InDetTRTStrawStatusSummaryTool,
                                                                          isData = (globalflags.DataSource == 'data') )
             
             ToolSvc += GSFBuildTRT_ElectronPidTool
 
+
         #
         #  Configurable version of PixelToTPIDTOol
         #
diff --git a/Reconstruction/egamma/egammaValidation/scripts/EgammaARTmonitoring_plotsMaker.py b/Reconstruction/egamma/egammaValidation/scripts/EgammaARTmonitoring_plotsMaker.py
index fbf065d2f9e4d95b4d2005d641dd299501a745cd..7272f31aa2d91f434f62192388f8a6f166838e35 100755
--- a/Reconstruction/egamma/egammaValidation/scripts/EgammaARTmonitoring_plotsMaker.py
+++ b/Reconstruction/egamma/egammaValidation/scripts/EgammaARTmonitoring_plotsMaker.py
@@ -1,115 +1,339 @@
 #!/usr/bin/env python
 #
-# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration.
+# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration.
 #
 
 import sys
-import os
+from ROOT import gDirectory, gROOT, gStyle, kTRUE, kFALSE, \
+    TCanvas, TFile, TH1, \
+    TH1D, TLegend, TPad, kBlack, kBlue, kRed, kGreen, kOrange, kCyan, kPink
 
-#Import the ROOT libraries
-from ROOT import gDirectory, gROOT, gStyle, kTRUE, TCanvas, TFile, TFileIter, TH1, TH1D, TLegend, TPad
+# gROOT.SetBatch(kTRUE)
+gStyle.SetOptStat(0)
+
+cluster_list = [
+
+    {'name': 'clusterAll', 'title': 'Clusters - Inclusive'},
+    {'name': 'cluster10GeV', 'title': 'Clusters - 10 GeV'},
+    {'name': 'clusterPromptAll', 'title': 'Clusters from Prompt - Inclusive'},
+    {'name': 'clusterPrompt10GeV', 'title': 'Clusters from Prompt  - 10 GeV'},
+
+
+]
+electron_comparison_list = [
+    {'name': 'showerShapesAll', 'title': 'Shower Shape - Inclusive'},
+    {'name': 'showerShapes10GeV', 'title': 'Shower Shape - 10 GeV'},
+    {'name': 'isolationAll', 'title': 'Isolation'},
+    {'name': 'recoElectronAll', 'title': 'Reconstructed Electron'},
+    {'name': 'truthRecoElectronLooseLH', 'title': 'Reconstructed Electron LooseLH'},
+    {'name': 'truthRecoElectronMediumLH', 'title': 'Reconstructed Electron MediumLH'},
+    {'name': 'truthRecoElectronTightLH', 'title': 'Reconstructed Electron TightLH'},
+    {'name': 'truthElectronAll', 'title': 'True Electron'},
+    {'name': 'truthPromptElectronAll', 'title': 'True Prompt Electron'},
+    {'name': 'truthElectronRecoElectronAll', 'title': 'True Electron Reconstructed as Electron'},
+    {'name': 'truthPromptElectronWithTrack', 'title': 'True Prompt Electron with Track'},
+    {'name': 'truthPromptElectronWithGSFTrack', 'title': 'True Prompt Electron with GSFTrack'},
+    {'name': 'truthPromptElectronWithReco', 'title': 'True Prompt Electron with Reco Electron'},
+    {'name': 'recoElectronIsoFixedCutTight', 'title': 'Reconstructed Electron FixedCutTight'},
+    {'name': 'recoElectronIsoFixedCutTightTrackOnly', 'title': 'Reconstructed Electron FixedCutTightTrackOnly'},
+    {'name': 'recoElectronIsoFixedCutLoose', 'title': 'Reconstructed Electron FixedCutLoose'},
+    {'name': 'trackingEfficiency', 'title': 'Tracking Efficiency'},
+    {'name': 'GSFEfficiency', 'title': 'GSF Efficiency'},
+    {'name': 'matchingEfficiency', 'title': 'Matching  Efficiency'},
+    {'name': 'reconstructionEfficiency', 'title': 'Reconstruction Efficiency'},
+    {'name': 'recoElectronLooseLHEfficiency', 'title': 'Reconstructed Electron LooseLH Efficiency'},
+    {'name': 'recoElectronMediumLHEfficiency', 'title': 'Reconstructed Electron MediumLH Efficiency'},
+    {'name': 'recoElectronTightLHEfficiency', 'title': 'Reconstructed Electron TightLH Efficiency'},
+    {'name': 'recoElectronIsoFixedCutTightEfficiency', 'title': 'Reconstructed Electron FixedCutTight Efficiency'},
+    {'name': 'recoElectronIsoFixedCutTightTrackOnlyEfficiency', 'title': 'Reconstructed Electron FixedCutTighTrackOnly Efficiency'},
+    {'name': 'recoElectronIsoFixedCutLooseEfficiency', 'title': 'Reconstructed Electron FixedCutLoose Efficiency'},
+]
+
+photon_comparison_list = [
+    {'name': 'recoPhotonAll', 'title': 'Reconstructed Photon'},
+    {'name': 'truthPhotonRecoPhoton', 'title': 'True photon reconstructed as photon'},
+    {'name': 'truthConvPhoton', 'title': 'True converted photon'},
+    {'name': 'truthConvRecoConv', 'title': 'True conversion reconstructed as converted photon'},
+    {'name': 'truthConvRecoConv1Si', 'title': 'True conversion reconstructed as 1 Si conv'},
+    {'name': 'truthConvRecoConv1TRT', 'title': 'True conversion reconstructed as 1 TRT conv'},
+    {'name': 'truthConvRecoConv2Si', 'title': 'True conversion reconstructed as Si-Si conv'},
+    {'name': 'truthConvRecoConv2TRT', 'title': 'True conversion reconstructed as TRT-TRT conv'},
+    {'name': 'truthConvRecoConv2SiTRT', 'title': 'True conversion reconstructed as Si-TRT conv'},
+    {'name': 'truthConvRecoUnconv', 'title': 'True conversion reconstructed as unconverted photon'},
+    {'name': 'truthUnconvPhoton', 'title': 'True unconverted photon'},
+    {'name': 'truthUnconvRecoConv', 'title': 'True unconverted reconstructed as conv photon'},
+    {'name': 'truthUnconvRecoUnconv', 'title': 'True unconverted reconstructed as unconverted photon'},
+    {'name': 'showerShapesAll', 'title': 'Shower Shape - Inclusive'},
+    {'name': 'showerShapes10GeV', 'title': 'Shower Shape - 10 GeV'},
+    {'name': 'isolationAll', 'title': 'Isolation'},
+    {'name': 'recoPhotonUnconvIsoFixedCutTight', 'title': 'FixedCutTight Unconverted Photon'},
+    {'name': 'recoPhotonUnconvIsoFixedCutTightCaloOnly', 'title': 'FixedCutTightCaloOnly Unconverted Photon'},
+    {'name': 'recoPhotonUnconvIsoFixedCutLoose', 'title': 'FixedCutLoose Unconverted Photon'},
+    {'name': 'recoPhotonConvIsoFixedCutTight', 'title': 'FixedCutTight Converted Photon'},
+    {'name': 'recoPhotonConvIsoFixedCutTightCaloOnly', 'title': 'FixedCutTightCaloOnly Converted Photon'},
+    {'name': 'recoPhotonConvIsoFixedCutLoose', 'title': 'FixedCutLoose Converted Photon'},
+    {'name': 'truthPhotonUnconvRecoUnconvEfficiency', 'title': 'True Conv #rightarrow Conv'},
+    {'name': 'truthPhotonRecoConvEfficiency', 'title': 'True Conv #rightarrow Conv'},
+    {'name': 'recoPhotonUnconvIsoFixedCutTightEfficiency', 'title': 'True Conv #rightarrow Conv'},
+    {'name': 'recoPhotonUnconvIsoFixedCutTightCaloOnlyEfficiency', 'title': 'True Conv #rightarrow Conv'},
+    {'name': 'recoPhotonUnconvIsoFixedCutLooseEfficiency', 'title': 'True Conv #rightarrow Conv'},
+    {'name': 'recoPhotonConvIsoFixedCutTightEfficiency', 'title': 'True Conv #rightarrow Conv'},
+    {'name': 'recoPhotonConvIsoFixedCutTightCaloOnlyEfficiency', 'title': 'True Conv #rightarrow Conv'},
+    {'name': 'recoPhotonConvIsoFixedCutLooseEfficiency', 'title': 'True Conv #rightarrow Conv'},
+]
 
-def GetKeyNames(f0, dir = ""):
-    f0.cd(dir)
+photon_fraction_list = [
+    {'name': 'truthPhotonConvRecoConvEfficiency', 'color': kBlack, 'title': 'True Conv #rightarrow Conv'},
+    {'name': 'truthPhotonConvRecoConv1SiEfficiency', 'color': kBlue + 2, 'title': 'True Conv #rightarrow 1 Si Conv'},
+    {'name': 'truthPhotonConvRecoConv1TRTEfficiency', 'color': kRed + 2, 'title': 'True Conv #rightarrow 1 TRT Conv'},
+    {'name': 'truthPhotonConvRecoConv2SiEfficiency', 'color': kGreen + 2, 'title': 'True Conv #rightarrow Si-Si Conv'},
+    {'name': 'truthPhotonConvRecoConv2TRTEfficiency', 'color': kOrange + 2,
+     'title': 'True Conv #rightarrow TRT-TRT Conv'},
+    {'name': 'truthPhotonConvRecoConv2SiTRTEfficiency', 'color': kCyan + 2,
+     'title': 'True Conv #rightarrow Si-TRT Conv'},
+    {'name': 'truthPhotonConvRecoUnconvEfficiency', 'color': kPink + 2, 'title': 'True Conv #rightarrow Unconv'}
+]
+
+
+def get_key_names(file, directory=""):
+    """
+    Function to get the key elements name from a given directory
+    :param file: TFile
+    :param directory: Directory
+    :return:
+    """
+    file.cd(directory)
     return [key.GetName() for key in gDirectory.GetListOfKeys()]
 
-f_baseline = TFile(sys.argv[1])
-f_nightly = TFile(sys.argv[2])
 
-particleType = sys.argv[3]
+def make_comparison_plots(type, f_base, f_nightly, result_file):
+    """
 
-fO = TFile("BN_ComparisonPlots_"+particleType+".hist.root", "RECREATE")
+    :param type: electron or gamma
+    :param f_base: TFile with the baseline plots
+    :param f_nightly: TFile with the nightly plots
+    :param result_file: TFile with the resulting comparison
+    """
+    comparison_list = photon_comparison_list if type == 'gamma' else electron_comparison_list
+    for folder in comparison_list:
+        for histo in get_key_names(f_nightly, folder['name']):
+            h_base = f_base.Get(folder['name'] + '/' + histo)
+            h_nightly = f_nightly.Get(folder['name'] + '/' + histo)
+            make_ratio_plot(h_base, h_nightly, folder['title'], result_file)
 
-gROOT.SetBatch(kTRUE)
-gStyle.SetOptStat(0)
-for folder in GetKeyNames(f_nightly):
-    for histo in GetKeyNames(f_nightly,folder):
 
-        c1 = TCanvas()
-        
-        mainPad =  TPad("mainPad", "top", 0.00, 0.254758, 1.00, 1.00)
-        mainPad.SetLeftMargin(0.12)
-        mainPad.SetRightMargin(0.04)
-        mainPad.SetTopMargin(0.02)
-        mainPad.SetBottomMargin(0.02)
-        mainPad.SetTicky(0)
-        mainPad.SetTickx(0)
-        mainPad.Draw()
+def make_profile_plots(f_base, f_nightly, result_file):
 
-        c1.Update()
-        
-        ratioPad = TPad("ratioPad","bottom", 0.00, 0.00, 1.00, 0.25)
-        ratioPad.SetLeftMargin(0.12)
-        ratioPad.SetRightMargin(0.04)
-        ratioPad.SetTopMargin(0.03)
-        ratioPad.SetTickx(0)
-        ratioPad.SetBottomMargin(0.36)
-        ratioPad.Draw()
-        
-        c1.Update()
+    for i, folder in enumerate(cluster_list):
+        for histo in get_key_names(f_nightly, folder['name']):
+            print(histo)
+            if '2D' not in histo:
+                continue
+            h_base = f_base.Get(folder['name'] + '/' + histo)
+            h_base_profile = h_base.ProfileX(histo+"_ProfileB")
+            h_nightly = f_nightly.Get(folder['name'] + '/' + histo)
+            h_nightly_profile = h_nightly.ProfileX(histo+"_Profile")
+            h_base_profile.SetDirectory(0)
+            h_nightly_profile.SetDirectory(0)
 
-        h_Base = f_baseline.Get(folder+'/'+histo)
-        h_Base.SetLineColor(4)
-        h_Base.SetLineWidth(2)
-        h_Base.GetXaxis().SetLabelOffset(1.20)
-        h_Base.GetYaxis().SetTitleSize(0.045)
-        h_Base.GetYaxis().SetTitleOffset(0.95)
-        
-        h_Night = f_nightly.Get(folder+'/'+histo)
-        h_Night.SetMarkerStyle(8)
-        h_Night.SetMarkerSize(0.5)
- 
-        mainPad.cd()
-        
-        if not "2D" in histo: h_Base.Draw()
-        h_Night.Draw("same p" if not "2D" in histo else "colz")
+            make_ratio_plot(h_base_profile, h_nightly_profile, folder['title'], result_file, "Mean E_{raw}/E_{truth}")
 
-        c1.Update()
 
-        var_name = histo.split("_", 1)[1]
-        
-        leg = TLegend(0.330986, 0.884087, 0.879499, 0.97053)
-        leg.SetHeader(folder+''+var_name, "C")
+
+
+def make_photon_fraction_plot(f_base, f_nightly, result_file):
+    """
+    This functions created a photon validation plot with efficiencies
+    and fractions
+
+    :param f_base TFile with the baseline histograms:
+    :param f_nightly TFile with the nightly histograms:
+    """
+    for histo in get_key_names(f_nightly, 'truthPhotonConvRecoConvEfficiency'):
+
+        variable_name = histo.split("_", 1)[1]
+
+        c1 = TCanvas()
+
+        leg = TLegend(0.1, 0.75, 0.9, 0.9)
         leg.SetNColumns(2)
-        leg.SetFillStyle(0)
-        leg.SetBorderSize(0)
-        if not "2D" in histo: leg.AddEntry(h_Base , "Baseline", "l")
-        leg.AddEntry(h_Night, "Nightly" , "p")
+
+        for i, folder in enumerate(photon_fraction_list):
+
+            baseline = f_base.Get(folder['name'] + '/' + folder['name'] + "_" + variable_name)
+            baseline.SetDirectory(0)
+            nightly = f_nightly.Get(folder['name'] + '/' + folder['name'] + "_" + variable_name)
+            nightly.SetDirectory(0)
+
+            baseline.GetYaxis().SetTitle("Efficiency and fraction")
+
+            baseline.SetLineColor(folder['color'])
+            nightly.SetLineColor(folder['color'])
+            baseline.SetMarkerColor(folder['color'])
+            nightly.SetMarkerColor(folder['color'])
+
+            baseline.SetMarkerStyle(1)
+            nightly.SetMarkerStyle(20)
+
+            leg.AddEntry(nightly, folder['title'], "p")
+
+            if i == 0:
+                baseline.Draw("hist ")
+            else:
+                baseline.Draw("same hist")
+
+            nightly.Draw("p same")
+
         leg.Draw()
-        
-        c1.Update()
-                
-        ratioPad.cd()
-                
-        if not "2D" in histo:
-          h1clone = h_Night.Clone()
-          h1clone.Sumw2()
-          h1clone.SetStats(0)
-          h1clone.Divide(h_Base)
-          h1clone.SetMarkerColor(1)
-          h1clone.SetMarkerStyle(20)
-          if "Efficiency" in folder: 
-            h1clone.GetYaxis().SetRangeUser(h1clone.GetMinimum()*0.7,h1clone.GetMaximum()*1.3)
-            gStyle.SetOptStat(0)
-          h1clone.GetXaxis().SetLabelSize(0.10)
-          h1clone.GetXaxis().SetTitleSize(0.17)
-          h1clone.GetYaxis().SetLabelSize(0.10)
-          h1clone.GetYaxis().SetRangeUser(0.75, 1.25)
-          h1clone.GetYaxis().SetTitle("Ratio")
-          h1clone.GetYaxis().CenterTitle(1)
-          h1clone.GetYaxis().SetTitleSize(0.15)
-          h1clone.GetYaxis().SetTitleOffset(0.3)
-          h1clone.GetYaxis().SetNdivisions(505)
-
-          h1clone.Draw("p")
 
         c1.Update()
-        
-        c1.SaveAs(folder+'_'+var_name+".png" )
-        
-        fO.cd()
-        c1.Write(folder+'_'+var_name)        
-
-fO.Write()
-fO.Close()
+
+        result_file.cd()
+
+        c1.SaveAs("ConvertionEff_" + variable_name + ".png")
+
+        c1.Write("ConvertionEff_" + variable_name)
+
+
+def make_ratio_plot(h_base, h_nightly, name, result_file, y_axis_label=None):
+    """
+
+    :param h_base: Baseline histogram
+    :param h_nightly: Nightly histogram
+    :param name: Human-readable name of the histogram
+    :param result_file: TFile where the output is saved
+    :param y_axis_label: Y axis label is case is needed (fraction vs efficiency)
+    """
+    histogram_name = h_nightly.GetName()
+
+    type_name = histogram_name.split("_", 1)[0]
+    variable_name = histogram_name.split("_", 1)[1]
+
+    c1 = TCanvas()
+
+    main_pad = TPad("main_pad", "top", 0.00, 0.25, 1.00, 1.00)
+    main_pad.SetLeftMargin(0.12)
+    main_pad.SetRightMargin(0.04)
+    main_pad.SetTopMargin(0.02)
+    main_pad.SetBottomMargin(0.02)
+    main_pad.SetTicky(0)
+    main_pad.SetTickx(0)
+    main_pad.Draw()
+
+    ratio_pad = TPad("ratio_pad", "bottom", 0.00, 0.00, 1.00, 0.25)
+    ratio_pad.SetLeftMargin(0.12)
+    ratio_pad.SetRightMargin(0.04)
+    ratio_pad.SetTopMargin(0.03)
+    ratio_pad.SetTickx(0)
+    ratio_pad.SetBottomMargin(0.36)
+    ratio_pad.Draw()
+
+    h_base.SetLineColor(4)
+    h_base.SetLineWidth(2)
+
+
+    h_nightly.SetMarkerStyle(8)
+    h_nightly.SetMarkerSize(0.5)
+
+    main_pad.cd()
+
+
+
+
+    if y_axis_label != None:
+        h_base.GetYaxis().SetTitle(y_axis_label)
+        h_base.GetYaxis().SetTitle(y_axis_label)
+
+    if not '2D' in variable_name or 'Profile' in variable_name:
+        h_base.Draw()
+
+    h_nightly.Draw("same p" if not '2D'  in variable_name or 'Profile' in variable_name else 'colz')
+
+    c1.Update()
+
+    h_base.GetXaxis().SetLabelSize(0)
+    h_base.GetXaxis().SetLabelOffset(999)
+
+    h_base.SetMinimum(min(h_base.GetMinimum(), h_nightly.GetMinimum()) * 0.7)
+    h_base.SetMaximum(max(h_base.GetMaximum(), h_nightly.GetMaximum()) * 1.3)
+
+
+    leg = TLegend(0.4, 0.88, 0.9, 0.95)
+    leg.SetHeader(name, "C")
+    leg.SetNColumns(2)
+    leg.SetFillStyle(0)
+    leg.SetBorderSize(0)
+    leg.AddEntry(h_base, "Baseline", "l")
+    leg.AddEntry(h_nightly, "Nightly", "p")
+    leg.Draw()
+
+    c1.Update()
+
+    ratio_pad.cd()
+
+    h1clone = h_nightly.Clone()
+    h1clone.Sumw2()
+    h1clone.SetStats(0)
+    h1clone.Divide(h_base)
+    h1clone.SetMarkerColor(1)
+    h1clone.SetMarkerStyle(20)
+    if "Efficiency" in histogram_name:
+        h1clone.GetYaxis().SetRangeUser(h1clone.GetMinimum() * 0.7, h1clone.GetMaximum() * 1.3)
+        gStyle.SetOptStat(0)
+    h1clone.GetXaxis().SetLabelSize(0.10)
+    h1clone.GetXaxis().SetTitleSize(0.17)
+    h1clone.GetYaxis().SetLabelSize(0.10)
+    h1clone.GetYaxis().SetRangeUser(0.75, 1.25)
+    h1clone.GetYaxis().SetTitle("Ratio")
+    h1clone.GetYaxis().CenterTitle(1)
+    h1clone.GetYaxis().SetTitleSize(0.15)
+    h1clone.GetYaxis().SetTitleOffset(0.3)
+    h1clone.GetYaxis().SetNdivisions(505)
+
+    h1clone.Draw("hist")
+
+    c1.Update()
+
+
+
+    result_file.cd()
+
+    c1.SaveAs(type_name + '_' + variable_name + ".png")
+
+    c1.Write(type_name + '_' + variable_name)
+
+
+
+if __name__ == '__main__':
+
+    gROOT.SetBatch(kTRUE)
+    gStyle.SetOptStat(0)
+
+    baseline_file = TFile(sys.argv[1])
+    nightly_file = TFile(sys.argv[2])
+    particle_type = sys.argv[3] # it can be 'electron' or 'gamma'
+
+    output_file = TFile("BN_ComparisonPlots_" + particle_type + ".hist.root", "RECREATE")
+
+    make_comparison_plots(particle_type, baseline_file, nightly_file, output_file)
+
+    make_profile_plots(baseline_file, nightly_file, output_file)
+
+
+    if particle_type == 'gamma':
+
+        make_photon_fraction_plot(baseline_file, nightly_file,output_file)
+
+
+
+
+
+
+
+
+
+
+
+
+
 
diff --git a/Reconstruction/egamma/egammaValidation/src/ClusterHistograms.cxx b/Reconstruction/egamma/egammaValidation/src/ClusterHistograms.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..c78d4f790cb190fac3cb1714059c41231a55476d
--- /dev/null
+++ b/Reconstruction/egamma/egammaValidation/src/ClusterHistograms.cxx
@@ -0,0 +1,30 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#include "ClusterHistograms.h"
+#include "AthenaBaseComps/AthCheckMacros.h"
+#include "xAODEgamma/ElectronxAODHelpers.h"
+
+using namespace egammaMonitoring;
+
+StatusCode ClusterHistograms::initializePlots() {
+  
+  histo2DMap["Eraw_Etruth_vs_Etruth_2D"] = (new TH2D(Form("%s_%s",m_name.c_str(),"Eraw_Etruth_vs_Etruth_2D"), ";E^{truth};E^{raw}/E^{truth}", 100,0.,200.,50, 0.5, 1.5));
+  histo2DMap["Eraw_Etruth_vs_eta_2D"] = (new TH2D(Form("%s_%s",m_name.c_str(),"Eraw_Etruth_vs_eta_2D"), ";truth #eta;E^{raw}/E^{truth}", 40,           -3,           3, 50, 0.5, 1.5));
+  ATH_CHECK(m_rootHistSvc->regHist(m_folder+"Eraw_Etruth_vs_Etruth_2D", histo2DMap["Eraw_Etruth_vs_Etruth_2D"]));
+  ATH_CHECK(m_rootHistSvc->regHist(m_folder+"Eraw_Etruth_vs_eta_2D", histo2DMap["Eraw_Etruth_vs_eta_2D"]));
+  return StatusCode::SUCCESS;
+  
+} // initializePlots
+
+void ClusterHistograms::fill(const xAOD::Egamma& egamma) {
+
+  const xAOD::CaloCluster *cluster = egamma.caloCluster();
+  const xAOD::TruthParticle *truth_egamma = xAOD::TruthHelpers::getTruthParticle(egamma);
+  if (truth_egamma) {
+    histo2DMap["Eraw_Etruth_vs_Etruth_2D"]->Fill(truth_egamma->e()/1000,cluster->rawE()/truth_egamma->e());
+    histo2DMap["Eraw_Etruth_vs_eta_2D"]->Fill(truth_egamma->eta(),cluster->rawE()/truth_egamma->e());
+
+  }
+}
diff --git a/Reconstruction/egamma/egammaValidation/src/ClusterHistograms.h b/Reconstruction/egamma/egammaValidation/src/ClusterHistograms.h
new file mode 100644
index 0000000000000000000000000000000000000000..9c9e4ee087e942a85ee5898fa7fe668c8d3877fb
--- /dev/null
+++ b/Reconstruction/egamma/egammaValidation/src/ClusterHistograms.h
@@ -0,0 +1,50 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef EGAMMAVALIDATION_CLUSTERSHISTOGRAMS_H
+#define EGAMMAVALIDATION_CLUSTERSHISTOGRAMS_H
+
+#include "GaudiKernel/ITHistSvc.h"
+#include "xAODEgamma/Egamma.h"
+#include "xAODEgamma/EgammaxAODHelpers.h"
+#include "xAODTruth/TruthParticle.h"
+#include "xAODTruth/xAODTruthHelpers.h"
+#include "EgammaAnalysisInterfaces/IAsgElectronLikelihoodTool.h"
+#include "TH1.h"
+#include "TH2.h"
+
+namespace egammaMonitoring{
+
+  class ClusterHistograms{
+  public:
+
+    // Histos
+    ClusterHistograms(std::string name,
+                   std::string title,
+                   std::string folder,
+                   ITHistSvc * &rootHistSvc
+    ) :
+      m_name(name),
+      m_title(title),
+      m_folder(folder),
+      m_rootHistSvc(rootHistSvc) {}
+
+    std::map<std::string, TH1D* > histoMap;
+    std::map<std::string, TH2D* > histo2DMap;
+
+    StatusCode initializePlots();
+    void fill(const xAOD::Egamma& egamma);
+
+  protected:
+    std::string m_name;
+    std::string m_title;
+    std::string m_folder;
+    ITHistSvc*  m_rootHistSvc =  nullptr;
+
+    
+  };
+
+}
+
+#endif
diff --git a/Reconstruction/egamma/egammaValidation/src/EgammaMonitoring.cxx b/Reconstruction/egamma/egammaValidation/src/EgammaMonitoring.cxx
index 455db0fd9bee60f20bea78d3b3681f907654e5ae..3fd5b9004d2271df0c0cbd0cf30ae844390707e5 100644
--- a/Reconstruction/egamma/egammaValidation/src/EgammaMonitoring.cxx
+++ b/Reconstruction/egamma/egammaValidation/src/EgammaMonitoring.cxx
@@ -6,6 +6,7 @@
 
 #include "EgammaMonitoring.h"
 #include "MCTruthClassifier/IMCTruthClassifier.h"
+#include "GaudiKernel/SystemOfUnits.h"
 #include "IHistograms.h"
 
 
@@ -34,11 +35,27 @@ StatusCode EgammaMonitoring::initialize() {
   showerShapes10GeV = std::unique_ptr<egammaMonitoring::ShowerShapesHistograms>(new egammaMonitoring::ShowerShapesHistograms(
     "showerShapes10GeV","Shower Shapes - 10 GeV", "/MONITORING/showerShapes10GeV/", rootHistSvc));
 
+  clusterAll = std::unique_ptr<egammaMonitoring::ClusterHistograms>(new egammaMonitoring::ClusterHistograms(
+    "clustersAll","Clusters", "/MONITORING/clusterAll/", rootHistSvc));
+
+  cluster10GeV= std::unique_ptr<egammaMonitoring::ClusterHistograms>(new egammaMonitoring::ClusterHistograms(
+    "clusters10GeV","Clusters - 10 GeV", "/MONITORING/cluster10GeV/", rootHistSvc));
+
+  clusterPromptAll = std::unique_ptr<egammaMonitoring::ClusterHistograms>(new egammaMonitoring::ClusterHistograms(
+    "clustersPromptAll","Clusters from Prompt", "/MONITORING/clusterPromptAll/", rootHistSvc));
+
+  clusterPrompt10GeV = std::unique_ptr<egammaMonitoring::ClusterHistograms>(new egammaMonitoring::ClusterHistograms(
+    "clustersPrompt10GeV","Clusters from Prompt - 10 GeV", "/MONITORING/clusterPrompt10GeV/", rootHistSvc));
+
   isolationAll = std::unique_ptr<egammaMonitoring::IsolationHistograms>(new egammaMonitoring::IsolationHistograms(
     "isolationAll","Isolation ", "/MONITORING/isolationAll/", rootHistSvc));
 
   ATH_CHECK(showerShapesAll->initializePlots());
   ATH_CHECK(showerShapes10GeV->initializePlots());
+  ATH_CHECK(clusterAll->initializePlots());
+  ATH_CHECK(cluster10GeV->initializePlots());
+  ATH_CHECK(clusterPromptAll->initializePlots());
+  ATH_CHECK(clusterPrompt10GeV->initializePlots());
   ATH_CHECK(isolationAll->initializePlots());
 
   if ("electron" == m_sampleType) {
@@ -268,6 +285,25 @@ StatusCode EgammaMonitoring::execute() {
     }
 
 
+    ATH_MSG_DEBUG( "------------ Truth Egamma Container ---------------" );
+    for (auto egtruth : *egTruthParticles) {
+
+      if (!egtruth) continue;
+
+      const xAOD::Electron *electron = xAOD::EgammaHelpers::getRecoElectron(egtruth);
+
+      if (!electron) continue;
+
+      clusterPromptAll->fill(*electron);
+      if (egtruth->pt() > 10*Gaudi::Units::GeV) {
+        clusterPrompt10GeV->fill(*electron);
+      }
+     
+
+      
+
+    }
+
     ATH_MSG_DEBUG( "------------ Truth Particles Container ---------------" );
     unsigned int promtpElectronTruthIndex = - 9;
     for (auto truth : *truthParticles) {
@@ -435,11 +471,16 @@ StatusCode EgammaMonitoring::execute() {
     for (auto elrec : *RecoEl) {
 
       if (!elrec) continue;
-
+      clusterAll->fill(*elrec);
+      if (elrec->pt() > 10*Gaudi::Units::GeV) {
+        cluster10GeV->fill(*elrec);
+      }
       recoElectronAll->fill(*elrec);
       showerShapesAll->fill(*elrec);
       isolationAll->fill(*elrec);
-      if ((elrec->pt()) / 1000. > 10.) showerShapes10GeV->fill(*elrec);
+      if (elrec->pt() > 10*Gaudi::Units::GeV) {
+        showerShapes10GeV->fill(*elrec);
+      }
 
       const xAOD::TruthParticle *truth = xAOD::TruthHelpers::getTruthParticle(*elrec);
       if (!truth ) continue;
@@ -506,9 +547,14 @@ StatusCode EgammaMonitoring::execute() {
 
       recoPhotonAll->fill(*phrec);
       isolationAll->fill(*phrec);
-
       showerShapesAll->fill(*phrec);
-      if (phrec->pt()) showerShapes10GeV->fill(*phrec);
+      clusterAll->fill(*phrec);
+      if (phrec->pt() > 10*Gaudi::Units::GeV) {
+        cluster10GeV->fill(*phrec);
+      }
+      if (phrec->pt() > 10*Gaudi::Units::GeV){ 
+        showerShapes10GeV->fill(*phrec);
+      }
 
     } // RecoPh Loop
 
@@ -523,6 +569,10 @@ StatusCode EgammaMonitoring::execute() {
       if (!photon) continue;
 
       truthPhotonRecoPhoton->fill(*egtruth);
+      clusterPromptAll->fill(*photon);
+      if (egtruth->pt() > 10*Gaudi::Units::GeV) {
+        clusterPrompt10GeV->fill(*photon);
+      }
 
       bool isRecoConv = xAOD::EgammaHelpers::isConvertedPhoton(photon);
       xAOD::EgammaParameters::ConversionType convType = xAOD::EgammaHelpers::conversionType(photon);
diff --git a/Reconstruction/egamma/egammaValidation/src/EgammaMonitoring.h b/Reconstruction/egamma/egammaValidation/src/EgammaMonitoring.h
index 6cf1c1cf6c67b4ad4ca387e471af415f8706c417..868af6ba57067bf785f4492809ff14bdc1e3250c 100644
--- a/Reconstruction/egamma/egammaValidation/src/EgammaMonitoring.h
+++ b/Reconstruction/egamma/egammaValidation/src/EgammaMonitoring.h
@@ -42,6 +42,7 @@
 #include "RecoPhotonHistograms.h"
 #include "IHistograms.h"
 #include "ShowerShapesHistograms.h"
+#include "ClusterHistograms.h"
 #include "EfficiencyPlot.h"
 
 #include "IsolationHistograms.h"
@@ -61,6 +62,14 @@ class EgammaMonitoring : public AthAlgorithm
   /// Tools and services ///
   ITHistSvc*   rootHistSvc = nullptr;
 
+
+  std::unique_ptr<egammaMonitoring::ClusterHistograms> clusterAll;
+  std::unique_ptr<egammaMonitoring::ClusterHistograms> cluster10GeV;
+ 
+  std::unique_ptr<egammaMonitoring::ClusterHistograms> clusterPromptAll;
+  std::unique_ptr<egammaMonitoring::ClusterHistograms> clusterPrompt10GeV;
+
+
   std::unique_ptr<egammaMonitoring::ShowerShapesHistograms> showerShapesAll;
   std::unique_ptr<egammaMonitoring::ShowerShapesHistograms> showerShapes10GeV;
   std::unique_ptr<egammaMonitoring::IsolationHistograms> isolationAll;
diff --git a/Reconstruction/tauRec/share/run_tau_standalone.py b/Reconstruction/tauRec/share/run_tau_standalone.py
index cc2739fa760853ce684c7f6bd59444498b974809..926de0666acb183222e9e2435d93b772ebe159b7 100644
--- a/Reconstruction/tauRec/share/run_tau_standalone.py
+++ b/Reconstruction/tauRec/share/run_tau_standalone.py
@@ -83,7 +83,7 @@ svcMgr += CondSvc()
 include( "PerfMonGPerfTools/DisablePerfMon_jobOFragment.py" )
 
 # Input file
-dataFile="/afs/cern.ch/work/a/adbailey/public/ESD/mc16_13TeV.301046.PowhegPythia8EvtGen_AZNLOCTEQ6L1_DYtautau_1000M1250.recon.ESD.e3649_s3170_r9466/ESD.11318157._000005.pool.root.1"
+dataFile="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/RecExRecoTest/mc16_13TeV.361022.Pythia8EvtGen_A14NNPDF23LO_jetjet_JZ2W.recon.ESD.e3668_s3170_r10572_homeMade.pool.root"
 
 from AthenaCommon.AthenaCommonFlags  import athenaCommonFlags
 athenaCommonFlags.FilesInput=[dataFile,dataFile]
diff --git a/Simulation/G4Utilities/G4UserActions/src/VolumeDumper.cxx b/Simulation/G4Utilities/G4UserActions/src/VolumeDumper.cxx
index ac9416230497664375a8eb550cb319515856eb1f..f5c40fec5c576d040081a378c79ee069d2baf3ab 100644
--- a/Simulation/G4Utilities/G4UserActions/src/VolumeDumper.cxx
+++ b/Simulation/G4Utilities/G4UserActions/src/VolumeDumper.cxx
@@ -7,6 +7,7 @@
 
 // Geant4
 #include "G4PhysicalVolumeStore.hh"
+#include "G4LogicalVolume.hh"
 
 // Gaudi
 #include "GaudiKernel/Bootstrap.h"
@@ -30,17 +31,22 @@ void VolumeDumper::BeginOfEventAction(const G4Event*)
         ATH_MSG_INFO("-----------------------------");
 
         G4PhysicalVolumeStore* store = G4PhysicalVolumeStore::GetInstance();
-        std::set<G4String> volumes;
+        std::set<std::pair<G4String, G4String>> volumes;
 
         ATH_MSG_INFO("Size: " << store->size());
 
         for (unsigned int i = 0; i < store->size(); i++) {
-                volumes.insert((*store)[i]->GetName());
+                volumes.insert(
+                    std::pair<G4String, G4String>(
+                        (*store)[i]->GetName(), (*store)[i]->GetLogicalVolume()->GetName() 
+                    ));
         }
 
         for (auto& vol : volumes) {
-                std::cout << "short: " << G4DebuggingHelpers::ClassifyVolume(vol)
-                          << " full: " << vol << std::endl;
+                std::cout << "short: " << G4DebuggingHelpers::ClassifyVolume(vol.first)
+                          << " full: " << vol.first
+                          << " logical: " << vol.second
+                          << std::endl;
         }
 
         ATH_MSG_INFO("Finished dumbing G4PhysicalVolumeStore");
diff --git a/Simulation/ISF/ISF_Validation/test/ISF_Validation_TestConfiguration.xml b/Simulation/ISF/ISF_Validation/test/ISF_Validation_TestConfiguration.xml
deleted file mode 100644
index 1ce4045c743c286c9ee11d45f85f25fe7aed01b3..0000000000000000000000000000000000000000
--- a/Simulation/ISF/ISF_Validation/test/ISF_Validation_TestConfiguration.xml
+++ /dev/null
@@ -1,1745 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE unifiedTestConfiguration SYSTEM "http://www.hep.ucl.ac.uk/atlas/AtlasTesting/DTD/unifiedTestConfiguration.dtd">
-
-<!--
-  don't forget to validate the xml syntax of this file after changing it:
-    python /afs/cern.ch/user/r/rtt/public/xmlvalidate.py ISF_Validation_TestConfiguration.xml
--->
-
-<unifiedTestConfiguration>
-  <rtt xmlns="http://www.hep.ucl.ac.uk/atlas/AtlasTesting/rtt">
-    <rttContactPerson>Elmar Ritsch (elmar.ritsch@cern.ch)</rttContactPerson>
-    <rttContactPerson>John Chapman (chapman@hep.phy.cam.ac.uk)</rttContactPerson>
-    <rttContactPerson>Robert Harrington (roberth@cern.ch)</rttContactPerson>
-    <mailto>atlas-simulation-testreports@cern.ch</mailto>
-
-    <!--
-       run the following to check the xml syntax in this file:
-       python /afs/cern.ch/user/r/rtt/public/validateXML.py ISF_Validation_TestConfiguration.xml
-       (this is now done by default when make is run on this package)
-      -->
-
-    <jobList>
-      <classification>
-        <displayClass>OfflineValidation</displayClass>
-        <displayProcess>Simul</displayProcess>
-        <displayComponent>Athena-Core</displayComponent>
-      </classification>
-
-      <!--%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-          %%                FullG4 ttbar (MC15 production setup)
-          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-        -->
-      <chain>
-        <chainName>SimulationTest_FullG4_ttbar</chainName>
-        <sequential>
-
-          <chainElement>
-            <jobTransform userJobId="FullG4_ttbar_1sim">
-              <doc>Test detector functionality for ISF FullG4 using ttbar events</doc>
-              <jobTransformJobName>FullG4_ttbar_1sim</jobTransformJobName>
-              <jobTransformCmd>Sim_tf.py --conditionsTag 'default:OFLCOND-RUN12-SDR-19' --physicsList 'FTFP_BERT' --truthStrategy 'MC15aPlus' --simulator 'FullG4' --postInclude 'default:PyJobTransforms/UseFrontier.py,G4AtlasTests/postInclude.DCubeTest.py' --preInclude 'EVNTtoHITS:SimulationJobOptions/preInclude.BeamPipeKill.py,SimulationJobOptions/preInclude.FrozenShowersFCalOnly.py' --DataRunNumber '222525' --geometryVersion 'default:ATLAS-R2-2015-03-01-00_VALIDATION' --inputEVNTFile "/afs/cern.ch/atlas/groups/Simulation/EVNT_files/mc12_valid.110401.PowhegPythia_P2012_ttbar_nonallhad.evgen.EVNT.e3099.01517252._000001.pool.root.1" --outputHITSFile "Hits.pool.root" --maxEvents 4</jobTransformCmd>
-              <group>ISF_Validation_sim</group>
-              <queue>medium</queue>
-
-              <test position="1">
-                <modulename>RttLibraryTools</modulename>
-                <testname>DCubeRunner</testname>
-                <arg>
-                  <argname>DCubeCfg</argname>
-                  <argvalue>MC15/dcube-G4_ttbar_1sim.xml</argvalue>
-                </arg>
-                <arg>
-                  <argname>DCubeRef</argname>
-                  <argvalue>MC15/G4_ttbar_1sim.truth.root</argvalue>
-                </arg>
-                <arg>
-                  <argname>DCubeMon</argname>
-                  <argvalue>truth.root</argvalue>
-                </arg>
-                <keepFilePattern>DCube-MC15/G4_ttbar_1sim.truth.root/truth.root.dcube.xml.php</keepFilePattern>
-                <noalarm />
-              </test>
-            </jobTransform>
-          </chainElement>
-
-          <chainElement>
-            <jobTransform userJobId="FullG4_ttbar_1sim_Reg">
-              <doc>Regression test between releases</doc>
-              <jobTransformJobName>FullG4_ttbar_1sim_Reg</jobTransformJobName>
-              <jobTransformCmd>sim_reg_test.py FullG4_ttbar_1sim truth.root Hits.pool.root</jobTransformCmd>
-              <group>ISF_Validation_HitsRegressionTests</group>
-              <queue>short</queue>
-            </jobTransform>
-          </chainElement>
-
-        </sequential>
-      </chain>
-
-      <!--%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-          %%           FullG4_LongLived Z-prime (MC15 production setup)
-          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-        -->
-      <chain>
-        <chainName>SimulationTest_FullG4_ZPrime_QuasiStable</chainName>
-        <abortOnError />
-        <sequential>
-
-          <chainElement>
-            <jobTransform userJobId="FullG4_LongLived_ZPrime_1sim">
-              <doc>Test detector functionality for ISF G4 using ttbar</doc>
-              <jobTransformJobName>FullG4_LongLived_ZPrime_1sim</jobTransformJobName>
-              <jobTransformCmd>Sim_tf.py --conditionsTag 'default:OFLCOND-RUN12-SDR-19' --physicsList 'FTFP_BERT' --truthStrategy 'MC15aPlus' --simulator 'FullG4_LongLived' --postInclude 'default:PyJobTransforms/UseFrontier.py,G4AtlasTests/postInclude.DCubeTest.py' --preInclude 'EVNTtoHITS:SimulationJobOptions/preInclude.BeamPipeKill.py,SimulationJobOptions/preInclude.FrozenShowersFCalOnly.py' --DataRunNumber '222525' --geometryVersion 'default:ATLAS-R2-2015-03-01-00_VALIDATION' --inputEVNTFile "root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/proj-sit/simulation/jira/ATLASSIM-1795/EVNT.04607198._000001.pool.root.1" --outputHITSFile "Hits.pool.root" --maxEvents 10</jobTransformCmd>
-              <group>ISF_Validation_sim</group>
-              <queue>medium</queue>
-
-              <test position="1">
-                <modulename>RttLibraryTools</modulename>
-                <testname>DCubeRunner</testname>
-                <arg>
-                  <argname>DCubeCfg</argname>
-                  <argvalue>MC15/dcube-G4_MC15_ZPrime_QuasiStable_1sim.xml</argvalue>
-                </arg>
-                <arg>
-                  <argname>DCubeRef</argname>
-                  <argvalue>MC15/G4_MC15_ZPrime_QuasiStable_1sim.truth.root</argvalue>
-                </arg>
-                <arg>
-                  <argname>DCubeMon</argname>
-                  <argvalue>truth.root</argvalue>
-                </arg>
-                <keepFilePattern>DCube-MC15/G4_MC15_ZPrime_QuasiStable_1sim.truth.root/truth.root.dcube.xml.php</keepFilePattern>
-                <noalarm />
-              </test>
-            </jobTransform>
-          </chainElement>
-
-          <chainElement>
-            <jobTransform userJobId="FullG4_LongLived_ZPrime_1sim_Reg">
-              <doc>Regression test between releases</doc>
-              <jobTransformJobName>FullG4_LongLived_ZPrime_1sim_Reg</jobTransformJobName>
-              <jobTransformCmd>sim_reg_test.py FullG4_LongLived_ZPrime_1sim truth.root Hits.pool.root</jobTransformCmd>
-              <group>ISF_Validation_HitsRegressionTests</group>
-              <queue>short</queue>
-            </jobTransform>
-          </chainElement>
-
-        </sequential>
-      </chain>
-
-       <!--%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-         %%                           Geant4 Z-prime LongLived (MC15 Truth Strategy) (will soon be depricated)
-         %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-        -->
-      <chain>
-        <chainName>SimulationTest_Geant4_ZPrime_QuasiStable_MC15</chainName>
-        <abortOnError />
-        <sequential>
-
-          <chainElement>
-            <jobTransform userJobId="G4_MC15_ZPrime_QuasiStable_1sim">
-              <doc>Test detector functionality for ISF G4 using ttbar</doc>
-              <jobTransformJobName>G4_MC15_ZPrime_QuasiStable_1sim</jobTransformJobName>
-              <jobTransformCmd>xrdcp root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/proj-sit/simulation/jira/ATLASSIM-1795/EVNT.04607198._000001.pool.root.1 EVNT.04607198._000001.pool.root.1; Sim_tf.py --inputEVNTFile="EVNT.04607198._000001.pool.root.1" --DataRunNumber="222525" --conditionsTag="OFLCOND-RUN12-SDR-20" --geometryVersion="ATLAS-R2-2015-03-01-00_VALIDATION" --maxEvents="10" --outputHITSFile="Hits.pool.root" --physicsList="FTFP_BERT" --postInclude="PyJobTransforms/UseFrontier.py" --preInclude EVNTtoHITS:SimulationJobOptions/preInclude.BeamPipeKill.py --randomSeed="8" --simulator="MC12G4_longLived" --truthStrategy MC15 --postInclude=G4AtlasTests/postInclude.DCubeTest.py</jobTransformCmd>
-              <group>ISF_Validation_sim</group>
-              <queue>medium</queue>
-
-              <test position="1">
-                <modulename>RttLibraryTools</modulename>
-                <testname>DCubeRunner</testname>
-                <arg>
-                  <argname>DCubeCfg</argname>
-                  <argvalue>MC15/dcube-G4_MC15_ZPrime_QuasiStable_1sim.xml</argvalue>
-                </arg>
-                <arg>
-                  <argname>DCubeRef</argname>
-                  <argvalue>MC15/G4_MC15_ZPrime_QuasiStable_1sim.truth.root</argvalue>
-                </arg>
-                <arg>
-                  <argname>DCubeMon</argname>
-                  <argvalue>truth.root</argvalue>
-                </arg>
-                <keepFilePattern>DCube-MC15/G4_MC15_ZPrime_QuasiStable_1sim.truth.root/truth.root.dcube.xml.php</keepFilePattern>
-                <noalarm />
-              </test>
-            </jobTransform>
-          </chainElement>
-
-          <chainElement>
-            <jobTransform userJobId="G4_MC15_ZPrime_QuasiStable_1sim_Reg">
-              <doc>Regression test between releases</doc>
-              <jobTransformJobName>G4_MC15_ZPrime_QuasiStable_1sim_Reg</jobTransformJobName>
-              <jobTransformCmd>sim_reg_test.py G4_MC15_ZPrime_QuasiStable_1sim truth.root Hits.pool.root</jobTransformCmd>
-              <group>ISF_Validation_HitsRegressionTests</group>
-              <queue>short</queue>
-            </jobTransform>
-          </chainElement>
-
-        </sequential>
-      </chain>
-
-     <!--%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-         %%         FullG4 Minbias FullChain (MC15 production setup)
-         %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-        -->
-      <chain>
-        <chainName>FullChainTest_FullG4_minbias</chainName>
-        <sequential>
-
-          <chainElement>
-            <jobTransform userJobId="FullG4_minbias_1sim">
-              <doc>Tests detector functionality for ISF FullG4 truth and beam transformation using minbias events in the innerdetector</doc>
-              <jobTransformJobName>FullG4_minbias_1sim</jobTransformJobName>
-              <jobTransformCmd>Sim_tf.py --conditionsTag 'default:OFLCOND-RUN12-SDR-19' --physicsList 'FTFP_BERT' --truthStrategy 'MC15aPlus' --simulator 'FullG4' --postInclude 'default:PyJobTransforms/UseFrontier.py,G4AtlasTests/postInclude.DCubeTest.py' --preInclude 'EVNTtoHITS:SimulationJobOptions/preInclude.BeamPipeKill.py,SimulationJobOptions/preInclude.FrozenShowersFCalOnly.py' --DataRunNumber '222525' --geometryVersion 'default:ATLAS-R2-2015-03-01-00_VALIDATION' --inputEVNTFile "/afs/cern.ch/atlas/groups/Simulation/EVNT_files/mc12_valid.119994.Pythia8_A2MSTW2008LO_minbias_inelastic.evgen.EVNT.e3099.01517253._000001.pool.root.1" --outputHITSFile "Hits.pool.root" --maxEvents 50</jobTransformCmd>
-              <group>ISF_Validation_sim</group>
-              <queue>medium</queue>
-              <test position="1">
-                <modulename>RttLibraryTools</modulename>
-                <testname>DCubeRunner</testname>
-                <arg>
-                  <argname>DCubeCfg</argname>
-                  <!-- need to update this for minbias and minbias above -->
-                  <argvalue>MC15/dcube-G4_minbias_1sim.xml</argvalue>
-                </arg>
-                <arg>
-                  <argname>DCubeRef</argname>
-                  <argvalue>MC15/G4_minbias_1sim.truth.root</argvalue>
-                </arg>
-                <arg>
-                  <argname>DCubeMon</argname>
-                  <argvalue>truth.root</argvalue>
-                </arg>
-                <keepFilePattern>DCube-MC15/G4_minbias_1sim.truth.root/truth.root.dcube.xml.php</keepFilePattern>
-                <noalarm />
-              </test>
-            </jobTransform>
-            <chainfileout>
-              Hits.pool.root
-            </chainfileout>
-          </chainElement>
-
-          <parallel>
-            <chainElement>
-              <jobTransform userJobId="FullG4_minbias_1sim_Reg">
-                <doc>Regression test between releases</doc>
-                <jobTransformJobName>FullG4_minbias_1sim_Reg</jobTransformJobName>
-                <jobTransformCmd>sim_reg_test.py FullG4_minbias_1sim truth.root Hits.pool.root</jobTransformCmd>
-
-                <group>ISF_Validation_HitsRegressionTests</group>
-                <queue>short</queue>
-              </jobTransform>
-            </chainElement>
-            <chainElement>
-              <jobTransform userJobId="FullG4_minbias_1sim_Compare_MCProd_G4">
-                <doc>comparison to ISF references</doc>
-                <jobTransformJobName>FullG4_minbias_1sim_Compare_MCProd_G4</jobTransformJobName>
-                <jobTransformCmd>sim_reg_test.py FullG4_minbias_1sim</jobTransformCmd>
-
-                <group>ISF_Validation</group>
-                <queue>short</queue>
-                <test position="1">
-                  <modulename>RttLibraryTools</modulename>
-                  <testname>DCubeRunner</testname>
-                  <arg>
-                    <argname>DCubeCfg</argname>
-                    <argvalue>MCProd/minbias_G4_50evt.truth.root.xml</argvalue>
-                  </arg>
-                  <arg>
-                    <argname>DCubeRef</argname>
-                    <argvalue>MCProd/minbias_G4_50evt.truth.root</argvalue>
-                  </arg>
-                  <arg>
-                    <argname>DCubeMon</argname>
-                    <argvalue>today.root</argvalue>
-                  </arg>
-                  <keepFilePattern>DCube-MCProd/minbias_G4_50evt.truth.root/today.root.dcube.xml.php</keepFilePattern>
-                  <noalarm />
-                </test>
-                <testToRemove>
-                  <jobGroupName>RTT:Top</jobGroupName>
-                  <testidentifier>CheckFileRunner0</testidentifier>
-                </testToRemove>
-              </jobTransform>
-            </chainElement>
-            <sequential>
-              <chainElement>
-                <jobTransform userJobId="FullG4_minbias_2merge">
-                  <doc>HITS merge job</doc>
-                  <jobTransformJobName>FullG4_minbias_2merge</jobTransformJobName>
-                  <jobTransformCmd>HITSMerge_tf.py --inputHITSFile='Hits.pool.root' --outputHITS_MRGFile='Merge.pool.root' --maxEvents=50 --skipEvents='0' --geometryVersion 'ATLAS-R2-2015-03-01-00' --conditionsTag 'OFLCOND-RUN12-SDR-19'</jobTransformCmd>
-                  <group>ISF_Validation</group>
-                  <chaindataset_info>
-                    <jobTransformData/>
-                    <chaindatasetName>Hits.pool.root</chaindatasetName>
-                    <dataset_info>
-                      <jobTransformData/>
-                      <datasetName>/afs/cern.ch/atlas/offline/external/FullChainTest/long/rtt.fallback/MC12/MC12.108351.pythia_minbias.8TeV.HITS.pool.root</datasetName>
-                    </dataset_info>
-                  </chaindataset_info>
-                  <queue>short</queue>
-                  <batchWallTime>300</batchWallTime>
-                </jobTransform>
-                <chainfileout>
-                  Merge.pool.root
-                </chainfileout>
-              </chainElement>
-              <!-- Run Digitisation -->
-              <chainElement>
-                <jobTransform userJobId="FullG4_minbias_3digi">
-
-                  <doc>Digitiziation without pile-up, with additional modifications for AFII inputs.</doc>
-                  <jobTransformJobName>FullG4_minbias_3digi</jobTransformJobName>
-
-                  <jobTransformCmd>Digi_tf.py --inputHITSFile 'Merge.pool.root' --outputRDOFile 'RDO.pool.root' --maxEvents '50' --skipEvents '0' --geometryVersion 'ATLAS-R2-2015-03-01-00' --digiSeedOffset1 '123456' --digiSeedOffset2 '2345678' --postInclude 'PyJobTransforms/UseFrontier.py' --AddCaloDigi 'False' --conditionsTag 'OFLCOND-RUN12-SDR-31'</jobTransformCmd>
-
-                  <group>ISF_Validation</group>
-
-                  <chaindataset_info>
-                    <jobTransformData/>
-                    <chaindatasetName>Merge.pool.root</chaindatasetName>
-                    <dataset_info>
-                      <jobTransformData/>
-                      <datasetName>/afs/cern.ch/atlas/offline/external/FullChainTest/long/rtt.fallback/MC12/MC12.108351.pythia_minbias.8TeV.HITS.pool.root</datasetName>
-                    </dataset_info>
-                  </chaindataset_info>
-
-                  <queue>short</queue>
-                  <batchWallTime>300</batchWallTime>
-                </jobTransform>
-                <chainfileout>RDO.pool.root</chainfileout>
-              </chainElement>
-
-              <!-- Run Reconstruction -->
-              <chainElement>
-                <jobTransform userJobId="FullG4_minbias_4reco">
-                  <doc>reco</doc>
-                  <jobTransformJobName>FullG4_minbias_4reco</jobTransformJobName>
-                  <jobTransformCmd>Reco_tf.py --inputRDOFile 'RDO.pool.root' --outputESDFile 'ESD.pool.root' --maxEvents '50' --skipEvents '0' --preInclude 'ISF_Example/preInclude.IDonly_reconstruction.py'</jobTransformCmd>
-                  <group>ISF_Validation</group>
-                  <chaindataset_info>
-                    <jobTransformData/>
-                    <chaindatasetName>RDO.pool.root</chaindatasetName>
-                    <dataset_info>
-                      <jobTransformData/>
-                      <datasetName>/afs/cern.ch/atlas/offline/external/FullChainTest/long/rtt.fallback/MC12/MC12.108351.pythia_minbias.8TeV.RDO.pool.root</datasetName>
-                    </dataset_info>
-                  </chaindataset_info>
-                  <queue>short</queue>
-                  <batchWallTime>300</batchWallTime>
-                  <test position="1">
-                    <modulename>RttLibraryTools</modulename>
-                    <testname>DCubeRunner</testname>
-                    <arg>
-                      <argname>DCubeCfg</argname>
-                      <argvalue>MCProd/InDetStandardPlots.root.xml</argvalue>
-                    </arg>
-                    <arg>
-                      <argname>DCubeRef</argname>
-                      <argvalue>MCProd/minbias_G4_50evt.InDetStandardPlots.root</argvalue>
-                    </arg>
-                    <arg>
-                      <argname>DCubeMon</argname>
-                      <argvalue>InDetStandardPlots.root</argvalue>
-                    </arg>
-                    <keepFilePattern>DCube-MCProd/minbias_G4_50evt.InDetStandardPlots.root/InDetStandardPlots.root.dcube.xml.php</keepFilePattern>
-                    <noalarm />
-                  </test>
-                </jobTransform>
-                <chainfileout>AOD.pool.root</chainfileout>
-              </chainElement>
-            </sequential>
-          </parallel>
-        </sequential>
-      </chain>
-
-
-      <!--%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-         %%                           G4 COSMICS
-         %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-        -->
-      <jobTransform userJobId="G4_cosmics_1sim">
-        <doc>Running cosmic simulation transform from track records</doc>
-        <jobTransformJobName>G4_cosmics_1sim</jobTransformJobName>
-        <jobTransformCmd>Sim_tf.py --simulator MC12G4 --inputEVNT_TRFile /afs/cern.ch/atlas/offline/ProdData/16.6.X/16.6.7.Y/Cosmics.TR.pool.root --outputHITSFile testCosmics.HITS.pool.root --maxEvents -1 --randomSeed 1234 --DataRunNumber '10' --geometryVersion ATLAS-R2-2015-03-01-00_VALIDATION --conditionsTag OFLCOND-RUN12-SDR-19 --firstEvent 0 --physicsList QGSP_BERT --preInclude SimulationJobOptions/preInclude.Cosmics.py --beamType cosmics</jobTransformCmd>
-        <group>ISF_Validation_sim</group>
-        <queue>short</queue>
-        <!-- add in some tests later -->
-      </jobTransform>
-
-      <jobTransform userJobId="G4_cosmicsTR_1sim">
-        <doc>Running cosmic simulation transform from track records</doc>
-        <jobTransformJobName>G4_cosmicsTR_1sim</jobTransformJobName>
-        <jobTransformCmd>Sim_tf.py --simulator MC12G4 --outputEVNT_TRFile 'testCosmics.TR.pool.root' --outputHITSFile 'testCosmics.HITS.pool.root' --maxEvents '1500' --randomSeed '1234' --DataRunNumber '10' --physicsList 'QGSP_BERT' --CosmicFilterVolume 'Calo' --CosmicFilterVolume2 'NONE' --preInclude 'SimulationJobOptions/preInclude.Cosmics.py' --geometryVersion 'ATLAS-R2-2015-03-01-00_VALIDATION' --conditionsTag 'OFLCOND-RUN12-SDR-19' --CosmicPtSlice 'NONE' --beamType 'cosmics'</jobTransformCmd>
-        <group>ISF_Validation_sim</group>
-        <queue>medium</queue>
-        <!-- add in some tests later -->
-      </jobTransform>
-
-
-      <!--%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-         %%                      G4 CALIBRATION HITS
-         %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-        -->
-
-      <chain>
-        <chainName>RegressionTest_G4_WriteCalHitsTest</chainName>
-        <sequential>
-
-          <chainElement>
-            <jobTransform userJobId="G4_WriteCalHitsTest_1sim">
-              <doc>Reading gen events, single particle</doc>
-              <jobTransformJobName>G4_WriteCalHitsTest_1sim</jobTransformJobName>
-              <jobTransformCmd>Sim_tf.py --simulator MC12G4 --inputEVNTFile '/afs/cern.ch/atlas/offline/ProdData/16.6.X/16.6.7.Y/pi_E50_eta0-60.evgen.pool.root' --outputHITSFile 'Hits.pool.root' --maxEvents '10' --skipEvents '0' --randomSeed '10' --geometryVersion 'ATLAS-R2-2015-03-01-00_VALIDATION' --conditionsTag 'OFLCOND-RUN12-SDR-19' --preInclude 'SimulationJobOptions/preInclude.CalHits.py,SimulationJobOptions/preInclude.ParticleID.py' --postInclude 'G4AtlasTests/postInclude.DCubeTest_CaloCalibHits.py' --preExec 'simFlags.ReleaseGeoModel=False;'</jobTransformCmd>
-              <group>ISF_Validation_sim</group>
-              <queue>short</queue>
-              <test position="1">
-                <modulename>RttLibraryTools</modulename>
-                <testname>DCubeRunner</testname>
-                <testidentifier>G4_WriteCalHitsTestDCubeTest</testidentifier>
-                <arg>
-                  <argname>DCubeCfg</argname>
-                  <argvalue>MC15/dcube-G4_WriteCalHitsTest_1sim.xml</argvalue>
-                </arg>
-                <arg>
-                  <argname>DCubeRef</argname>
-                  <argvalue>MC15/G4_WriteCalHitsTest_1sim.truth.root</argvalue>
-                </arg>
-                <arg>
-                  <argname>DCubeMon</argname>
-                  <argvalue>truth.root</argvalue>
-                </arg>
-                <keepFilePattern>DCube-MC15/G4_WriteCalHitsTest_1sim.truth.root/truth.root.dcube.xml.php</keepFilePattern>
-                <noalarm />
-              </test>
-            </jobTransform>
-          </chainElement>
-
-          <chainElement>
-            <jobTransform userJobId="G4_WriteCalHitsTest_1sim_Reg">
-              <doc>Regression test between releases</doc>
-              <jobTransformJobName>G4_WriteCalHitsTest_Reg</jobTransformJobName>
-              <jobTransformCmd>sim_reg_test.py G4_WriteCalHitsTest_1sim truth.root Hits.pool.root</jobTransformCmd>
-              <group>ISF_Validation</group>
-              <queue>short</queue>
-              <test position="1">
-                <modulename>RttLibraryTools</modulename>
-                <testname>DCubeRunner</testname>
-                <testidentifier>G4_WriteCalHitsTest_RegDCubeTest</testidentifier>
-                <arg>
-                  <argname>DCubeCfg</argname>
-                  <argvalue>MC15/dcube-G4_WriteCalHitsTest_1sim.xml</argvalue>
-                </arg>
-                <arg>
-                  <argname>DCubeRef</argname>
-                  <argvalue>yesterday.truth.root</argvalue>
-                </arg>
-                <arg>
-                  <argname>localRefFile</argname>
-                  <argvalue>True</argvalue>
-                </arg>
-                <arg>
-                  <argname>DCubeMon</argname>
-                  <argvalue>today.truth.root</argvalue>
-                </arg>
-                <keepFilePattern>DCube-yesterday.truth.root/today.truth.root.dcube.xml.php</keepFilePattern>
-              </test>
-              <test position="2">
-                <modulename>RttLibraryTools</modulename>
-                <testname>DiffPoolFilesRunner</testname>
-                <testidentifier>HITS_RegressionTestRunner</testidentifier>
-                <arg>
-                  <argname>fileName</argname>
-                  <argvalue>today.Hits.pool.root</argvalue>
-                </arg>
-                <arg>
-                  <argname>refFileName</argname>
-                  <argvalue>yesterday.Hits.pool.root</argvalue>
-                </arg>
-                <keepFilePattern>today.Hits.pool.root_yesterday.Hits.pool.root.diffPool</keepFilePattern>
-              </test>
-
-              <testToRemove>
-                <jobGroupName>RTT:Top</jobGroupName>
-                <testidentifier>CheckFileRunner0</testidentifier>
-              </testToRemove>
-            </jobTransform>
-          </chainElement>
-
-        </sequential>
-      </chain>
-
-
-      <!--%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-         %%                           ATLFASTII ttbar (FullChainTest)
-         %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-        -->
-      <chain>
-        <chainName>FullChainTest_ATLFASTII_ttbar</chainName>
-        <sequential>
-          <chainElement>
-            <jobTransform userJobId="ATLFASTII_ttbar_1sim">
-              <doc>Tests detector functionality for ISF ATLFASTII-like configuration using ttbar events</doc>
-              <jobTransformJobName>ATLFASTII_ttbar_1sim</jobTransformJobName>
-              <!-- MC15 production AMI tag a766 -->
-              <jobTransformCmd>Sim_tf.py --conditionsTag 'default:OFLCOND-RUN12-SDR-19' --physicsList 'FTFP_BERT' --truthStrategy 'MC12' --simulator 'ATLFASTII' --postInclude 'default:PyJobTransforms/UseFrontier.py' 'G4AtlasTests/postInclude.DCubeTest.py' --preInclude 'EVNTtoHITS:SimulationJobOptions/preInclude.BeamPipeKill.py' --DataRunNumber '222525' --geometryVersion 'default:ATLAS-R2-2015-03-01-00_VALIDATION' --inputEVNTFile "/afs/cern.ch/atlas/groups/Simulation/EVNT_files/mc12_valid.110401.PowhegPythia_P2012_ttbar_nonallhad.evgen.EVNT.e3099.01517252._000001.pool.root.1" --outputHITSFile "Hits.pool.root" --maxEvents 250</jobTransformCmd>
-              <group>ISF_Validation_sim</group>
-              <queue>long</queue>
-              <test>
-                <modulename>RttLibraryTools</modulename>
-                <testname>DCubeRunner</testname>
-                <arg>
-                  <argname>DCubeCfg</argname>
-                  <argvalue>MC15/dcube-ISF_ATLFASTII_ttbar_MC12.xml</argvalue>
-                </arg>
-                <arg>
-                  <argname>DCubeRef</argname>
-                  <argvalue>MC15/ISF_ATLFASTII_ttbar_MC12.truth.root</argvalue>
-                </arg>
-                <arg>
-                  <argname>DCubeMon</argname>
-                  <argvalue>truth.root</argvalue>
-                </arg>
-                <keepFilePattern>ISF_ATLFASTII_ttbar_log</keepFilePattern>
-                <keepFilePattern>DCube-MC15/ISF_ATLFASTII_ttbar_MC12.truth.root/truth.root.dcube.xml.php</keepFilePattern>
-                <noalarm />
-              </test>
-            </jobTransform>
-            <chainfileout>Hits.pool.root</chainfileout>
-          </chainElement>
-          <parallel>
-            <chainElement>
-              <jobTransform userJobId="ATLFASTII_ttbar_1sim_Compare_MCProd_AFII">
-                <doc>comparison to ISF references</doc>
-                <jobTransformJobName>ATLFASTII_ttbar_1sim_Compare_MCProd_AFII</jobTransformJobName>
-                <jobTransformCmd>sim_reg_test.py ATLFASTII_ttbar_1sim</jobTransformCmd>
-                <group>ISF_Validation</group>
-                <queue>extrashort</queue>
-                <test>
-                  <modulename>RttLibraryTools</modulename>
-                  <testname>DCubeRunner</testname>
-                  <arg>
-                    <argname>DCubeCfg</argname>
-                    <argvalue>MCProd/ttbar_ATLFASTII_500evt.truth.root.xml</argvalue>
-                  </arg>
-                  <arg>
-                    <argname>DCubeRef</argname>
-                    <argvalue>MCProd/ttbar_ATLFASTII_500evt.truth.root</argvalue>
-                  </arg>
-                  <arg>
-                    <argname>DCubeMon</argname>
-                    <argvalue>today.root</argvalue>
-                  </arg>
-                  <keepFilePattern>DCube-MCProd/ttbar_ATLFASTII_500evt.truth.root/today.root.dcube.xml.php</keepFilePattern>
-                  <noalarm />
-                </test>
-                <testToRemove>
-                  <jobGroupName>RTT:Top</jobGroupName>
-                  <testidentifier>CheckFileRunner0</testidentifier>
-                </testToRemove>
-              </jobTransform>
-            </chainElement>
-            <chainElement>
-              <jobTransform userJobId="ATLFASTII_ttbar_1sim_Reg">
-                <doc>Regression test between releases</doc>
-                <jobTransformJobName>ATLFASTII_ttbar_1sim_Reg</jobTransformJobName>
-                <jobTransformCmd>sim_reg_test.py ATLFASTII_ttbar_1sim truth.root Hits.pool.root</jobTransformCmd>
-                <group>ISF_Validation_HitsRegressionTests</group>
-                <queue>medium</queue>
-              </jobTransform>
-            </chainElement>
-            <sequential>
-
-              <chainElement>
-                <jobTransform userJobId="ATLFASTII_ttbar_2merge">
-                  <doc>Merge job for backward compatibility with 17.3.13</doc>
-                  <jobTransformJobName>ATLFASTII_ttbar_2merge</jobTransformJobName>
-                  <jobTransformCmd>HITSMerge_tf.py --inputHITSFile='Hits.pool.root' --outputHITS_MRGFile='Merge.pool.root' --maxEvents=-1 --skipEvents='0' --geometryVersion='ATLAS-R2-2015-03-01-00' --conditionsTag='OFLCOND-RUN12-SDR-19'</jobTransformCmd>
-                  <group>ISF_Validation</group>
-                  <chaindataset_info>
-                    <jobTransformData/>
-                    <chaindatasetName>Hits.pool.root</chaindatasetName>
-                    <dataset_info>
-                      <jobTransformData/>
-                      <datasetName>/afs/cern.ch/atlas/offline/external/FullChainTest/long/rtt.fallback/MC12/MC12.108351.pythia_minbias.8TeV.HITS.pool.root</datasetName>
-                    </dataset_info>
-                  </chaindataset_info>
-                  <queue>short</queue>
-                </jobTransform>
-                <chainfileout>
-                  Merge.pool.root
-                </chainfileout>
-              </chainElement>
-
-              <!-- Run Digitization + Reconstruction -->
-              <chainElement>
-                <jobTransform userJobId="ATLFASTII_ttbar_3digireco">
-                  <doc>reco</doc>
-                  <jobTransformJobName>ATLFASTII_ttbar_3digireco</jobTransformJobName>
-                  <jobTransformCmd>Reco_tf.py --digiSteeringConf 'StandardSignalOnlyTruth' --conditionsTag 'default:OFLCOND-MC15c-SDR-09' --postInclude 'default:RecJobTransforms/UseFrontier.py' 'HITtoRDO:DigitizationTests/postInclude.RDO_Plots.py' --autoConfiguration 'everything' --steering 'doRDO_TRIG' --geometryVersion 'default:ATLAS-R2-2015-03-01-00' --DataRunNumber '267599' --preExec 'all:rec.Commissioning.set_Value_and_Lock(True);from AthenaCommon.BeamFlags import jobproperties;jobproperties.Beam.numberOfCollisions.set_Value_and_Lock(0.0);from LArROD.LArRODFlags import larRODFlags;larRODFlags.NumberOfCollisions.set_Value_and_Lock(0);larRODFlags.nSamples.set_Value_and_Lock(4);larRODFlags.doOFCPileupOptimization.set_Value_and_Lock(True);larRODFlags.firstSample.set_Value_and_Lock(0);larRODFlags.useHighestGainAutoCorr.set_Value_and_Lock(True)' 'RAWtoESD:from CaloRec.CaloCellFlags import jobproperties;jobproperties.CaloCellFlags.doLArCellEmMisCalib=False;from InDetRecExample.InDetJobProperties import InDetFlags;InDetFlags.doStandardPlots.set_Value_and_Lock(True)' 'ESDtoAOD:TriggerFlags.AODEDMSet="AODFULL"' 'RAWtoESD:from InDetRecExample.InDetJobProperties import InDetFlags;InDetFlags.doSlimming.set_Value_and_Lock(False)' 'ESDtoAOD:from InDetRecExample.InDetJobProperties import InDetFlags;InDetFlags.doSlimming.set_Value_and_Lock(False)' --numberOfCavernBkg '0' --postExec 'all:CfgMgr.MessageSvc().setError+=["HepMcParticleLink"]' "ESDtoAOD:fixedAttrib=[s if \"CONTAINER_SPLITLEVEL = \'99\'\" not in s else \"\" for s in svcMgr.AthenaPoolCnvSvc.PoolAttributes];svcMgr.AthenaPoolCnvSvc.PoolAttributes=fixedAttrib" --inputHITSFile 'Merge.pool.root' --outputRDOFile 'RDO.pool.root' --outputESDFile 'ESD.pool.root' --outputAODFile 'AOD.pool.root' --outputNTUP_PHYSVALFile 'PhysValMon.root' --validationFlags 'doInDet,doJet,doMuon,doEgamma' --maxEvents '250' --jobNumber '1'</jobTransformCmd>
-                  <group>ISF_Validation</group>
-                  <chaindataset_info>
-                    <jobTransformData/>
-                    <chaindatasetName>Merge.pool.root</chaindatasetName>
-                    <dataset_info>
-                      <jobTransformData/>
-                      <datasetName>/afs/cern.ch/atlas/offline/external/FullChainTest/long/rtt.fallback/MC12/MC12.108351.pythia_minbias.8TeV.HITS.pool.root</datasetName> <!-- dummy file -->
-                    </dataset_info>
-                  </chaindataset_info>
-                  <queue>long</queue>
-                </jobTransform>
-              </chainElement>
-
-              <parallel>
-                <chainElement>
-                  <jobTransform userJobId="ATLFASTII_ttbar_3digireco_Reg">
-                    <doc>Regression test between releases</doc>
-                    <jobTransformJobName>ATLFASTII_ttbar_3digireco_Reg</jobTransformJobName>
-                    <jobTransformCmd>sim_reg_test.py ATLFASTII_ttbar_3digireco InDetStandardPlots.root PhysValMon.root RDO_truth.root</jobTransformCmd>
-                    <group>ISF_Validation_RecoRegressionTests</group>
-                    <queue>short</queue>
-                  </jobTransform>
-                </chainElement>
-                <chainElement>
-                  <jobTransform userJobId="ATLFASTII_ttbar_3digireco_Compare_MCProd_G4">
-                    <doc>comparison to MC12 Geant4 references</doc>
-                    <jobTransformJobName>ATLFASTII_ttbar_3digireco_Compare_MCProd_G4</jobTransformJobName>
-                    <jobTransformCmd>sim_reg_test.py ATLFASTII_ttbar_3digireco InDetStandardPlots.root PhysValMon.root RDO_truth.root</jobTransformCmd>
-                    <group>ISF_Validation</group>
-                    <queue>medium</queue>
-                    <test>
-                      <modulename>RttLibraryTools</modulename>
-                      <testname>DCubeRunner</testname>
-                      <arg>
-                        <argname>DCubeCfg</argname>
-                        <argvalue>MCProd/ttbar_G4_500evt.InDetStandardPlots.root.xml</argvalue>
-                      </arg>
-                      <arg>
-                        <argname>DCubeRef</argname>
-                        <argvalue>MCProd/ttbar_G4_500evt.InDetStandardPlots.root</argvalue>
-                      </arg>
-                      <arg>
-                        <argname>DCubeMon</argname>
-                        <argvalue>today.InDetStandardPlots.root</argvalue>
-                      </arg>
-                      <keepFilePattern>DCube-MCProd/ttbar_G4_500evt.InDetStandardPlots.root/today.InDetStandardPlots.root.dcube.xml.php</keepFilePattern>
-                      <noalarm />
-                    </test>
-                    <test>
-                      <modulename>RttLibraryTools</modulename>
-                      <testname>DCubeRunner</testname>
-                      <arg>
-                        <argname>DCubeCfg</argname>
-                        <argvalue>MCProd/ttbar_G4_500evt.PhysValMon.root.xml</argvalue>
-                      </arg>
-                      <arg>
-                        <argname>DCubeRef</argname>
-                        <argvalue>MCProd/ttbar_G4_500evt.PhysValMon.root</argvalue>
-                      </arg>
-                      <arg>
-                        <argname>DCubeMon</argname>
-                        <argvalue>today.PhysValMon.root</argvalue>
-                      </arg>
-                      <keepFilePattern>DCube-MCProd/ttbar_G4_500evt.PhysValMon.root/today.PhysValMon.root.dcube.xml.php</keepFilePattern>
-                      <noalarm />
-                    </test>
-                    <test>
-                      <modulename>RttLibraryTools</modulename>
-                      <testname>DCubeRunner</testname>
-                      <arg>
-                        <argname>DCubeCfg</argname>
-                        <argvalue>MCProd/ttbar_G4_500evt.RDO_truth.root.xml</argvalue>
-                      </arg>
-                      <arg>
-                        <argname>DCubeRef</argname>
-                        <argvalue>MCProd/ttbar_G4_500evt.RDO_truth.root</argvalue>
-                      </arg>
-                      <arg>
-                        <argname>DCubeMon</argname>
-                        <argvalue>today.RDO_truth.root</argvalue>
-                      </arg>
-                      <keepFilePattern>DCube-MCProd/ttbar_G4_500evt.RDO_truth.root/today.RDO_truth.root.dcube.xml.php</keepFilePattern>
-                      <noalarm />
-                    </test>
-                    <testToRemove>
-                      <jobGroupName>RTT:Top</jobGroupName>
-                      <testidentifier>CheckFileRunner0</testidentifier>
-                    </testToRemove>
-                  </jobTransform>
-                </chainElement>
-                <chainElement>
-                  <jobTransform userJobId="ATLFASTII_ttbar_3digireco_Compare_MCProd_AFII">
-                    <doc>comparison to MC12 AtlfastII references</doc>
-                    <jobTransformJobName>ISF_reco_ATLFASTII_ttbar_AFII</jobTransformJobName>
-                    <jobTransformCmd>sim_reg_test.py ATLFASTII_ttbar_3digireco InDetStandardPlots.root PhysValMon.root RDO_truth.root</jobTransformCmd>
-                    <group>ISF_Validation</group>
-                    <queue>medium</queue>
-                    <test position="1">
-                      <modulename>RttLibraryTools</modulename>
-                      <testname>DCubeRunner</testname>
-                      <arg>
-                        <argname>DCubeCfg</argname>
-                        <argvalue>MCProd/ttbar_ATLFASTII_500evt.InDetStandardPlots.root.xml</argvalue>
-                      </arg>
-                      <arg>
-                        <argname>DCubeRef</argname>
-                        <argvalue>MCProd/ttbar_ATLFASTII_500evt.InDetStandardPlots.root</argvalue>
-                      </arg>
-                      <arg>
-                        <argname>DCubeMon</argname>
-                        <argvalue>today.InDetStandardPlots.root</argvalue>
-                      </arg>
-                      <keepFilePattern>DCube-MCProd/ttbar_ATLFASTII_500evt.InDetStandardPlots.root/today.InDetStandardPlots.root.dcube.xml.php</keepFilePattern>
-                      <noalarm />
-                    </test>
-                    <test>
-                      <modulename>RttLibraryTools</modulename>
-                      <testname>DCubeRunner</testname>
-                      <arg>
-                        <argname>DCubeCfg</argname>
-                        <argvalue>MCProd/ttbar_ATLFASTII_500evt.PhysValMon.root.xml</argvalue>
-                      </arg>
-                      <arg>
-                        <argname>DCubeRef</argname>
-                        <argvalue>MCProd/ttbar_ATLFASTII_500evt.PhysValMon.root</argvalue>
-                      </arg>
-                      <arg>
-                        <argname>DCubeMon</argname>
-                        <argvalue>today.PhysValMon.root</argvalue>
-                      </arg>
-                      <keepFilePattern>DCube-MCProd/ttbar_ATLFASTII_500evt.PhysValMon.root/today.PhysValMon.root.dcube.xml.php</keepFilePattern>
-                      <noalarm />
-                    </test>
-                    <test>
-                      <modulename>RttLibraryTools</modulename>
-                      <testname>DCubeRunner</testname>
-                      <arg>
-                        <argname>DCubeCfg</argname>
-                        <argvalue>MCProd/ttbar_ATLFASTII_500evt.RDO_truth.root.xml</argvalue>
-                      </arg>
-                      <arg>
-                        <argname>DCubeRef</argname>
-                        <argvalue>MCProd/ttbar_ATLFASTII_500evt.RDO_truth.root</argvalue>
-                      </arg>
-                      <arg>
-                        <argname>DCubeMon</argname>
-                        <argvalue>today.RDO_truth.root</argvalue>
-                      </arg>
-                      <keepFilePattern>DCube-MCProd/ttbar_ATLFASTII_500evt.RDO_truth.root/today.RDO_truth.root.dcube.xml.php</keepFilePattern>
-                      <noalarm />
-                    </test>
-
-                    <testToRemove>
-                      <jobGroupName>RTT:Top</jobGroupName>
-                      <testidentifier>CheckFileRunner0</testidentifier>
-                    </testToRemove>
-                  </jobTransform>
-                </chainElement>
-              </parallel>
-            </sequential>
-          </parallel>
-        </sequential>
-      </chain>
-
-
-      <!--%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-         %%                          ATLFASTIIF ttbar FullChain
-         %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-        -->
-      <chain>
-        <chainName>FullChainTest_ATLFASTIIF_ttbar</chainName>
-        <abortOnError />
-        <sequential>
-          <chainElement>
-            <jobTransform userJobId="ATLFASTIIF_ttbar_1sim">
-              <doc>Tests detector functionality for ISF ATLFASTIIF using ttbar</doc>
-              <jobTransformJobName>ATLFASTIIF_ttbar_1sim</jobTransformJobName>
-              <jobTransformCmd>Sim_tf.py --conditionsTag 'default:OFLCOND-RUN12-SDR-19' --physicsList 'FTFP_BERT' --truthStrategy 'MC12' --simulator 'ATLFASTIIF' --postInclude 'default:PyJobTransforms/UseFrontier.py' 'G4AtlasTests/postInclude.DCubeTest.py' --DataRunNumber '222525' --geometryVersion 'default:ATLAS-R2-2015-03-01-00_VALIDATION' --inputEVNTFile "/afs/cern.ch/atlas/groups/Simulation/EVNT_files/mc12_valid.110401.PowhegPythia_P2012_ttbar_nonallhad.evgen.EVNT.e3099.01517252._000001.pool.root.1" --outputHITSFile "Hits.pool.root" --maxEvents 2000</jobTransformCmd>
-              <group>ISF_Validation_sim</group>
-              <queue>medium</queue>
-              <!--
-                 <test position="1">
-                   <modulename>RttLibraryTools</modulename>
-                   <testname>DCubeRunner</testname>
-                   <arg>
-                     <argname>DCubeCfg</argname>
-                     <argvalue>MC15/dcube-ISF_ATLFASTIIF_ttbar.xml</argvalue>
-                   </arg>
-                   <arg>
-                     <argname>DCubeRef</argname>
-                     <argvalue>MC15/ISF_ATLFASTIIF_ttbar.truth.root</argvalue>
-                   </arg>
-                   <arg>
-                     <argname>DCubeMon</argname>
-                     <argvalue>truth.root</argvalue>
-                   </arg>
-                 </test>
-                 -->
-            </jobTransform>
-            <chainfileout>Hits.pool.root</chainfileout>
-          </chainElement>
-          <parallel>
-            <chainElement>
-              <jobTransform userJobId="ATLFASTIIF_ttbar_1sim_Reg">
-                <doc>Regression test between releases</doc>
-                <jobTransformJobName>ATLFASTIIF_ttbar_1sim_Reg</jobTransformJobName>
-                <jobTransformCmd>sim_reg_test.py ATLFASTIIF_ttbar_1sim truth.root Hits.pool.root</jobTransformCmd>
-                <group>ISF_Validation_HitsRegressionTests</group>
-                <queue>medium</queue>
-              </jobTransform>
-            </chainElement>
-            <chainElement>
-              <jobTransform userJobId="ATLFASTIIF_ttbar_1sim_Compare_MCProd_G4">
-                <doc>comparison to ISF references</doc>
-                <jobTransformJobName>ATLFASTIIF_ttbar_1sim_Compare_MCProd_G4</jobTransformJobName>
-                <jobTransformCmd>sim_reg_test.py ATLFASTIIF_ttbar_1sim</jobTransformCmd>
-                <group>ISF_Validation</group>
-                <queue>extrashort</queue>
-                <test position="1">
-                  <modulename>RttLibraryTools</modulename>
-                  <testname>DCubeRunner</testname>
-                  <arg>
-                    <argname>DCubeCfg</argname>
-                    <argvalue>MCProd/ttbar_G4_500evt.truth.root.xml</argvalue>
-                  </arg>
-                  <arg>
-                    <argname>DCubeRef</argname>
-                    <argvalue>MCProd/ttbar_G4_500evt.truth.root</argvalue>
-                  </arg>
-                  <arg>
-                    <argname>DCubeMon</argname>
-                    <argvalue>today.root</argvalue>
-                  </arg>
-                  <keepFilePattern>DCube-MCProd/ttbar_G4_500evt.truth.root/today.root.dcube.xml.php</keepFilePattern>
-                  <noalarm />
-                </test>
-                <testToRemove>
-                  <jobGroupName>RTT:Top</jobGroupName>
-                  <testidentifier>CheckFileRunner0</testidentifier>
-                </testToRemove>
-              </jobTransform>
-            </chainElement>
-            <chainElement>
-              <jobTransform userJobId="ATLFASTIIF_ttbar_1sim_Compare_MCProd_AFII">
-                <doc>comparison to ISF references</doc>
-                <jobTransformJobName>ATLFASTIIF_ttbar_1sim_Compare_MCProd_AFII</jobTransformJobName>
-                <jobTransformCmd>sim_reg_test.py ATLFASTIIF_ttbar_1sim</jobTransformCmd>
-                <group>ISF_Validation</group>
-                <queue>extrashort</queue>
-                <test position="1">
-                  <modulename>RttLibraryTools</modulename>
-                  <testname>DCubeRunner</testname>
-                  <arg>
-                    <argname>DCubeCfg</argname>
-                    <argvalue>MCProd/ttbar_ATLFASTII_500evt.truth.root.xml</argvalue>
-                  </arg>
-                  <arg>
-                    <argname>DCubeRef</argname>
-                    <argvalue>MCProd/ttbar_ATLFASTII_500evt.truth.root</argvalue>
-                  </arg>
-                  <arg>
-                    <argname>DCubeMon</argname>
-                    <argvalue>today.root</argvalue>
-                  </arg>
-                  <keepFilePattern>DCube-MCProd/ttbar_ATLFASTII_500evt.truth.root/today.root.dcube.xml.php</keepFilePattern>
-                  <noalarm />
-                </test>
-                <testToRemove>
-                  <jobGroupName>RTT:Top</jobGroupName>
-                  <testidentifier>CheckFileRunner0</testidentifier>
-                </testToRemove>
-              </jobTransform>
-            </chainElement>
-            <sequential>
-
-              <!--Run Merge Job with 17.6.51 makes hit file compatible with 17.3.13-->
-              <chainElement>
-                <jobTransform userJobId="ATLFASTIIF_ttbar_2merge">
-                  <doc>Merge job for backward compatibility with 17.3.13</doc>
-                  <jobTransformJobName>ATLFASTIIF_ttbar_2merge</jobTransformJobName>
-                  <jobTransformCmd>HITSMerge_tf.py --inputHITSFile='Hits.pool.root' --outputHITS_MRGFile='Merge.pool.root' --maxEvents=-1 --skipEvents='0' --geometryVersion='ATLAS-R2-2015-03-01-00' --conditionsTag='OFLCOND-RUN12-SDR-19'</jobTransformCmd>
-                  <group>ISF_Validation</group>
-                  <chaindataset_info>
-                    <jobTransformData/>
-                    <chaindatasetName>Hits.pool.root</chaindatasetName>
-                    <dataset_info>
-                      <jobTransformData/>
-                      <datasetName>/afs/cern.ch/atlas/offline/external/FullChainTest/long/rtt.fallback/MC12/MC12.108351.pythia_minbias.8TeV.HITS.pool.root</datasetName>
-                    </dataset_info>
-                  </chaindataset_info>
-                  <queue>short</queue>
-                </jobTransform>
-                <chainfileout>
-                  Merge.pool.root
-                </chainfileout>
-              </chainElement>
-
-              <!-- Run Digitization + Reconstruction -->
-              <chainElement>
-                <jobTransform userJobId="ATLFASTIIF_ttbar_3digireco">
-                  <doc>reco</doc>
-                  <jobTransformJobName>ATLFASTIIF_ttbar_3digireco</jobTransformJobName>
-                  <jobTransformCmd>Reco_tf.py --digiSteeringConf 'StandardSignalOnlyTruth' --conditionsTag 'default:OFLCOND-MC15c-SDR-09' --postInclude 'default:RecJobTransforms/UseFrontier.py' 'HITtoRDO:DigitizationTests/postInclude.RDO_Plots.py' --autoConfiguration 'everything' --steering 'doRDO_TRIG' --geometryVersion 'default:ATLAS-R2-2015-03-01-00' --DataRunNumber '267599' --preExec 'all:rec.Commissioning.set_Value_and_Lock(True);from AthenaCommon.BeamFlags import jobproperties;jobproperties.Beam.numberOfCollisions.set_Value_and_Lock(0.0);from LArROD.LArRODFlags import larRODFlags;larRODFlags.NumberOfCollisions.set_Value_and_Lock(0);larRODFlags.nSamples.set_Value_and_Lock(4);larRODFlags.doOFCPileupOptimization.set_Value_and_Lock(True);larRODFlags.firstSample.set_Value_and_Lock(0);larRODFlags.useHighestGainAutoCorr.set_Value_and_Lock(True);' 'RAWtoESD:from CaloRec.CaloCellFlags import jobproperties;jobproperties.CaloCellFlags.doLArCellEmMisCalib=False;from InDetRecExample.InDetJobProperties import InDetFlags;InDetFlags.doStandardPlots.set_Value_and_Lock(True)' 'ESDtoAOD:TriggerFlags.AODEDMSet="AODFULL"' 'RAWtoESD:from InDetRecExample.InDetJobProperties import InDetFlags;InDetFlags.doSlimming.set_Value_and_Lock(False)' 'ESDtoAOD:from InDetRecExample.InDetJobProperties import InDetFlags;InDetFlags.doSlimming.set_Value_and_Lock(False)' --numberOfCavernBkg '0' --postExec 'all:CfgMgr.MessageSvc().setError+=["HepMcParticleLink"]' "ESDtoAOD:fixedAttrib=[s if \"CONTAINER_SPLITLEVEL = \'99\'\" not in s else \"\" for s in svcMgr.AthenaPoolCnvSvc.PoolAttributes];svcMgr.AthenaPoolCnvSvc.PoolAttributes=fixedAttrib" --inputHITSFile 'Merge.pool.root' --outputRDOFile 'RDO.pool.root' --outputESDFile 'ESD.pool.root' --outputAODFile 'AOD.pool.root' --outputNTUP_PHYSVALFile 'PhysValMon.root' --validationFlags 'doInDet,doJet,doMuon,doEgamma' --maxEvents '2000' --jobNumber '1'</jobTransformCmd>
-                  <group>ISF_Validation</group>
-                  <chaindataset_info>
-                    <jobTransformData/>
-                    <chaindatasetName>Merge.pool.root</chaindatasetName>
-                    <dataset_info>
-                      <jobTransformData/>
-                      <datasetName>/afs/cern.ch/atlas/offline/external/FullChainTest/long/rtt.fallback/MC12/MC12.108351.pythia_minbias.8TeV.HITS.pool.root</datasetName> <!-- TODO: change this to ttbar dataset -->
-                    </dataset_info>
-                  </chaindataset_info>
-                  <queue>long</queue>
-                </jobTransform>
-                <!-- not required to be on chainstore at the moment
-                     <chainfileout>ESD.pool.root</chainfileout>
-                     <chainfileout>AOD.pool.root</chainfileout>
-                     <chainfileout>RecoValHists.root</chainfileout>
-                     <chainfileout>InDetStandardPlots.root</chainfileout>
-                     <chainfileout>PhysValMon.root</chainfileout>-->
-              </chainElement>
-              <parallel>
-                <chainElement>
-                  <jobTransform userJobId="ATLFASTIIF_ttbar_3digireco_Reg">
-                    <doc>Regression test between builds</doc>
-                    <jobTransformJobName>ATLFASTIIF_ttbar_3digireco_Reg</jobTransformJobName>
-                    <jobTransformCmd>sim_reg_test.py ATLFASTIIF_ttbar_3digireco InDetStandardPlots.root PhysValMon.root RDO_truth.root</jobTransformCmd>
-                    <group>ISF_Validation_RecoRegressionTests</group>
-                    <queue>medium</queue>
-                  </jobTransform>
-                </chainElement>
-                <chainElement>
-                  <jobTransform userJobId="ATLFASTIIF_ttbar_3digireco_Compare_MCProd_G4">
-                    <doc>comparison to MC12 Geant4 references</doc>
-                    <jobTransformJobName>ATLFASTIIF_ttbar_3digireco_Compare_MCProd_G4</jobTransformJobName>
-                    <jobTransformCmd>sim_reg_test.py ATLFASTIIF_ttbar_3digireco InDetStandardPlots.root PhysValMon.root RDO_truth.root</jobTransformCmd>
-                    <group>ISF_Validation</group>
-                    <queue>medium</queue>
-                    <test position="1">
-                      <modulename>RttLibraryTools</modulename>
-                      <testname>DCubeRunner</testname>
-                      <arg>
-                        <argname>DCubeCfg</argname>
-                        <argvalue>MCProd/ttbar_G4_500evt.InDetStandardPlots.root.xml</argvalue>
-                      </arg>
-                      <arg>
-                        <argname>DCubeRef</argname>
-                        <argvalue>MCProd/ttbar_G4_500evt.InDetStandardPlots.root</argvalue>
-                      </arg>
-                      <arg>
-                        <argname>DCubeMon</argname>
-                        <argvalue>today.InDetStandardPlots.root</argvalue>
-                      </arg>
-                      <keepFilePattern>DCube-MCProd/ttbar_G4_500evt.InDetStandardPlots.root/today.InDetStandardPlots.root.dcube.xml.php</keepFilePattern>
-                      <noalarm />
-                    </test>
-                    <test>
-                      <modulename>RttLibraryTools</modulename>
-                      <testname>DCubeRunner</testname>
-                      <arg>
-                        <argname>DCubeCfg</argname>
-                        <argvalue>MCProd/ttbar_G4_500evt.PhysValMon.root.xml</argvalue>
-                      </arg>
-                      <arg>
-                        <argname>DCubeRef</argname>
-                        <argvalue>MCProd/ttbar_G4_500evt.PhysValMon.root</argvalue>
-                      </arg>
-                      <arg>
-                        <argname>DCubeMon</argname>
-                        <argvalue>today.PhysValMon.root</argvalue>
-                      </arg>
-                      <keepFilePattern>DCube-MCProd/ttbar_G4_500evt.PhysValMon.root/today.PhysValMon.root.dcube.xml.php</keepFilePattern>
-                      <noalarm />
-                    </test>
-                    <test>
-                      <modulename>RttLibraryTools</modulename>
-                      <testname>DCubeRunner</testname>
-                      <arg>
-                        <argname>DCubeCfg</argname>
-                        <argvalue>MCProd/ttbar_G4_500evt.RDO_truth.root.xml</argvalue>
-                      </arg>
-                      <arg>
-                        <argname>DCubeRef</argname>
-                        <argvalue>MCProd/ttbar_G4_500evt.RDO_truth.root</argvalue>
-                      </arg>
-                      <arg>
-                        <argname>DCubeMon</argname>
-                        <argvalue>today.RDO_truth.root</argvalue>
-                      </arg>
-                      <keepFilePattern>DCube-MCProd/ttbar_G4_500evt.RDO_truth.root/today.RDO_truth.root.dcube.xml.php</keepFilePattern>
-                      <noalarm />
-                    </test>
-                    <testToRemove>
-                      <jobGroupName>RTT:Top</jobGroupName>
-                      <testidentifier>CheckFileRunner0</testidentifier>
-                    </testToRemove>
-                  </jobTransform>
-                </chainElement>
-
-                <chainElement>
-                  <jobTransform userJobId="ATLFASTIIF_ttbar_3digireco_Compare_MCProd_AFII">
-                    <doc>comparison to MC12 ATLFASTII references</doc>
-                    <jobTransformJobName>ATLFASTIIF_ttbar_3digireco_Compare_MCProd_AFII</jobTransformJobName>
-                    <jobTransformCmd>sim_reg_test.py ATLFASTIIF_ttbar_3digireco InDetStandardPlots.root PhysValMon.root RDO_truth.root</jobTransformCmd>
-                    <group>ISF_Validation</group>
-                    <queue>short</queue>
-                    <test position="1">
-                      <modulename>RttLibraryTools</modulename>
-                      <testname>DCubeRunner</testname>
-                      <arg>
-                        <argname>DCubeCfg</argname>
-                        <argvalue>MCProd/ttbar_ATLFASTII_500evt.InDetStandardPlots.root.xml</argvalue>
-                      </arg>
-                      <arg>
-                        <argname>DCubeRef</argname>
-                        <argvalue>MCProd/ttbar_ATLFASTII_500evt.InDetStandardPlots.root</argvalue>
-                      </arg>
-                      <arg>
-                        <argname>DCubeMon</argname>
-                        <argvalue>today.InDetStandardPlots.root</argvalue>
-                      </arg>
-                      <keepFilePattern>DCube-MCProd/ttbar_ATLFASTII_500evt.InDetStandardPlots.root/today.InDetStandardPlots.root.dcube.xml.php</keepFilePattern>
-                      <noalarm />
-                    </test>
-                    <test>
-                      <modulename>RttLibraryTools</modulename>
-                      <testname>DCubeRunner</testname>
-                      <arg>
-                        <argname>DCubeCfg</argname>
-                        <argvalue>MCProd/ttbar_ATLFASTII_500evt.PhysValMon.root.xml</argvalue>
-                      </arg>
-                      <arg>
-                        <argname>DCubeRef</argname>
-                        <argvalue>MCProd/ttbar_ATLFASTII_500evt.PhysValMon.root</argvalue>
-                      </arg>
-                      <arg>
-                        <argname>DCubeMon</argname>
-                        <argvalue>today.PhysValMon.root</argvalue>
-                      </arg>
-                      <keepFilePattern>DCube-MCProd/ttbar_ATLFASTII_500evt.PhysValMon.root/today.PhysValMon.root.dcube.xml.php</keepFilePattern>
-                      <noalarm />
-                    </test>
-                    <test>
-                      <modulename>RttLibraryTools</modulename>
-                      <testname>DCubeRunner</testname>
-                      <arg>
-                        <argname>DCubeCfg</argname>
-                        <argvalue>MCProd/ttbar_ATLFASTII_500evt.RDO_truth.root.xml</argvalue>
-                      </arg>
-                      <arg>
-                        <argname>DCubeRef</argname>
-                        <argvalue>MCProd/ttbar_ATLFASTII_500evt.RDO_truth.root</argvalue>
-                      </arg>
-                      <arg>
-                        <argname>DCubeMon</argname>
-                        <argvalue>today.RDO_truth.root</argvalue>
-                      </arg>
-                      <keepFilePattern>DCube-MCProd/ttbar_ATLFASTII_500evt.RDO_truth.root/today.RDO_truth.root.dcube.xml.php</keepFilePattern>
-                      <noalarm />
-                    </test>
-                    <testToRemove>
-                      <jobGroupName>RTT:Top</jobGroupName>
-                      <testidentifier>CheckFileRunner0</testidentifier>
-                    </testToRemove>
-                  </jobTransform>
-                </chainElement>
-
-              </parallel>
-            </sequential>
-
-          </parallel>
-        </sequential>
-
-      </chain>
-
-      <!--%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-         %%                          ATLFASTIIF minbias FullChain
-         %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-        -->
-      <chain>
-        <chainName>FullChainTest_ATLFASTIIF_minbias</chainName>
-        <abortOnError />
-        <sequential>
-          <chainElement>
-            <jobTransform userJobId="ATLFASTIIF_minbias_1sim">
-              <doc>Tests detector functionality for ISF ATLFASTIIF using minbias</doc>
-              <jobTransformJobName>ATLFASTIIF_minbias_1sim</jobTransformJobName>
-              <jobTransformCmd>Sim_tf.py --conditionsTag 'default:OFLCOND-RUN12-SDR-19' --physicsList 'FTFP_BERT' --truthStrategy 'MC12' --simulator 'ATLFASTIIF' --postInclude 'default:PyJobTransforms/UseFrontier.py' 'G4AtlasTests/postInclude.DCubeTest.py' --DataRunNumber '222525' --geometryVersion 'default:ATLAS-R2-2015-03-01-00_VALIDATION' --inputEVNTFile "/afs/cern.ch/atlas/groups/Simulation/EVNT_files/mc12_valid.119994.Pythia8_A2MSTW2008LO_minbias_inelastic.evgen.EVNT.e3099.01517253._000001.pool.root.1" --outputHITSFile "Hits.pool.root" --maxEvents 2000</jobTransformCmd>
-              <group>ISF_Validation_sim</group>
-              <queue>medium</queue>
-              <!--
-                 <test position="1">
-                   <modulename>RttLibraryTools</modulename>
-                   <testname>DCubeRunner</testname>
-                   <arg>
-                     <argname>DCubeCfg</argname>
-                     <argvalue>MC15/dcube-ISF_ATLFASTIIF_minbias.xml</argvalue>
-                   </arg>
-                   <arg>
-                     <argname>DCubeRef</argname>
-                     <argvalue>MC15/ISF_ATLFASTIIF_minbias.truth.root</argvalue>
-                   </arg>
-                   <arg>
-                     <argname>DCubeMon</argname>
-                     <argvalue>truth.root</argvalue>
-                   </arg>
-                 </test>
-                 -->
-            </jobTransform>
-            <chainfileout>Hits.pool.root</chainfileout>
-          </chainElement>
-          <parallel>
-            <chainElement>
-              <jobTransform userJobId="ATLFASTIIF_minbias_1sim_Reg">
-                <doc>Regression test between releases</doc>
-                <jobTransformJobName>ATLFASTIIF_minbias_1sim_Reg</jobTransformJobName>
-                <jobTransformCmd>sim_reg_test.py ATLFASTIIF_minbias_1sim truth.root Hits.pool.root</jobTransformCmd>
-                <group>ISF_Validation_HitsRegressionTests</group>
-                <queue>medium</queue>
-              </jobTransform>
-            </chainElement>
-            <chainElement>
-              <jobTransform userJobId="ATLFASTIIF_minbias_1sim_Compare_MCProd_AFII">
-                <doc>comparison to ISF references</doc>
-                <jobTransformJobName>ATLFASTIIF_minbias_1sim_Compare_MCProd_AFII</jobTransformJobName>
-                <jobTransformCmd>sim_reg_test.py ATLFASTIIF_minbias_1sim</jobTransformCmd>
-                <group>ISF_Validation</group>
-                <queue>extrashort</queue>
-                <test position="1">
-                  <modulename>RttLibraryTools</modulename>
-                  <testname>DCubeRunner</testname>
-                  <arg>
-                    <argname>DCubeCfg</argname>
-                    <argvalue>MCProd/minbias_ATLFASTII_2000evt.truth.root.xml</argvalue>
-                  </arg>
-                  <arg>
-                    <argname>DCubeRef</argname>
-                    <argvalue>MCProd/minbias_ATLFASTII_2000evt.truth.root.xml</argvalue>
-                  </arg>
-                  <arg>
-                    <argname>DCubeMon</argname>
-                    <argvalue>today.root</argvalue>
-                  </arg>
-                  <keepFilePattern>DCube-MCProd/minbias_ATLFASTII_2000evt.truth.root/today.root.dcube.xml.php</keepFilePattern>
-                  <noalarm />
-                </test>
-                <testToRemove>
-                  <jobGroupName>RTT:Top</jobGroupName>
-                  <testidentifier>CheckFileRunner0</testidentifier>
-                </testToRemove>
-              </jobTransform>
-            </chainElement>
-            <chainElement>
-              <jobTransform userJobId="ATLFASTIIF_minbias_1sim_Compare_MCProd_G4">
-                <doc>comparison to ISF references</doc>
-                <jobTransformJobName>ATLFASTIIF_minbias_1sim_Compare_MCProd_G4</jobTransformJobName>
-                <jobTransformCmd>sim_reg_test.py ATLFASTIIF_minbias_1sim</jobTransformCmd>
-                <group>ISF_Validation</group>
-                <queue>extrashort</queue>
-                <test position="1">
-                  <modulename>RttLibraryTools</modulename>
-                  <testname>DCubeRunner</testname>
-                  <arg>
-                    <argname>DCubeCfg</argname>
-                    <argvalue>MCProd/minbias_G4_2000evt.truth.root.xml</argvalue>
-                  </arg>
-                  <arg>
-                    <argname>DCubeRef</argname>
-                    <argvalue>MCProd/minbias_G4_2000evt.truth.root.xml</argvalue>
-                  </arg>
-                  <arg>
-                    <argname>DCubeMon</argname>
-                    <argvalue>today.root</argvalue>
-                  </arg>
-                  <keepFilePattern>DCube-MCProd/minbias_G4_2000evt.truth.root/today.root.dcube.xml.php</keepFilePattern>
-                  <noalarm />
-                </test>
-                <testToRemove>
-                  <jobGroupName>RTT:Top</jobGroupName>
-                  <testidentifier>CheckFileRunner0</testidentifier>
-                </testToRemove>
-              </jobTransform>
-            </chainElement>
-            <chainElement>
-              <jobTransform userJobId="ATLFASTIIF_minbias_1sim_Compare_MCProd_AFIIF">
-                <doc>comparison to ISF references</doc>
-                <jobTransformJobName>ATLFASTIIF_minbias_1sim_Compare_MCProd_AFIIF</jobTransformJobName>
-                <jobTransformCmd>sim_reg_test.py ATLFASTIIF_minbias_1sim</jobTransformCmd>
-                <group>ISF_Validation</group>
-                <queue>extrashort</queue>
-                <test position="1">
-                  <modulename>RttLibraryTools</modulename>
-                  <testname>DCubeRunner</testname>
-                  <arg>
-                    <argname>DCubeCfg</argname>
-                    <argvalue>MCProd/minbias_ATLFASTIIF_2000evt.truth.root.xml</argvalue>
-                  </arg>
-                  <arg>
-                    <argname>DCubeRef</argname>
-                    <argvalue>MCProd/minbias_ATLFASTIIF_2000evt.truth.root.xml</argvalue>
-                  </arg>
-                  <arg>
-                    <argname>DCubeMon</argname>
-                    <argvalue>today.root</argvalue>
-                  </arg>
-                  <keepFilePattern>DCube-MCProd/minbias_ATLFASTIIF_2000evt.truth.root/today.root.dcube.xml.php</keepFilePattern>
-                  <noalarm />
-                </test>
-                <testToRemove>
-                  <jobGroupName>RTT:Top</jobGroupName>
-                  <testidentifier>CheckFileRunner0</testidentifier>
-                </testToRemove>
-              </jobTransform>
-            </chainElement>
-
-            <sequential>
-
-              <!--Run Merge Job with 17.6.51 makes hit file compatible with 17.3.13-->
-              <chainElement>
-                <jobTransform userJobId="ATLFASTIIF_minbias_2merge">
-                  <doc>Merge job for backward compatibility with 17.3.13</doc>
-                  <jobTransformJobName>ATLFASTIIF_minbias_2merge</jobTransformJobName>
-                  <jobTransformCmd>HITSMerge_tf.py --inputHITSFile='Hits.pool.root' --outputHITS_MRGFile='Merge.pool.root' --maxEvents=-1 --skipEvents='0' --geometryVersion='ATLAS-R2-2015-03-01-00' --conditionsTag='OFLCOND-RUN12-SDR-19'</jobTransformCmd>
-                  <group>ISF_Validation</group>
-                  <chaindataset_info>
-                    <jobTransformData/>
-                    <chaindatasetName>Hits.pool.root</chaindatasetName>
-                    <dataset_info>
-                      <jobTransformData/>
-                      <datasetName>/afs/cern.ch/atlas/offline/external/FullChainTest/long/rtt.fallback/MC12/MC12.108351.pythia_minbias.8TeV.HITS.pool.root</datasetName>
-                    </dataset_info>
-                  </chaindataset_info>
-                  <queue>short</queue>
-                </jobTransform>
-                <chainfileout>
-                  Merge.pool.root
-                </chainfileout>
-              </chainElement>
-
-              <!-- Run Digitization + Reconstruction -->
-              <chainElement>
-                <jobTransform userJobId="ATLFASTIIF_minbias_3digireco">
-                  <doc>reco</doc>
-                  <jobTransformJobName>ATLFASTIIF_minbias_3digireco</jobTransformJobName>
-                  <jobTransformCmd>Reco_tf.py --digiSteeringConf 'StandardSignalOnlyTruth' --conditionsTag 'default:OFLCOND-MC15c-SDR-09' --postInclude 'default:RecJobTransforms/UseFrontier.py' 'HITtoRDO:DigitizationTests/postInclude.RDO_Plots.py' --autoConfiguration 'everything' --steering 'doRDO_TRIG' --geometryVersion 'default:ATLAS-R2-2015-03-01-00' --DataRunNumber '267599' --preExec 'all:rec.Commissioning.set_Value_and_Lock(True);from AthenaCommon.BeamFlags import jobproperties;jobproperties.Beam.numberOfCollisions.set_Value_and_Lock(0.0);from LArROD.LArRODFlags import larRODFlags;larRODFlags.NumberOfCollisions.set_Value_and_Lock(0);larRODFlags.nSamples.set_Value_and_Lock(4);larRODFlags.doOFCPileupOptimization.set_Value_and_Lock(True);larRODFlags.firstSample.set_Value_and_Lock(0);larRODFlags.useHighestGainAutoCorr.set_Value_and_Lock(True)' 'RAWtoESD:from CaloRec.CaloCellFlags import jobproperties;jobproperties.CaloCellFlags.doLArCellEmMisCalib=False;from InDetRecExample.InDetJobProperties import InDetFlags;InDetFlags.doStandardPlots.set_Value_and_Lock(True)' 'ESDtoAOD:TriggerFlags.AODEDMSet="AODFULL"' 'RAWtoESD:from InDetRecExample.InDetJobProperties import InDetFlags;InDetFlags.doSlimming.set_Value_and_Lock(False)' 'ESDtoAOD:from InDetRecExample.InDetJobProperties import InDetFlags;InDetFlags.doSlimming.set_Value_and_Lock(False)' --numberOfCavernBkg '0' --postExec 'all:CfgMgr.MessageSvc().setError+=["HepMcParticleLink"]' "ESDtoAOD:fixedAttrib=[s if \"CONTAINER_SPLITLEVEL = \'99\'\" not in s else \"\" for s in svcMgr.AthenaPoolCnvSvc.PoolAttributes];svcMgr.AthenaPoolCnvSvc.PoolAttributes=fixedAttrib" --inputHITSFile 'Merge.pool.root' --outputRDOFile 'RDO.pool.root' --outputESDFile 'ESD.pool.root' --outputAODFile 'AOD.pool.root' --outputNTUP_PHYSVALFile 'PhysValMon.root' --validationFlags 'doInDet,doJet,doMuon,doEgamma' --maxEvents '2000' --jobNumber '1'</jobTransformCmd>
-                  <group>ISF_Validation</group>
-                  <chaindataset_info>
-                    <jobTransformData/>
-                    <chaindatasetName>Merge.pool.root</chaindatasetName>
-                    <dataset_info>
-                      <jobTransformData/>
-                      <datasetName>/afs/cern.ch/atlas/offline/external/FullChainTest/long/rtt.fallback/MC12/MC12.108351.pythia_minbias.8TeV.HITS.pool.root</datasetName> <!-- TODO: change this to minbias dataset -->
-                    </dataset_info>
-                  </chaindataset_info>
-                  <queue>long</queue>
-                </jobTransform>
-              </chainElement>
-              <parallel>
-                <chainElement>
-                  <jobTransform userJobId="ATLFASTIIF_minbias_3digireco_Reg">
-                    <doc>Regression test between builds</doc>
-                    <jobTransformJobName>ATLFASTIIF_minbias_3digireco_Reg</jobTransformJobName>
-                    <jobTransformCmd>sim_reg_test.py ATLFASTIIF_minbias_3digireco InDetStandardPlots.root PhysValMon.root RDO_truth.root</jobTransformCmd>
-                    <group>ISF_Validation_RecoRegressionTests</group>
-                    <queue>medium</queue>
-                  </jobTransform>
-                </chainElement>
-                <chainElement>
-                  <jobTransform userJobId="ATLFASTIIF_minbias_3digireco_Compare_MCProd_G4">
-                    <doc>comparison to MC12 ATLFASTII references</doc>
-                    <jobTransformJobName>ATLFASTIIF_minbias_3digireco_Compare_MCProd_G4</jobTransformJobName>
-                    <jobTransformCmd>sim_reg_test.py ATLFASTIIF_minbias_3digireco InDetStandardPlots.root PhysValMon.root RDO_truth.root</jobTransformCmd>
-                    <group>ISF_Validation</group>
-                    <queue>short</queue>
-                    <test position="1">
-                      <modulename>RttLibraryTools</modulename>
-                      <testname>DCubeRunner</testname>
-                      <arg>
-                        <argname>DCubeCfg</argname>
-                        <argvalue>MCProd/minbias_G4_2000evt.InDetStandardPlots.root.xml</argvalue>
-                      </arg>
-                      <arg>
-                        <argname>DCubeRef</argname>
-                        <argvalue>MCProd/minbias_G4_2000evt.InDetStandardPlots.root</argvalue>
-                      </arg>
-                      <arg>
-                        <argname>DCubeMon</argname>
-                        <argvalue>today.InDetStandardPlots.root</argvalue>
-                      </arg>
-                      <keepFilePattern>DCube-MCProd/minbias_G4_2000evt.InDetStandardPlots.root/today.InDetStandardPlots.root.dcube.xml.php</keepFilePattern>
-                      <noalarm />
-                    </test>
-                    <test>
-                      <modulename>RttLibraryTools</modulename>
-                      <testname>DCubeRunner</testname>
-                      <arg>
-                        <argname>DCubeCfg</argname>
-                        <argvalue>MCProd/minbias_G4_2000evt.PhysValMon.root.xml</argvalue>
-                      </arg>
-                      <arg>
-                        <argname>DCubeRef</argname>
-                        <argvalue>MCProd/minbias_G4_2000evt.PhysValMon.root</argvalue>
-                      </arg>
-                      <arg>
-                        <argname>DCubeMon</argname>
-                        <argvalue>today.PhysValMon.root</argvalue>
-                      </arg>
-                      <keepFilePattern>DCube-MCProd/minbias_G4_2000evt.PhysValMon.root/today.PhysValMon.root.dcube.xml.php</keepFilePattern>
-                      <noalarm />
-                    </test>
-                    <test>
-                      <modulename>RttLibraryTools</modulename>
-                      <testname>DCubeRunner</testname>
-                      <arg>
-                        <argname>DCubeCfg</argname>
-                        <argvalue>MCProd/minbias_G4_2000evt.RDO_truth.root.xml</argvalue>
-                      </arg>
-                      <arg>
-                        <argname>DCubeRef</argname>
-                        <argvalue>MCProd/minbias_G4_2000evt.RDO_truth.root</argvalue>
-                      </arg>
-                      <arg>
-                        <argname>DCubeMon</argname>
-                        <argvalue>today.RDO_truth.root</argvalue>
-                      </arg>
-                      <keepFilePattern>DCube-MCProd/minbias_G4_2000evt.RDO_truth.root/today.RDO_truth.root.dcube.xml.php</keepFilePattern>
-                      <noalarm />
-                    </test>
-                    <testToRemove>
-                      <jobGroupName>RTT:Top</jobGroupName>
-                      <testidentifier>CheckFileRunner0</testidentifier>
-                    </testToRemove>
-                  </jobTransform>
-                </chainElement>
-                <chainElement>
-                  <jobTransform userJobId="ATLFASTIIF_minbias_3digireco_Compare_MCProd_AFII">
-                    <doc>comparison to MC12 ATLFASTII references</doc>
-                    <jobTransformJobName>ATLFASTIIF_minbias_3digireco_Compare_MCProd_AFII</jobTransformJobName>
-                    <jobTransformCmd>sim_reg_test.py ATLFASTIIF_minbias_3digireco InDetStandardPlots.root PhysValMon.root RDO_truth.root</jobTransformCmd>
-                    <group>ISF_Validation</group>
-                    <queue>short</queue>
-                    <test position="1">
-                      <modulename>RttLibraryTools</modulename>
-                      <testname>DCubeRunner</testname>
-                      <arg>
-                        <argname>DCubeCfg</argname>
-                        <argvalue>MCProd/minbias_ATLFASTII_2000evt.InDetStandardPlots.root.xml</argvalue>
-                      </arg>
-                      <arg>
-                        <argname>DCubeRef</argname>
-                        <argvalue>MCProd/minbias_ATLFASTII_2000evt.InDetStandardPlots.root</argvalue>
-                      </arg>
-                      <arg>
-                        <argname>DCubeMon</argname>
-                        <argvalue>today.InDetStandardPlots.root</argvalue>
-                      </arg>
-                      <keepFilePattern>DCube-MCProd/minbias_ATLFASTII_2000evt.InDetStandardPlots.root/today.InDetStandardPlots.root.dcube.xml.php</keepFilePattern>
-                      <noalarm />
-                    </test>
-                    <test>
-                      <modulename>RttLibraryTools</modulename>
-                      <testname>DCubeRunner</testname>
-                      <arg>
-                        <argname>DCubeCfg</argname>
-                        <argvalue>MCProd/minbias_ATLFASTII_2000evt.PhysValMon.root.xml</argvalue>
-                      </arg>
-                      <arg>
-                        <argname>DCubeRef</argname>
-                        <argvalue>MCProd/minbias_ATLFASTII_2000evt.PhysValMon.root</argvalue>
-                      </arg>
-                      <arg>
-                        <argname>DCubeMon</argname>
-                        <argvalue>today.PhysValMon.root</argvalue>
-                      </arg>
-                      <keepFilePattern>DCube-MCProd/minbias_ATLFASTII_2000evt.PhysValMon.root/today.PhysValMon.root.dcube.xml.php</keepFilePattern>
-                      <noalarm />
-                    </test>
-                    <test>
-                      <modulename>RttLibraryTools</modulename>
-                      <testname>DCubeRunner</testname>
-                      <arg>
-                        <argname>DCubeCfg</argname>
-                        <argvalue>MCProd/minbias_ATLFASTII_2000evt.RDO_truth.root.xml</argvalue>
-                      </arg>
-                      <arg>
-                        <argname>DCubeRef</argname>
-                        <argvalue>MCProd/minbias_ATLFASTII_2000evt.RDO_truth.root</argvalue>
-                      </arg>
-                      <arg>
-                        <argname>DCubeMon</argname>
-                        <argvalue>today.RDO_truth.root</argvalue>
-                      </arg>
-                      <keepFilePattern>DCube-MCProd/minbias_ATLFASTII_2000evt.RDO_truth.root/today.RDO_truth.root.dcube.xml.php</keepFilePattern>
-                      <noalarm />
-                    </test>
-                    <testToRemove>
-                      <jobGroupName>RTT:Top</jobGroupName>
-                      <testidentifier>CheckFileRunner0</testidentifier>
-                    </testToRemove>
-                  </jobTransform>
-                </chainElement>
-
-                <chainElement>
-                  <jobTransform userJobId="ATLFASTIIF_minbias_3digireco_Compare_MCProd_AFIIF">
-                    <doc>comparison to MC12 ATLFASTII references</doc>
-                    <jobTransformJobName>ATLFASTIIF_minbias_3digireco_Compare_MCProd_AFIIF</jobTransformJobName>
-                    <jobTransformCmd>sim_reg_test.py ATLFASTIIF_minbias_3digireco InDetStandardPlots.root PhysValMon.root RDO_truth.root</jobTransformCmd>
-                    <group>ISF_Validation</group>
-                    <queue>short</queue>
-                    <test position="1">
-                      <modulename>RttLibraryTools</modulename>
-                      <testname>DCubeRunner</testname>
-                      <arg>
-                        <argname>DCubeCfg</argname>
-                        <argvalue>MCProd/minbias_ATLFASTIIF_2000evt.InDetStandardPlots.root.xml</argvalue>
-                      </arg>
-                      <arg>
-                        <argname>DCubeRef</argname>
-                        <argvalue>MCProd/minbias_ATLFASTIIF_2000evt.InDetStandardPlots.root</argvalue>
-                      </arg>
-                      <arg>
-                        <argname>DCubeMon</argname>
-                        <argvalue>today.InDetStandardPlots.root</argvalue>
-                      </arg>
-                      <keepFilePattern>DCube-MCProd/minbias_ATLFASTIIF_2000evt.InDetStandardPlots.root/today.InDetStandardPlots.root.dcube.xml.php</keepFilePattern>
-                      <noalarm />
-                    </test>
-                    <test>
-                      <modulename>RttLibraryTools</modulename>
-                      <testname>DCubeRunner</testname>
-                      <arg>
-                        <argname>DCubeCfg</argname>
-                        <argvalue>MCProd/minbias_ATLFASTIIF_2000evt.PhysValMon.root.xml</argvalue>
-                      </arg>
-                      <arg>
-                        <argname>DCubeRef</argname>
-                        <argvalue>MCProd/minbias_ATLFASTIIF_2000evt.PhysValMon.root</argvalue>
-                      </arg>
-                      <arg>
-                        <argname>DCubeMon</argname>
-                        <argvalue>today.PhysValMon.root</argvalue>
-                      </arg>
-                      <keepFilePattern>DCube-MCProd/minbias_ATLFASTIIF_2000evt.PhysValMon.root/today.PhysValMon.root.dcube.xml.php</keepFilePattern>
-                      <noalarm />
-                    </test>
-                    <test>
-                      <modulename>RttLibraryTools</modulename>
-                      <testname>DCubeRunner</testname>
-                      <arg>
-                        <argname>DCubeCfg</argname>
-                        <argvalue>MCProd/minbias_ATLFASTIIF_2000evt.RDO_truth.root.xml</argvalue>
-                      </arg>
-                      <arg>
-                        <argname>DCubeRef</argname>
-                        <argvalue>MCProd/minbias_ATLFASTIIF_2000evt.RDO_truth.root</argvalue>
-                      </arg>
-                      <arg>
-                        <argname>DCubeMon</argname>
-                        <argvalue>today.RDO_truth.root</argvalue>
-                      </arg>
-                      <keepFilePattern>DCube-MCProd/minbias_ATLFASTIIF_2000evt.RDO_truth.root/today.RDO_truth.root.dcube.xml.php</keepFilePattern>
-                      <noalarm />
-                    </test>
-                    <testToRemove>
-                      <jobGroupName>RTT:Top</jobGroupName>
-                      <testidentifier>CheckFileRunner0</testidentifier>
-                    </testToRemove>
-                  </jobTransform>
-                </chainElement>
-
-
-              </parallel>
-            </sequential>
-
-          </parallel>
-        </sequential>
-
-      </chain>
-
-
-
-    </jobList>
-
-
-    <jobGroups>
-      <jobGroup name="ISF_Validation" parent="Top">
-        <keepFilePattern>*.root</keepFilePattern>
-        <keepFilePattern>*.txt</keepFilePattern>
-        <keepFilePattern>*.out</keepFilePattern>
-        <keepFilePattern>*.html</keepFilePattern>
-        <keepFilePattern>prof/*.html</keepFilePattern>
-        <keepFilePattern>*.php</keepFilePattern>
-        <keepFilePattern>*log</keepFilePattern>
-        <keepFilePattern>log*</keepFilePattern>
-        <keepFilePattern>*.diffPool</keepFilePattern>
-        <keepFilePattern>test.athena.profile</keepFilePattern>
-      </jobGroup>
-      <jobGroup name="ISF_Validation_HitsRegressionTests" parent="Top">
-        <keepFilePattern>*.root</keepFilePattern>
-        <keepFilePattern>*.txt</keepFilePattern>
-        <keepFilePattern>*.out</keepFilePattern>
-        <keepFilePattern>*.html</keepFilePattern>
-        <keepFilePattern>prof/*.html</keepFilePattern>
-        <keepFilePattern>*.php</keepFilePattern>
-        <keepFilePattern>*log</keepFilePattern>
-        <keepFilePattern>*.diffPool</keepFilePattern>
-        <keepFilePattern>*.diffRoot</keepFilePattern>
-        <keepFilePattern>test.athena.profile</keepFilePattern>
-        <test position="1">
-          <modulename>RttLibraryTools</modulename>
-          <testname>DiffPoolFilesRunner</testname>
-          <testidentifier>HITS_RegressionTestDiffPoolRunner</testidentifier>
-          <arg>
-            <argname>fileName</argname>
-            <argvalue>today.Hits.pool.root</argvalue>
-          </arg>
-          <arg>
-            <argname>refFileName</argname>
-            <argvalue>yesterday.Hits.pool.root</argvalue>
-          </arg>
-          <keepFilePattern>today.Hits.pool.root_yesterday.Hits.pool.root.diffPool</keepFilePattern>
-        </test>
-        <test position="2">
-          <modulename>FlexibleDiffPoolFilesRunner</modulename>
-          <testname>FlexibleDiffPoolFilesRunner</testname>
-          <testidentifier>HITS_RegressionTestDiffRootRunner</testidentifier>
-          <arg>
-            <argname>platformDependent</argname>
-            <argvalue>True</argvalue>
-          </arg>
-          <arg>
-            <argname>optionString</argname>
-            <argvalue>--ignore-leaves RecoTimingObj_p1_EVNTtoHITS_timings</argvalue>
-          </arg>
-          <arg>
-            <argname>doDetailedChecks</argname>
-            <argvalue>True</argvalue>
-          </arg>
-          <arg>
-            <argname>fileName</argname>
-            <argvalue>today.Hits.pool.root</argvalue>
-          </arg>
-          <arg>
-            <argname>refFileName</argname>
-            <argvalue>yesterday.Hits.pool.root</argvalue>
-          </arg>
-          <arg>
-            <argname>testOutputFile</argname>
-            <argvalue>today.Hits.pool.root_yesterday.Hits.pool.root.diffRoot</argvalue>
-          </arg>
-          <keepFilePattern>today.Hits.pool.root_yesterday.Hits.pool.root.diffRoot</keepFilePattern>
-        </test>
-        <test position="3">
-          <modulename>RttLibraryTools</modulename>
-          <testname>DCubeRunner</testname>
-          <arg>
-            <argname>DCubeCfg</argname>
-            <argvalue>MCProd/HITS_truth.root.xml</argvalue>
-          </arg>
-          <arg>
-            <argname>DCubeRef</argname>
-            <argvalue>yesterday.truth.root</argvalue>
-          </arg>
-          <arg>
-            <argname>localRefFile</argname>
-            <argvalue>True</argvalue>
-          </arg>
-          <arg>
-            <argname>DCubeMon</argname>
-            <argvalue>today.truth.root</argvalue>
-          </arg>
-          <keepFilePattern>DCube-yesterday.truth.root/today.truth.root.dcube.xml.php</keepFilePattern>
-        </test>
-
-        <testToRemove>
-          <jobGroupName>RTT:Top</jobGroupName>
-          <testidentifier>CheckFileRunner0</testidentifier>
-        </testToRemove>
-      </jobGroup>
-
-      <jobGroup name="ISF_Validation_RecoRegressionTests" parent="Top">
-        <keepFilePattern>*.root</keepFilePattern>
-        <keepFilePattern>*.txt</keepFilePattern>
-        <keepFilePattern>*.out</keepFilePattern>
-        <keepFilePattern>*.html</keepFilePattern>
-        <keepFilePattern>prof/*.html</keepFilePattern>
-        <keepFilePattern>*.php</keepFilePattern>
-        <keepFilePattern>*log</keepFilePattern>
-        <keepFilePattern>log.*</keepFilePattern>
-        <keepFilePattern>*.diffPool</keepFilePattern>
-        <keepFilePattern>test.athena.profile</keepFilePattern>
-        <test position="1">
-          <modulename>RttLibraryTools</modulename>
-          <testname>DCubeRunner</testname>
-          <arg>
-            <argname>DCubeCfg</argname>
-            <argvalue>MCProd/RDO_truth.root.xml</argvalue>
-          </arg>
-          <arg>
-            <argname>DCubeRef</argname>
-            <argvalue>yesterday.RDO_truth.root</argvalue>
-          </arg>
-          <arg>
-            <argname>localRefFile</argname>
-            <argvalue>True</argvalue>
-          </arg>
-          <arg>
-            <argname>DCubeMon</argname>
-            <argvalue>today.RDO_truth.root</argvalue>
-          </arg>
-          <keepFilePattern>DCube-yesterday.RDO_truth.root/today.RDO_truth.root.dcube.xml.php</keepFilePattern>
-        </test>
-        <test position="2">
-          <modulename>RttLibraryTools</modulename>
-          <testname>DCubeRunner</testname>
-          <arg>
-            <argname>DCubeCfg</argname>
-            <argvalue>MCProd/PhysValMon.root.xml</argvalue>
-          </arg>
-          <arg>
-            <argname>DCubeRef</argname>
-            <argvalue>yesterday.PhysValMon.root</argvalue>
-          </arg>
-          <arg>
-            <argname>localRefFile</argname>
-            <argvalue>True</argvalue>
-          </arg>
-          <arg>
-            <argname>DCubeMon</argname>
-            <argvalue>today.PhysValMon.root</argvalue>
-          </arg>
-          <keepFilePattern>DCube-yesterday.PhysValMon.root/today.PhysValMon.root.dcube.xml.php</keepFilePattern>
-        </test>
-        <test position="3">
-          <modulename>RttLibraryTools</modulename>
-          <testname>DCubeRunner</testname>
-          <arg>
-            <argname>DCubeCfg</argname>
-            <argvalue>MCProd/InDetStandardPlots.root.xml</argvalue>
-          </arg>
-          <arg>
-            <argname>DCubeRef</argname>
-            <argvalue>yesterday.InDetStandardPlots.root</argvalue>
-          </arg>
-          <arg>
-            <argname>localRefFile</argname>
-            <argvalue>True</argvalue>
-          </arg>
-          <arg>
-            <argname>DCubeMon</argname>
-            <argvalue>today.InDetStandardPlots.root</argvalue>
-          </arg>
-          <keepFilePattern>DCube-yesterday.InDetStandardPlots.root/today.InDetStandardPlots.root.dcube.xml.php</keepFilePattern>
-        </test>
-        <testToRemove>
-          <jobGroupName>RTT:Top</jobGroupName>
-          <testidentifier>CheckFileRunner0</testidentifier>
-        </testToRemove>
-      </jobGroup>
-
-      <jobGroup name="ISF_Validation_sim" parent="Top">
-        <keepFilePattern>*.root</keepFilePattern>
-        <keepFilePattern>*.txt</keepFilePattern>
-        <keepFilePattern>*.out</keepFilePattern>
-        <keepFilePattern>*.html</keepFilePattern>
-        <keepFilePattern>prof/*.html</keepFilePattern>
-        <keepFilePattern>*.php</keepFilePattern>
-        <keepFilePattern>*log</keepFilePattern>
-        <keepFilePattern>log.*</keepFilePattern>
-        <keepFilePattern>*.diffPool</keepFilePattern>
-        <keepFilePattern>test.athena.profile</keepFilePattern>
-        <test>
-          <modulename>RttLibraryTools</modulename>
-          <testname>FileGrepper</testname>
-          <outputFile>fileGrepper_results.txt</outputFile>
-          <testidentifier>FileGrepperA</testidentifier>
-          <arg>
-            <argname>inputFile</argname>
-            <argvalue>log.EVNTtoHITS</argvalue>
-          </arg>
-          <arg>
-            <fileGrepperArgs>
-              <!-- search pattern block -->
-              <fileGrepperSearchPattern>
-                <fileGrepperPattern>leaving with code 0</fileGrepperPattern>
-              </fileGrepperSearchPattern>
-              <!-- veto pattern block -->
-              <fileGrepperVetoPattern>
-                <fileGrepperPattern>(segmentation violation|bus error|Event was aborted)</fileGrepperPattern>
-              </fileGrepperVetoPattern>
-              <fileGrepperVetoPattern>
-                <!-- This looks for StuckTrack that is not due to a CSCspacer -->
-                <fileGrepperPattern>\*\*\* G4Exception : StuckTrack(?!([^\n]*\n){4}([^\n]*?)CSCspacer)</fileGrepperPattern>
-                <compileFlags>S</compileFlags>
-              </fileGrepperVetoPattern>
-            </fileGrepperArgs>
-          </arg>
-          <keepFilePattern>fileGrepper_results.txt</keepFilePattern>
-        </test>
-        <test> <!-- Special Test for InfiniteLoop G4Exceptions should remove once it starts failing.. -->
-          <modulename>RttLibraryTools</modulename>
-          <testname>FileGrepper</testname>
-          <outputFile>InfiniteLoopGrepper_results.txt</outputFile>
-          <testidentifier>InfiniteLoopGrepper</testidentifier>
-          <arg>
-            <argname>inputFile</argname>
-            <argvalue>log.EVNTtoHITS</argvalue>
-          </arg>
-          <arg>
-            <fileGrepperArgs>
-              <!-- veto pattern block -->
-              <fileGrepperVetoPattern>
-                <fileGrepperPattern>G4Exception : InfiniteLoop</fileGrepperPattern>
-                <compileFlags>S</compileFlags>
-              </fileGrepperVetoPattern>
-            </fileGrepperArgs>
-          </arg>
-          <keepFilePattern>InfiniteLoopGrepper_results.txt</keepFilePattern>
-        </test>
-        <test> <!-- Special Test for StrangePDG G4Exceptions should remove once it starts failing.. -->
-          <modulename>RttLibraryTools</modulename>
-          <testname>FileGrepper</testname>
-          <outputFile>StrangePDGGrepper_results.txt</outputFile>
-          <testidentifier>StrangePDGGrepper</testidentifier>
-          <arg>
-            <argname>inputFile</argname>
-            <argvalue>log.EVNTtoHITS</argvalue>
-          </arg>
-          <arg>
-            <fileGrepperArgs>
-              <!-- veto pattern block -->
-              <fileGrepperVetoPattern>
-                <fileGrepperPattern>G4Exception : PART102</fileGrepperPattern>
-                <compileFlags>S</compileFlags>
-              </fileGrepperVetoPattern>
-            </fileGrepperArgs>
-          </arg>
-          <keepFilePattern>StrangePDGGrepper_results.txt</keepFilePattern>
-        </test>
-        <test> <!-- Special Test for uninitialized random stream seeds should remove once it starts failing.. -->
-          <modulename>RttLibraryTools</modulename>
-          <testname>FileGrepper</testname>
-          <outputFile>DefaultSeedsGrepper_results.txt</outputFile>
-          <testidentifier>DefaultSeedsGrepper</testidentifier>
-          <arg>
-            <argname>inputFile</argname>
-            <argvalue>log.EVNTtoHITS</argvalue>
-          </arg>
-          <arg>
-            <fileGrepperArgs>
-              <!-- veto pattern block -->
-              <fileGrepperVetoPattern>
-                <fileGrepperPattern>DEFAULT seeds</fileGrepperPattern>
-                <compileFlags>S</compileFlags>
-              </fileGrepperVetoPattern>
-            </fileGrepperArgs>
-          </arg>
-          <keepFilePattern>DefaultSeedsGrepper_results.txt</keepFilePattern>
-        </test>
-
-      </jobGroup>
-
-    </jobGroups>
-
-  </rtt>
-
-</unifiedTestConfiguration>
diff --git a/Simulation/ISF/ISF_Validation/test/test_MC16_ATLFASTIIF_ttbar.sh b/Simulation/ISF/ISF_Validation/test/test_MC16_ATLFASTIIF_ttbar.sh
new file mode 100755
index 0000000000000000000000000000000000000000..4317a8a2ddeb0fba9ff7988260fc9e2db97d752b
--- /dev/null
+++ b/Simulation/ISF/ISF_Validation/test/test_MC16_ATLFASTIIF_ttbar.sh
@@ -0,0 +1,33 @@
+#!/bin/sh
+#
+# art-description: MC16-style simulation using ATLFASTIIF
+# art-type: build
+# art-include: 21.3/Athena
+# art-include: 21.9/Athena
+# art-include: master/Athena
+
+# MC16 setup
+# ATLAS-R2-2016-01-00-01 and OFLCOND-MC16-SDR-14
+
+Sim_tf.py \
+--conditionsTag 'default:OFLCOND-MC16-SDR-14' \
+--physicsList 'FTFP_BERT_ATL' \
+--truthStrategy 'MC15aPlus' \
+--simulator 'ATLFASTIIF' \
+--postInclude 'default:PyJobTransforms/UseFrontier.py' 'EVNTtoHITS:G4AtlasTests/postInclude.DCubeTest.py' \
+--preExec 'EVNTtoHITS:simFlags.TightMuonStepping=True' \
+--DataRunNumber '284500' \
+--geometryVersion 'default:ATLAS-R2-2016-01-00-01' \
+--inputEVNTFile "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/SimCoreTests/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.evgen.EVNT.e4993.EVNT.08166201._000012.pool.root.1" \
+--outputHITSFile "Hits.pool.root" \
+--maxEvents 2000 \
+--imf False
+
+echo  "art-result: $? simulation"
+
+ArtPackage=$1
+ArtJobName=$2
+# TODO This is a regression test I think. We would also need to compare these files to fixed references
+art.py compare grid  --entries 10 ${ArtPackage} ${ArtJobName}
+
+echo  "art-result: $? regression"
diff --git a/Simulation/ISF/ISF_Validation/test/test_MC16_ATLFASTII_ttbar.sh b/Simulation/ISF/ISF_Validation/test/test_MC16_ATLFASTII_ttbar.sh
new file mode 100755
index 0000000000000000000000000000000000000000..b9386bb4c1aef0b15955ce30b51977877c4b2271
--- /dev/null
+++ b/Simulation/ISF/ISF_Validation/test/test_MC16_ATLFASTII_ttbar.sh
@@ -0,0 +1,37 @@
+#!/bin/sh
+#
+# art-description: MC16-style simulation using ATLFASTII
+# art-include: 21.0/Athena
+# art-include: 21.3/Athena
+# art-include: 21.9/Athena
+# art-include: master/Athena
+# art-type: grid
+# art-output: test.HITS.pool.root
+# art-output: truth.root
+
+# MC16 setup
+# ATLAS-R2-2016-01-00-01 and OFLCOND-MC16-SDR-14
+
+Sim_tf.py \
+--conditionsTag 'default:OFLCOND-MC16-SDR-14' \
+--physicsList 'FTFP_BERT_ATL' \
+--truthStrategy 'MC15aPlus' \
+--simulator 'ATLFASTII' \
+--postInclude 'default:PyJobTransforms/UseFrontier.py' 'EVNTtoHITS:G4AtlasTests/postInclude.DCubeTest.py' \
+--preInclude 'EVNTtoHITS:SimulationJobOptions/preInclude.BeamPipeKill.py' \
+--preExec 'EVNTtoHITS:simFlags.TightMuonStepping=True' \
+--DataRunNumber '284500' \
+--geometryVersion 'default:ATLAS-R2-2016-01-00-01' \
+--inputEVNTFile "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/SimCoreTests/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.evgen.EVNT.e4993.EVNT.08166201._000012.pool.root.1" \
+--outputHITSFile "test.Hits.pool.root" \
+--maxEvents 250 \
+--imf False
+
+echo  "art-result: $? simulation"
+
+ArtPackage=$1
+ArtJobName=$2
+# TODO This is a regression test I think. We would also need to compare these files to fixed references
+art.py compare grid  --entries 10 ${ArtPackage} ${ArtJobName}
+
+echo  "art-result: $? regression"
diff --git a/Simulation/ISF/ISF_Validation/test/test_MC16_FullG4_QS_ttbar.sh b/Simulation/ISF/ISF_Validation/test/test_MC16_FullG4_QS_ttbar.sh
new file mode 100755
index 0000000000000000000000000000000000000000..de5226928208e638326096a21db33a71c2e323d9
--- /dev/null
+++ b/Simulation/ISF/ISF_Validation/test/test_MC16_FullG4_QS_ttbar.sh
@@ -0,0 +1,36 @@
+#!/bin/sh
+#
+# art-description: MC16-style simulation using FullG4_LongLived
+# art-include: 21.0/Athena
+# art-include: 21.3/Athena
+# art-include: 21.9/Athena
+# art-include: master/Athena
+# art-type: grid
+# art-output: test.HITS.pool.root
+# art-output: truth.root
+
+# MC16 setup
+# ATLAS-R2-2016-01-00-01 and OFLCOND-MC16-SDR-14
+Sim_tf.py \
+--conditionsTag 'default:OFLCOND-MC16-SDR-14' \
+--physicsList 'FTFP_BERT_ATL' \
+--truthStrategy 'MC15aPlus' \
+--simulator 'FullG4_LongLived' \
+--postInclude 'default:PyJobTransforms/UseFrontier.py' \
+--preInclude 'EVNTtoHITS:SimulationJobOptions/preInclude.BeamPipeKill.py,SimulationJobOptions/preInclude.FrozenShowersFCalOnly.py' \
+--preExec 'EVNTtoHITS:simFlags.TightMuonStepping=True' \
+--DataRunNumber '284500' \
+--geometryVersion 'default:ATLAS-R2-2016-01-00-01' \
+--inputEVNTFile "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/SimCoreTests/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.evgen.EVNT.e4993.EVNT.08166201._000012.pool.root.1" \
+--outputHITSFile "Hits.pool.root" \
+--maxEvents 4 \
+--imf False
+
+echo  "art-result: $? simulation"
+
+ArtPackage=$1
+ArtJobName=$2
+# TODO This is a regression test I think. We would also need to compare these files to fixed references
+art.py compare grid  --entries 4 ${ArtPackage} ${ArtJobName}
+
+echo  "art-result: $? regression"
diff --git a/Simulation/ISF/ISF_Validation/test/test_MC16_FullG4_ttbar.sh b/Simulation/ISF/ISF_Validation/test/test_MC16_FullG4_ttbar.sh
new file mode 100755
index 0000000000000000000000000000000000000000..99060e2c9a879eadf28afbf9d5d926fc91831777
--- /dev/null
+++ b/Simulation/ISF/ISF_Validation/test/test_MC16_FullG4_ttbar.sh
@@ -0,0 +1,36 @@
+#!/bin/sh
+#
+# art-description: MC16-style simulation using FullG4
+# art-include: 21.0/Athena
+# art-include: 21.3/Athena
+# art-include: 21.9/Athena
+# art-include: master/Athena
+# art-type: grid
+# art-output: test.HITS.pool.root
+# art-output: truth.root
+
+# MC16 setup
+# ATLAS-R2-2016-01-00-01 and OFLCOND-MC16-SDR-14
+Sim_tf.py \
+--conditionsTag 'default:OFLCOND-MC16-SDR-14' \
+--physicsList 'FTFP_BERT_ATL' \
+--truthStrategy 'MC15aPlus' \
+--simulator 'FullG4' \
+--postInclude 'default:PyJobTransforms/UseFrontier.py' \
+--preInclude 'EVNTtoHITS:SimulationJobOptions/preInclude.BeamPipeKill.py,SimulationJobOptions/preInclude.FrozenShowersFCalOnly.py' \
+--preExec 'EVNTtoHITS:simFlags.TightMuonStepping=True' \
+--DataRunNumber '284500' \
+--geometryVersion 'default:ATLAS-R2-2016-01-00-01' \
+--inputEVNTFile "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/SimCoreTests/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.evgen.EVNT.e4993.EVNT.08166201._000012.pool.root.1" \
+--outputHITSFile "Hits.pool.root" \
+--maxEvents 4 \
+--imf False
+
+echo  "art-result: $? simulation"
+
+ArtPackage=$1
+ArtJobName=$2
+# TODO This is a regression test I think. We would also need to compare these files to fixed references
+art.py compare grid  --entries 4 ${ArtPackage} ${ArtJobName}
+
+echo  "art-result: $? regression"
diff --git a/Simulation/ISF/ISF_Validation/test/test_MC16_FullG4_ttbar_2evts.sh b/Simulation/ISF/ISF_Validation/test/test_MC16_FullG4_ttbar_2evts.sh
new file mode 100755
index 0000000000000000000000000000000000000000..83ff94ba13b5c2eb2104c56108d85706eaf98d27
--- /dev/null
+++ b/Simulation/ISF/ISF_Validation/test/test_MC16_FullG4_ttbar_2evts.sh
@@ -0,0 +1,29 @@
+#!/bin/sh
+#
+# art-description: MC16-style simulation using FullG4
+# art-type: build
+# art-include: 21.0/Athena
+# art-include: 21.0/AthSimulation
+# art-include: 21.3/Athena
+# art-include: 21.9/Athena
+# art-include: master/Athena
+# art-include: master/AthSimulation
+
+# MC16 setup
+# ATLAS-R2-2016-01-00-01 and OFLCOND-MC16-SDR-14
+export TRF_ECHO=1
+Sim_tf.py \
+--conditionsTag 'default:OFLCOND-MC16-SDR-14' \
+--physicsList 'FTFP_BERT_ATL' \
+--truthStrategy 'MC15aPlus' \
+--simulator 'FullG4' \
+--postInclude 'default:PyJobTransforms/UseFrontier.py' \
+--preInclude 'EVNTtoHITS:SimulationJobOptions/preInclude.BeamPipeKill.py,SimulationJobOptions/preInclude.FrozenShowersFCalOnly.py' \
+--preExec 'EVNTtoHITS:simFlags.TightMuonStepping=True' \
+--DataRunNumber '284500' \
+--geometryVersion 'default:ATLAS-R2-2016-01-00-01' \
+--inputEVNTFile "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/SimCoreTests/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.evgen.EVNT.e4993.EVNT.08166201._000012.pool.root.1" \
+--outputHITSFile "Hits.pool.root" \
+--maxEvents 2
+
+echo  "art-result: $? simulation"
diff --git a/Simulation/Tests/SimCoreTests/test/SimCoreTests_TestConfiguration.xml b/Simulation/Tests/SimCoreTests/test/SimCoreTests_TestConfiguration.xml
deleted file mode 100644
index bb5dc68b5d8b5206913d90e8edc62be06e2e756c..0000000000000000000000000000000000000000
--- a/Simulation/Tests/SimCoreTests/test/SimCoreTests_TestConfiguration.xml
+++ /dev/null
@@ -1,2066 +0,0 @@
-<!DOCTYPE unifiedTestConfiguration SYSTEM "http://www.hep.ucl.ac.uk/atlas/AtlasTesting/DTD/unifiedTestConfiguration.dtd">
-<unifiedTestConfiguration>
-  <rtt xmlns="http://www.hep.ucl.ac.uk/atlas/AtlasTesting/rtt">
-    <rttContactPerson>John Chapman (chapman@hep.phy.cam.ac.uk)</rttContactPerson>
-    <mailto>atlas-simulation-testreports@cern.ch</mailto>
-
-    <!--
-       don't forget to check the xml file with
-       python /afs/cern.ch/user/r/rtt/public/validateXML.py SimCoreTests_TestConfiguration.xml
-
-       and to update the twiki page:
-       https://twiki.cern.ch/twiki/bin/viewauth/AtlasComputing/SimCoreTests
-
-      -->
-
-    <jobList>
-
-      <classification>
-        <displayClass>OfflineValidation</displayClass>
-        <displayProcess>Simul</displayProcess>
-        <displayComponent>Athena-Core</displayComponent>
-      </classification>
-
-      <chain>
-        <chainName>RegressionTest_TestBeamSim</chainName>
-        <abortOnError />
-        <sequential>
-
-          <chainElement>
-            <jobTransform userJobId="TestBeamSim">
-              <doc>Tile TB Simulation</doc>
-              <jobTransformJobName>TestBeamSim</jobTransformJobName>
-              <jobTransformCmd>TestBeam_tf.py --outputHITSFile 'test.HITS.pool.root' --maxEvents '10' --Eta '0.35' --testBeamConfig 'tbtile' --postInclude 'PyJobTransforms/UseFrontier.py'
-              </jobTransformCmd>
-              <group>SimCoreJobTransformTests</group>
-              <queue>short</queue>
-              <test position="1">
-                <modulename>RttLibraryTools</modulename>
-                <testname>DiffPoolFilesRunner</testname>
-                <testidentifier>TestBeamSim_HITSFileDiff</testidentifier>
-                <arg>
-                  <argname>fileName</argname>
-                  <argvalue>test.HITS.pool.root</argvalue>
-                </arg>
-                <arg>
-                  <argname>refFileName</argname>
-                  <argvalue>root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/proj-sit/simulation/validation/RTT/referenceFiles/21.0.X/TestBeamSim.HITS.pool.root</argvalue>
-                </arg>
-                <keepFilePattern>test.HITS.pool.root_TestBeamSim.HITS.pool.root.diffPool</keepFilePattern>
-              </test>
-            </jobTransform>
-          </chainElement>
-
-          <chainElement>
-            <jobTransform userJobId="TestBeamSim_Reg">
-              <doc>Regression test between releases</doc>
-              <jobTransformJobName>TestBeamSim_Reg</jobTransformJobName>
-              <jobTransformCmd>sim_reg_test.py TestBeamSim</jobTransformCmd>
-              <group>SimCoreTests:SimCoreRegressionTests</group>
-              <queue>short</queue>
-            </jobTransform>
-          </chainElement>
-
-        </sequential>
-      </chain>
-
-      <chain>
-          <chainName>RegressionTest_Atlas2010GeomSim</chainName>
-          <abortOnError />
-          <sequential>
-
-          <chainElement>
-            <jobTransform userJobId="Atlas2010GeomSim">
-              <doc>Reading gen events, single particle</doc>
-              <jobTransformJobName>Atlas2010GeomSim</jobTransformJobName>
-              <jobTransformCmd>AtlasG4_tf.py --inputEVNTFile '/afs/cern.ch/atlas/offline/ProdData/16.6.X/16.6.7.Y/mu_E200_eta0-25.evgen.pool.root' --outputHITSFile 'test.HITS.pool.root' --maxEvents '10' --skipEvents '0' --randomSeed '10' --geometryVersion 'ATLAS-R1-2010-02-00-00' --conditionsTag 'OFLCOND-RUN12-SDR-19' --DataRunNumber '155697' --physicsList 'FTFP_BERT' --postInclude 'PyJobTransforms/UseFrontier.py'
-              </jobTransformCmd>
-              <group>SimCoreJobTransformTests</group>
-              <queue>short</queue>
-              <test position="1">
-                <modulename>RttLibraryTools</modulename>
-                <testname>DiffPoolFilesRunner</testname>
-                <testidentifier>Atlas2010GeomSim_HITSFileDiff</testidentifier>
-                <arg>
-                  <argname>fileName</argname>
-                  <argvalue>test.HITS.pool.root</argvalue>
-                </arg>
-                <arg>
-                  <argname>refFileName</argname>
-                  <argvalue>root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/proj-sit/simulation/validation/RTT/referenceFiles/21.0.X/Atlas2010GeomSim.HITS.pool.root</argvalue>
-                </arg>
-                <keepFilePattern>test.HITS.pool.root_Atlas2010GeomSim.HITS.pool.root.diffPool</keepFilePattern>
-              </test>
-            </jobTransform>
-          </chainElement>
-
-          <chainElement>
-            <jobTransform userJobId="Atlas2010GeomSim_Reg">
-              <doc>Regression test between releases</doc>
-              <jobTransformJobName>Atlas2010GeomSim_Reg</jobTransformJobName>
-              <jobTransformCmd>sim_reg_test.py Atlas2010GeomSim</jobTransformCmd>
-              <group>SimCoreTests:SimCoreRegressionTests</group>
-              <queue>short</queue>
-            </jobTransform>
-          </chainElement>
-
-        </sequential>
-      </chain>
-
-      <chain>
-        <chainName>RegressionTest_Atlas2011GeomSim</chainName>
-        <abortOnError />
-        <sequential>
-
-          <chainElement>
-            <jobTransform userJobId="Atlas2011GeomSim">
-              <doc>Reading gen events, single particle</doc>
-              <jobTransformJobName>Atlas2011GeomSim</jobTransformJobName>
-              <jobTransformCmd>AtlasG4_tf.py --inputEVNTFile '/afs/cern.ch/atlas/offline/ProdData/16.6.X/16.6.7.Y/mu_E200_eta0-25.evgen.pool.root' --outputHITSFile 'test.HITS.pool.root' --maxEvents '10' --skipEvents '0' --randomSeed '10' --geometryVersion 'ATLAS-R1-2011-02-00-00' --conditionsTag 'OFLCOND-RUN12-SDR-19' --DataRunNumber '180164' --physicsList 'FTFP_BERT' --postInclude 'PyJobTransforms/UseFrontier.py'
-              </jobTransformCmd>
-              <group>SimCoreJobTransformTests</group>
-              <queue>short</queue>
-              <test position="1">
-                <modulename>RttLibraryTools</modulename>
-                <testname>DiffPoolFilesRunner</testname>
-                <testidentifier>Atlas2011GeomSim_HITSFileDiff</testidentifier>
-                <arg>
-                  <argname>fileName</argname>
-                  <argvalue>test.HITS.pool.root</argvalue>
-                </arg>
-                <arg>
-                  <argname>refFileName</argname>
-                  <argvalue>root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/proj-sit/simulation/validation/RTT/referenceFiles/21.0.X/Atlas2011GeomSim.HITS.pool.root</argvalue>
-                </arg>
-                <keepFilePattern>test.HITS.pool.root_Atlas2011GeomSim.HITS.pool.root.diffPool</keepFilePattern>
-              </test>
-            </jobTransform>
-          </chainElement>
-
-          <chainElement>
-            <jobTransform userJobId="Atlas2011GeomSim_Reg">
-              <doc>Regression test between releases</doc>
-              <jobTransformJobName>Atlas2011GeomSim_Reg</jobTransformJobName>
-              <jobTransformCmd>sim_reg_test.py Atlas2011GeomSim</jobTransformCmd>
-              <group>SimCoreTests:SimCoreRegressionTests</group>
-              <queue>short</queue>
-            </jobTransform>
-          </chainElement>
-
-        </sequential>
-      </chain>
-
-      <chain>
-        <chainName>RegressionTest_Atlas2012GeomSim</chainName>
-        <abortOnError />
-        <sequential>
-
-          <chainElement>
-            <jobTransform userJobId="Atlas2012GeomSim">
-              <doc>Reading gen events, single particle</doc>
-              <jobTransformJobName>Atlas2012GeomSim</jobTransformJobName>
-              <jobTransformCmd>AtlasG4_tf.py --inputEVNTFile '/afs/cern.ch/atlas/offline/ProdData/16.6.X/16.6.7.Y/mu_E200_eta0-25.evgen.pool.root' --outputHITSFile 'test.HITS.pool.root' --maxEvents '10' --skipEvents '0' --randomSeed '10' --geometryVersion 'ATLAS-R1-2012-03-00-00' --conditionsTag 'OFLCOND-RUN12-SDR-19' --DataRunNumber '212272' --physicsList 'FTFP_BERT' --postInclude 'PyJobTransforms/UseFrontier.py'
-              </jobTransformCmd>
-              <group>SimCoreJobTransformTests</group>
-              <queue>short</queue>
-              <test position="1">
-                <modulename>RttLibraryTools</modulename>
-                <testname>DiffPoolFilesRunner</testname>
-                <testidentifier>Atlas2012GeomSim_HITSFileDiff</testidentifier>
-                <arg>
-                  <argname>fileName</argname>
-                  <argvalue>test.HITS.pool.root</argvalue>
-                </arg>
-                <arg>
-                  <argname>refFileName</argname>
-                  <argvalue>root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/proj-sit/simulation/validation/RTT/referenceFiles/21.0.X/Atlas2012GeomSim.HITS.pool.root</argvalue>
-                </arg>
-                <keepFilePattern>test.HITS.pool.root_Atlas2012GeomSim.HITS.pool.root.diffPool</keepFilePattern>
-              </test>
-            </jobTransform>
-          </chainElement>
-
-          <chainElement>
-            <jobTransform userJobId="Atlas2012GeomSim_Reg">
-              <doc>Regression test between releases</doc>
-              <jobTransformJobName>Atlas2012GeomSim_Reg</jobTransformJobName>
-              <jobTransformCmd>sim_reg_test.py Atlas2012GeomSim</jobTransformCmd>
-              <group>SimCoreTests:SimCoreRegressionTests</group>
-              <queue>short</queue>
-            </jobTransform>
-          </chainElement>
-
-        </sequential>
-      </chain>
-
-      <chain>
-        <chainName>RegressionTest_TTbarSim</chainName>
-        <abortOnError />
-        <sequential>
-
-          <chainElement>
-            <jobTransform userJobId="TTbarSim">
-              <doc>Reading gen events, full physics</doc>
-              <jobTransformJobName>T1_McAtNlo_Jimmy</jobTransformJobName>
-              <jobTransformCmd>AtlasG4_tf.py --inputEVNTFile '/afs/cern.ch/atlas/offline/ProdData/16.6.X/16.6.7.Y/ttbar_muplusjets-pythia6-7000.evgen.pool.root' --outputHITSFile 'test.HITS.pool.root' --maxEvents '4' --skipEvents '0' --randomSeed '10' --geometryVersion 'ATLAS-R2-2015-03-01-00_VALIDATION' --conditionsTag 'OFLCOND-RUN12-SDR-19' --DataRunNumber '222525' --physicsList 'FTFP_BERT' --postInclude 'PyJobTransforms/UseFrontier.py' 'AtlasG4Tf:G4AtlasTests/postInclude.DCubeTest.py' --preExec 'AtlasG4Tf:simFlags.ReleaseGeoModel=False;'
-              </jobTransformCmd>
-              <group>SimCoreJobTransformTests</group>
-              <queue>short</queue>
-              <test position="1">
-                <modulename>RttLibraryTools</modulename>
-                <testname>DiffPoolFilesRunner</testname>
-                <testidentifier>TTbarSimHITSFileDiff</testidentifier>
-                <arg>
-                  <argname>fileName</argname>
-                  <argvalue>test.HITS.pool.root</argvalue>
-                </arg>
-                <arg>
-                  <argname>refFileName</argname>
-                  <argvalue>root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/proj-sit/simulation/validation/RTT/referenceFiles/21.0.X/TTbarSim.HITS.pool.root</argvalue>
-                </arg>
-                <keepFilePattern>test.HITS.pool.root_TTbarSim.HITS.pool.root.diffPool</keepFilePattern>
-              </test>
-            </jobTransform>
-          </chainElement>
-
-          <chainElement>
-            <jobTransform userJobId="TTbarSim_Reg">
-              <doc>Regression test between releases</doc>
-              <jobTransformJobName>TTbarSim_Reg</jobTransformJobName>
-              <jobTransformCmd>sim_reg_test.py TTbarSim</jobTransformCmd>
-              <group>SimCoreTests:SimCoreRegressionTests</group>
-              <queue>short</queue>
-            </jobTransform>
-          </chainElement>
-
-        </sequential>
-      </chain>
-
-      <chain>
-        <chainName>TimingTest_TTbarSim</chainName>
-        <abortOnError />
-        <sequential>
-
-          <chainElement>
-            <jobTransform userJobId="TTbarSimTiming">
-              <doc>Reading gen events, full physics, with timing information in output</doc>
-              <jobTransformJobName>T1_McAtNlo_Jimmy</jobTransformJobName>
-              <jobTransformCmd>AtlasG4_tf.py --inputEVNTFile '/afs/cern.ch/atlas/offline/ProdData/16.6.X/16.6.7.Y/ttbar_muplusjets-pythia6-7000.evgen.pool.root' --outputHITSFile 'test.HITS.pool.root' --maxEvents '10' --skipEvents '0' --randomSeed '10' --geometryVersion 'ATLAS-R2-2015-03-01-00_VALIDATION' --conditionsTag 'OFLCOND-RUN12-SDR-19' --DataRunNumber '222525' --physicsList 'FTFP_BERT' --postInclude 'PyJobTransforms/UseFrontier.py' --preInclude 'AtlasG4Tf:LArG4FastSimulation/LArG4FastSimulation_setupTimer_jobOptions.py'
-              </jobTransformCmd>
-              <group>SimCoreJobTransformTests</group>
-              <queue>medium</queue>
-
-              <test>
-                <modulename>RttLibraryTools</modulename>
-                <testname>DCubeRunner</testname>
-                <testidentifier>TTbarSimTiming_DCubeTest</testidentifier>
-                <arg>
-                  <argname>DCubeCfg</argname>
-                  <argvalue>21.0.X/dcube_TTbarSimTiming.xml</argvalue>
-                </arg>
-                <arg>
-                  <argname>DCubeRef</argname>
-                  <argvalue>21.0.X/TTbarSimTiming.timing_histos.root</argvalue>
-                </arg>
-                <arg>
-                  <argname>DCubeMon</argname>
-                  <argvalue>timing_histos.root</argvalue>
-                </arg>
-                <keepFilePattern>DCube-21.0.X/TTbarSimTiming.timing_histos.root/timing_histos.root.dcube.xml.php</keepFilePattern>
-                <noalarm />
-              </test>
-
-            </jobTransform>
-          </chainElement>
-
-        </sequential>
-      </chain>
-
-      <chain>
-        <chainName>RegressionTest_FtfpBertAtlTest</chainName>
-        <abortOnError />
-        <sequential>
-
-          <chainElement>
-            <jobTransform userJobId="FtfpBertAtlTest">
-              <doc>Reading gen events, full physics</doc>
-              <jobTransformJobName>J2_jetjet-pythia6</jobTransformJobName>
-              <jobTransformCmd>AtlasG4_tf.py --inputEVNTFile '/afs/cern.ch/atlas/offline/ProdData/16.6.X/16.6.7.Y/J2_jetjet-pythia6-7000.evgen.pool.root' --outputHITSFile 'test.HITS.pool.root' --maxEvents '5' --skipEvents '0' --randomSeed '10' --geometryVersion 'ATLAS-R2-2015-03-01-00_VALIDATION' --conditionsTag 'OFLCOND-RUN12-SDR-19' --DataRunNumber '222525' --physicsList 'FTFP_BERT_ATL' --postInclude 'PyJobTransforms/UseFrontier.py'
-              </jobTransformCmd>
-              <group>SimCoreJobTransformTests</group>
-              <queue>medium</queue>
-              <test position="1">
-                <modulename>RttLibraryTools</modulename>
-                <testname>DiffPoolFilesRunner</testname>
-                <testidentifier>FtfpBertAtlTestHITSFileDiff</testidentifier>
-                <arg>
-                  <argname>fileName</argname>
-                  <argvalue>test.HITS.pool.root</argvalue>
-                </arg>
-                <arg>
-                  <argname>refFileName</argname>
-                  <argvalue>root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/proj-sit/simulation/validation/RTT/referenceFiles/21.0.X/FtfpBertAtlTest.HITS.pool.root</argvalue>
-                </arg>
-                <keepFilePattern>test.HITS.pool.root_FtfpBertAtlTest.HITS.pool.root.diffPool</keepFilePattern>
-              </test>
-            </jobTransform>
-          </chainElement>
-
-          <chainElement>
-            <jobTransform userJobId="FtfpBertAtlTest_Reg">
-              <doc>Regression test between releases</doc>
-              <jobTransformJobName>FtfpBertAtlTest_Reg</jobTransformJobName>
-              <jobTransformCmd>sim_reg_test.py FtfpBertAtlTest</jobTransformCmd>
-              <group>SimCoreTests:SimCoreRegressionTests</group>
-              <queue>short</queue>
-            </jobTransform>
-
-          </chainElement>
-        </sequential>
-      </chain>
-
-
-
-      <chain>
-        <chainName>RegressionTest_NeutronCutTest</chainName>
-        <abortOnError />
-        <sequential>
-          <chainElement>
-
-            <jobTransform userJobId="NeutronCutTest">
-              <doc>Reading gen events, full physics</doc>
-              <jobTransformJobName>A3_Ztautau-NeutronCut</jobTransformJobName>
-              <jobTransformCmd>AtlasG4_tf.py --inputEVNTFile '/afs/cern.ch/atlas/offline/ProdData/16.6.X/16.6.7.Y/A3_Ztautau_filter-pythia6-7000.evgen.pool.root' --outputHITSFile 'test.HITS.pool.root' --maxEvents '5' --skipEvents '0' --randomSeed '10' --geometryVersion 'ATLAS-R2-2015-03-01-00_VALIDATION' --conditionsTag 'OFLCOND-RUN12-SDR-19' --DataRunNumber '222525' --physicsList 'FTFP_BERT' --preInclude 'SimulationJobOptions/preInclude.G4SignalCavern.py' --postInclude 'PyJobTransforms/UseFrontier.py'
-              </jobTransformCmd>
-              <group>SimCoreJobTransformTests</group>
-              <queue>medium</queue>
-              <test position="1">
-                <modulename>RttLibraryTools</modulename>
-                <testname>DiffPoolFilesRunner</testname>
-                <testidentifier>NeutronCutTestHITSFileDiff</testidentifier>
-                <arg>
-                  <argname>fileName</argname>
-                  <argvalue>test.HITS.pool.root</argvalue>
-                </arg>
-                <arg>
-                  <argname>refFileName</argname>
-                  <argvalue>root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/proj-sit/simulation/validation/RTT/referenceFiles/21.0.X/NeutronCutTest.HITS.pool.root</argvalue>
-                </arg>
-                <keepFilePattern>test.HITS.pool.root_NeutronCutTest.HITS.pool.root.diffPool</keepFilePattern>
-              </test>
-            </jobTransform>
-
-          </chainElement>
-
-          <chainElement>
-            <jobTransform userJobId="NeutronCutTest_Reg">
-              <doc>Regression test between releases</doc>
-              <jobTransformJobName>NeutronCutTest_Reg</jobTransformJobName>
-              <jobTransformCmd>sim_reg_test.py NeutronCutTest</jobTransformCmd>
-              <group>SimCoreTests:SimCoreRegressionTests</group>
-              <queue>short</queue>
-            </jobTransform>
-          </chainElement>
-        </sequential>
-      </chain>
-
-
-      <chain>
-        <chainName>RegressionTest_QgsBicTest</chainName>
-        <abortOnError />
-        <sequential>
-          <chainElement>
-            <jobTransform userJobId="QgsBicTest">
-              <doc>Reading gen events, full physics</doc>
-              <jobTransformJobName>SusyQgsBic</jobTransformJobName>
-              <jobTransformCmd>AtlasG4_tf.py --inputEVNTFile '/afs/cern.ch/atlas/offline/ProdData/16.6.X/16.6.7.Y/susy_SU3-herwigpp-7000.evgen.pool.root' --outputHITSFile 'test.HITS.pool.root' --maxEvents '5' --skipEvents '0' --randomSeed '42' --geometryVersion 'ATLAS-R2-2015-03-01-00_VALIDATION' --conditionsTag 'OFLCOND-RUN12-SDR-19' --DataRunNumber '222525' --physicsList 'QGSP_BIC' --postInclude 'PyJobTransforms/UseFrontier.py'
-              </jobTransformCmd>
-              <group>SimCoreJobTransformTests</group>
-              <queue>medium</queue>
-              <test position="1">
-                <modulename>RttLibraryTools</modulename>
-                <testname>DiffPoolFilesRunner</testname>
-                <testidentifier>QgsBicTestHITSFileDiff</testidentifier>
-                <arg>
-                  <argname>fileName</argname>
-                  <argvalue>test.HITS.pool.root</argvalue>
-                </arg>
-                <arg>
-                  <argname>refFileName</argname>
-                  <argvalue>root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/proj-sit/simulation/validation/RTT/referenceFiles/21.0.X/QgsBicTest.HITS.pool.root</argvalue>
-                </arg>
-                <keepFilePattern>test.HITS.pool.root_QgsBicTest.HITS.pool.root.diffPool</keepFilePattern>
-              </test>
-            </jobTransform>
-          </chainElement>
-
-          <chainElement>
-            <jobTransform userJobId="QgsBicTest_Reg">
-              <doc>Regression test between releases</doc>
-              <jobTransformJobName>QgsBicTest_Reg</jobTransformJobName>
-              <jobTransformCmd>sim_reg_test.py QgsBicTest</jobTransformCmd>
-              <group>SimCoreTests:SimCoreRegressionTests</group>
-              <queue>short</queue>
-            </jobTransform>
-
-          </chainElement>
-        </sequential>
-      </chain>
-
-
-      <chain>
-        <chainName>RegressionTest_HeavyIonSim</chainName>
-        <abortOnError />
-        <sequential>
-          <chainElement>
-            <jobTransform userJobId="HeavyIonSim">
-              <doc>Reading gen events, lead ions peripheral simulation (low multiplicity)</doc>
-              <jobTransformJobName>HeavyIons_Simulation</jobTransformJobName>
-              <jobTransformCmd>AtlasG4_tf.py --inputEVNTFile '/afs/cern.ch/atlas/offline/ProdData/16.6.X/16.6.7.Y/pbpb_Peripheral-hijing-5500.evgen.pool.root' --outputHITSFile 'test.HITS.pool.root' --maxEvents '1' --skipEvents '4' --randomSeed '10' --geometryVersion 'ATLAS-R1-2012-03-00-00_VALIDATION' --conditionsTag 'OFLCOND-RUN12-SDR-19' --DataRunNumber '210184' --physicsList 'FTFP_BERT' --postInclude 'PyJobTransforms/UseFrontier.py' 'AtlasG4Tf:SimulationJobOptions/postInclude.HijingPars.py'
-              </jobTransformCmd>
-              <group>SimCoreJobTransformTests</group>
-              <queue>short</queue>
-              <test position="1">
-                <modulename>RttLibraryTools</modulename>
-                <testname>DiffPoolFilesRunner</testname>
-                <testidentifier>HeavyIonSimHITSFileDiff</testidentifier>
-                <arg>
-                  <argname>fileName</argname>
-                  <argvalue>test.HITS.pool.root</argvalue>
-                </arg>
-                <arg>
-                  <argname>refFileName</argname>
-                  <argvalue>root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/proj-sit/simulation/validation/RTT/referenceFiles/21.0.X/HeavyIonSim.HITS.pool.root</argvalue>
-                </arg>
-                <keepFilePattern>test.HITS.pool.root_HeavyIonSim.HITS.pool.root.diffPool</keepFilePattern>
-              </test>
-            </jobTransform>
-          </chainElement>
-
-          <chainElement>
-            <jobTransform userJobId="HeavyIonSim_Reg">
-              <doc>Regression test between releases</doc>
-              <jobTransformJobName>HeavyIonSim_Reg</jobTransformJobName>
-              <jobTransformCmd>sim_reg_test.py HeavyIonSim</jobTransformCmd>
-              <group>SimCoreTests:SimCoreRegressionTests</group>
-              <queue>short</queue>
-            </jobTransform>
-          </chainElement>
-        </sequential>
-      </chain>
-
-
-      <chain>
-        <chainName>RegressionTest_CavernBg_EVNT2TR</chainName>
-        <abortOnError />
-        <sequential>
-
-          <chainElement>
-            <jobTransform userJobId="CavernBg_EVNT2TR">
-              <doc>Reading min bias events, write cavern background track records</doc>
-              <jobTransformJobName>CavernBg_EVNT2TR</jobTransformJobName>
-              <jobTransformCmd>AtlasG4_tf.py --inputEVNTFile '/afs/cern.ch/atlas/offline/ProdData/16.6.X/16.6.7.Y/minbias_Inelastic_low-pythia8-7000.evgen.pool.root' --outputHITSFile 'discard.HITS.pool.root' --outputEVNT_TRFile 'test.EVNT.pool.root' --maxEvents '2' --skipEvents '0' --randomSeed '5678' --geometryVersion 'ATLAS-R2-2015-03-01-00_VALIDATION' --conditionsTag 'OFLCOND-RUN12-SDR-19' --DataRunNumber '222525' --physicsList 'QGSP_BERT_HP' --postInclude 'PyJobTransforms/UseFrontier.py'
-              </jobTransformCmd>
-              <group>SimCoreJobTransformTests</group>
-              <queue>medium</queue>
-              <test position="1">
-                <modulename>RttLibraryTools</modulename>
-                <testname>DiffPoolFilesRunner</testname>
-                <testidentifier>CavernBg_EVNT2TR_EVNTFileDiff</testidentifier>
-                <arg>
-                  <argname>fileName</argname>
-                  <argvalue>test.EVNT.pool.root</argvalue>
-                </arg>
-                <arg>
-                  <argname>refFileName</argname>
-                  <argvalue>root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/proj-sit/simulation/validation/RTT/referenceFiles/21.0.X/CavernBg_EVNT2TR.EVNT.pool.root</argvalue>
-                </arg>
-                <keepFilePattern>test.EVNT.pool.root_CavernBg_EVNT2TR.EVNT.pool.root.diffPool</keepFilePattern>
-              </test>
-            </jobTransform>
-          </chainElement>
-
-          <chainElement>
-            <jobTransform userJobId="CavernBg_EVNT2TR_Reg">
-              <doc>Regression test between releases</doc>
-              <jobTransformJobName>CavernBg_EVNT2TR_Reg</jobTransformJobName>
-              <jobTransformCmd>sim_reg_test.py CavernBg_EVNT2TR</jobTransformCmd>
-              <group>SimCoreTests:SimCoreRegressionTests</group>
-              <queue>short</queue>
-              <test position="1">
-                <modulename>RttLibraryTools</modulename>
-                <testname>DiffPoolFilesRunner</testname>
-                <testidentifier>CavernBg_EVNT_RegressionTestRunner</testidentifier>
-                <arg>
-                  <argname>fileName</argname>
-                  <argvalue>today.EVNT.pool.root</argvalue>
-                </arg>
-                <arg>
-                  <argname>refFileName</argname>
-                  <argvalue>yesterday.EVNT.pool.root</argvalue>
-                </arg>
-                <keepFilePattern>today.EVNT.pool.root_yesterday.EVNT.pool.root.diffPool</keepFilePattern>
-              </test>
-              <testToRemove>
-                <jobGroupName>SimCoreTests:SimCoreRegressionTests</jobGroupName>
-                <testidentifier>HITS_RegressionTestRunner</testidentifier>
-              </testToRemove>
-            </jobTransform>
-          </chainElement>
-
-        </sequential>
-      </chain>
-
-
-      <chain>
-        <chainName>RegressionTest_CavernBg_TR2HITS</chainName>
-        <abortOnError />
-        <sequential>
-
-          <chainElement>
-            <jobTransform userJobId="CavernBg_TR2HITS">
-              <doc>Reading cavern background track record, creating cav bg hits.</doc>
-              <jobTransformJobName>CavernBg_TR2HITS</jobTransformJobName>
-              <jobTransformCmd>AtlasG4_tf.py --inputEVNT_TRFile '/afs/cern.ch/atlas/offline/ProdData/16.6.X/16.6.7.Y/cavernbg-pythia8-7000.evgen.pool.root' --outputHITSFile 'test.HITS.pool.root' --maxEvents '5' --skipEvents '0' --randomSeed '8765' --geometryVersion 'ATLAS-R2-2015-03-01-00_VALIDATION' --conditionsTag 'OFLCOND-RUN12-SDR-19' --DataRunNumber '222525' --physicsList 'QGSP_BERT_HP' --postInclude 'PyJobTransforms/UseFrontier.py'
-              </jobTransformCmd>
-              <group>SimCoreJobTransformTests</group>
-              <queue>medium</queue>
-              <test position="1">
-                <modulename>RttLibraryTools</modulename>
-                <testname>DiffPoolFilesRunner</testname>
-                <testidentifier>CavernBg_HITSFileDiff</testidentifier>
-                <arg>
-                  <argname>fileName</argname>
-                  <argvalue>test.HITS.pool.root</argvalue>
-                </arg>
-                <arg>
-                  <argname>refFileName</argname>
-                  <argvalue>root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/proj-sit/simulation/validation/RTT/referenceFiles/21.0.X/CavernBg_TR2HITS.HITS.pool.root</argvalue>
-                </arg>
-                <keepFilePattern>test.HITS.pool.root_CavernBg_TR2HITS.HITS.pool.root.diffPool</keepFilePattern>
-              </test>
-            </jobTransform>
-          </chainElement>
-
-          <chainElement>
-            <jobTransform userJobId="CavernBg_TR2HITS_Reg">
-              <doc>Regression test between releases</doc>
-              <jobTransformJobName>CavernBg_TR2HITS_Reg</jobTransformJobName>
-              <jobTransformCmd>sim_reg_test.py CavernBg_TR2HITS</jobTransformCmd>
-              <group>SimCoreTests:SimCoreRegressionTests</group>
-              <queue>short</queue>
-            </jobTransform>
-          </chainElement>
-
-        </sequential>
-      </chain>
-
-      <chain>
-        <chainName>RegressionTest_FrozenShowerFCalOnly</chainName>
-        <abortOnError />
-        <sequential>
-
-          <chainElement>
-            <jobTransform userJobId="FrozenShowerFCalOnly">
-              <doc>Testing basic frozen showers (FCal only)</doc>
-              <jobTransformJobName>FrozenShowerFCalOnly</jobTransformJobName>
-              <!-- setting environment variables needs syntax update -->
-              <jobTransformCmd>FSRELEASE=1.0.0 DATAPATH=$DATAPATH:/afs/cern.ch/atlas/software/FSreleases/DD0/FSRelease/1.0.0 AtlasG4_tf.py --inputEVNTFile '/afs/cern.ch/atlas/offline/ProdData/17.2.X/17.2.6.2/e_E50_eta34_49.EVNT.pool.root' --outputHITSFile 'test.HITS.pool.root' --maxEvents 10 --skipEvents 0 --randomSeed 10 --geometryVersion 'ATLAS-R2-2015-03-01-00_VALIDATION' --conditionsTag 'OFLCOND-RUN12-SDR-19' --DataRunNumber '222525' --physicsList 'FTFP_BERT' --preInclude 'SimulationJobOptions/preInclude.FrozenShowersFCalOnly.py' --postInclude 'PyJobTransforms/UseFrontier.py'
-              </jobTransformCmd>
-              <group>SimCoreJobTransformTests</group>
-              <queue>short</queue>
-              <test position="1">
-                <modulename>RttLibraryTools</modulename>
-                <testname>DiffPoolFilesRunner</testname>
-                <testidentifier>FrozenShowerFCalOnlyHITSFileDiff</testidentifier>
-                <arg>
-                  <argname>fileName</argname>
-                  <argvalue>test.HITS.pool.root</argvalue>
-                </arg>
-                <arg>
-                  <argname>refFileName</argname>
-                  <argvalue>root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/proj-sit/simulation/validation/RTT/referenceFiles/21.0.X/FrozenShowerFCalOnly.HITS.pool.root</argvalue>
-                </arg>
-                <keepFilePattern>test.HITS.pool.root_FrozenShowerFCalOnly.HITS.pool.root.diffPool</keepFilePattern>
-              </test>
-            </jobTransform>
-          </chainElement>
-
-          <chainElement>
-            <jobTransform userJobId="FrozenShowerFCalOnly_Reg">
-              <doc>Regression test between releases</doc>
-              <jobTransformJobName>FrozenShowerFCalOnly_Reg</jobTransformJobName>
-              <jobTransformCmd>sim_reg_test.py FrozenShowerFCalOnly</jobTransformCmd>
-              <group>SimCoreTests:SimCoreRegressionTests</group>
-              <queue>short</queue>
-            </jobTransform>
-          </chainElement>
-
-        </sequential>
-      </chain>
-
-      <chain>
-        <chainName>RegressionTest_CosmicSimTR</chainName>
-        <abortOnError />
-        <sequential>
-
-          <chainElement>
-            <jobTransform userJobId="CosmicSimTR">
-              <doc>Running cosmic simulation transform from track records</doc>
-              <jobTransformJobName>CosmicSimTR</jobTransformJobName>
-              <jobTransformCmd>AtlasG4_tf.py --inputEVNT_TRFile '/afs/cern.ch/atlas/offline/ProdData/16.6.X/16.6.7.Y/Cosmics.TR.pool.root' --outputHITSFile 'test.HITS.pool.root' --maxEvents '-1' --randomSeed '1234' --geometryVersion 'ATLAS-R2-2015-03-01-00_VALIDATION' --conditionsTag 'OFLCOND-RUN12-SDR-19' --physicsList 'FTFP_BERT' --DataRunNumber '222525' --firstEvent '0' --beamType 'cosmics' --postInclude 'PyJobTransforms/UseFrontier.py'
-              </jobTransformCmd>
-              <group>SimCoreJobTransformTests</group>
-              <queue>short</queue>
-              <test position="1">
-                <modulename>RttLibraryTools</modulename>
-                <testname>DiffPoolFilesRunner</testname>
-                <testidentifier>CosmicSimTR_HITSFileDiff</testidentifier>
-                <arg>
-                  <argname>fileName</argname>
-                  <argvalue>test.HITS.pool.root</argvalue>
-                </arg>
-                <arg>
-                  <argname>refFileName</argname>
-                  <argvalue>root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/proj-sit/simulation/validation/RTT/referenceFiles/21.0.X/CosmicSimTR.HITS.pool.root</argvalue>
-                </arg>
-                <keepFilePattern>test.HITS.pool.root_CosmicSimTR.HITS.pool.root.diffPool</keepFilePattern>
-              </test>
-            </jobTransform>
-          </chainElement>
-
-          <chainElement>
-            <jobTransform userJobId="CosmicSimTR_Reg">
-              <doc>Regression test between releases</doc>
-              <jobTransformJobName>CosmicSimTR_Reg</jobTransformJobName>
-              <jobTransformCmd>sim_reg_test.py CosmicSimTR</jobTransformCmd>
-              <group>SimCoreTests:SimCoreRegressionTests</group>
-              <queue>short</queue>
-            </jobTransform>
-          </chainElement>
-
-        </sequential>
-      </chain>
-
-      <chain>
-        <chainName>RegressionTest_LucidSimTest</chainName>
-        <abortOnError />
-        <sequential>
-
-          <chainElement>
-            <jobTransform userJobId="LucidSimTest">
-              <doc>Test Main ATLAS+Lucid simulation job transform</doc>
-              <jobTransformJobName>LucidSimTest</jobTransformJobName>
-              <jobTransformCmd>AtlasG4_tf.py --inputEVNTFile '/afs/cern.ch/atlas/offline/ProdData/16.6.X/16.6.7.Y/minbias_Inelastic-pythia8-7000.evgen.pool.root' --outputHITSFile 'test.HITS.pool.root' --maxEvents '3' --skipEvents '0' --randomSeed '10' --geometryVersion 'ATLAS-R2-2015-03-01-00_VALIDATION' --conditionsTag 'OFLCOND-RUN12-SDR-19' --DataRunNumber '222525' --physicsList 'FTFP_BERT' --LucidOn 'True' --postInclude 'PyJobTransforms/UseFrontier.py'
-              </jobTransformCmd>
-              <group>SimCoreJobTransformTests</group>
-              <queue>short</queue>
-              <test position="1">
-                <modulename>RttLibraryTools</modulename>
-                <testname>DiffPoolFilesRunner</testname>
-                <testidentifier>LucidSimTestHITSFileDiff</testidentifier>
-                <arg>
-                  <argname>fileName</argname>
-                  <argvalue>test.HITS.pool.root</argvalue>
-                </arg>
-                <arg>
-                  <argname>refFileName</argname>
-                  <argvalue>root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/proj-sit/simulation/validation/RTT/referenceFiles/21.0.X/LucidSimTest.HITS.pool.root</argvalue>
-                </arg>
-                <keepFilePattern>test.HITS.pool.root_LucidSimTest.HITS.pool.root.diffPool</keepFilePattern>
-              </test>
-            </jobTransform>
-          </chainElement>
-
-          <chainElement>
-            <jobTransform userJobId="LucidSimTest_Reg">
-              <doc>Regression test between releases</doc>
-              <jobTransformJobName>LucidSimTest_Reg</jobTransformJobName>
-              <jobTransformCmd>sim_reg_test.py LucidSimTest</jobTransformCmd>
-              <group>SimCoreTests:SimCoreRegressionTests</group>
-              <queue>short</queue>
-            </jobTransform>
-          </chainElement>
-
-        </sequential>
-      </chain>
-
-      <chain>
-        <chainName>RegressionTest_AFPSimTest</chainName>
-        <abortOnError />
-        <sequential>
-
-          <chainElement>
-            <jobTransform userJobId="AFPSimTest">
-              <doc>Test Main ATLAS+AFP simulation job transform</doc>
-              <jobTransformJobName>AFPSimTest</jobTransformJobName>
-              <!-- FIXME need an AFP-specific single particle generator configuration -->
-              <jobTransformCmd>AtlasG4_tf.py --preInclude 'G4AtlasTests/preInclude.ALFA_SingleParticle.py' --outputHITSFile 'test.HITS.pool.root' --maxEvents '3' --randomSeed '10' --geometryVersion 'ATLAS-R2-2015-03-01-00_VALIDATION' --conditionsTag 'OFLCOND-RUN12-SDR-19' --DataRunNumber '222525' --physicsList 'FTFP_BERT' --AFPOn 'True' --postInclude 'PyJobTransforms/UseFrontier.py'
-              </jobTransformCmd>
-              <group>SimCoreJobTransformTests</group>
-              <queue>short</queue>
-              <test position="1">
-                <modulename>RttLibraryTools</modulename>
-                <testname>DiffPoolFilesRunner</testname>
-                <testidentifier>AFPSimTestHITSFileDiff</testidentifier>
-                <arg>
-                  <argname>fileName</argname>
-                  <argvalue>test.HITS.pool.root</argvalue>
-                </arg>
-                <arg>
-                  <argname>refFileName</argname>
-                  <argvalue>root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/proj-sit/simulation/validation/RTT/referenceFiles/21.0.X/AFPSimTest.HITS.pool.root</argvalue>
-                </arg>
-                <keepFilePattern>test.HITS.pool.root_AFPSimTest.HITS.pool.root.diffPool</keepFilePattern>
-              </test>
-            </jobTransform>
-          </chainElement>
-
-          <chainElement>
-            <jobTransform userJobId="AFPSimTest_Reg">
-              <doc>Regression test between releases</doc>
-              <jobTransformJobName>AFPSimTest_Reg</jobTransformJobName>
-              <jobTransformCmd>sim_reg_test.py AFPSimTest</jobTransformCmd>
-              <group>SimCoreTests:SimCoreRegressionTests</group>
-              <queue>short</queue>
-            </jobTransform>
-          </chainElement>
-
-        </sequential>
-      </chain>
-
-      <chain>
-        <chainName>RegressionTest_ALFASimTest</chainName>
-        <abortOnError />
-        <sequential>
-
-          <chainElement>
-            <jobTransform userJobId="ALFASimTest">
-              <doc>Test Main ATLAS+ALFA simulation job transform</doc>
-              <jobTransformJobName>ALFASimTest</jobTransformJobName>
-              <jobTransformCmd>AtlasG4_tf.py --preInclude 'G4AtlasTests/preInclude.ALFA_SingleParticle.py' --outputHITSFile 'test.HITS.pool.root' --maxEvents '3' --randomSeed '10' --geometryVersion 'ATLAS-R2-2015-03-01-00_VALIDATION' --conditionsTag 'OFLCOND-RUN12-SDR-19' --DataRunNumber '222525' --physicsList 'FTFP_BERT' --ALFAOn 'True' --postInclude 'PyJobTransforms/UseFrontier.py' 'AtlasG4Tf:G4AtlasTests/postInclude.ALFA_dcube.py'
-              </jobTransformCmd>
-              <group>SimCoreJobTransformTests</group>
-              <queue>short</queue>
-              <test position="1">
-                <modulename>RttLibraryTools</modulename>
-                <testname>DiffPoolFilesRunner</testname>
-                <testidentifier>ALFASimTestHITSFileDiff</testidentifier>
-                <arg>
-                  <argname>fileName</argname>
-                  <argvalue>test.HITS.pool.root</argvalue>
-                </arg>
-                <arg>
-                  <argname>refFileName</argname>
-                  <argvalue>root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/proj-sit/simulation/validation/RTT/referenceFiles/21.0.X/ALFASimTest.HITS.pool.root</argvalue>
-                </arg>
-                <keepFilePattern>test.HITS.pool.root_ALFASimTest.HITS.pool.root.diffPool</keepFilePattern>
-              </test>
-              <test position="2">
-                <modulename>RttLibraryTools</modulename>
-                <testname>DCubeRunner</testname>
-                <testidentifier>ALFASimTestDCubeTest</testidentifier>
-                <arg>
-                  <argname>DCubeCfg</argname>
-                  <argvalue>21.0.X/dcube-ALFASimTest.xml</argvalue>
-                </arg>
-                <arg>
-                  <argname>DCubeRef</argname>
-                  <argvalue>21.0.X/ALFASimTest.truth.root</argvalue>
-                </arg>
-                <arg>
-                  <argname>DCubeMon</argname>
-                  <argvalue>truth.root</argvalue>
-                </arg>
-                <keepFilePattern>DCube-21.0.X/ALFASimTest.truth.root/truth.root.dcube.xml.php</keepFilePattern>
-                <noalarm />
-              </test>
-            </jobTransform>
-          </chainElement>
-
-          <chainElement>
-            <jobTransform userJobId="ALFASimTest_Reg">
-              <doc>Regression test between releases</doc>
-              <jobTransformJobName>ALFASimTest_Reg</jobTransformJobName>
-              <jobTransformCmd>sim_reg_test.py ALFASimTest</jobTransformCmd>
-              <group>SimCoreTests:SimCoreRegressionTests</group>
-              <queue>short</queue>
-            </jobTransform>
-          </chainElement>
-
-        </sequential>
-      </chain>
-
-      <chain>
-        <chainName>RegressionTest_ZDCSimTest</chainName>
-        <abortOnError />
-        <sequential>
-
-          <chainElement>
-            <jobTransform userJobId="ZDCSimTest">
-              <doc>Test Main ATLAS+ZDC simulation job transform</doc>
-              <jobTransformJobName>ZDCSimTest</jobTransformJobName>
-              <jobTransformCmd>AtlasG4_tf.py --preInclude 'G4AtlasTests/preInclude.ZDC_SingleParticle.py' --outputHITSFile 'test.HITS.pool.root' --maxEvents 3 --randomSeed 10 --geometryVersion 'ATLAS-R2-2015-03-01-00_VALIDATION' --conditionsTag 'OFLCOND-RUN12-SDR-19' --DataRunNumber '222525' --physicsList 'FTFP_BERT' --ZDCOn 'True' --postInclude 'PyJobTransforms/UseFrontier.py' 'AtlasG4Tf:G4AtlasTests/postInclude.ZDC_dcube.py'
-              </jobTransformCmd>
-              <group>SimCoreJobTransformTests</group>
-              <queue>medium</queue>
-              <test position="1">
-                <modulename>RttLibraryTools</modulename>
-                <testname>DiffPoolFilesRunner</testname>
-                <testidentifier>ZDCSimTestHITSFileDiff</testidentifier>
-                <arg>
-                  <argname>fileName</argname>
-                  <argvalue>test.HITS.pool.root</argvalue>
-                </arg>
-                <arg>
-                  <argname>refFileName</argname>
-                  <argvalue>root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/proj-sit/simulation/validation/RTT/referenceFiles/21.0.X/ZDCSimTest.HITS.pool.root</argvalue>
-                </arg>
-                <keepFilePattern>test.HITS.pool.root_ZDCSimTest.HITS.pool.root.diffPool</keepFilePattern>
-              </test>
-              <test position="2">
-                <modulename>RttLibraryTools</modulename>
-                <testname>DCubeRunner</testname>
-                <testidentifier>ZDCSimTestDCubeTest</testidentifier>
-                <arg>
-                  <argname>DCubeCfg</argname>
-                  <argvalue>21.0.X/dcube-ZDCSimTest.xml</argvalue>
-                </arg>
-                <arg>
-                  <argname>DCubeRef</argname>
-                  <argvalue>21.0.X/ZDCSimTest.truth.root</argvalue>
-                </arg>
-                <arg>
-                  <argname>DCubeMon</argname>
-                  <argvalue>truth.root</argvalue>
-                </arg>
-                <keepFilePattern>DCube-21.0.X/ZDCSimTest.truth.root/truth.root.dcube.xml.php</keepFilePattern>
-                <noalarm />
-              </test>
-            </jobTransform>
-          </chainElement>
-
-          <chainElement>
-            <jobTransform userJobId="ZDCSimTest_Reg">
-              <doc>Regression test between releases</doc>
-              <jobTransformJobName>ZDCSimTest_Reg</jobTransformJobName>
-              <jobTransformCmd>sim_reg_test.py ZDCSimTest</jobTransformCmd>
-              <group>SimCoreTests:SimCoreRegressionTests</group>
-              <queue>short</queue>
-              <test position="2">
-                <modulename>RttLibraryTools</modulename>
-                <testname>DCubeRunner</testname>
-                <testidentifier>ZDCSimTest_RegDCubeTest</testidentifier>
-                <arg>
-                  <argname>DCubeCfg</argname>
-                  <argvalue>21.0.X/dcube-ZDCSimTest.xml</argvalue>
-                </arg>
-                <arg>
-                  <argname>DCubeRef</argname>
-                  <argvalue>yesterday.root</argvalue>
-                </arg>
-                <arg>
-                  <argname>localRefFile</argname>
-                  <argvalue>True</argvalue>
-                </arg>
-                <arg>
-                  <argname>DCubeMon</argname>
-                  <argvalue>today.root</argvalue>
-                </arg>
-                <keepFilePattern>DCube-yesterday.root/today.root.dcube.xml.php</keepFilePattern>
-                <noalarm />
-              </test>
-            </jobTransform>
-          </chainElement>
-
-        </sequential>
-      </chain>
-
-      <chain>
-        <chainName>RegressionTest_NSWSimTest</chainName>
-        <abortOnError />
-        <sequential>
-
-          <chainElement>
-            <jobTransform userJobId="NSWSimTest">
-              <doc>Test Main ATLAS+NSW simulation job transform</doc>
-              <jobTransformJobName>NSWSimTest</jobTransformJobName>
-              <jobTransformCmd>AtlasG4_tf.py --preInclude 'G4AtlasTests/ParticleGun_flatpt_2particle.py' --outputHITSFile 'test.HITS.pool.root' --maxEvents '200' --randomSeed '10' --geometryVersion 'ATLAS-R2-2015-03-01-00' --conditionsTag 'OFLCOND-RUN12-SDR-25' --physicsList 'FTFP_BERT' --DBRelease 'current' --postInclude 'G4AtlasTests/postInclude.DCubeTest.py,G4AtlasTests/postInclude.NSW.config.simu.py' --preExec 'simFlags.ReleaseGeoModel=False;simFlags.SimulateNewSmallWheel=True;'
-              </jobTransformCmd>
-              <group>SimCoreJobTransformTests</group>
-              <queue>medium</queue>
-              <test position="1">
-                <modulename>RttLibraryTools</modulename>
-                <testname>DiffPoolFilesRunner</testname>
-                <testidentifier>NSWSimTestHITSFileDiff</testidentifier>
-                <arg>
-                  <argname>fileName</argname>
-                  <argvalue>test.HITS.pool.root</argvalue>
-                </arg>
-                <arg>
-                  <argname>refFileName</argname>
-                  <argvalue>root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/proj-sit/simulation/validation/RTT/referenceFiles/21.0.X/NSWSimTest.HITS.pool.root</argvalue>
-                </arg>
-                <keepFilePattern>test.HITS.pool.root_NSWSimTest.HITS.pool.root.diffPool</keepFilePattern>
-              </test>
-              <test position="2">
-                <modulename>RttLibraryTools</modulename>
-                <testname>DCubeRunner</testname>
-                <testidentifier>NSWSimTestDCubeTest</testidentifier>
-                <arg>
-                  <argname>DCubeCfg</argname>
-                  <argvalue>21.0.X/dcube-NSWSimTest.xml</argvalue>
-                </arg>
-                <arg>
-                  <argname>DCubeRef</argname>
-                  <argvalue>21.0.X/NSWSimTest.truth.root</argvalue>
-                </arg>
-                <arg>
-                  <argname>DCubeMon</argname>
-                  <argvalue>truth.root</argvalue>
-                </arg>
-                <keepFilePattern>DCube-21.0.X/NSWSimTest.truth.root/truth.root.dcube.xml.php</keepFilePattern>
-                <noalarm />
-              </test>
-            </jobTransform>
-          </chainElement>
-
-          <chainElement>
-            <jobTransform userJobId="NSWSimTest_Reg">
-              <doc>Regression test between releases</doc>
-              <jobTransformJobName>NSWSimTest_Reg</jobTransformJobName>
-              <jobTransformCmd>sim_reg_test.py NSWSimTest</jobTransformCmd>
-              <group>SimCoreTests:SimCoreRegressionTests</group>
-              <queue>short</queue>
-              <test position="2">
-                <modulename>RttLibraryTools</modulename>
-                <testname>DCubeRunner</testname>
-                <testidentifier>NSWSimTest_RegDCubeTest</testidentifier>
-                <arg>
-                  <argname>DCubeCfg</argname>
-                  <argvalue>21.0.X/dcube-NSWSimTest.xml</argvalue>
-                </arg>
-                <arg>
-                  <argname>DCubeRef</argname>
-                  <argvalue>yesterday.root</argvalue>
-                </arg>
-                <arg>
-                  <argname>localRefFile</argname>
-                  <argvalue>True</argvalue>
-                </arg>
-                <arg>
-                  <argname>DCubeMon</argname>
-                  <argvalue>today.root</argvalue>
-                </arg>
-                <keepFilePattern>DCube-yesterday.root/today.root.dcube.xml.php</keepFilePattern>
-                <noalarm />
-              </test>
-            </jobTransform>
-          </chainElement>
-
-        </sequential>
-      </chain>
-
-      <chain>
-        <chainName>RegressionTest_AtlasG4_muons</chainName>
-        <abortOnError />
-        <sequential>
-
-          <chainElement>
-            <jobTransform userJobId="AtlasG4_muons">
-              <doc>Tests detector functionality using single muons</doc>
-              <jobTransformJobName>AtlasG4_muons</jobTransformJobName>
-              <jobTransformCmd>AtlasG4_tf.py --preInclude 'SimulationJobOptions/preInclude.SingleMuonGenerator.py' --outputHITSFile 'test.HITS.pool.root' --maxEvents '2000' --randomSeed '10' --geometryVersion 'ATLAS-R2-2015-03-01-00_VALIDATION' --conditionsTag 'OFLCOND-RUN12-SDR-19' --DataRunNumber '222525' --physicsList 'FTFP_BERT' --postInclude 'PyJobTransforms/UseFrontier.py' 'AtlasG4Tf:G4AtlasTests/postInclude.DCubeTest.py' --preExec 'AtlasG4Tf:simFlags.ReleaseGeoModel=False;'
-              </jobTransformCmd>
-              <group>SimCoreJobTransformTests</group>
-              <queue>medium</queue>
-
-              <test position="1">
-                <modulename>RttLibraryTools</modulename>
-                <testname>DCubeRunner</testname>
-                <testidentifier>AtlasG4_muonsDCubeTest</testidentifier>
-                <arg>
-                  <argname>DCubeCfg</argname>
-                  <argvalue>21.0.X/dcube-AtlasG4_muons.xml</argvalue>
-                </arg>
-                <arg>
-                  <argname>DCubeRef</argname>
-                  <argvalue>21.0.X/AtlasG4_muons.truth.root</argvalue>
-                </arg>
-                <arg>
-                  <argname>DCubeMon</argname>
-                  <argvalue>truth.root</argvalue>
-                </arg>
-                <keepFilePattern>DCube-21.0.X/AtlasG4_muons.truth.root/truth.root.dcube.xml.php</keepFilePattern>
-                <noalarm />
-              </test>
-            </jobTransform>
-            <chainfileout>test.HITS.pool.root</chainfileout>
-          </chainElement>
-
-          <parallel>
-            <chainElement>
-              <athena userJobId="AtlasG4_muons_noevgen">
-                <doc>Tests detector functionality using single muons read from POOL</doc>
-                <options>G4AtlasTests/test_AtlasG4_muons_noevgen</options>
-                <group>AthenaSimCoreTestJobs</group>
-                <queue>short</queue>
-                <chaindataset_info>
-                  <dc2 />
-                  <chaindatasetName>test.HITS.pool.root</chaindatasetName>
-                  <dataset_info>
-                    <dc2 />
-                    <datasetName>/eos/atlas/atlascerngroupdisk/proj-sit/simulation/validation/RTT/referenceFiles/21.0.X/AtlasG4_muons.HITS.pool.root</datasetName>
-                  </dataset_info>
-                </chaindataset_info>
-                <test>
-                  <modulename>RttLibraryTools</modulename>
-                  <testname>DCubeRunner</testname>
-                  <testidentifier>AtlasG4_muons_noevgenDCubeTest</testidentifier>
-                  <arg>
-                    <argname>DCubeCfg</argname>
-                    <argvalue>21.0.X/dcube-AtlasG4_muons_noevgen.xml</argvalue>
-                  </arg>
-                  <arg>
-                    <argname>DCubeRef</argname>
-                    <argvalue>truth.root</argvalue>
-                  </arg>
-                  <arg>
-                    <argname>localRefFile</argname>
-                    <argvalue>True</argvalue>
-                  </arg>
-                  <arg>
-                    <argname>DCubeMon</argname>
-                    <argvalue>truth_2.root</argvalue>
-                  </arg>
-                  <keepFilePattern>DCube-truth.root/truth_2.root.dcube.xml.php</keepFilePattern>
-                  <noalarm />
-                </test>
-                <testToRemove>
-                  <jobGroupName>RTT:Top</jobGroupName>
-                  <testidentifier>CheckFileRunner0</testidentifier>
-                </testToRemove>
-                <testToRemove>
-                  <jobGroupName>RTT:Athena</jobGroupName>
-                  <testidentifier>Athena_FileGrepper</testidentifier>
-                </testToRemove>
-                <testToRemove>
-                  <jobGroupName>RTT:Athena</jobGroupName>
-                  <testidentifier>Athena_FileGrepper1</testidentifier>
-                </testToRemove>
-              </athena>
-            </chainElement>
-
-            <chainElement>
-              <jobTransform userJobId="AtlasG4_muons_Reg">
-                <doc>Regression test between releases</doc>
-                <jobTransformJobName>AtlasG4_muons_Reg</jobTransformJobName>
-                <jobTransformCmd>sim_reg_test.py AtlasG4_muons</jobTransformCmd>
-                <group>SimCoreTests:SimCoreRegressionTests</group>
-                <queue>short</queue>
-                <test>
-                  <modulename>RttLibraryTools</modulename>
-                  <testname>DCubeRunner</testname>
-                  <testidentifier>AtlasG4_muons_RegDCubeTest</testidentifier>
-                  <arg>
-                    <argname>DCubeCfg</argname>
-                    <argvalue>21.0.X/dcube-AtlasG4_muons.xml</argvalue>
-                  </arg>
-                  <arg>
-                    <argname>DCubeRef</argname>
-                    <argvalue>yesterday.root</argvalue>
-                  </arg>
-                  <arg>
-                    <argname>localRefFile</argname>
-                    <argvalue>True</argvalue>
-                  </arg>
-                  <arg>
-                    <argname>DCubeMon</argname>
-                    <argvalue>today.root</argvalue>
-                  </arg>
-                  <keepFilePattern>DCube-yesterday.root/today.root.dcube.xml.php</keepFilePattern>
-                  <noalarm />
-                </test>
-              </jobTransform>
-            </chainElement>
-
-          </parallel>
-        </sequential>
-      </chain>
-
-      <chain>
-        <chainName>RegressionTest_AtlasG4_pions</chainName>
-        <abortOnError />
-        <sequential>
-
-          <chainElement>
-            <jobTransform userJobId="AtlasG4_pions">
-              <doc>Tests detector functionality using single pions</doc>
-              <jobTransformJobName>AtlasG4_pions</jobTransformJobName>
-              <jobTransformCmd>AtlasG4_tf.py --preInclude 'SimulationJobOptions/preInclude.SinglePionGenerator.py' --outputHITSFile 'test.HITS.pool.root' --maxEvents '150' --randomSeed '10' --geometryVersion 'ATLAS-R2-2015-03-01-00_VALIDATION' --conditionsTag 'OFLCOND-RUN12-SDR-19' --DataRunNumber '222525' --physicsList 'FTFP_BERT' --postInclude 'PyJobTransforms/UseFrontier.py' 'AtlasG4Tf:G4AtlasTests/postInclude.DCubeTest.py' --preExec 'AtlasG4Tf:simFlags.ReleaseGeoModel=False;'
-              </jobTransformCmd>
-              <group>SimCoreJobTransformTests</group>
-              <queue>long</queue>
-
-              <test position="1">
-                <modulename>RttLibraryTools</modulename>
-                <testname>DCubeRunner</testname>
-                <testidentifier>AtlasG4_pionsDCubeTest</testidentifier>
-                <arg>
-                  <argname>DCubeCfg</argname>
-                  <argvalue>21.0.X/dcube-AtlasG4_pions.xml</argvalue>
-                </arg>
-                <arg>
-                  <argname>DCubeRef</argname>
-                  <argvalue>21.0.X/AtlasG4_pions.truth.root</argvalue>
-                </arg>
-                <arg>
-                  <argname>DCubeMon</argname>
-                  <argvalue>truth.root</argvalue>
-                </arg>
-                <keepFilePattern>DCube-21.0.X/AtlasG4_pions.truth.root/truth.root.dcube.xml.php</keepFilePattern>
-                <noalarm />
-              </test>
-            </jobTransform>
-          </chainElement>
-
-          <chainElement>
-            <jobTransform userJobId="AtlasG4_pions_Reg">
-              <doc>Regression test between releases</doc>
-              <jobTransformJobName>AtlasG4_pions_Reg</jobTransformJobName>
-              <jobTransformCmd>sim_reg_test.py AtlasG4_pions</jobTransformCmd>
-              <group>SimCoreTests:SimCoreRegressionTests</group>
-              <queue>short</queue>
-              <test>
-                <modulename>RttLibraryTools</modulename>
-                <testname>DCubeRunner</testname>
-                <testidentifier>AtlasG4_pions_RegDCubeTest</testidentifier>
-                <arg>
-                  <argname>DCubeCfg</argname>
-                  <argvalue>21.0.X/dcube-AtlasG4_pions.xml</argvalue>
-                </arg>
-                <arg>
-                  <argname>DCubeRef</argname>
-                  <argvalue>yesterday.root</argvalue>
-                </arg>
-                <arg>
-                  <argname>localRefFile</argname>
-                  <argvalue>True</argvalue>
-                </arg>
-                <arg>
-                  <argname>DCubeMon</argname>
-                  <argvalue>today.root</argvalue>
-                </arg>
-                <keepFilePattern>DCube-yesterday.root/today.root.dcube.xml.php</keepFilePattern>
-                <noalarm />
-              </test>
-            </jobTransform>
-          </chainElement>
-
-        </sequential>
-      </chain>
-
-      <chain>
-        <chainName>RegressionTest_AtlasG4_minbias</chainName>
-        <abortOnError />
-        <sequential>
-
-          <chainElement>
-            <jobTransform userJobId="AtlasG4_minbias">
-              <doc>Reading gen events, single particle</doc>
-              <jobTransformJobName>AtlasG4_minbias</jobTransformJobName>
-              <jobTransformCmd>AtlasG4_tf.py --inputEVNTFile '/afs/cern.ch/atlas/offline/ProdData/16.6.X/16.6.7.Y/minbias_Inelastic-pythia8-7000.evgen.pool.root' --outputHITSFile 'test.HITS.pool.root' --maxEvents '50' --skipEvents '0' --randomSeed '10' --geometryVersion 'ATLAS-R2-2015-03-01-00_VALIDATION' --conditionsTag 'OFLCOND-RUN12-SDR-19' --DataRunNumber '222525' --physicsList 'FTFP_BERT' --preInclude 'SimulationJobOptions/preInclude.CaloOffDigitConfig.py,SimulationJobOptions/preInclude.MuonOffDigitConfig.py' --postInclude 'PyJobTransforms/UseFrontier.py' 'AtlasG4Tf:G4AtlasTests/postInclude.DCubeTest.py' --preExec 'AtlasG4Tf:simFlags.ReleaseGeoModel=False;simFlags.EventFilter.set_On();simFlags.EventFilter.get_Value()["BeamEffectTransformation"]=True;'
-              </jobTransformCmd>
-              <group>SimCoreJobTransformTests</group>
-              <queue>medium</queue>
-              <test position="1">
-                <modulename>RttLibraryTools</modulename>
-                <testname>DiffPoolFilesRunner</testname>
-                <testidentifier>AtlasG4_minbias_HITSFileDiff</testidentifier>
-                <arg>
-                  <argname>fileName</argname>
-                  <argvalue>test.HITS.pool.root</argvalue>
-                </arg>
-                <arg>
-                  <argname>refFileName</argname>
-                  <argvalue>root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/proj-sit/simulation/validation/RTT/referenceFiles/21.0.X/AtlasG4_minbias.HITS.pool.root</argvalue>
-                </arg>
-                <keepFilePattern>test.HITS.pool.root_AtlasG4_minbias.HITS.pool.root.diffPool</keepFilePattern>
-              </test>
-              <test>
-                <modulename>RttLibraryTools</modulename>
-                <testname>DCubeRunner</testname>
-                <testidentifier>AtlasG4_minbiasDCubeTest</testidentifier>
-                <arg>
-                  <argname>DCubeCfg</argname>
-                  <argvalue>21.0.X/dcube-AtlasG4_minbias.xml</argvalue>
-                </arg>
-                <arg>
-                  <argname>DCubeRef</argname>
-                  <argvalue>21.0.X/AtlasG4_minbias.truth.root</argvalue>
-                </arg>
-                <arg>
-                  <argname>DCubeMon</argname>
-                  <argvalue>truth.root</argvalue>
-                </arg>
-                <keepFilePattern>DCube-21.0.X/AtlasG4_minbias.truth.root/truth.root.dcube.xml.php</keepFilePattern>
-                <noalarm />
-              </test>
-            </jobTransform>
-          </chainElement>
-
-          <chainElement>
-            <jobTransform userJobId="AtlasG4_minbias_Reg">
-              <doc>Regression test between releases</doc>
-              <jobTransformJobName>AtlasG4_minbias_Reg</jobTransformJobName>
-              <jobTransformCmd>sim_reg_test.py AtlasG4_minbias</jobTransformCmd>
-              <group>SimCoreTests:SimCoreRegressionTests</group>
-              <queue>short</queue>
-              <test>
-                <modulename>RttLibraryTools</modulename>
-                <testname>DCubeRunner</testname>
-                <testidentifier>AtlasG4_minbias_RegDCubeTest</testidentifier>
-                <arg>
-                  <argname>DCubeCfg</argname>
-                  <argvalue>21.0.X/dcube-AtlasG4_minbias.xml</argvalue>
-                </arg>
-                <arg>
-                  <argname>DCubeRef</argname>
-                  <argvalue>yesterday.root</argvalue>
-                </arg>
-                <arg>
-                  <argname>localRefFile</argname>
-                  <argvalue>True</argvalue>
-                </arg>
-                <arg>
-                  <argname>DCubeMon</argname>
-                  <argvalue>today.root</argvalue>
-                </arg>
-                <keepFilePattern>DCube-yesterday.root/today.root.dcube.xml.php</keepFilePattern>
-                <noalarm />
-              </test>
-            </jobTransform>
-          </chainElement>
-
-        </sequential>
-      </chain>
-
-      <chain>
-        <chainName>RegressionTest_AtlasG4_electrons</chainName>
-        <abortOnError />
-        <sequential>
-
-          <chainElement>
-            <jobTransform userJobId="AtlasG4_electrons">
-              <doc>Tests detector functionality using single electrons</doc>
-              <jobTransformJobName>AtlasG4_electrons</jobTransformJobName>
-              <jobTransformCmd>AtlasG4_tf.py --preInclude 'SimulationJobOptions/preInclude.SingleElectronGenerator.py' --outputHITSFile 'test.HITS.pool.root' --maxEvents '1000' --randomSeed '10' --geometryVersion 'ATLAS-R2-2015-03-01-00_VALIDATION' --conditionsTag 'OFLCOND-RUN12-SDR-19' --DataRunNumber '222525' --physicsList 'FTFP_BERT' --postInclude 'PyJobTransforms/UseFrontier.py' 'AtlasG4Tf:G4AtlasTests/postInclude.DCubeTest.py' --preExec 'AtlasG4Tf:simFlags.ReleaseGeoModel=False;'
-              </jobTransformCmd>
-              <group>SimCoreJobTransformTests</group>
-              <queue>long</queue>
-
-              <test position="1">
-                <modulename>RttLibraryTools</modulename>
-                <testname>DCubeRunner</testname>
-                <testidentifier>AtlasG4_electronsDCubeTest</testidentifier>
-                <arg>
-                  <argname>DCubeCfg</argname>
-                  <argvalue>21.0.X/dcube-AtlasG4_electrons.xml</argvalue>
-                </arg>
-                <arg>
-                  <argname>DCubeRef</argname>
-                  <argvalue>21.0.X/AtlasG4_electrons.truth.root</argvalue>
-                </arg>
-                <arg>
-                  <argname>DCubeMon</argname>
-                  <argvalue>truth.root</argvalue>
-                </arg>
-                <keepFilePattern>DCube-21.0.X/AtlasG4_electrons.truth.root/truth.root.dcube.xml.php</keepFilePattern>
-                <noalarm />
-              </test>
-
-            </jobTransform>
-            <chainfileout>test.HITS.pool.root</chainfileout>
-          </chainElement>
-
-          <parallel>
-
-            <chainElement>
-              <athena userJobId="AtlasG4_electrons_noevgen">
-                <doc>Tests detector functionality using single electrons read from POOL</doc>
-                <options>G4AtlasTests/test_AtlasG4_electrons_noevgen</options>
-                <group>AthenaSimCoreTestJobs</group>
-                <queue>short</queue>
-                <chaindataset_info>
-                  <dc2 />
-                  <chaindatasetName>test.HITS.pool.root</chaindatasetName>
-                  <dataset_info>
-                    <dc2 />
-                    <datasetName>/eos/atlas/atlascerngroupdisk/proj-sit/simulation/validation/RTT/referenceFiles/21.0.X/AtlasG4_electrons.HITS.pool.root</datasetName>
-                  </dataset_info>
-                </chaindataset_info>
-                <test>
-                  <modulename>RttLibraryTools</modulename>
-                  <testname>DCubeRunner</testname>
-                  <testidentifier>AtlasG4_electrons_noevgenDCubeTest</testidentifier>
-                  <arg>
-                    <argname>DCubeCfg</argname>
-                    <argvalue>21.0.X/dcube-AtlasG4_electrons_noevgen.xml</argvalue>
-                  </arg>
-                  <arg>
-                    <argname>DCubeRef</argname>
-                    <argvalue>truth.root</argvalue>
-                  </arg>
-                  <arg>
-                    <argname>localRefFile</argname>
-                    <argvalue>True</argvalue>
-                  </arg>
-                  <arg>
-                    <argname>DCubeMon</argname>
-                    <argvalue>truth_2.root</argvalue>
-                  </arg>
-                  <keepFilePattern>DCube-truth.root/truth_2.root.dcube.xml.php</keepFilePattern>
-                  <noalarm />
-                </test>
-                <testToRemove>
-                  <jobGroupName>RTT:Top</jobGroupName>
-                  <testidentifier>CheckFileRunner0</testidentifier>
-                </testToRemove>
-                <testToRemove>
-                  <jobGroupName>RTT:Athena</jobGroupName>
-                  <testidentifier>Athena_FileGrepper</testidentifier>
-                </testToRemove>
-                <testToRemove>
-                  <jobGroupName>RTT:Athena</jobGroupName>
-                  <testidentifier>Athena_FileGrepper1</testidentifier>
-                </testToRemove>
-              </athena>
-            </chainElement>
-
-            <chainElement>
-              <jobTransform userJobId="AtlasG4_electrons_Reg">
-                <doc>Regression test between releases</doc>
-                <jobTransformJobName>AtlasG4_electrons_Reg</jobTransformJobName>
-                <jobTransformCmd>sim_reg_test.py AtlasG4_electrons</jobTransformCmd>
-                <group>SimCoreTests:SimCoreRegressionTests</group>
-                <queue>short</queue>
-                <test>
-                  <modulename>RttLibraryTools</modulename>
-                  <testname>DCubeRunner</testname>
-                  <testidentifier>AtlasG4_electrons_RegDCubeTest</testidentifier>
-                  <arg>
-                    <argname>DCubeCfg</argname>
-                    <argvalue>21.0.X/dcube-AtlasG4_electrons.xml</argvalue>
-                  </arg>
-                  <arg>
-                    <argname>DCubeRef</argname>
-                    <argvalue>yesterday.root</argvalue>
-                  </arg>
-                  <arg>
-                    <argname>localRefFile</argname>
-                    <argvalue>True</argvalue>
-                  </arg>
-                  <arg>
-                    <argname>DCubeMon</argname>
-                    <argvalue>today.root</argvalue>
-                  </arg>
-                  <keepFilePattern>DCube-yesterday.root/today.root.dcube.xml.php</keepFilePattern>
-                  <noalarm />
-                </test>
-              </jobTransform>
-            </chainElement>
-
-          </parallel>
-
-        </sequential>
-      </chain>
-
-      <chain>
-        <chainName>RegressionTest_WriteCalHitsTest</chainName>
-        <abortOnError />
-        <sequential>
-
-          <chainElement>
-            <jobTransform userJobId="WriteCalHitsTest">
-              <doc>Reading gen events, single particle</doc>
-              <jobTransformJobName>WriteCalHitsTest</jobTransformJobName>
-              <jobTransformCmd>AtlasG4_tf.py --inputEVNTFile '/afs/cern.ch/atlas/offline/ProdData/16.6.X/16.6.7.Y/pi_E50_eta0-60.evgen.pool.root' --outputHITSFile 'test.HITS.pool.root' --maxEvents '10' --skipEvents '0' --randomSeed '10' --geometryVersion 'ATLAS-R2-2015-03-01-00_VALIDATION' --conditionsTag 'OFLCOND-RUN12-SDR-19' --DataRunNumber '222525' --physicsList 'FTFP_BERT' --preInclude 'SimulationJobOptions/preInclude.CalHits.py,SimulationJobOptions/preInclude.ParticleID.py' --postInclude 'PyJobTransforms/UseFrontier.py' 'AtlasG4Tf:G4AtlasTests/postInclude.DCubeTest_CaloCalibHits.py' --preExec 'AtlasG4Tf:simFlags.ReleaseGeoModel=False;'
-              </jobTransformCmd>
-              <group>SimCoreJobTransformTests</group>
-              <queue>short</queue>
-              <test position="1">
-                <modulename>RttLibraryTools</modulename>
-                <testname>DCubeRunner</testname>
-                <testidentifier>WriteCalHitsTestDCubeTest</testidentifier>
-                <arg>
-                  <argname>DCubeCfg</argname>
-                  <argvalue>21.0.X/dcube-WriteCalHitsTest.xml</argvalue>
-                </arg>
-                <arg>
-                  <argname>DCubeRef</argname>
-                  <argvalue>21.0.X/WriteCalHitsTest.truth.root</argvalue>
-                </arg>
-                <arg>
-                  <argname>DCubeMon</argname>
-                  <argvalue>truth.root</argvalue>
-                </arg>
-                <keepFilePattern>DCube-21.0.X/WriteCalHitsTest.truth.root/truth.root.dcube.xml.php</keepFilePattern>
-                <noalarm />
-              </test>
-              <test position="2">
-                <modulename>RttLibraryTools</modulename>
-                <testname>DiffPoolFilesRunner</testname>
-                <testidentifier>WriteCalHitsTestHITSFileDiff</testidentifier>
-                <arg>
-                  <argname>fileName</argname>
-                  <argvalue>test.HITS.pool.root</argvalue>
-                </arg>
-                <arg>
-                  <argname>refFileName</argname>
-                  <argvalue>root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/proj-sit/simulation/validation/RTT/referenceFiles/21.0.X/WriteCalHitsTest.HITS.pool.root</argvalue>
-                </arg>
-                <keepFilePattern>test.HITS.pool.root_WriteCalHitsTest.HITS.pool.root.diffPool</keepFilePattern>
-              </test>
-            </jobTransform>
-          </chainElement>
-
-          <chainElement>
-            <jobTransform userJobId="WriteCalHitsTest_Reg">
-              <doc>Regression test between releases</doc>
-              <jobTransformJobName>WriteCalHitsTest_Reg</jobTransformJobName>
-              <jobTransformCmd>sim_reg_test.py WriteCalHitsTest</jobTransformCmd>
-              <group>SimCoreTests:SimCoreRegressionTests</group>
-              <queue>short</queue>
-              <test>
-                <modulename>RttLibraryTools</modulename>
-                <testname>DCubeRunner</testname>
-                <testidentifier>WriteCalHitsTest_RegDCubeTest</testidentifier>
-                <arg>
-                  <argname>DCubeCfg</argname>
-                  <argvalue>21.0.X/dcube-WriteCalHitsTest.xml</argvalue>
-                </arg>
-                <arg>
-                  <argname>DCubeRef</argname>
-                  <argvalue>yesterday.root</argvalue>
-                </arg>
-                <arg>
-                  <argname>localRefFile</argname>
-                  <argvalue>True</argvalue>
-                </arg>
-                <arg>
-                  <argname>DCubeMon</argname>
-                  <argvalue>today.root</argvalue>
-                </arg>
-                <keepFilePattern>DCube-yesterday.root/today.root.dcube.xml.php</keepFilePattern>
-                <noalarm />
-              </test>
-            </jobTransform>
-          </chainElement>
-
-        </sequential>
-      </chain>
-
-
-      <!--
-         ********************************************************************************
-         Section II
-         ********************************************************************************
-        -->
-
-      <athena userJobId="G4AtlasGeoTest">
-        <doc>Recursive geometry test on ATLAS-R2-2015-03-01-00 (MC15 default). Done only on G4 and GeoModel envelopes</doc>
-        <options>G4AtlasTests/test_G4AtlasGeo</options>
-        <group>SimCoreTests:SimGeomTestJobs</group>
-        <queue>short</queue>
-        <testToInvert> <!-- still failing as of August 2015 -->
-          <jobGroupName>SimCoreTests:SimGeomTestJobs</jobGroupName>
-          <testidentifier>SolidProblemGrepper</testidentifier>
-        </testToInvert>
-      </athena>
-
-      <chain>
-        <chainName>RegressionTest_G4AtlasCosmic</chainName>
-        <abortOnError />
-        <sequential>
-
-          <chainElement>
-            <athena userJobId="G4AtlasCosmic">
-              <doc>Test with commisioning layouts and cosmic generator</doc>
-              <commandLineString>--preloadlib=${ATLASMKLLIBDIR_PRELOAD}/libintlc.so.5:${ATLASMKLLIBDIR_PRELOAD}/libimf.so</commandLineString>
-              <options>G4AtlasApps/jobOptions.G4Cosmic.py</options>
-              <group>AthenaSimCoreTestJobs</group>
-              <queue>short</queue>
-            </athena>
-          </chainElement>
-
-          <chainElement>
-            <jobTransform userJobId="G4AtlasCosmic_Reg">
-              <doc>Regression test between releases</doc>
-              <jobTransformJobName>G4AtlasCosmic_Reg</jobTransformJobName>
-              <jobTransformCmd>sim_reg_test.py G4AtlasCosmic</jobTransformCmd>
-              <group>SimCoreTests:SimCoreRegressionTests</group>
-              <queue>short</queue>
-            </jobTransform>
-          </chainElement>
-
-        </sequential>
-      </chain>
-      <!--
-         ********************************************************************************
-         Section III
-         ********************************************************************************
-        -->
-      <chain>
-        <chainName>RegressionTest_SkipEventsTest</chainName>
-        <abortOnError />
-        <sequential>
-
-          <chainElement>
-            <jobTransform userJobId="SkipEventsTest">
-              <doc>Reading single particle gen events, checking that the SkipEvents argument works</doc>
-              <jobTransformJobName>SkipEvents</jobTransformJobName>
-              <jobTransformCmd>AtlasG4_tf.py --inputEVNTFile '/afs/cern.ch/atlas/offline/ProdData/16.6.X/16.6.7.Y/e_E50_eta0-25.evgen.pool.root' --outputHITSFile 'test.HITS.pool.root' --maxEvents '10' --skipEvents '5' --randomSeed '10' --geometryVersion 'ATLAS-R2-2015-03-01-00_VALIDATION' --conditionsTag 'OFLCOND-RUN12-SDR-19' --DataRunNumber '222525' --physicsList 'FTFP_BERT' --postInclude 'PyJobTransforms/UseFrontier.py'
-              </jobTransformCmd>
-              <group>SimCoreJobTransformTests</group>
-              <queue>short</queue>
-              <test position="1">
-                <modulename>RttLibraryTools</modulename>
-                <testname>FileGrepper</testname>
-                <outputFile>fileGrepper_results.txt</outputFile>
-                <testidentifier>SkipFileGrepper</testidentifier>
-                <arg>
-                  <argname>inputFile</argname>
-                  <argvalue>log.AtlasG4Tf</argvalue>
-                </arg>
-                <arg>
-                  <fileGrepperArgs>
-                    <fileGrepperSearchPattern>
-                      <fileGrepperPattern>skipping event 1.*skipping event 2.*skipping event 3.*skipping event 4.*skipping event 5</fileGrepperPattern>
-                      <compileFlags>S</compileFlags>
-                    </fileGrepperSearchPattern>
-                  </fileGrepperArgs>
-                </arg>
-                <keepFilePattern>fileGrepper_results.txt</keepFilePattern>
-              </test>
-            </jobTransform>
-          </chainElement>
-
-          <chainElement>
-            <jobTransform userJobId="SkipEventsTest_Reg">
-              <doc>Regression test between releases</doc>
-              <jobTransformJobName>SkipEventsTest_Reg</jobTransformJobName>
-              <jobTransformCmd>sim_reg_test.py SkipEventsTest</jobTransformCmd>
-              <group>SimCoreTests:SimCoreRegressionTests</group>
-              <queue>short</queue>
-            </jobTransform>
-          </chainElement>
-        </sequential>
-      </chain>
-
-      <chain>
-        <chainName>RegressionTest_CosmicSim</chainName>
-        <abortOnError />
-        <sequential>
-
-          <chainElement>
-            <jobTransform userJobId="CosmicSim">
-              <doc>Running cosmic simulation transform</doc>
-              <jobTransformJobName>CosmicSim</jobTransformJobName>
-              <jobTransformCmd>AtlasG4_tf.py --outputHITSFile 'test.HITS.pool.root' --maxEvents '1500' --randomSeed '1234' --DataRunNumber '222525' --CosmicFilterVolume 'Calo' --CosmicFilterVolume2 'NONE' --geometryVersion 'ATLAS-R2-2015-03-01-00_VALIDATION' --conditionsTag 'OFLCOND-RUN12-SDR-19' --physicsList 'FTFP_BERT' --CosmicPtSlice 'NONE' --outputEVNT_TRFile 'test.TR.pool.root' --beamType 'cosmics' --postInclude 'PyJobTransforms/UseFrontier.py'
-              </jobTransformCmd>
-              <group>SimCoreJobTransformTests</group>
-              <queue>short</queue>
-              <test position="1">
-                <modulename>RttLibraryTools</modulename>
-                <testname>DiffPoolFilesRunner</testname>
-                <testidentifier>CosmicSimHITSFileDiff</testidentifier>
-                <arg>
-                  <argname>fileName</argname>
-                  <argvalue>test.HITS.pool.root</argvalue>
-                </arg>
-                <arg>
-                  <argname>refFileName</argname>
-                  <argvalue>root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/proj-sit/simulation/validation/RTT/referenceFiles/21.0.X/CosmicSim.HITS.pool.root</argvalue>
-                </arg>
-                <keepFilePattern>test.HITS.pool.root_CosmicSim.HITS.pool.root.diffPool</keepFilePattern>
-              </test>
-              <test position="2">
-                <modulename>RttLibraryTools</modulename>
-                <testname>DiffPoolFilesRunner</testname>
-                <testidentifier>CosmicSimTrackRecordFileDiff</testidentifier>
-                <arg>
-                  <argname>fileName</argname>
-                  <argvalue>test.TR.pool.root</argvalue>
-                </arg>
-                <arg>
-                  <argname>refFileName</argname>
-                  <argvalue>root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/proj-sit/simulation/validation/RTT/referenceFiles/21.0.X/CosmicSim.TR.pool.root</argvalue>
-                </arg>
-                <keepFilePattern>test.TR.pool.root_CosmicSim.TR.pool.root.diffPool</keepFilePattern>
-              </test>
-              <testToRemove>
-                <jobGroupName>SimCoreTests:SimCoreJobTransformTests</jobGroupName>
-                <testidentifier>AbortedEventGrepper</testidentifier>
-              </testToRemove>
-            </jobTransform>
-          </chainElement>
-
-          <chainElement>
-            <jobTransform userJobId="CosmicSim_Reg">
-              <doc>Regression test between releases</doc>
-              <jobTransformJobName>CosmicSim_Reg</jobTransformJobName>
-              <jobTransformCmd>sim_reg_test.py CosmicSim</jobTransformCmd>
-              <group>SimCoreTests:SimCoreRegressionTests</group>
-              <queue>short</queue>
-              <test position="2">
-                <modulename>RttLibraryTools</modulename>
-                <testname>DiffPoolFilesRunner</testname>
-                <testidentifier>CosmicSim_RegTrackRecordRegressionTestRunner</testidentifier>
-                <arg>
-                  <argname>fileName</argname>
-                  <argvalue>today.TR.pool.root</argvalue>
-                </arg>
-                <arg>
-                  <argname>refFileName</argname>
-                  <argvalue>yesterday.TR.pool.root</argvalue>
-                </arg>
-                <keepFilePattern>today.TR.pool.root_yesterday.TR.pool.root.diffPool</keepFilePattern>
-              </test>
-            </jobTransform>
-          </chainElement>
-
-        </sequential>
-      </chain>
-    </jobList>
-
-    <jobGroups>
-      <jobGroup name="AthenaSimCoreTestJobs" parent="RTT:Athena">
-        <keepFilePattern>*.ps</keepFilePattern>
-        <keepFilePattern>*.root</keepFilePattern>
-        <keepFilePattern>*.txt</keepFilePattern>
-        <keepFilePattern>*.log</keepFilePattern>
-        <keepFilePattern>*.diffPool</keepFilePattern>
-        <keepFilePattern>G4InitStats.out</keepFilePattern>
-        <keepFilePattern>memorytest.out</keepFilePattern>
-        <keepFilePattern>GeoModelStatistics</keepFilePattern>
-        <test>
-          <modulename>RttLibraryTools</modulename>
-          <testname>FileGrepper</testname>
-          <outputFile>ErrorG4ExceptionGrepper_results.txt</outputFile>
-          <testidentifier>ErrorG4ExceptionGrepper</testidentifier>
-          <arg>
-            <argname>inputFile</argname>
-            <argvalue>*_log</argvalue>
-          </arg>
-          <arg>
-            <fileGrepperArgs>
-              <!-- veto pattern block -->
-              <fileGrepperVetoPattern>
-                <fileGrepperPattern>-------- EEEE ------- G4Exception-START -------- EEEE -------
-                </fileGrepperPattern>
-              </fileGrepperVetoPattern>
-            </fileGrepperArgs>
-          </arg>
-          <keepFilePattern>ErrorG4ExceptionGrepper_results.txt</keepFilePattern>
-        </test>
-        <test>
-          <modulename>RttLibraryTools</modulename>
-          <testname>FileGrepper</testname>
-          <outputFile>WarningG4ExceptionGrepper_results.txt</outputFile>
-          <testidentifier>WarningG4ExceptionGrepper</testidentifier>
-          <arg>
-            <argname>inputFile</argname>
-            <argvalue>*_log</argvalue>
-          </arg>
-          <arg>
-            <fileGrepperArgs>
-              <!-- veto pattern block -->
-              <fileGrepperVetoPattern>
-                <fileGrepperPattern>-------- WWWW ------- G4Exception-START -------- WWWW -------
-                </fileGrepperPattern>
-              </fileGrepperVetoPattern>
-            </fileGrepperArgs>
-          </arg>
-          <keepFilePattern>WarningG4ExceptionGrepper_results.txt</keepFilePattern>
-          <noalarm />
-        </test>
-        <test> <!-- Special Test for uninitialized random stream seeds should remove once it starts failing.. -->
-          <modulename>RttLibraryTools</modulename>
-          <testname>FileGrepper</testname>
-          <outputFile>DefaultSeedsGrepper_results.txt</outputFile>
-          <testidentifier>DefaultSeedsGrepper</testidentifier>
-          <arg>
-            <argname>inputFile</argname>
-            <argvalue>*_log</argvalue>
-          </arg>
-          <arg>
-            <fileGrepperArgs>
-              <!-- veto pattern block -->
-              <fileGrepperVetoPattern>
-                <fileGrepperPattern>DEFAULT seeds</fileGrepperPattern>
-                <compileFlags>S</compileFlags>
-              </fileGrepperVetoPattern>
-            </fileGrepperArgs>
-          </arg>
-          <keepFilePattern>DefaultSeedsGrepper_results.txt</keepFilePattern>
-        </test>
-        <test> <!-- Special Test for StrangePDG G4Exceptions should remove once it starts failing.. -->
-          <modulename>RttLibraryTools</modulename>
-          <testname>FileGrepper</testname>
-          <outputFile>StrangePDGGrepper_results.txt</outputFile>
-          <testidentifier>StrangePDGGrepper</testidentifier>
-          <arg>
-            <argname>inputFile</argname>
-            <argvalue>*_log</argvalue>
-          </arg>
-          <arg>
-            <fileGrepperArgs>
-              <!-- veto pattern block -->
-              <fileGrepperVetoPattern>
-                <fileGrepperPattern>G4Exception : PART102</fileGrepperPattern>
-                <compileFlags>S</compileFlags>
-              </fileGrepperVetoPattern>
-            </fileGrepperArgs>
-          </arg>
-          <keepFilePattern>StrangePDGGrepper_results.txt</keepFilePattern>
-          <noalarm />
-        </test>
-      </jobGroup>
-
-      <jobGroup name="SimGeomTestJobs" parent="RTT:Athena">
-        <keepFilePattern>*.ps</keepFilePattern>
-        <keepFilePattern>*.root</keepFilePattern>
-        <keepFilePattern>*.txt</keepFilePattern>
-        <keepFilePattern>*.log</keepFilePattern>
-        <keepFilePattern>*.diffPool</keepFilePattern>
-        <keepFilePattern>G4InitStats.out</keepFilePattern>
-        <keepFilePattern>memorytest.out</keepFilePattern>
-        <keepFilePattern>GeoModelStatistics</keepFilePattern>
-        <test>
-          <modulename>RttLibraryTools</modulename>
-          <testname>FileGrepper</testname>
-          <outputFile>CodeZeroGrepper_results.txt</outputFile>
-          <testidentifier>CodeZeroGrepper</testidentifier>
-          <arg>
-            <argname>inputFile</argname>
-            <argvalue>G4AtlasGeo*_log</argvalue>
-          </arg>
-          <arg>
-            <fileGrepperArgs>
-              <!-- search pattern block -->
-              <fileGrepperSearchPattern>
-                <fileGrepperPattern>leaving with code 0</fileGrepperPattern>
-              </fileGrepperSearchPattern>
-            </fileGrepperArgs>
-          </arg>
-          <keepFilePattern>CodeZeroGrepper_results.txt</keepFilePattern>
-        </test>
-
-        <test>
-          <modulename>RttLibraryTools</modulename>
-          <testname>FileGrepper</testname>
-          <outputFile>OtherGeoErrorGrepper_results.txt</outputFile>
-          <testidentifier>OtherGeoErrorGrepper</testidentifier>
-          <arg>
-            <argname>inputFile</argname>
-            <argvalue>G4AtlasGeo*_log</argvalue>
-          </arg>
-          <arg>
-            <fileGrepperArgs>
-              <!-- veto pattern block -->
-              <fileGrepperVetoPattern>
-                <fileGrepperPattern>GeomTest Error((?!(Overlapping daughter volumes|Overshooting daughter volume|SolidProblem)).)*$</fileGrepperPattern>
-              </fileGrepperVetoPattern>
-            </fileGrepperArgs>
-          </arg>
-          <keepFilePattern>OtherGeoErrorGrepper_results.txt</keepFilePattern>
-        </test>
-
-        <test>
-          <modulename>RttLibraryTools</modulename>
-          <testname>FileGrepper</testname>
-          <outputFile>DaughterOverlapGrepper_results.txt</outputFile>
-          <testidentifier>DaughterOverlapGrepper</testidentifier>
-          <arg>
-            <argname>inputFile</argname>
-            <argvalue>G4AtlasGeo*_log</argvalue>
-          </arg>
-          <arg>
-            <fileGrepperArgs>
-              <!-- veto pattern block -->
-              <fileGrepperVetoPattern>
-                <fileGrepperPattern>GeomTest Error: Overlapping daughter volumes</fileGrepperPattern>
-              </fileGrepperVetoPattern>
-            </fileGrepperArgs>
-          </arg>
-          <keepFilePattern>DaughterOverlapGrepper_results.txt</keepFilePattern>
-        </test>
-
-        <test>
-          <modulename>RttLibraryTools</modulename>
-          <testname>FileGrepper</testname>
-          <outputFile>DaughterOvershootGrepper_results.txt</outputFile>
-          <testidentifier>DaughterOvershootGrepper</testidentifier>
-          <arg>
-            <argname>inputFile</argname>
-            <argvalue>G4AtlasGeo*_log</argvalue>
-          </arg>
-          <arg>
-            <fileGrepperArgs>
-              <!-- veto pattern block -->
-              <fileGrepperVetoPattern>
-                <fileGrepperPattern>GeomTest Error: Overshooting daughter volume</fileGrepperPattern>
-              </fileGrepperVetoPattern>
-            </fileGrepperArgs>
-          </arg>
-          <keepFilePattern>DaughterOvershootGrepper_results.txt</keepFilePattern>
-        </test>
-
-        <test>
-          <modulename>RttLibraryTools</modulename>
-          <testname>FileGrepper</testname>
-          <outputFile>SolidProblemGrepper_results.txt</outputFile>
-          <testidentifier>SolidProblemGrepper</testidentifier>
-          <arg>
-            <argname>inputFile</argname>
-            <argvalue>G4AtlasGeo*_log</argvalue>
-          </arg>
-          <arg>
-            <fileGrepperArgs>
-              <!-- veto pattern block -->
-              <fileGrepperVetoPattern>
-                <fileGrepperPattern>GeomTest Error: SolidProblem</fileGrepperPattern>
-              </fileGrepperVetoPattern>
-            </fileGrepperArgs>
-          </arg>
-          <keepFilePattern>SolidProblemGrepper_results.txt</keepFilePattern>
-        </test>
-
-        <testToRemove>
-          <jobGroupName>SimCoreTests:AthenaSimCoreTestJobs</jobGroupName>
-          <testidentifier>ErrorG4ExceptionGrepper</testidentifier>
-        </testToRemove>
-
-        <testToRemove>
-          <jobGroupName>SimCoreTests:AthenaSimCoreTestJobs</jobGroupName>
-          <testidentifier>WarningG4ExceptionGrepper</testidentifier>
-        </testToRemove>
-
-        <testToRemove>
-          <jobGroupName>SimCoreTests:AthenaSimCoreTestJobs</jobGroupName>
-          <testidentifier>DefaultSeedsGrepper</testidentifier>
-        </testToRemove>
-
-        <testToRemove>
-          <jobGroupName>SimCoreTests:AthenaSimCoreTestJobs</jobGroupName>
-          <testidentifier>StrangePDGGrepper</testidentifier>
-        </testToRemove>
-
-        <testToRemove>
-          <jobGroupName>RTT:Top</jobGroupName>
-          <testidentifier>CheckFileRunner0</testidentifier>
-        </testToRemove>
-
-      </jobGroup>
-
-      <jobGroup name="SimCoreJobTransformTests" parent="RTT:Top">
-        <keepFilePattern>*.root</keepFilePattern>
-        <keepFilePattern>*.txt</keepFilePattern>
-        <keepFilePattern>*.out</keepFilePattern>
-        <keepFilePattern>*.html</keepFilePattern>
-        <keepFilePattern>prof/*.html</keepFilePattern>
-        <keepFilePattern>*.php</keepFilePattern>
-        <keepFilePattern>log*</keepFilePattern>
-        <keepFilePattern>*log</keepFilePattern>
-        <keepFilePattern>*.json</keepFilePattern>
-        <keepFilePattern>*.diffPool</keepFilePattern>
-        <keepFilePattern>test.athena.profile</keepFilePattern>
-        <!-- TODO: Look for G4Exceptions in jobReport.json rather than the log files. -->
-        <test>
-          <modulename>RttLibraryTools</modulename>
-          <testname>FileGrepper</testname>
-          <outputFile>ErrorG4ExceptionGrepper_results.txt</outputFile>
-          <testidentifier>ErrorG4ExceptionGrepper</testidentifier>
-          <arg>
-            <argname>inputFile</argname>
-            <argvalue>log.AtlasG4Tf</argvalue>
-          </arg>
-          <arg>
-            <fileGrepperArgs>
-              <!-- veto pattern block -->
-              <fileGrepperVetoPattern>
-                <fileGrepperPattern>-------- EEEE ------- G4Exception-START -------- EEEE -------
-                </fileGrepperPattern>
-              </fileGrepperVetoPattern>
-            </fileGrepperArgs>
-          </arg>
-          <keepFilePattern>ErrorG4ExceptionGrepper_results.txt</keepFilePattern>
-        </test>
-        <test>
-          <modulename>RttLibraryTools</modulename>
-          <testname>FileGrepper</testname>
-          <outputFile>WarningG4ExceptionGrepper_results.txt</outputFile>
-          <testidentifier>WarningG4ExceptionGrepper</testidentifier>
-          <arg>
-            <argname>inputFile</argname>
-            <argvalue>log.AtlasG4Tf</argvalue>
-          </arg>
-          <arg>
-            <fileGrepperArgs>
-              <!-- veto pattern block -->
-              <fileGrepperVetoPattern>
-                <fileGrepperPattern>-------- WWWW ------- G4Exception-START -------- WWWW -------
-                </fileGrepperPattern>
-              </fileGrepperVetoPattern>
-            </fileGrepperArgs>
-          </arg>
-          <keepFilePattern>WarningG4ExceptionGrepper_results.txt</keepFilePattern>
-          <noalarm />
-        </test>
-        <test>
-          <modulename>RttLibraryTools</modulename>
-          <testname>FileGrepper</testname>
-          <outputFile>AbortedEventGrepper_results.txt</outputFile>
-          <testidentifier>AbortedEventGrepper</testidentifier>
-          <arg>
-            <argname>inputFile</argname>
-            <argvalue>log.AtlasG4Tf</argvalue>
-          </arg>
-          <arg>
-            <fileGrepperArgs>
-              <!-- veto pattern block -->
-              <fileGrepperVetoPattern>
-                <fileGrepperPattern>Event was aborted
-                </fileGrepperPattern>
-              </fileGrepperVetoPattern>
-            </fileGrepperArgs>
-          </arg>
-          <keepFilePattern>AbortedEventGrepper_results.txt</keepFilePattern>
-        </test>
-        <test>
-          <modulename>RttLibraryTools</modulename>
-          <testname>FileGrepper</testname>
-          <outputFile>jobGroupFileGrepper_results.txt</outputFile>
-          <testidentifier>FileGrepperA</testidentifier>
-          <arg>
-            <argname>inputFile</argname>
-            <argvalue>log.AtlasG4Tf</argvalue>
-          </arg>
-          <arg>
-            <fileGrepperArgs>
-              <!-- search pattern block -->
-              <fileGrepperSearchPattern>
-                <fileGrepperPattern>leaving with code 0</fileGrepperPattern>
-              </fileGrepperSearchPattern>
-              <!-- veto pattern block -->
-              <fileGrepperVetoPattern>
-                <fileGrepperPattern>(segmentation violation|bus error)
-                </fileGrepperPattern>
-              </fileGrepperVetoPattern>
-            </fileGrepperArgs>
-          </arg>
-          <keepFilePattern>jobGroupFileGrepper_results.txt</keepFilePattern>
-        </test>
-        <test> <!-- Special Test for uninitialized random stream seeds should remove once it starts failing.. -->
-          <modulename>RttLibraryTools</modulename>
-          <testname>FileGrepper</testname>
-          <outputFile>DefaultSeedsGrepper_results.txt</outputFile>
-          <testidentifier>DefaultSeedsGrepper</testidentifier>
-          <arg>
-            <argname>inputFile</argname>
-            <argvalue>log.AtlasG4Tf</argvalue>
-          </arg>
-          <arg>
-            <fileGrepperArgs>
-              <!-- veto pattern block -->
-              <fileGrepperVetoPattern>
-                <fileGrepperPattern>DEFAULT seeds</fileGrepperPattern>
-                <compileFlags>S</compileFlags>
-              </fileGrepperVetoPattern>
-            </fileGrepperArgs>
-          </arg>
-          <keepFilePattern>DefaultSeedsGrepper_results.txt</keepFilePattern>
-        </test>
-        <test> <!-- Special Test for StrangePDG G4Exceptions should remove once it starts failing.. -->
-          <modulename>RttLibraryTools</modulename>
-          <testname>FileGrepper</testname>
-          <outputFile>StrangePDGGrepper_results.txt</outputFile>
-          <testidentifier>StrangePDGGrepper</testidentifier>
-          <arg>
-            <argname>inputFile</argname>
-            <argvalue>log.AtlasG4Tf</argvalue>
-          </arg>
-          <arg>
-            <fileGrepperArgs>
-              <!-- veto pattern block -->
-              <fileGrepperVetoPattern>
-                <fileGrepperPattern>G4Exception : PART102</fileGrepperPattern>
-                <compileFlags>S</compileFlags>
-              </fileGrepperVetoPattern>
-            </fileGrepperArgs>
-          </arg>
-          <keepFilePattern>StrangePDGGrepper_results.txt</keepFilePattern>
-          <noalarm />
-        </test>
-      </jobGroup>
-      <jobGroup name="SimCoreRegressionTests" parent="RTT:Top">
-        <keepFilePattern>*.root</keepFilePattern>
-        <keepFilePattern>*.txt</keepFilePattern>
-        <keepFilePattern>*.out</keepFilePattern>
-        <keepFilePattern>*.html</keepFilePattern>
-        <keepFilePattern>prof/*.html</keepFilePattern>
-        <keepFilePattern>*.php</keepFilePattern>
-        <keepFilePattern>*log</keepFilePattern>
-        <keepFilePattern>*.diffPool</keepFilePattern>
-        <keepFilePattern>test.athena.profile</keepFilePattern>
-        <test position="1">
-          <modulename>RttLibraryTools</modulename>
-          <testname>DiffPoolFilesRunner</testname>
-          <outputFile>today.HITS.pool.root_yesterday.HITS.pool.root.basic.diffPool</outputFile>
-          <testidentifier>HITS_RegressionTestRunner</testidentifier>
-          <arg>
-            <argname>fileName</argname>
-            <argvalue>today.HITS.pool.root</argvalue>
-          </arg>
-          <arg>
-            <argname>refFileName</argname>
-            <argvalue>yesterday.HITS.pool.root</argvalue>
-          </arg>
-          <keepFilePattern>today.HITS.pool.root_yesterday.HITS.pool.root.basic.diffPool</keepFilePattern>
-        </test>
-        <test>
-          <modulename>FlexibleDiffPoolFilesRunner</modulename>
-          <testname>FlexibleDiffPoolFilesRunner</testname>
-          <testidentifier>HITS_RegressionTestRunner</testidentifier>
-          <arg>
-            <argname>platformDependent</argname>
-            <argvalue>True</argvalue>
-          </arg>
-          <arg>
-            <argname>optionString</argname>
-            <argvalue>--ignore-leaves RecoTimingObj_p1_EVNTtoHITS_timings</argvalue>
-          </arg>
-          <arg>
-            <argname>doDetailedChecks</argname>
-            <argvalue>True</argvalue>
-          </arg>
-          <arg>
-            <argname>fileName</argname>
-            <argvalue>today.HITS.pool.root</argvalue>
-          </arg>
-          <arg>
-            <argname>refFileName</argname>
-            <argvalue>yesterday.HITS.pool.root</argvalue>
-          </arg>
-          <keepFilePattern>today.HITS.pool.root_yesterday.HITS.pool.root.diffPool</keepFilePattern>
-        </test>
-        <testToRemove>
-          <jobGroupName>RTT:Top</jobGroupName>
-          <testidentifier>CheckFileRunner0</testidentifier>
-        </testToRemove>
-      </jobGroup>
-    </jobGroups>
-
-  </rtt>
-
-</unifiedTestConfiguration>
diff --git a/Simulation/Tests/SimCoreTests/test/test_MC16_AtlasG4_ttbar.sh b/Simulation/Tests/SimCoreTests/test/test_MC16_AtlasG4_ttbar.sh
new file mode 100755
index 0000000000000000000000000000000000000000..0f746d6047b940483113d571590e4a715b59f4b1
--- /dev/null
+++ b/Simulation/Tests/SimCoreTests/test/test_MC16_AtlasG4_ttbar.sh
@@ -0,0 +1,35 @@
+#!/bin/sh
+#
+# art-description: MC16-style simulation using FullG4
+# art-include: 21.0/Athena
+# art-include: 21.3/Athena
+# art-include: 21.9/Athena
+# art-include: master/Athena
+# art-type: grid
+# art-output: test.HITS.pool.root
+# art-output: truth.root
+
+# MC16 setup
+# ATLAS-R2-2016-01-00-01 and OFLCOND-MC16-SDR-14
+AtlasG4_tf.py \
+--conditionsTag 'default:OFLCOND-MC16-SDR-14' \
+--physicsList 'FTFP_BERT_ATL' \
+--truthStrategy 'MC15aPlus' \
+--postInclude 'default:PyJobTransforms/UseFrontier.py' \
+--preInclude 'AtlasG4Tf:SimulationJobOptions/preInclude.BeamPipeKill.py,SimulationJobOptions/preInclude.FrozenShowersFCalOnly.py' \
+--preExec 'AtlasG4Tf:simFlags.TightMuonStepping=True' \
+--DataRunNumber '284500' \
+--geometryVersion 'default:ATLAS-R2-2016-01-00-01' \
+--inputEVNTFile "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/SimCoreTests/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.evgen.EVNT.e4993.EVNT.08166201._000012.pool.root.1" \
+--outputHITSFile "Hits.pool.root" \
+--maxEvents 4 \
+--imf False
+
+echo  "art-result: $? simulation"
+
+ArtPackage=$1
+ArtJobName=$2
+# TODO This is a regression test I think. We would also need to compare these files to fixed references
+art.py compare grid  --entries 4 ${ArtPackage} ${ArtJobName}
+
+echo  "art-result: $? regression"
diff --git a/Trigger/TrigAlgorithms/TrigEFMissingET/TrigEFMissingET/IMissingETTool.h b/Trigger/TrigAlgorithms/TrigEFMissingET/TrigEFMissingET/IMissingETTool.h
index 255eb17150fd18dffc2c710d7ec10c9a29dd807e..cd6a3d55396a47a1cb8c87ded4a0fad414644cc6 100644
--- a/Trigger/TrigAlgorithms/TrigEFMissingET/TrigEFMissingET/IMissingETTool.h
+++ b/Trigger/TrigAlgorithms/TrigEFMissingET/TrigEFMissingET/IMissingETTool.h
@@ -1,10 +1,23 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 #ifndef TRIGEFMISSINGET_IMISSINGETTOOL_H
 #define TRIGEFMISSINGET_IMISSINGETTOOL_H 1
 
+/********************************************************************
+
+NAME:     IMissingETTool.h
+PACKAGE:  Trigger/TrigAlgorithms/TrigEFMissingET
+AUTHOR:   Gabriel Gallardo
+CREATED:  September 2018
+
+PURPOSE:  Interface for MET trigger tools in AthenaMT
+
+ ********************************************************************/
+
+
 #include "GaudiKernel/IAlgTool.h"
+#include "TrigTimeAlgs/ITrigTimerSvc.h"
 
 #include "TrigEFMissingET/EFMissingETHelper.h"
 #include "xAODTrigMissingET/TrigMissingET.h"
@@ -22,13 +35,21 @@ public:
 
   /**
    * a method to update the met object (and met helper object)
-   * The API deliberately does not include EventContext as it is only needed 
-   * in one implementation when input is not taken from the regular store. 
    **/
   virtual StatusCode update( xAOD::TrigMissingET *met,
-			     TrigEFMissingEtHelper *metHelper ) const = 0;
+			     TrigEFMissingEtHelper *metHelper,
+           const EventContext& ctx ) const = 0;
 
 protected:
+
+  int m_fextype;            //!< Fex type
+
+  ITrigTimerSvc* m_timersvc;    //!< Timer service
+  TrigTimer*     m_timer[4][3]; //!< (EM, HEC, Tile, FCAL) x (RegionSelector, LoadCollections, loop)
+  TrigTimer*     m_glob_timer;  //!< total time
+  std::string    m_FexName;     //!< name of the parent Fex
+
+  
  /** definition of the meaning for the component flag bits
   **/
  static const unsigned short m_maskProcessing         = 0x0001 ; // bit  0 Component is being processed
diff --git a/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETAlgMT.cxx b/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETAlgMT.cxx
index 145c9ab7e76a7897407ae5a29f2933f46099b648..6b68dfa2cb2353bbdfffdfa0f1be4f5803e7bc33 100644
--- a/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETAlgMT.cxx
+++ b/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETAlgMT.cxx
@@ -1,6 +1,21 @@
 /*
   Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
+
+/********************************************************************
+
+NAME:     EFMissingETFromJetsMT.cxx
+PACKAGE:  Trigger/TrigAlgorithms/TrigEFMissingET
+AUTHOR:   Gabriel Gallardo
+CREATED:  Feb 19, 2018
+
+BASED ON: EFMissingETFromJets.cxx
+AUTHORS:  Florian U. Bernlochner, Doug Schaefer, Justin Chiu
+
+
+PURPOSE:  Updates TrigMissingETHelper using info from jets
+ ********************************************************************/
+
 #include <cmath>
 #include "xAODTrigMissingET/TrigMissingETAuxContainer.h"
 #include "TrigEFMissingET/EFMissingETHelper.h"
@@ -57,8 +72,8 @@ StatusCode EFMissingETAlgMT::execute( const EventContext& context ) const {
   
   loopTimer.start();
   for ( auto& t: m_metTools ) {
-    ATH_MSG_DEBUG( "Invoking tool " << t->name() << " to update the MET obejct" );
-    t->update( met, &metHelper );
+    ATH_MSG_DEBUG( "Invoking tool " << t->name() << " to update the MET object" );
+    t->update( met, &metHelper, context );
   }
   loopTimer.stop();
 
diff --git a/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromCellsMT.cxx b/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromCellsMT.cxx
index 62838f17ef8a52a996bfcb27d19700fab464a4bc..8e747a82f7a7898ed0d07bb3cc878351d26562e7 100644
--- a/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromCellsMT.cxx
+++ b/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromCellsMT.cxx
@@ -7,7 +7,7 @@
 
 // TrigEFMissingET includes
 #include "TrigEFMissingET/IMissingETTool.h"
-#include "TrigEFMissingET/EFMissingETFromCellsMT.h"
+#include "EFMissingETFromCellsMT.h"
 
 
 EFMissingETFromCellsMT::EFMissingETFromCellsMT( const std::string& type, 
@@ -32,11 +32,11 @@ StatusCode EFMissingETFromCellsMT::initialize()
 }
 
 StatusCode EFMissingETFromCellsMT::update( xAOD::TrigMissingET */*met*/,
-					   TrigEFMissingEtHelper *metHelper ) const {
+					   TrigEFMissingEtHelper *metHelper,
+             const EventContext& ctx ) const {
 
   auto totalTimer = Monitored::Timer( "TIME_Total" );
-  const EventContext context{ Gaudi::Hive::currentContext() };
-  auto caloCellsHandle = SG::makeHandle( m_cellsKey );
+  auto caloCellsHandle = SG::makeHandle( m_cellsKey, ctx );
 
   auto loopTimer = Monitored::Timer( "TIME_Loop" );
   auto countUsedCells = Monitored::Scalar<unsigned>( "UsedCells", 0 );
diff --git a/Trigger/TrigAlgorithms/TrigEFMissingET/TrigEFMissingET/EFMissingETFromCellsMT.h b/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromCellsMT.h
similarity index 96%
rename from Trigger/TrigAlgorithms/TrigEFMissingET/TrigEFMissingET/EFMissingETFromCellsMT.h
rename to Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromCellsMT.h
index 92d975b2d6631c7c8efcbc66f0ef4912ea7f05b4..263aa84939ae1e0e2d7f85a7dfbdeb6ad2479f03 100644
--- a/Trigger/TrigAlgorithms/TrigEFMissingET/TrigEFMissingET/EFMissingETFromCellsMT.h
+++ b/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromCellsMT.h
@@ -34,7 +34,8 @@ class EFMissingETFromCellsMT: public extends<AthAlgTool, IMissingETTool> {
   virtual StatusCode  initialize() override;
 
   virtual StatusCode update( xAOD::TrigMissingET *met,
-			     TrigEFMissingEtHelper *metHelper ) const override;
+			     TrigEFMissingEtHelper *metHelper,
+           const EventContext& ctx  ) const override;
 
  private: 
   EFMissingETFromCellsMT();
diff --git a/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromClustersMT.cxx b/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromClustersMT.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..3707413a312ff8fb3d67a0e5e028798a1720897c
--- /dev/null
+++ b/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromClustersMT.cxx
@@ -0,0 +1,179 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+/********************************************************************
+
+NAME:     EFMissingETFromClustersMT.h
+PACKAGE:  Trigger/TrigAlgorithms/TrigEFMissingET
+
+AUTHORS:  Kenji Hamano
+CREATED:  Feb 8, 2019
+
+PURPOSE:  athenaMT migration
+
+ ********************************************************************/
+// Framework includes
+#include "AthenaMonitoring/Monitored.h"
+#include "GaudiKernel/IToolSvc.h"
+
+#include "CxxUtils/sincosf.h"
+
+#include "EventKernel/ISignalState.h"
+#include "EventKernel/SignalStateHelper.h"
+
+// TrigEFMissingET includes
+#include "EFMissingETFromClustersMT.h"
+
+
+#include <cmath>
+#include <string>
+using namespace std;
+
+EFMissingETFromClustersMT::EFMissingETFromClustersMT(const std::string& type,
+    const std::string& name,
+    const IInterface* parent) :
+  base_class(type, name, parent)
+{
+  m_clusterstate = xAOD::CaloCluster_v1::UNCALIBRATED;
+}
+
+
+EFMissingETFromClustersMT::~EFMissingETFromClustersMT()
+{
+}
+
+
+StatusCode EFMissingETFromClustersMT::initialize()
+{
+
+  ATH_MSG_DEBUG( "called EFMissingETFromClustersMT::initialize()" );
+
+  if(m_saveuncalibrated) 
+  {
+    m_metHelperComp = TrigEFMissingEtComponent::TCEM;
+    m_clusterstate = xAOD::CaloCluster_v1::UNCALIBRATED;
+  }
+  else 
+  {
+    m_metHelperComp = TrigEFMissingEtComponent::TCLCW;
+    m_clusterstate = xAOD::CaloCluster_v1::CALIBRATED;
+  }
+
+  CHECK( m_clustersKey.initialize() );
+
+  return StatusCode::SUCCESS;
+}
+
+
+StatusCode EFMissingETFromClustersMT::update(xAOD::TrigMissingET *met ,
+					      TrigEFMissingEtHelper *metHelper, const EventContext& ctx ) const
+{
+  
+  ATH_MSG_DEBUG( "called EFMissingETFromClustersMT::execute()" );
+
+  /* This is a bit opaque but necessary to cooperate with how the MET helper 
+     and MissingETFromHelper classes work. This will be cleaned up (ATR-19488).
+     - @ggallard
+   */
+  const std::vector<std::string> vComp = {"TCLCWB1", "TCLCWB2", 
+                                          "TCLCWE1", "TCLCWE2", 
+                                          "TCEMB1", "TCEMB2", 
+                                          "TCEME1", "TCEME2",
+                                          "Muons" };
+  met->defineComponents(vComp);
+
+  auto totalTimer = Monitored::Timer( "TIME_Total" );
+  auto caloClustersHandle = SG::makeHandle( m_clustersKey, ctx );
+
+  auto loopTimer = Monitored::Timer( "TIME_Loop" );
+
+  TrigEFMissingEtComponent* metComp = nullptr;
+  metComp = metHelper->GetComponent(m_saveuncalibrated?  TrigEFMissingEtComponent::TCEM : TrigEFMissingEtComponent::TCLCW); // fetch Cluster component
+  if (metComp==0) {
+    ATH_MSG_ERROR( "cannot fetch Topo. cluster component!" );
+    return StatusCode::FAILURE;
+  }
+
+  ATH_MSG_DEBUG( "fetched metHelper component \"" << metComp->m_name << "\"" );
+
+  if ( (metComp->m_status & m_maskProcessed)==0 ){ // not yet processed
+    metComp->Reset();  // reset component...
+  } else { // skip if processed
+    return StatusCode::SUCCESS;
+  }
+
+  // set status to Processing
+  metComp->m_status |= m_maskProcessing;
+
+  //--- fetching the topocluster components
+  const std::map<TrigEFMissingEtComponent::Component, std::pair<float, float> > tcComponents = {
+            {m_saveuncalibrated ? TrigEFMissingEtComponent::TCEM   : TrigEFMissingEtComponent::TCLCW  , {  20, -20   }},
+            {m_saveuncalibrated ? TrigEFMissingEtComponent::TCEMB1 : TrigEFMissingEtComponent::TCLCWB1, { 1.5,   0   }},
+            {m_saveuncalibrated ? TrigEFMissingEtComponent::TCEMB2 : TrigEFMissingEtComponent::TCLCWB2, {   0,  -1.5 }},
+            {m_saveuncalibrated ? TrigEFMissingEtComponent::TCEME1 : TrigEFMissingEtComponent::TCLCWE1, {   5,   1.5 }},
+            {m_saveuncalibrated ? TrigEFMissingEtComponent::TCEME2 : TrigEFMissingEtComponent::TCLCWE2, {-1.5,  -5   }}   };
+
+
+  for(auto const& [tcComp, etaLimits] : tcComponents){
+
+    switch(tcComp)
+    {
+      case TrigEFMissingEtComponent::TCEM    :
+      case TrigEFMissingEtComponent::TCEMB1  : case TrigEFMissingEtComponent::TCEMB2  :
+      case TrigEFMissingEtComponent::TCEME1  : case TrigEFMissingEtComponent::TCEME2  :
+      case TrigEFMissingEtComponent::TCLCW   :
+      case TrigEFMissingEtComponent::TCLCWB1 : case TrigEFMissingEtComponent::TCLCWB2 :
+      case TrigEFMissingEtComponent::TCLCWE1 : case TrigEFMissingEtComponent::TCLCWE2 :
+        break;
+
+      default:
+        ATH_MSG_ERROR("You are somehow iterating over this non-tc component: " 
+                        << TrigEFMissingEtComponent::ComponentToName(tcComp) 
+                        << ". This is not okay, because this is supposed to be MET from clusters!");
+        return StatusCode::FAILURE;
+    }
+
+    metComp = metHelper->GetComponent(tcComp); // fetch Cluster component
+
+    if (metComp==0) {  
+      ATH_MSG_ERROR( "Cannot fetch topocluster component " 
+                      << TrigEFMissingEtComponent::ComponentToName(tcComp) << "!" );  
+      return StatusCode::FAILURE; 
+    }
+
+    for (const auto& clus : *caloClustersHandle) 
+    {
+
+      float phi = clus->phi();
+      float eta = clus->eta();
+      float Et  = clus->pt();
+      float cosPhi, sinPhi;
+      sincosf(phi, &sinPhi, &cosPhi);
+      float Ex = Et*cosPhi;
+      float Ey = Et*sinPhi;
+      float Ez = Et*sinhf(eta);
+      float E =  sqrtf(Et*Et + Ez*Ez);
+
+      if (eta < etaLimits.first && eta > etaLimits.second)
+      {
+        metComp->m_ex -= Ex;
+        metComp->m_ey -= Ey;
+        metComp->m_ez -= Ez;
+        metComp->m_sumEt += Et;
+        metComp->m_sumE  += E;
+        metComp->m_usedChannels += 1;
+        metComp->m_sumOfSigns += static_cast<short int>(floor(copysign(1.0,Et)+0.5));
+      }
+
+     } // end for (cluster : topoclusters)
+
+     // move from "processing" to "processed" state
+     metComp->m_status ^= m_maskProcessing; // switch off bit
+     metComp->m_status |= m_maskProcessed;  // switch on bit
+     
+  } // end for (tcComp : tcComponents)
+
+  return StatusCode::SUCCESS;
+
+}
diff --git a/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromClustersMT.h b/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromClustersMT.h
new file mode 100644
index 0000000000000000000000000000000000000000..c0ea240254cb4d000b961a0040a934e7c283ff1d
--- /dev/null
+++ b/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromClustersMT.h
@@ -0,0 +1,70 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef TRIGEFMISSINGET_EFMISSINGETFROMCLUSTERSMT_H
+#define TRIGEFMISSINGET_EFMISSINGETFROMCLUSTERSMT_H
+
+/********************************************************************
+
+NAME:     EFMissingETFromClustersMT.h
+PACKAGE:  Trigger/TrigAlgorithms/TrigEFMissingET
+
+AUTHORS:  Kenji Hamano
+CREATED:  Feb 8, 2019
+
+PURPOSE:  athenaMT migration
+
+ ********************************************************************/
+
+// Framework includes
+#include "AthenaBaseComps/AthAlgTool.h"
+#include "GaudiKernel/ServiceHandle.h"
+
+// TrigEFMissingET included
+#include "xAODCaloEvent/CaloClusterContainer.h"
+#include "TrigMissingEtEvent/TrigMissingET.h"
+#include "TrigEFMissingET/IMissingETTool.h"
+#include "TrigEFMissingET/EFMissingETHelper.h"
+
+/**
+  @class EFMissingETFromClustersMT
+  \brief Updates metHelper object with topoclusters
+  \author Kenji Hamano
+  \author Gabriel Gallardo
+  \date Feb 8, 2019
+ **/
+class EFMissingETFromClustersMT : public extends<AthAlgTool, IMissingETTool>
+{
+  public:
+
+    EFMissingETFromClustersMT(const std::string& type,
+                            const std::string& name,
+                            const IInterface* parent);
+
+    virtual ~EFMissingETFromClustersMT();
+
+    virtual StatusCode initialize() override;
+
+    /**
+    This function does two things:
+    1. It initializes the `met` object so that `EFMissingETFromHelper` knows that it will receive input from MetFromClusters 
+    2. It fills in the topocluster components of the `metHelper` object 
+    It is meant to be called by the `EFMissingETAlgMT` class 
+
+    If `m_saveuncalibrated==true`, then EM calibrated TC are saved, else the LCW calibrated TC are saved.
+    **/
+    virtual StatusCode update(xAOD::TrigMissingET *met,
+                               TrigEFMissingEtHelper *metHelper,
+                               const EventContext& ctx) const override;
+
+  private:
+    Gaudi::Property<bool> m_saveuncalibrated {this, "SaveUncalibrated", false ,"save uncalibrated topo. clusters"};
+    SG::ReadHandleKey<xAOD::CaloClusterContainer> m_clustersKey { this, "ClustersCollection", "CaloClusters", "Collection containg all clusters" };
+
+    xAOD::CaloCluster_v1::State m_clusterstate;
+    TrigEFMissingEtComponent::Component m_metHelperComp;
+
+};
+
+#endif // TRIGEFMISSINGET_EFMISSINGETFROMCLUSTERSMT_H
diff --git a/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromHelper.cxx b/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromHelper.cxx
index 7e7735cdf84e42503615174883ee642895c8679a..7688d7773ee8b7bd59ecffb457a1b80e615eb160 100644
--- a/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromHelper.cxx
+++ b/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromHelper.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 /********************************************************************
@@ -174,7 +174,7 @@ StatusCode EFMissingETFromHelper::execute(xAOD::TrigMissingET *met ,
 
   met->setFlag( metHelper->GetStatus() );
 
-  uint comp = met->getNumberOfComponents(); // final no. of aux. compon.
+  uint nMetComp = met->getNumberOfComponents(); // final no. of aux. compon.
   uint nHelperComp = metHelper->GetElements(); // no. of transient aux. compon.
   if (nHelperComp != static_cast<unsigned char>(TrigEFMissingEtComponent::ComponentSize)) {
     ATH_MSG_WARNING( "Found " << nHelperComp << " aux components in the transient helper class.  Not supported!" );
@@ -187,7 +187,7 @@ StatusCode EFMissingETFromHelper::execute(xAOD::TrigMissingET *met ,
   bool save3comp=false;
   bool save2comp=false;
   bool save1comp=false;
-  switch (comp) {
+  switch (nMetComp) {
     case 25: // default: do nothing
       break;
     case 9:
@@ -209,10 +209,10 @@ StatusCode EFMissingETFromHelper::execute(xAOD::TrigMissingET *met ,
       save1comp=true;
       break;
     default:
-      ATH_MSG_WARNING( "Found " << comp << " aux components in TrigMissingET.  Not supported.  NOT SAVING AUX INFO" );
+      ATH_MSG_WARNING( "Found " << nMetComp << " aux components in TrigMissingET.  Not supported.  NOT SAVING AUX INFO" );
       skipAuxInfo=true;
   }
-      ATH_MSG_DEBUG( "Found " << comp << " aux components in TrigMissingET." );
+      ATH_MSG_DEBUG( "Found " << nMetComp << " aux components in TrigMissingET." );
 
   // Initialize EDM by setting all components to zero
   met->setEx(0.); met->setEy(0.); met->setEz(0.);
@@ -245,10 +245,10 @@ StatusCode EFMissingETFromHelper::execute(xAOD::TrigMissingET *met ,
     if (skipAuxInfo) continue;
 
     // auxiliary info - uncorrected
-    if (comp == unsigned(nHelperComp-17) && helper_i < 24) { 
+    if (nMetComp == unsigned(nHelperComp-17) && helper_i < 24) { 
       ATH_MSG_DEBUG( "finest granularity");
       copier.setMETCompFromHelper(helper_i, helper_i);
-    } else if(comp == unsigned(nHelperComp-17) && helper_i == static_cast<uint>(TrigEFMissingEtComponent::Muons)) { 
+    } else if(nMetComp == unsigned(nHelperComp-17) && helper_i == static_cast<uint>(TrigEFMissingEtComponent::Muons)) { 
       ATH_MSG_DEBUG( "save muons");
       copier.setMETCompFromHelper(helper_i-17, helper_i);
     } else if (save6comp) {
@@ -379,9 +379,7 @@ StatusCode EFMissingETFromHelper::execute(xAOD::TrigMissingET *met ,
     ATH_MSG_DEBUG( message );
   }
 
-  if(msgLvl(MSG::DEBUG)){
-    unsigned int nMetComp = met->getNumberOfComponents();
-
+  if(msgLvl(MSG::DEBUG) && nMetComp > 0){
     s="REGTEST __name____status_usedChannels__sumOfSigns__calib1_calib0";
       s+="/MeV__ex/MeV_____ey/MeV_____ez/MeV___sumE/MeV__sumEt/CLHEP::MeV";
     ATH_MSG_DEBUG( s );
diff --git a/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromJetsMT.cxx b/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromJetsMT.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..496c83bd77106146915e13f40018ed74af04d4e0
--- /dev/null
+++ b/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromJetsMT.cxx
@@ -0,0 +1,185 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+/********************************************************************
+
+NAME:     EFMissingETFromJetsMT.cxx
+PACKAGE:  Trigger/TrigAlgorithms/TrigEFMissingET
+AUTHOR:   Gabriel Gallardo
+CREATED:  Feb 19, 2018
+
+BASED ON: EFMissingETFromJets.cxx
+AUTHORS:  Florian U. Bernlochner, Doug Schaefer, Justin Chiu
+
+PURPOSE:  Updates TrigMissingETHelper using info from jets
+
+ ********************************************************************/
+
+#include "EFMissingETFromJetsMT.h"
+
+#include "TrigTimeAlgs/TrigTimerSvc.h"
+#include "CxxUtils/sincosf.h"
+
+#include "JetEvent/JetCollection.h"
+#include "JetEvent/Jet.h"
+//#include "FourMomUtils/P4DescendingSorters.h"
+#include "xAODJet/JetContainer.h"
+#include "xAODJet/Jet.h"
+#include "CaloGeoHelpers/CaloSampling.h"
+#include "xAODJet/JetAccessorMap.h"
+
+#include "EventKernel/ISignalState.h"
+#include "EventKernel/SignalStateHelper.h"
+
+#include <cmath>
+#include <string>
+using namespace std;
+
+EFMissingETFromJetsMT::EFMissingETFromJetsMT(const std::string& type,
+    const std::string& name,
+    const IInterface* parent) : base_class(type, name, parent)
+{
+  m_etacut = fabs(m_etacut);
+}
+
+
+EFMissingETFromJetsMT::~EFMissingETFromJetsMT()
+{
+}
+
+
+StatusCode EFMissingETFromJetsMT::initialize()
+{
+  ATH_MSG_DEBUG( "called EFMissingETFromJetsMT::initialize()" );
+
+  /// timers
+  if( service( "TrigTimerSvc", m_timersvc).isFailure() )
+    ATH_MSG_WARNING( name() << ": Unable to locate TrigTimer Service" );
+
+  if (m_timersvc) {
+    // global time
+    std::string basename=name()+".TotalTime";
+    m_glob_timer = m_timersvc->addItem(basename);
+  } // if timing service
+
+  CHECK( m_jetsKey.initialize() );
+
+  return StatusCode::SUCCESS;
+}
+
+
+StatusCode EFMissingETFromJetsMT::update( xAOD::TrigMissingET *met,
+             TrigEFMissingEtHelper *metHelper, const EventContext& ctx ) const
+{
+
+  ATH_MSG_DEBUG( "called EFMissingETFromJetsMT::update()" ); // 
+
+  const std::vector<std::string> vComp = {"Jets", "Muon"};
+  met->defineComponents(vComp);
+
+  if(m_timersvc)
+    m_glob_timer->start(); // total time
+  ATH_MSG_DEBUG( "started MET jet CPU timer" );
+
+  TrigEFMissingEtComponent* metComp = metHelper->GetComponent(TrigEFMissingEtComponent::JET); // fetch Jet component
+  if (metComp==0) {  ATH_MSG_ERROR( "Could not fetch jet component!" );  return StatusCode::FAILURE; }
+  else ATH_MSG_DEBUG( "fetched metHelper component \"" << metComp->m_name << "\"" );
+
+  if ( (metComp->m_status & m_maskProcessed)==0 ){ // not yet processed
+    metComp->Reset();  // reset component...
+  } else { // skip if processed
+    return StatusCode::SUCCESS;
+  }
+
+  auto jetsHandle = SG::makeHandle( m_jetsKey, ctx );
+  std::vector<const xAOD::Jet*> MHTJetsVec(jetsHandle->begin(), jetsHandle->end());
+  ATH_MSG_DEBUG( "num of jets: " << MHTJetsVec.size() );
+
+  //--- fetching the jet components
+  const std::map<TrigEFMissingEtComponent::Component, std::pair<float, float > > jetComponents = {
+                                          {TrigEFMissingEtComponent::JET  , {       20, -20       }},
+                                          {TrigEFMissingEtComponent::JETB1, { m_etacut,  0       }},
+                                          {TrigEFMissingEtComponent::JETB2, {        0, -m_etacut}},
+                                          {TrigEFMissingEtComponent::JETE1, {        5,  m_etacut}},
+                                          {TrigEFMissingEtComponent::JETE2, {-m_etacut, -5       }}  };
+
+  for(auto const& [jetComp, etaLimits] : jetComponents) {
+    metComp = metHelper->GetComponent(jetComp); 
+
+    if(!metComp) {
+      ATH_MSG_ERROR("Could not fetch jet component "
+                    << TrigEFMissingEtComponent::ComponentToName(jetComp) << "!");
+      return StatusCode::FAILURE;
+    }
+
+    for (const xAOD::Jet* aJet : MHTJetsVec) {
+      TLorentzVector p4 = aJet->p4();
+      float scale = 1.;
+      p4*=scale;
+
+      /*
+      // TileGap3Correction obsolete? Will remove in future MR if this is the case.
+      // Commented out for the time being because this block of code is not thread-safe and is raising warnings. @ggallard
+
+      if (m_applyTileGap3Correction) {
+        // get the uncalibrated energy and tile gap 3 fractions
+        static const xAOD::JetAttributeAccessor::AccessorWrapper< std::vector<float> >& acc_ePerSample =
+          *xAOD::JetAttributeAccessor::accessor< std::vector<float> >(xAOD::JetAttribute::EnergyPerSampling);
+        static xAOD::JetAttributeAccessor::AccessorWrapper<xAOD::JetFourMom_t> acc_uncalibrated("JetConstitScaleMomentum");
+        const std::vector<float>& eInSampling = acc_ePerSample.getAttribute(*aJet);
+        float e_tileGap3 = eInSampling.at(CaloSampling::TileGap3);
+        scale = 1 - e_tileGap3/acc_uncalibrated.getAttribute(*aJet).E();
+      }
+      */
+
+      switch (jetComp)
+      {
+        case TrigEFMissingEtComponent::JETB1:
+        case TrigEFMissingEtComponent::JETB2:
+          if (p4.Pt() < m_central_ptcut) continue;
+          break;
+
+        case TrigEFMissingEtComponent::JETE1:
+        case TrigEFMissingEtComponent::JETE2:
+          if (p4.Pt() < m_forward_ptcut) continue;
+          break;
+        case TrigEFMissingEtComponent::JET:
+          break;
+        default:
+          ATH_MSG_ERROR("You are somehow iterating over this non-jet component: " 
+                          << TrigEFMissingEtComponent::ComponentToName(jetComp) 
+                          << ". This is not okay, because this is supposed to be MET from jets!");
+          return StatusCode::FAILURE;
+      }
+
+      if (p4.Eta() < etaLimits.first && p4.Eta() > etaLimits.second)
+      {
+        metComp->m_ex           -= p4.Px();
+        metComp->m_ey           -= p4.Py();
+        metComp->m_ez           -= p4.Pz();
+        metComp->m_sumEt        += p4.Pt();
+        metComp->m_sumE         += p4.E();
+        metComp->m_usedChannels += 1;
+        metComp->m_sumOfSigns   += copysign(1.0, p4.Pt() );
+      }
+
+    } // End loop over all jets
+
+    // move from "processing" to "processed" state
+    metComp->m_status ^= m_maskProcessing; // switch off bit
+    metComp->m_status |= m_maskProcessed;  // switch on bit
+
+  }
+
+  // fetch jet component and output MET value
+  metComp = metHelper->GetComponent(TrigEFMissingEtComponent::JET); 
+  ATH_MSG_DEBUG( " calculated MET: " << sqrt((metComp->m_ex)*(metComp->m_ex)+(metComp->m_ey)*(metComp->m_ey)) );
+
+
+  if(m_timersvc)
+    m_glob_timer->stop(); // total time
+
+  return StatusCode::SUCCESS;
+}
+
diff --git a/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromJetsMT.h b/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromJetsMT.h
new file mode 100644
index 0000000000000000000000000000000000000000..1404bdf72e801cf5138a6075fedb3b33ebb31ca4
--- /dev/null
+++ b/Trigger/TrigAlgorithms/TrigEFMissingET/src/EFMissingETFromJetsMT.h
@@ -0,0 +1,72 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef TRIGEFMISSINGET_EFMISSINGETFROMJETSMT_H
+#define TRIGEFMISSINGET_EFMISSINGETFROMJETSMT_H
+
+/********************************************************************
+
+NAME:     EFMissingETFromJetsMT.h
+PACKAGE:  Trigger/TrigAlgorithms/TrigEFMissingET
+AUTHOR:   Gabriel Gallardo
+CREATED:  Feb 19, 2018
+
+BASED ON: EFMissingETFromJets.h
+AUTHORS:  Florian U. Bernlochner, Doug Schaefer, Justin Chiu
+
+
+PURPOSE:  Updates TrigMissingETHelper using info from jets
+
+ ********************************************************************/
+
+#include "AthenaBaseComps/AthAlgTool.h"
+#include "GaudiKernel/ServiceHandle.h"
+#include "xAODJet/JetContainer.h"
+#include "TrigEFMissingET/IMissingETTool.h"
+
+using xAOD::JetContainer;
+
+/**
+  @class EFMissingETFromJetsMT
+  \brief Updates metHelper object with jets
+  \author Gabriel Gallardo
+  \date Feb 19, 2019
+ **/
+
+class EFMissingETFromJetsMT : public extends<AthAlgTool, IMissingETTool> 
+{
+  public:
+
+    EFMissingETFromJetsMT(const std::string& type,
+                        const std::string& name,
+                        const IInterface* parent);
+
+    ~EFMissingETFromJetsMT();
+
+    virtual StatusCode initialize() override;
+
+    /**
+    This function does two things:
+    1. It initializes the `met` object so that `EFMissingETFromHelper` knows that it will receive input from MetFromJets 
+    2. It fills in the jet components of the `metHelper` object 
+    It is meant to be called by the `EFMissingETAlgMT` class 
+    **/
+    virtual StatusCode update( xAOD::TrigMissingET *met,
+             TrigEFMissingEtHelper *metHelper, const EventContext& ctx ) const override;
+
+
+  private:
+    EFMissingETFromJetsMT();
+
+    Gaudi::Property<float> m_etacut                 {this, "EtaSeparation", 2.2 , "Cut to split into forward and central jets -- needs to be positive"};
+    Gaudi::Property<float> m_forward_ptcut          {this, "CentralpTCut", 0.0 , "pT Cut for central jets"};
+    Gaudi::Property<float> m_central_ptcut          {this, "ForwardpTCut", 0.0 ," pT Cut for forward jets"};
+    SG::ReadHandleKey<JetContainer> m_jetsKey       {this, "JetsCollection", "jets", "Collection containing all jets" };
+
+    // TileGap3Correction obsolete? Will remove in future MR if this is the case.
+    // Commented out for the time being because the corresponding code is not thread-safe and is raising warnings. @ggallard
+    // Gaudi::Property<bool> m_applyTileGap3Correction {this, "ApplyTileGap3Correction", false, "ApplyTileGap3Correction"};
+};
+
+#endif // TRIGEFMISSINGET_EFMISSINGETFROMJETSMT_H
diff --git a/Trigger/TrigAlgorithms/TrigEFMissingET/src/components/TrigEFMissingET_entries.cxx b/Trigger/TrigAlgorithms/TrigEFMissingET/src/components/TrigEFMissingET_entries.cxx
index 9e636d5423bf1c84500bce954244ff25671d0aa2..d968a3557117c4ef407c6b04843cf6b1861b312a 100644
--- a/Trigger/TrigAlgorithms/TrigEFMissingET/src/components/TrigEFMissingET_entries.cxx
+++ b/Trigger/TrigAlgorithms/TrigEFMissingET/src/components/TrigEFMissingET_entries.cxx
@@ -13,7 +13,9 @@
 #include "TrigEFMissingET/EFMissingETFlags.h"
 #include "TrigEFMissingET/EFMissingETFromHelper.h"
 #include "TrigEFMissingET/EFMissingETAlgMT.h"
-#include "TrigEFMissingET/EFMissingETFromCellsMT.h"
+#include "../EFMissingETFromCellsMT.h"
+#include "../EFMissingETFromClustersMT.h"
+#include "../EFMissingETFromJetsMT.h"
 
 DECLARE_COMPONENT( EFMissingET )
 DECLARE_COMPONENT( EFMissingETBaseTool )
@@ -31,4 +33,6 @@ DECLARE_COMPONENT( EFMissingETFlags )
 DECLARE_COMPONENT( EFMissingETFromHelper )
 DECLARE_COMPONENT( EFMissingETAlgMT )
 DECLARE_COMPONENT( EFMissingETFromCellsMT )
+DECLARE_COMPONENT( EFMissingETFromClustersMT )
+DECLARE_COMPONENT( EFMissingETFromJetsMT )
 
diff --git a/Trigger/TrigAlgorithms/TrigEFMissingET/test/test_met_fexes.sh b/Trigger/TrigAlgorithms/TrigEFMissingET/test/test_met_fexes.sh
index 33591ac57d95f2c9d490e06990f872746830f226..b18a3586d8c36cca529a84d001f19529410b7fb1 100755
--- a/Trigger/TrigAlgorithms/TrigEFMissingET/test/test_met_fexes.sh
+++ b/Trigger/TrigAlgorithms/TrigEFMissingET/test/test_met_fexes.sh
@@ -2,9 +2,6 @@
 # art-type: build
 # art-ci: master
 
-STARDATE=`date +%g%m%d.%H%M`
-RUN_LOG="run_${STARDATE}.log"
-
 
 ## READ OPTIONS
 OPT_FOLLOW=0
@@ -20,42 +17,70 @@ OPT_INTERACTIVE=0
 while [ ! $# -eq 0 ]
 do
 	case "$1" in
+		# Set '-d' debug flag for athena
 		-d )
 			OPT_DEBUG="-d"
 			;;
-		--debug)
+
+		# Set '--debug' flag for athena, follow with one of ('conf', 'init', 'exec', 'fini')
+		# See `athena --help`
+		--debug) 
 			shift
 			OPT_DEBUG="--debug ${1}"
 			;;
+
+		# Follow the output of the job with `less +F`
 		--follow | -f)
 			OPT_FOLLOW=1
 			;;
+
+		# Maximum number of events to run on
+		# Sets the --evtMax option of athena
 		--evtMax)
 			shift
 			OPT_EVT="$1"
 			;;
+
+		# Number of threads to run on
+		# Set to >1 for multi-threaded
 		--threads)
 			shift
 			OPT_THREADS="$1"
 			;;
+
+		# Path to job option
 		--jobo | -j)
 			shift
 			OPT_JOBO="$1"
 			;;
+
+		# Print the command to be executed, then exit
 		-n)
 			OPT_DRY_RUN=1
 			;;
+
+		# Set --loglevel option of athena
 		-l | --loglevel)
 			shift
 			OPT_LOG_LEVEL="--loglevel $1"
 			;;
+
+		# Interactive athena, equivalent to `athena -i`
 		-i )
 			OPT_INTERACTIVE=1
 			;;
+
+		# Comma separated list of files to run over\
+		# Sets --filesInput option of athena
 		--filesInput )
 			shift
 			OPT_FILES_INPUT=$1
 			;;
+
+		# Clear current directory before execution
+		-o)
+			rm ./*
+			;;
 	esac
 	shift
 done
@@ -80,6 +105,9 @@ elif [ $OPT_DRY_RUN -eq 1 ];then
 	exit
 fi
 
+STARDATE=`date +%g%m%d.%H%M`
+RUN_LOG="${OPT_JOBO##*/}_${STARDATE}.log"
+
 athena $ATH_OPT &> ${RUN_LOG} &
 if [ ${OPT_FOLLOW} -eq 0 ]; then
 	echo "Running in background. Log output to ${RUN_LOG}. "
diff --git a/Trigger/TrigAlgorithms/TrigEFMissingET/test/test_met_fexes_cluster.sh b/Trigger/TrigAlgorithms/TrigEFMissingET/test/test_met_fexes_cluster.sh
new file mode 100755
index 0000000000000000000000000000000000000000..349621d61098a9b1b1622c2549e9846764b14447
--- /dev/null
+++ b/Trigger/TrigAlgorithms/TrigEFMissingET/test/test_met_fexes_cluster.sh
@@ -0,0 +1,89 @@
+#!/bin/sh
+# art-type: build
+# art-ci: master
+
+STARDATE=`date +%g%m%d.%H%M`
+RUN_LOG="run_${STARDATE}.log"
+
+
+## READ OPTIONS
+OPT_FOLLOW=0
+OPT_DEBUG=""
+OPT_EVT=10
+OPT_THREADS=1
+OPT_FILES_INPUT=""/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1""
+OPT_JOBO="TrigEFMissingET/testMETCluster.py"
+OPT_DRY_RUN=0
+OPT_LOG_LEVEL=""
+OPT_INTERACTIVE=0
+
+while [ ! $# -eq 0 ]
+do
+	case "$1" in
+		-d )
+			OPT_DEBUG="-d"
+			;;
+		--debug)
+			shift
+			OPT_DEBUG="--debug ${1}"
+			;;
+		--follow | -f)
+			OPT_FOLLOW=1
+			;;
+		--evtMax)
+			shift
+			OPT_EVT="$1"
+			;;
+		--threads)
+			shift
+			OPT_THREADS="$1"
+			;;
+		--jobo | -j)
+			shift
+			OPT_JOBO="$1"
+			;;
+		-n)
+			OPT_DRY_RUN=1
+			;;
+		-l | --loglevel)
+			shift
+			OPT_LOG_LEVEL="--loglevel $1"
+			;;
+		-i )
+			OPT_INTERACTIVE=1
+			;;
+		--filesInput )
+			shift
+			OPT_FILES_INPUT=$1
+			;;
+	esac
+	shift
+done
+
+
+## BUILD ATHENA COMMAND
+ATH_OPT="--filesInput=${OPT_FILES_INPUT} --threads=${OPT_THREADS} --evtMax=${OPT_EVT}"
+ATH_OPT="${OPT_DEBUG} ${ATH_OPT} ${OPT_LOG_LEVEL}"
+ATH_OPT="${ATH_OPT} ${OPT_JOBO}"
+
+## EXECUTE AND FOLLOW LOG
+echo "Executing..."
+echo "athena ${ATH_OPT}"
+
+if [ "${OPT_DEBUG}" != "" ]; then
+	athena ${ATH_OPT}
+	exit
+elif [ $OPT_INTERACTIVE -eq 1 ]; then
+    athena -i ${ATH_OPT}
+    exit
+elif [ $OPT_DRY_RUN -eq 1 ];then
+	exit
+fi
+
+athena $ATH_OPT &> ${RUN_LOG} &
+if [ ${OPT_FOLLOW} -eq 0 ]; then
+	echo "Running in background. Log output to ${RUN_LOG}. "
+	echo "Execute 'tail -f ${RUN_LOG}' to follow. "
+else
+	less +F "${RUN_LOG}"
+fi
diff --git a/Trigger/TrigAlgorithms/TrigFastTrackFinder/python/TrigFastTrackFinder_Config.py b/Trigger/TrigAlgorithms/TrigFastTrackFinder/python/TrigFastTrackFinder_Config.py
index 43d2c0ea0dfd3d44edaf8eb16b75f653592d656d..a566e806402b1b13fbf527e1da05c509481265bf 100755
--- a/Trigger/TrigAlgorithms/TrigFastTrackFinder/python/TrigFastTrackFinder_Config.py
+++ b/Trigger/TrigAlgorithms/TrigFastTrackFinder/python/TrigFastTrackFinder_Config.py
@@ -609,6 +609,10 @@ class TrigFastTrackFinder_Muon(TrigFastTrackFinderBase):
   def __init__(self, name = "TrigFastTrackFinder_Muon"):
     TrigFastTrackFinderBase.__init__(self, "TrigFastTrackFinder_Muon","Muon")
 
+class TrigFastTrackFinder_MuonFS(TrigFastTrackFinderBase):
+  def __init__(self, name = "TrigFastTrackFinder_MuonFS"):
+    TrigFastTrackFinderBase.__init__(self, "TrigFastTrackFinder_MuonFS","Muon")
+
 class TrigFastTrackFinder_eGamma(TrigFastTrackFinderBase):
   def __init__(self, name = "TrigFastTrackFinder_eGamma"):
     TrigFastTrackFinderBase.__init__(self, "TrigFastTrackFinder_eGamma","eGamma")
diff --git a/Trigger/TrigAlgorithms/TrigMuonEF/python/TrigMuonEFCosmicConfig.py b/Trigger/TrigAlgorithms/TrigMuonEF/python/TrigMuonEFCosmicConfig.py
index 9c65c810255d59357822022946e9eacd9fd0c27e..68bb62e4e41cc7dc4b59aa5b0c6bf27069c08726 100755
--- a/Trigger/TrigAlgorithms/TrigMuonEF/python/TrigMuonEFCosmicConfig.py
+++ b/Trigger/TrigAlgorithms/TrigMuonEF/python/TrigMuonEFCosmicConfig.py
@@ -70,8 +70,7 @@ TMEF_MdtDriftCircleOnTrackCreatorAdjustableT0Cosmic = Muon__MdtDriftCircleOnTrac
                                                                                          TimingMode = 3,
                                                                                          DoFixedError = True,
                                                                                          FixedError = 2.0,
-                                                                                         DoTofCorrection = True,
-                                                                                         MuonTofTool = TMEF_AdjustableT0Tool,
+                                                                                         DoTofCorrection = True
                                                                                          )
 ToolSvc += TMEF_MdtDriftCircleOnTrackCreatorAdjustableT0Cosmic
 
@@ -122,7 +121,6 @@ TMEF_DCMathSegmentMakerCosmic = Muon__DCMathSegmentMaker("TMEF_DCMathSegmentMake
 if doT0Fit:
     if muonRecFlags.doSegmentT0Fit():
         TMEF_DCMathSegmentMakerCosmic.MdtCreator = TMEF_MdtDriftCircleOnTrackCreatorAdjustableT0Cosmic
-        TMEF_DCMathSegmentMakerCosmic.TofTool = TMEF_AdjustableT0Tool
         
 ToolSvc += TMEF_DCMathSegmentMakerCosmic
 
diff --git a/Trigger/TrigHypothesis/TrigMissingETHypo/python/TrigMissingETHypoConfigMT.py b/Trigger/TrigHypothesis/TrigMissingETHypo/python/TrigMissingETHypoConfigMT.py
index e3221afc9d6e0156bdde492b9112221b2418a5fb..dbb68c7b95b1fe1eb5d9fb2fa88f3c4fa5065ca5 100644
--- a/Trigger/TrigHypothesis/TrigMissingETHypo/python/TrigMissingETHypoConfigMT.py
+++ b/Trigger/TrigHypothesis/TrigMissingETHypo/python/TrigMissingETHypoConfigMT.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 
 from TrigMissingETHypo.TrigMissingETHypoConf import TrigMissingETHypoAlgMT, TrigMissingETHypoToolMT
 
@@ -80,7 +80,7 @@ def TrigMETPufitHypoToolFromName(name, conf):
 def TrigMETPufitHypoToolFromName(name, conf):
     return MissingETHypoToolMT(name, alg='pufit')
 
-def TrigMETMhtHypoToolFromName(name, conf):
+def TrigMETJetHypoToolFromName(name, conf):
     return MissingETHypoToolMT(name, alg='mht')
 
 
diff --git a/Trigger/TrigHypothesis/TrigMuonHypoMT/src/TrigMuonEFCombinerHypoAlg.cxx b/Trigger/TrigHypothesis/TrigMuonHypoMT/src/TrigMuonEFCombinerHypoAlg.cxx
index be33078a44f834b44c49da8b4f49d8f23c8a9dac..728ac895cc6891638baa9dc3adc17caa91fd3458 100755
--- a/Trigger/TrigHypothesis/TrigMuonHypoMT/src/TrigMuonEFCombinerHypoAlg.cxx
+++ b/Trigger/TrigHypothesis/TrigMuonHypoMT/src/TrigMuonEFCombinerHypoAlg.cxx
@@ -95,28 +95,29 @@ StatusCode TrigMuonEFCombinerHypoAlg::execute( const EventContext& context ) con
     // It is posisble that no muons are found, in this case we go to the next decision
     if(muonHandle->size()==0) continue;
 
-    // this code only gets muon 0. The EF algorithms can potentially make more than 1 muon, so may need to revisit this
-    auto muonEL = ViewHelper::makeLink( *viewEL, muonHandle, 0 );
-    ATH_CHECK( muonEL.isValid() );
+    //loop over muons (more than one muon can be found by EF algos)
+    for(uint i=0; i<muonHandle->size(); i++){
+      auto muonEL = ViewHelper::makeLink( *viewEL, muonHandle, i );
+      ATH_CHECK( muonEL.isValid() );
 
-    const xAOD::Muon* muon = *muonEL;
-
-    // create new decisions
-    auto newd = newDecisionIn( decisions );
-
-    // pussh_back to toolInput
-    toolInput.emplace_back( newd, roi, muon, previousDecision );
-
-    newd -> setObjectLink( "feature", muonEL );
-    newd -> setObjectLink( "roi",     roiEL  );
-    newd -> setObjectLink( "view",    viewEL );
-    TrigCompositeUtils::linkToPrevious( newd, previousDecision );
-
-    ATH_MSG_DEBUG("REGTEST: " << m_muonKey.key() << " pT = " << (*muonEL)->pt() << " GeV");
-    ATH_MSG_DEBUG("REGTEST: " << m_muonKey.key() << " eta/phi = " << (*muonEL)->eta() << "/" << (*muonEL)->phi());
-    ATH_MSG_DEBUG("REGTEST:  RoI  = eta/phi = " << (*roiEL)->eta() << "/" << (*roiEL)->phi());
-    ATH_MSG_DEBUG("Added view, roi, feature, previous decision to new decision "<<counter <<" for view "<<(*viewEL)->name()  );
+      const xAOD::Muon* muon = *muonEL;
 
+      // create new decisions
+      auto newd = newDecisionIn( decisions );
+      
+      // pussh_back to toolInput
+      toolInput.emplace_back( newd, roi, muon, previousDecision );
+
+      newd -> setObjectLink( "feature", muonEL );
+      newd -> setObjectLink( "roi",     roiEL  );
+      newd -> setObjectLink( "view",    viewEL );
+      TrigCompositeUtils::linkToPrevious( newd, previousDecision );
+
+      ATH_MSG_DEBUG("REGTEST: " << m_muonKey.key() << " pT = " << (*muonEL)->pt() << " GeV");
+      ATH_MSG_DEBUG("REGTEST: " << m_muonKey.key() << " eta/phi = " << (*muonEL)->eta() << "/" << (*muonEL)->phi());
+      ATH_MSG_DEBUG("REGTEST:  RoI  = eta/phi = " << (*roiEL)->eta() << "/" << (*roiEL)->phi());
+      ATH_MSG_DEBUG("Added view, roi, feature, previous decision to new decision "<<counter <<" for view "<<(*viewEL)->name()  );
+    }
     counter++;
   }
 
diff --git a/Trigger/TrigHypothesis/TrigMuonHypoMT/src/TrigMuonEFMSonlyHypoAlg.cxx b/Trigger/TrigHypothesis/TrigMuonHypoMT/src/TrigMuonEFMSonlyHypoAlg.cxx
index e91f559945aa6c79683b76631d26dfcff65ee58d..18362c4cf6ca097e8a82caf8fa704bc83c8630e0 100755
--- a/Trigger/TrigHypothesis/TrigMuonHypoMT/src/TrigMuonEFMSonlyHypoAlg.cxx
+++ b/Trigger/TrigHypothesis/TrigMuonHypoMT/src/TrigMuonEFMSonlyHypoAlg.cxx
@@ -73,7 +73,6 @@ StatusCode TrigMuonEFMSonlyHypoAlg::execute( const EventContext& context ) const
   
   std::vector<TrigMuonEFMSonlyHypoTool::MuonEFInfo> toolInput;
   size_t counter = 0;  // view counter
-
   // loop over previous decisions
   for (const auto previousDecision: *previousDecisionsHandle ) {
      // get RoIs
@@ -95,29 +94,30 @@ StatusCode TrigMuonEFMSonlyHypoAlg::execute( const EventContext& context ) const
     // It is posisble that no muons are found, in this case we go to the next decision
     if(muonHandle->size()==0) continue;
 
-    // this code only gets muon 0. The EF algorithms can potentially make more than 1 muon, so may need to revisit this
-    auto muonEL = ViewHelper::makeLink( *viewEL, muonHandle, 0 );
-    ATH_CHECK( muonEL.isValid() );
-
-    const xAOD::Muon* muon = *muonEL;
+    //loop over muons (more than one muon can be found by EF algos)
+    for(uint i=0; i<muonHandle->size(); i++){
+      auto muonEL = ViewHelper::makeLink( *viewEL, muonHandle, i );
+      ATH_CHECK( muonEL.isValid() );
 
-    // create new decisions
-    auto newd = newDecisionIn( decisions );
+      const xAOD::Muon* muon = *muonEL;
 
-    // pussh_back to toolInput
-    toolInput.emplace_back( newd, roi, muon, previousDecision );
+      // create new decisions
+      auto newd = newDecisionIn( decisions );
 
-    newd -> setObjectLink( "feature", muonEL );
-    newd -> setObjectLink( "roi",     roiEL  );
-    newd -> setObjectLink( "view",    viewEL );
-    TrigCompositeUtils::linkToPrevious( newd, previousDecision );
+      // pussh_back to toolInput
+      toolInput.emplace_back( newd, roi, muon, previousDecision );
+      newd -> setObjectLink( "feature", muonEL );
+      newd -> setObjectLink( "roi",     roiEL  );
+      newd -> setObjectLink( "view",    viewEL );
+      TrigCompositeUtils::linkToPrevious( newd, previousDecision );
 
-    ATH_MSG_DEBUG("REGTEST: " << m_muonKey.key() << " pT = " << (*muonEL)->pt() << " GeV");
-    ATH_MSG_DEBUG("REGTEST: " << m_muonKey.key() << " eta/phi = " << (*muonEL)->eta() << "/" << (*muonEL)->phi());
-    ATH_MSG_DEBUG("REGTEST:  RoI  = eta/phi = " << (*roiEL)->eta() << "/" << (*roiEL)->phi());
-    ATH_MSG_DEBUG("Added view, roi, feature, previous decision to new decision "<<counter <<" for view "<<(*viewEL)->name()  );
-
-    counter++;
+      ATH_MSG_DEBUG("REGTEST: " << m_muonKey.key() << " pT = " << (*muonEL)->pt() << " GeV");
+      ATH_MSG_DEBUG("REGTEST: " << m_muonKey.key() << " eta/phi = " << (*muonEL)->eta() << "/" << (*muonEL)->phi());
+      ATH_MSG_DEBUG("REGTEST:  RoI  = eta/phi = " << (*roiEL)->eta() << "/" << (*roiEL)->phi());
+      ATH_MSG_DEBUG("Added view, roi, feature, previous decision to new decision "<<counter <<" for view "<<(*viewEL)->name()  );
+    }
+      counter++;
+    
   }
 
   ATH_MSG_DEBUG("Found "<<toolInput.size()<<" inputs to tools");
diff --git a/Trigger/TrigSteer/TrigOutputHandling/python/TrigOutputHandlingConfig.py b/Trigger/TrigSteer/TrigOutputHandling/python/TrigOutputHandlingConfig.py
index 0a83eec373e6a8ec5edb797d000cfbccaee51c6e..3ca1d2507476f8e648b79508554449a2c2a99b35 100644
--- a/Trigger/TrigSteer/TrigOutputHandling/python/TrigOutputHandlingConfig.py
+++ b/Trigger/TrigSteer/TrigOutputHandling/python/TrigOutputHandlingConfig.py
@@ -1,10 +1,10 @@
 # Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 
-def HLTResultMTMakerCfg():
+def HLTResultMTMakerCfg(name="HLTResultMTMaker"):
    from TrigOutputHandlingConf import HLTResultMTMaker
    from AthenaMonitoring.GenericMonitoringTool import GenericMonitoringTool, defineHistogram
 
-   m = HLTResultMTMaker()
+   m = HLTResultMTMaker(name)
 
    # ROBs/SubDets which are enabled but not necessarily part of the ROS-ROB map
    from libpyeformat_helper import SourceIdentifier,SubDetector
@@ -42,6 +42,8 @@ def HLTResultMTMakerCfg():
                                              xbins=10, xmin=0, xmax=10 ),
                             defineHistogram( 'sizeMain', path='EXPERT', type='TH1F', title='Main (physics) HLT Result size;4B words',
                                              xbins=100, xmin=-1, xmax=999 ) ] # 1000 k span
+   
+   
    return m
 
 def TriggerEDMSerialiserToolCfg(name):
@@ -85,4 +87,11 @@ def TriggerEDMSerialiserToolCfg(name):
          return self.__repr__()
 
    serialiser.CollectionsToSerialize = OD()
+
+   from TrigSerializeTP.TrigSerializeTPConf import TrigSerTPTool
+   from TrigEDMConfig.TriggerEDMRun3 import tpMap
+   tpTool = TrigSerTPTool()
+   tpTool.TPMap = tpMap()
+   serialiser.TPTool = tpTool
+
    return serialiser
diff --git a/Trigger/TrigSteer/ViewAlgs/CMakeLists.txt b/Trigger/TrigSteer/ViewAlgs/CMakeLists.txt
index 3651dbe8c139adf9b2c063302231a2aa2163f23f..a2a1bdf65a4dc741a4cbe284352dd1506a352687 100644
--- a/Trigger/TrigSteer/ViewAlgs/CMakeLists.txt
+++ b/Trigger/TrigSteer/ViewAlgs/CMakeLists.txt
@@ -14,6 +14,7 @@ atlas_depends_on_subdirs( PUBLIC
                           Event/xAOD/xAODTrigCalo
                           Event/xAOD/xAODTrigEgamma
 			  Event/xAOD/xAODJet
+			  Event/xAOD/xAODMuon
                           PRIVATE
                           Control/AthViews
                           Control/StoreGate
@@ -27,7 +28,7 @@ atlas_depends_on_subdirs( PUBLIC
 atlas_add_library( ViewAlgsLib
                    src/*.cxx
                    PUBLIC_HEADERS ViewAlgs
-                   LINK_LIBRARIES xAODTrigger GaudiKernel AthViews xAODTrigCalo xAODTrigEgamma xAODJet
+                   LINK_LIBRARIES xAODTrigger GaudiKernel AthViews xAODTrigCalo xAODTrigEgamma xAODJet xAODMuon
                    PRIVATE_LINK_LIBRARIES AthenaBaseComps CxxUtils TrigConfHLTData TrigSteeringEvent DecisionHandlingLib )
 
 atlas_add_component( ViewAlgs
diff --git a/Trigger/TrigSteer/ViewAlgs/src/EventViewCreatorAlgorithmWithMuons.cxx b/Trigger/TrigSteer/ViewAlgs/src/EventViewCreatorAlgorithmWithMuons.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..8591294cc270f77e188d0763a68c81aa10d30b46
--- /dev/null
+++ b/Trigger/TrigSteer/ViewAlgs/src/EventViewCreatorAlgorithmWithMuons.cxx
@@ -0,0 +1,125 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+///
+/// General-purpose view creation algorithm <bwynne@cern.ch>
+///
+
+#include "EventViewCreatorAlgorithmWithMuons.h"
+#include "AthLinks/ElementLink.h"
+#include "AthViews/ViewHelper.h"
+#include "AthViews/View.h"
+#include "DecisionHandling/TrigCompositeUtils.h"
+#include "DecisionHandling/HLTIdentifier.h"
+
+using namespace TrigCompositeUtils;
+
+EventViewCreatorAlgorithmWithMuons::EventViewCreatorAlgorithmWithMuons( const std::string& name, ISvcLocator* pSvcLocator )
+  : EventViewCreatorAlgorithm( name, pSvcLocator ) {
+
+  declareProperty("RoIEtaWidth", m_roiEtaWidth=0.1);
+  declareProperty("RoIPhiWidth", m_roiPhiWidth=0.1);
+}
+
+EventViewCreatorAlgorithmWithMuons::~EventViewCreatorAlgorithmWithMuons() {}
+
+StatusCode EventViewCreatorAlgorithmWithMuons::initialize() {
+  EventViewCreatorAlgorithm::initialize();
+
+  ATH_CHECK( m_inViewMuons.initialize() );
+
+  return StatusCode::SUCCESS;
+}
+
+StatusCode EventViewCreatorAlgorithmWithMuons::execute( const EventContext& context ) const {
+  // create the output decisions, similar to inputs (copy basic links)
+  std::vector< SG::WriteHandle<TrigCompositeUtils::DecisionContainer> > outputHandles;
+  ATH_CHECK (decisionInputToOutput(context, outputHandles));
+
+  // make the views
+  auto viewsHandle = SG::makeHandle( m_viewsKey ); 
+  auto viewVector1 = std::make_unique< ViewContainer >();
+  ATH_CHECK( viewsHandle.record(  std::move( viewVector1 ) ) );
+  auto viewVector = viewsHandle.ptr();
+
+  auto contexts = std::vector<EventContext>( );
+  unsigned int viewCounter = 0;
+  unsigned int conditionsRun = context.getExtension<Atlas::ExtendedEventContext>().conditionsRun();
+
+  //map all RoIs that are stored
+  std::vector <ElementLink<TrigRoiDescriptorCollection> > RoIsFromDecision;
+
+
+  for (auto outputHandle: outputHandles) {
+    if( not outputHandle.isValid() ) {
+      ATH_MSG_DEBUG( "Got no decisions from output "<< outputHandle.key() << " because handle not valid");
+      continue;
+    }
+    if( outputHandle->size() == 0){ // input filtered out
+      ATH_MSG_ERROR( "Got no decisions from output "<< outputHandle.key()<<": handle is valid but container is empty. Is this expected?");
+      return StatusCode::FAILURE;
+    }
+
+    ATH_MSG_DEBUG( "Got output "<< outputHandle.key()<<" with " << outputHandle->size() << " elements" );
+    // loop over output decisions in container of outputHandle, follow link to inputDecision
+    for ( auto outputDecision : *outputHandle){ 
+      ElementLinkVector<DecisionContainer> inputLinks = getLinkToPrevious(outputDecision);
+      // loop over input links as predecessors
+      for (auto input: inputLinks){
+        const Decision* inputDecision = *input;
+        // Retrieve muons ...
+        ATH_MSG_DEBUG( "Checking there are muons linked to decision object" );
+        TrigCompositeUtils::LinkInfo< xAOD::MuonContainer > muonELInfo = TrigCompositeUtils::findLink< xAOD::MuonContainer >( inputDecision,m_muonsLink );
+        ATH_CHECK( muonELInfo.isValid() );
+        const xAOD::Muon *muon = *muonELInfo.link;
+        ATH_MSG_DEBUG( "Placing xAOD::MuonContainer " );
+        ATH_MSG_DEBUG( "   -- pt="<< muon->p4().Et() <<" eta="<< muon->eta() << " muon="<< muon->phi() );
+
+        
+        // create the RoI around muon
+	auto roi = new TrigRoiDescriptor(muon->eta(), muon->eta()-m_roiEtaWidth, muon->eta()+m_roiEtaWidth, muon->phi(), muon->phi()-m_roiPhiWidth, muon->phi()+m_roiPhiWidth);
+	ATH_MSG_DEBUG("Created roi around muon: "<<*roi);          
+	// make the view
+	ATH_MSG_DEBUG( "Making the View "<<name()<<"_view" );
+	auto newView = ViewHelper::makeView( name()+"_view", viewCounter++, m_viewFallThrough ); //pointer to the view
+	viewVector->push_back( newView );
+	contexts.emplace_back( context );
+	contexts.back().setExtension( Atlas::ExtendedEventContext( viewVector->back(), conditionsRun, roi ) );
+          
+	// link decision to this view
+	outputDecision->setObjectLink( "view", ElementLink< ViewContainer >(m_viewsKey.key(), viewVector->size()-1 ));//adding view to TC
+	outputDecision->setObjectLink( "muons", muonELInfo.link );
+	ATH_MSG_DEBUG( "Adding new view to new decision; storing view in viewVector component " << viewVector->size()-1 );
+	ATH_CHECK( linkViewToParent( inputDecision, viewVector->back() ) );
+	ATH_CHECK( placeRoIInView( roi, viewVector->back(), contexts.back() ) );
+	ATH_CHECK( placeMuonInView( muon, viewVector->back(), contexts.back() ) );
+      }// loop over previous inputs
+    } // loop over decisions   
+  }// loop over output keys
+
+  ATH_MSG_DEBUG( "Launching execution in " << viewVector->size() << " views" );
+  ATH_CHECK( ViewHelper::ScheduleViews( viewVector,           // Vector containing views
+					m_viewNodeName,             // CF node to attach views to
+					context,                    // Source context
+					m_scheduler.get() ) );
+  
+
+  ATH_CHECK( debugPrintOut(context, outputHandles) );
+  return StatusCode::SUCCESS;
+}
+
+StatusCode EventViewCreatorAlgorithmWithMuons::placeMuonInView( const xAOD::Muon* theObject, SG::View* view, const EventContext& context ) const {
+  // fill the Muon output collection  
+  ATH_MSG_DEBUG( "Adding Muon To View : " << m_inViewMuons.key() );
+  auto oneObjectCollection = std::make_unique< ConstDataVector< xAOD::MuonContainer > >();
+  oneObjectCollection->clear( SG::VIEW_ELEMENTS ); 
+  oneObjectCollection->push_back( theObject );
+
+  //store in the view 
+  auto handle = SG::makeHandle( m_inViewMuons,context );
+  ATH_CHECK( handle.setProxyDict( view ) );
+  ATH_CHECK( handle.record( std::move( oneObjectCollection ) ) ); 
+  return StatusCode::SUCCESS;
+}
+
diff --git a/Trigger/TrigSteer/ViewAlgs/src/EventViewCreatorAlgorithmWithMuons.h b/Trigger/TrigSteer/ViewAlgs/src/EventViewCreatorAlgorithmWithMuons.h
new file mode 100644
index 0000000000000000000000000000000000000000..effe7701ce29b5821b9ccdf05254a6fafec66568
--- /dev/null
+++ b/Trigger/TrigSteer/ViewAlgs/src/EventViewCreatorAlgorithmWithMuons.h
@@ -0,0 +1,42 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef ViewAlgs_EventViewCreatorAlgorithmWithMuons_h
+#define ViewAlgs_EventViewCreatorAlgorithmWithMuons_h
+
+#include "EventViewCreatorAlgorithm.h"
+
+#include "xAODMuon/MuonContainer.h"
+#include "xAODMuon/MuonAuxContainer.h"
+
+ /**
+   * @class EventViewCreatorAlgorithmWithMuons
+   * @brief Used at the start of a sequence to create the EventViews: retrieves filtered collection via menu decision from previous step and writes it out directly so it can be used as input by the reco alg that follows in sequence.
+   **/
+
+class EventViewCreatorAlgorithmWithMuons : public EventViewCreatorAlgorithm {
+ public:
+    EventViewCreatorAlgorithmWithMuons( const std::string& name, ISvcLocator* pSvcLocator );
+    virtual ~EventViewCreatorAlgorithmWithMuons();
+
+    virtual StatusCode initialize() override;
+    virtual StatusCode execute(const EventContext&) const override;
+
+ private:
+
+    StatusCode placeMuonInView( const xAOD::Muon* theObject,
+			       SG::View* view,
+			       const EventContext& context ) const;
+
+    EventViewCreatorAlgorithmWithMuons();
+
+    SG::WriteHandleKey< ConstDataVector<xAOD::MuonContainer> > m_inViewMuons {this,"InViewMuons","Unspecified","Name with which the Muons should be inserted into the views"};
+
+    Gaudi::Property< std::string > m_muonsLink {this,"MuonsLink","Unspecified","Name of EL to Muon object linked to the decision"};
+    double m_roiEtaWidth;
+    double m_roiPhiWidth;
+};
+
+#endif
+
diff --git a/Trigger/TrigSteer/ViewAlgs/src/components/ViewAlgs_entries.cxx b/Trigger/TrigSteer/ViewAlgs/src/components/ViewAlgs_entries.cxx
index ba298d3a4cb8a2697bcc8ea1f1bac654968dd0e9..b2d16b8ea8b72f0654c3cd6687b0f02eb8ce4868 100644
--- a/Trigger/TrigSteer/ViewAlgs/src/components/ViewAlgs_entries.cxx
+++ b/Trigger/TrigSteer/ViewAlgs/src/components/ViewAlgs_entries.cxx
@@ -2,11 +2,13 @@
 
 #include "../EventViewCreatorAlgorithm.h"
 #include "../EventViewCreatorAlgorithmWithJets.h"
+#include "../EventViewCreatorAlgorithmWithMuons.h"
 #include "../MergeViews.h"
 
 
 
 DECLARE_COMPONENT( EventViewCreatorAlgorithm )
 DECLARE_COMPONENT( EventViewCreatorAlgorithmWithJets )
+DECLARE_COMPONENT( EventViewCreatorAlgorithmWithMuons )
 DECLARE_COMPONENT( MergeViews )
 
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/CMakeLists.txt b/Trigger/TrigValidation/TrigUpgradeTest/CMakeLists.txt
index 27a0c889194d815d2973eccea04ee4c3d0da632a..adbdb1df64c019e56c193d2f8f34851e8d4b7415 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/CMakeLists.txt
+++ b/Trigger/TrigValidation/TrigUpgradeTest/CMakeLists.txt
@@ -6,35 +6,26 @@
 atlas_subdir( TrigUpgradeTest )
 
 # Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          TestPolicy
-                          AtlasPolicy
+atlas_depends_on_subdirs( PRIVATE
                           GaudiKernel
-                          PRIVATE
                           Control/AthenaBaseComps
                           Trigger/TrigSteer/DecisionHandling
                           Trigger/TrigEvent/TrigSteeringEvent
-                          Control/AthViews
                           )
 
-find_package( Boost COMPONENTS filesystem thread system )
-find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
-
-atlas_add_library( TrigUpgradeTestLib
-                   src/*.cxx
-                   PUBLIC_HEADERS TrigUpgradeTest
-                   INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS}
-                   LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES}
-                   GaudiKernel AthenaBaseComps TrigSteeringEvent DecisionHandlingLib )
-
 atlas_add_component( TrigUpgradeTest
+                     src/*.cxx
                      src/components/*.cxx
-                     INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${Boost_LIBRARIES}
-                     ${ROOT_LIBRARIES} GaudiKernel
-                     AthenaBaseComps TrigUpgradeTestLib AthViews )
+                     LINK_LIBRARIES AthenaBaseComps TrigSteeringEvent DecisionHandlingLib
+                     )
 
+# Install files from the package:
+atlas_install_joboptions( share/*.py )
+atlas_install_data( share/*.ref share/*.conf )
+atlas_install_python_modules( python/*.py )
+atlas_install_scripts( test/exec*.sh test/test*.sh )
 
+# Unit tests:
 atlas_add_test( ViewSchedule1 SCRIPT test/test_view_schedule.sh
                 ENVIRONMENT THREADS=1 )
 atlas_add_test( ViewSchedule2 SCRIPT test/test_view_schedule.sh
@@ -42,10 +33,6 @@ atlas_add_test( ViewSchedule2 SCRIPT test/test_view_schedule.sh
 atlas_add_test( ViewSchedule64 SCRIPT test/test_view_schedule.sh
                 ENVIRONMENT THREADS=64 )
 
-# out until we find a way to properly invoke tests from other packages
-# atlas_add_test( creatingEVTest SCRIPT forward.sh ViewAlgsTest/test/creatingEVTest.sh )
-
-
 atlas_add_test( merge
    SCRIPT test/test_merge.sh
    PROPERTIES TIMEOUT 1000
@@ -172,6 +159,14 @@ atlas_add_test( EmuStepProcessing
    PROPERTIES WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/unitTestRun_emu_step_processing
    )
 
+file( MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/unitTestRun_emu_newjo )
+atlas_add_test( EmuNewJO
+    SCRIPT test_emu_newjo.sh
+    EXTRA_PATTERNS "-s TrigSignatureMo.*INFO HLT_.*"
+    PROPERTIES TIMEOUT 1000
+    PROPERTIES WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/unitTestRun_emu_newjo
+    )
+
 file( MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/unitTestRun_NewJO )
 atlas_add_test( NewJO
    SCRIPT test/test_newJO_build.sh
@@ -228,12 +223,28 @@ atlas_add_test( bJetMenuALLTE
    )
 
 
-file( MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/unitTestRun_met_standalone )
-atlas_add_test( met_standalone
-    SCRIPT test/test_met_standalone.sh
+file( MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/unitTestRun_met_fromCells )
+atlas_add_test( met_fromCells
+    SCRIPT test/test_met_fromCells.sh
     PROPERTIES TIMEOUT 1000
    	EXTRA_PATTERNS "-s METHypoAlg.*MET.*value" 	   
-    PROPERTIES WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/unitTestRun_met_standalone
+    PROPERTIES WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/unitTestRun_met_fromCells
+    )
+
+file( MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/unitTestRun_met_fromClusters )
+atlas_add_test( met_fromClusters
+    SCRIPT test/test_met_fromClusters.sh
+    PROPERTIES TIMEOUT 1000
+   	EXTRA_PATTERNS "-s METHypoAlg.*MET.*value" 	   
+    PROPERTIES WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/unitTestRun_met_fromClusters
+    )
+
+file( MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/unitTestRun_met_fromJets )
+atlas_add_test( met_fromJets
+    SCRIPT test/test_met_fromJets.sh
+    PROPERTIES TIMEOUT 1000
+    EXTRA_PATTERNS "-s METHypoAlg.*MET.*value"     
+    PROPERTIES WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/unitTestRun_met_fromJets
     )
 
 file( MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/unitTestRun_met_menu )
@@ -243,8 +254,3 @@ atlas_add_test( met_menu
    	EXTRA_PATTERNS "-s TrigSignatureMoniMT.*HLT_.*" 	   
     PROPERTIES WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/unitTestRun_met_menu 
     )
-
-atlas_install_joboptions( share/*.py )
-atlas_install_data( share/*.ref share/*.conf )
-atlas_install_python_modules( python/*.py )
-atlas_install_scripts( test/exec*.sh test/test*.sh )
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/python/EmuStepProcessingConfig.py b/Trigger/TrigValidation/TrigUpgradeTest/python/EmuStepProcessingConfig.py
new file mode 100644
index 0000000000000000000000000000000000000000..9c8fda770ba2f9cd87baeedef8f047e5f1e649f0
--- /dev/null
+++ b/Trigger/TrigValidation/TrigUpgradeTest/python/EmuStepProcessingConfig.py
@@ -0,0 +1,191 @@
+# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+
+# Configure the scheduler
+from AthenaCommon.AlgScheduler import AlgScheduler
+from AthenaCommon.Constants import DEBUG, VERBOSE
+from AthenaCommon.CFElements import parOR
+from AthenaCommon.Logging import logging
+from L1Decoder.L1DecoderConf import CTPUnpackingEmulationTool, RoIsUnpackingEmulationTool, L1Decoder
+
+log = logging.getLogger('EmuStepProcessingConfig')
+log.setLevel(VERBOSE)
+
+
+def generateL1DecoderAndChains():
+    AlgScheduler.ShowControlFlow( True )
+    AlgScheduler.ShowDataFlow( True )
+
+    # add chain names in Menu/MenuChains.py
+
+    # 4 events
+
+    data = {'noreco': [';', ';', ';',';']}  # in the lists there are the events
+
+    data['emclusters'] = [ ';',
+                        'eta:1,phi:1,et:180000; eta:1,phi:-1.2,et:35000;',
+                        'eta:0.5,phi:0,et:120000; eta:1,phi:-1.2,et:65000;',
+                        'eta:-0.6,phi:1.7,et:9000;']
+
+    data['msmu']  = [';',
+                     ';',
+                     'eta:-1.2,phi:0.7,pt:6500,pt2:8500; eta:-1.1,phi:0.6,pt:8500,pt2:8500;',
+                     'eta:-1.7,phi:-0.2,pt:9500,pt2:8500;']
+
+    #data['ctp'] = [ 'HLT_e20 HLT_e5_e8 HLT_e5 HLT_e8 HLT_e5v22 HLT_g5',
+    data['ctp'] = [ 'HLT_e20 HLT_e5_e8 HLT_e5 HLT_e8 HLT_g5',
+                    'HLT_e20 HLT_e5_e8 HLT_e5 HLT_e8 HLT_g5 HLT_e5_v3',
+                    'HLT_mu8 HLT_mu8_1step HLT_e20 HLT_e8 HLT_mu8_e8 HLT_e3_e5',
+                    'HLT_mu20 HLT_mu8 HLT_mu8_1step HLT_2mu8 HLT_e8' ]
+
+
+    data['l1emroi'] = [ ';',
+                        '1,1,0,EM3,EM7,EM15,EM20,EM50,EM100,2EM3; 1,-1.2,0,EM3,EM7,2EM3',
+                        '-0.6,0.2,0,EM3,EM7,EM15,EM20,EM50,EM100; 1,-1.1,0,EM3,EM7,EM15,EM20,EM50',
+                        '-0.6,1.5,0,EM3,EM7,EM7']
+
+    data['l1muroi'] = [';',
+                       '0,0,0,MU0;',
+                       '-1,0.5,0,MU6,MU8; -1,0.5,0,MU6,MU8,MU10',
+                       '-1.5,-0.1,0,MU6,MU8']
+
+    data['tracks'] = ['eta:1,phi:1,pt:120000; eta:1,phi:-1.2,et:32000;',
+                      'eta:1,phi:1,pt:120000; eta:1,phi:-1.2,et:32000;',
+                      'eta:0.5,phi:0,pt:130000; eta:1,phi:-1.2,pt:60000;eta:-1.2,phi:0.7,pt:6700; eta:-1.1,phi:0.6,pt:8600;',
+                      'eta:-0.6,phi:1.7,et:9000;'] # no MU track for MS candidate 'eta:-1.7,phi:-0.2,pt:9500;'
+
+    data['mucomb'] = [';',
+                      ';',
+                      'eta:-1.2,phi:0.7,pt:6600; eta:-1.1,phi:0.6,pt:8600;',
+                      ';']
+
+    data['electrons'] = [';',
+                         'eta:1,phi:1,pt:120000; eta:1,phi:-1.2,et:32000;',
+                         ';',
+                         ';']
+    data['photons'] = [';',
+                       'eta:1,phi:1,pt:130000;',
+                       ';',
+                       ';']
+
+
+
+    from TrigUpgradeTest.TestUtils import writeEmulationFiles
+    writeEmulationFiles(data)
+
+    from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import MenuSequence, Chain, ChainStep
+
+
+    doMuon=True
+    doElectron=True
+    doCombo=True
+
+    HLTChains = []
+    EnabledElChains = []
+    EnabledMuChains = []
+    EnabledMuComboChains = []
+    EnabledElComboChains = []
+
+
+    # muon chains
+    if doMuon:
+        from TrigUpgradeTest.HLTSignatureConfig import muStep1MenuSequence, muStep2MenuSequence
+        muStep1 = muStep1MenuSequence("v1")
+        muStep2 = muStep2MenuSequence("v1")
+
+
+        MuChains  = [
+            Chain(name='HLT_mu20', Seed="L1_MU10",      ChainSteps=[ChainStep("Step1_mu", [muStep1]) , ChainStep("Step2_mu", [muStep2] )]) ,
+            Chain(name='HLT_mu8_1step', Seed="L1_MU6",   ChainSteps=[ChainStep("Step1_mu", [muStep1]) ]) ,
+            Chain(name='HLT_mu8',  Seed="L1_MU6",       ChainSteps=[ChainStep("Step1_mu", [muStep1]) , ChainStep("Step2_mu",  [muStep2] ) ] )
+            ]
+
+        HLTChains += MuChains
+        EnabledMuChains= [c.seed.strip().split("_")[1] +" : "+ c.name for c in MuChains]
+
+
+
+
+    ## #electron chains
+    if doElectron:
+        from TrigUpgradeTest.HLTSignatureConfig import elStep1MenuSequence, elStep2MenuSequence, gammStep1MenuSequence
+        # electron
+        elStep1 = elStep1MenuSequence("v1")
+        elStep2 = elStep2MenuSequence("v1","v1")
+        elStep2v2 = elStep2MenuSequence("v2","v2")
+        elStep2v3 = elStep2MenuSequence("v2","v3")
+        # gamma
+        gammStep1 = gammStep1MenuSequence("v1")
+
+        ElChains  = [
+            Chain(name='HLT_e5'   , Seed="L1_EM7", ChainSteps=[ ChainStep("Step1_em",  [elStep1]), ChainStep("Step2_em",  [elStep2]) ] ),
+            Chain(name='HLT_e5_v2', Seed="L1_EM7", ChainSteps=[ ChainStep("Step1_em",  [elStep1]), ChainStep("Step2v2_em",  [elStep2v2]) ] ),
+            Chain(name='HLT_e5_v3', Seed="L1_EM7", ChainSteps=[ ChainStep("Step1_em",  [elStep1]), ChainStep("Step2v3_em",  [elStep2v3]) ] ),
+            Chain(name='HLT_e8'   , Seed="L1_EM7", ChainSteps=[ ChainStep("Step1_em",  [elStep1]), ChainStep("Step2_em",  [elStep2]) ] ),
+            Chain(name='HLT_g5'   , Seed="L1_EM7", ChainSteps=[ ChainStep("Step1_gam", [gammStep1]) ] )
+            ]
+
+        HLTChains += ElChains
+        EnabledElChains= [c.seed.strip().split("_")[1] +" : "+ c.name for c in ElChains]
+
+
+    # combined chain
+    if doCombo:
+        from TrigUpgradeTest.HLTSignatureConfig import elStep1MenuSequence, muStep1MenuSequence, elStep2MenuSequence, muStep2MenuSequence
+        elStep1 = elStep1MenuSequence("v1")
+        muStep1 = muStep1MenuSequence("v1")
+        elStep2 = elStep2MenuSequence("v1","v1")
+        muStep2 = muStep2MenuSequence("v1")
+
+
+        CombChains =[
+            Chain(name='HLT_mu8_e8',  Seed="L1_MU6_EM7", ChainSteps=[ ChainStep("Step1_mu_em",  [muStep1, elStep1]), ChainStep("Step2_mu_em",  [muStep2, elStep2])] ),
+            Chain(name='HLT_e5_e8',   Seed="L1_2EM3",    ChainSteps=[ ChainStep("Step1_2em",[elStep1, elStep1]) ])
+            ]
+
+        HLTChains += CombChains
+        for c in CombChains:
+            seeds=c.seed.split("_")
+            seeds.pop(0) #remove first L1 string
+            for s in seeds:
+                if "MU" in s: EnabledMuComboChains.append(s +" : "+ c.name)
+                if "EM" in s: EnabledElComboChains.append(s +" : "+ c.name)
+
+        log.debug("enabled Combo chains: %s, %s", EnabledMuComboChains, EnabledElComboChains)
+
+
+    # this is a temporary hack to include new test chains
+    EnabledChainNamesToCTP = dict([ (c.name, c.seed)  for c in HLTChains])
+
+    ########################## L1 #################################################
+
+    L1UnpackingSeq = parOR("L1UnpackingSeq")
+
+    l1Decoder = L1Decoder( OutputLevel=DEBUG, RoIBResult="" )
+    l1Decoder.prescaler.EventInfo=""
+    l1Decoder.ChainToCTPMapping = EnabledChainNamesToCTP
+    l1Decoder.L1DecoderSummaryKey = "L1DecoderSummary"
+
+    ctpUnpacker = CTPUnpackingEmulationTool( OutputLevel =  DEBUG, ForceEnableAllChains=False , InputFilename="ctp.dat" )
+    l1Decoder.ctpUnpacker = ctpUnpacker
+
+    emUnpacker = RoIsUnpackingEmulationTool("EMRoIsUnpackingTool", OutputLevel=DEBUG, InputFilename="l1emroi.dat", OutputTrigRoIs="L1EMRoIs", Decisions="L1EM" )
+    emUnpacker.ThresholdToChainMapping = EnabledElChains + EnabledElComboChains
+    emUnpacker.Decisions="L1EM"
+    log.debug("EMRoIsUnpackingTool enables chians:")
+    log.debug(emUnpacker.ThresholdToChainMapping)
+
+    muUnpacker = RoIsUnpackingEmulationTool("MURoIsUnpackingTool", OutputLevel=DEBUG, InputFilename="l1muroi.dat",  OutputTrigRoIs="L1MURoIs", Decisions="L1MU" )
+    muUnpacker.ThresholdToChainMapping = EnabledMuChains + EnabledMuComboChains
+    muUnpacker.Decisions="L1MU"
+    log.debug("MURoIsUnpackingTool enables chians:")
+    log.debug(muUnpacker.ThresholdToChainMapping)
+
+    l1Decoder.roiUnpackers = [emUnpacker, muUnpacker]
+
+    #print l1Decoder
+    L1UnpackingSeq += l1Decoder
+    log.debug(L1UnpackingSeq)
+
+    ########################## L1 #################################################
+
+    return l1Decoder, HLTChains
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/python/MuonSetup.py b/Trigger/TrigValidation/TrigUpgradeTest/python/MuonSetup.py
index f5fe90f92c31b0ca256d30fb3c2df91eaf126065..2bc203e171d3c1825a206ebcb4c2a21b98f07d5d 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/python/MuonSetup.py
+++ b/Trigger/TrigValidation/TrigUpgradeTest/python/MuonSetup.py
@@ -564,7 +564,7 @@ def muEFSARecoSequence( RoIs, name, OutputLevel=INFO ):
 
 
 
-def muEFCBRecoSequence( RoIs, OutputLevel=INFO ):
+def muEFCBRecoSequence( RoIs, name, OutputLevel=INFO ):
 
   from MuonRecExample.MuonRecFlags import muonRecFlags
   from AthenaCommon.DetFlags import DetFlags
@@ -578,10 +578,34 @@ def muEFCBRecoSequence( RoIs, OutputLevel=INFO ):
   from AthenaCommon.CFElements import parOR, seqAND, seqOR, stepSeq
 
   efAlgs = [] 
-  muEFCBRecoSequence = parOR("efcbViewNode")
+  muEFCBRecoSequence = parOR("efcbViewNode_"+name)
   #Need ID tracking related objects and MS tracks from previous steps
   ViewVerifyTrk = CfgMgr.AthViews__ViewDataVerifier("muonCBViewDataVerifier")
-  ViewVerifyTrk.DataObjects = [( 'xAOD::TrackParticleContainer' , 'StoreGateSvc+xAODTracks' ),( 'SCT_FlaggedCondData' , 'StoreGateSvc+SCT_FlaggedCondData' ), ( 'InDetBSErrContainer' , 'StoreGateSvc+SCT_ByteStreamErrs' ), ( 'xAOD::EventInfo' , 'StoreGateSvc+EventInfo' ),( 'xAOD::IParticleContainer' , 'StoreGateSvc+xAODTracks' ),( 'SCT_ByteStreamFractionContainer' , 'StoreGateSvc+SCT_ByteStreamFrac' ),( 'Muon::CscStripPrepDataContainer' , 'StoreGateSvc+CSC_Measurements' ),  ( 'Muon::MdtPrepDataContainer' , 'StoreGateSvc+MDT_DriftCircles' ),  ( 'xAOD::TrackParticleContainer' , 'StoreGateSvc+MuonSpectrometerTrackParticles' ) ]
+  ViewVerifyTrk.DataObjects = [( 'Muon::CscStripPrepDataContainer' , 'StoreGateSvc+CSC_Measurements' ),  ( 'Muon::MdtPrepDataContainer' , 'StoreGateSvc+MDT_DriftCircles' ),  ( 'xAOD::TrackParticleContainer' , 'StoreGateSvc+MuonSpectrometerTrackParticles' ) ]
+  eventAlgs=[]
+  if "FS" in name:
+    #Need to run tracking for full scan chains
+    from TriggerMenuMT.HLTMenuConfig.CommonSequences.InDetSetup import makeInDetAlgs
+    (viewAlgs, eventAlgs) = makeInDetAlgs("MuonFS")
+
+    from TrigFastTrackFinder.TrigFastTrackFinder_Config import TrigFastTrackFinder_MuonFS
+    theFTF_Muon = TrigFastTrackFinder_MuonFS()
+    theFTF_Muon.OutputLevel = OutputLevel
+    theFTF_Muon.isRoI_Seeded = True
+    viewAlgs.append(theFTF_Muon)
+
+     #TrackParticlesName = ""
+    for viewAlg in viewAlgs:
+      muEFCBRecoSequence += viewAlg
+      viewAlg.OutputLevel = OutputLevel
+      if viewAlg.properties().has_key("RoIs"):
+        viewAlg.RoIs = RoIs
+      if viewAlg.properties().has_key("roiCollectionName"):
+        viewAlg.roiCollectionName = RoIs
+      if viewAlg.name() == "InDetTrigTrackParticleCreatorAlg":
+        TrackParticlesName = viewAlg.TrackParticlesName
+  else:
+    ViewVerifyTrk.DataObjects += [( 'xAOD::TrackParticleContainer' , 'StoreGateSvc+xAODTracks' ),( 'SCT_FlaggedCondData' , 'StoreGateSvc+SCT_FlaggedCondData' ), ( 'InDetBSErrContainer' , 'StoreGateSvc+SCT_ByteStreamErrs' ), ( 'xAOD::EventInfo' , 'StoreGateSvc+EventInfo' ),( 'xAOD::IParticleContainer' , 'StoreGateSvc+xAODTracks' ),( 'SCT_ByteStreamFractionContainer' , 'StoreGateSvc+SCT_ByteStreamFrac' ) ]
   muEFCBRecoSequence += ViewVerifyTrk
 
 
@@ -594,7 +618,10 @@ def muEFCBRecoSequence( RoIs, OutputLevel=INFO ):
   #When run in a different view than FTF some data dependencies needs to be loaded through verifier
   #Pass verifier as an argument and it will automatically append necessary DataObjects
   #@NOTE: Don't provide any verifier if loaded in the same view as FTF
-  PTTracks, PTTrackParticles, PTAlgs = makeInDetPrecisionTracking( "muons",  ViewVerifyTrk ) 
+  if 'FS' in name:  
+    PTTracks, PTTrackParticles, PTAlgs = makeInDetPrecisionTracking( "muonsFS" ) 
+  else:
+    PTTracks, PTTrackParticles, PTAlgs = makeInDetPrecisionTracking( "muons",  ViewVerifyTrk ) 
 
   #Get last tracks from the list as input for other alg
 
@@ -609,46 +636,46 @@ def muEFCBRecoSequence( RoIs, OutputLevel=INFO ):
   trackParticles = PTTrackParticles[-1] 
 
   #Make InDetCandidates
-  theIndetCandidateAlg = CfgMgr.MuonCombinedInDetCandidateAlg("TrigMuonCombinedInDetCandidateAlg",TrackSelector=getPublicTool("MuonCombinedInDetDetailedTrackSelectorTool"),TrackParticleLocation = [ trackParticles ],ForwardParticleLocation=trackParticles,OutputLevel=DEBUG)
+  theIndetCandidateAlg = CfgMgr.MuonCombinedInDetCandidateAlg("TrigMuonCombinedInDetCandidateAlg_"+name,TrackSelector=getPublicTool("MuonCombinedInDetDetailedTrackSelectorTool"),TrackParticleLocation = [trackParticles],ForwardParticleLocation=trackParticles,OutputLevel=DEBUG)
 
   #MuonCombinedCandidates
-  theCaloMeasTool = getPublicToolClone("TrigCaloMeasTool", "MuidCaloEnergyMeas", CaloNoiseTool="", UseCaloNoiseTool=False,CellContainerLocation="")
-  theCaloEnergyTool = getPublicToolClone("TrigCaloEnergyTool", "MuidCaloEnergyTool", CaloMeasTool = theCaloMeasTool, EnergyLossMeasurement=False, MopParametrization=True, TrackIsolation=False)
+  theCaloMeasTool = getPublicToolClone("TrigCaloMeasTool_"+name, "MuidCaloEnergyMeas", CaloNoiseTool="", UseCaloNoiseTool=False,CellContainerLocation="")
+  theCaloEnergyTool = getPublicToolClone("TrigCaloEnergyTool_"+name, "MuidCaloEnergyTool", CaloMeasTool = theCaloMeasTool, EnergyLossMeasurement=False, MopParametrization=True, TrackIsolation=False)
 
   from TrkExRungeKuttaIntersector.TrkExRungeKuttaIntersectorConf import Trk__IntersectorWrapper as Propagator
   TrigMuonPropagator = Propagator(name = 'TrigMuonPropagator')
   ToolSvc += TrigMuonPropagator
 
-  theCaloTSOS = getPublicToolClone("TrigCaloTrackStateOnSurface", "MuidCaloTrackStateOnSurface", CaloEnergyDeposit=theCaloEnergyTool, CaloEnergyParam=theCaloEnergyTool, Propagator =TrigMuonPropagator, MinRemainingEnergy= 200, ParamPtCut= 3000)
+  theCaloTSOS = getPublicToolClone("TrigCaloTrackStateOnSurface_"+name, "MuidCaloTrackStateOnSurface", CaloEnergyDeposit=theCaloEnergyTool, CaloEnergyParam=theCaloEnergyTool, Propagator =TrigMuonPropagator, MinRemainingEnergy= 200, ParamPtCut= 3000)
   from MuidCaloScatteringTools.MuidCaloScatteringToolsConf import Rec__MuidMaterialEffectsOnTrackProvider
   Rec__MuidMaterialEffectsOnTrackProvider.TSOSTool=theCaloTSOS
 
-  theErrorOptimiser = getPublicToolClone("TrigMuonErrorOptimiser", "MuonErrorOptimisationTool", PrepareForFit=False, RecreateStartingParameters=False,RefitTool=getPublicToolClone("TrigMuidRefitTool", "MuonRefitTool", AlignmentErrors = False, Fitter = CfgGetter.getPublicTool("iPatFitter")))
+  theErrorOptimiser = getPublicToolClone("TrigMuonErrorOptimiser_"+name, "MuonErrorOptimisationTool", PrepareForFit=False, RecreateStartingParameters=False,RefitTool=getPublicToolClone("TrigMuidRefitTool_"+name, "MuonRefitTool", AlignmentErrors = False, Fitter = CfgGetter.getPublicTool("iPatFitter")))
 
-  theTrackCleaner = getPublicToolClone("TrigMuonTrackCleaner", "MuonTrackCleaner", Fitter='TMEF_iPatFitter', SLFitter='TMEF_iPatFitter')
+  theTrackCleaner = getPublicToolClone("TrigMuonTrackCleaner_"+name, "MuonTrackCleaner", Fitter='TMEF_iPatFitter', SLFitter='TMEF_iPatFitter')
 
 
-  theTrackBuilderTool = getPublicToolClone("TrigCombinedMuonTrackBuilder","CombinedMuonTrackBuilder", UseCaloTG = True, CaloTSOS=theCaloTSOS, CaloMaterialProvider='TMEF_TrkMaterialProviderTool', MuonHoleRecovery="",OutputLevel=DEBUG,CaloEnergyParam=theCaloEnergyTool,MuonErrorOptimizer=theErrorOptimiser, Fitter='TMEF_iPatFitter', MaterialAllocator="TMEF_MaterialAllocator", Propagator=TrigMuonPropagator, LargeMomentumError=0.5, PerigeeAtSpectrometerEntrance=True, ReallocateMaterial=False, TrackSummaryTool=getPublicTool("CombinedMuonTrackSummary"), Cleaner=theTrackCleaner)
-  theTrackQuery = getPublicToolClone("TrigMuonTrackQuery", "MuonTrackQuery", Fitter=theTrackBuilderTool)
+  theTrackBuilderTool = getPublicToolClone("TrigCombinedMuonTrackBuilder_"+name,"CombinedMuonTrackBuilder", UseCaloTG = True, CaloTSOS=theCaloTSOS, CaloMaterialProvider='TMEF_TrkMaterialProviderTool', MuonHoleRecovery="",OutputLevel=DEBUG,CaloEnergyParam=theCaloEnergyTool,MuonErrorOptimizer=theErrorOptimiser, Fitter='TMEF_iPatFitter', MaterialAllocator="TMEF_MaterialAllocator", Propagator=TrigMuonPropagator, LargeMomentumError=0.5, PerigeeAtSpectrometerEntrance=True, ReallocateMaterial=False, TrackSummaryTool=getPublicTool("CombinedMuonTrackSummary"), Cleaner=theTrackCleaner)
+  theTrackQuery = getPublicToolClone("TrigMuonTrackQuery_"+name, "MuonTrackQuery", Fitter=theTrackBuilderTool)
 
-  theCandidateToolCB = getPublicToolClone("TrigMuonCandidateTool_CB", "MuonCandidateTool", TrackBuilder=theTrackBuilderTool,OutputLevel=DEBUG)
-  theMuonCombinedCandidateAlg = CfgMgr.MuonCombinedMuonCandidateAlg("TrigMuonCombinedMuonCandidateAlg",MuonCandidateTool=theCandidateToolCB,MuonCandidateLocation="CombinedMuonCandidates", OutputLevel=DEBUG)
+  theCandidateToolCB = getPublicToolClone("TrigMuonCandidateTool_CB_"+name, "MuonCandidateTool", TrackBuilder=theTrackBuilderTool,OutputLevel=DEBUG)
+  theMuonCombinedCandidateAlg = CfgMgr.MuonCombinedMuonCandidateAlg("TrigMuonCombinedMuonCandidateAlg_"+name,MuonCandidateTool=theCandidateToolCB,MuonCandidateLocation="CombinedMuonCandidates", OutputLevel=DEBUG)
 
   #MS ID combination
-  theMuonCombinedFitTagTool = getPublicToolClone("TrigMuonCombinedFitTagTool", "MuonCombinedFitTagTool",TrackBuilder=theTrackBuilderTool,MuonRecovery=getPublicToolClone("TrigMuonRecovery","MuidMuonRecovery", TrackBuilder=theTrackBuilderTool),OutputLevel=DEBUG, TrackQuery=theTrackQuery, MatchQuality = getPublicToolClone("TrigMuonMatchQuality", "MuonMatchQuality", TrackQuery=theTrackQuery))
+  theMuonCombinedFitTagTool = getPublicToolClone("TrigMuonCombinedFitTagTool_"+name, "MuonCombinedFitTagTool",TrackBuilder=theTrackBuilderTool,MuonRecovery=getPublicToolClone("TrigMuonRecovery_"+name,"MuidMuonRecovery", TrackBuilder=theTrackBuilderTool),OutputLevel=DEBUG, TrackQuery=theTrackQuery, MatchQuality = getPublicToolClone("TrigMuonMatchQuality_"+name, "MuonMatchQuality", TrackQuery=theTrackQuery))
   tools=[]
   tools.append(theMuonCombinedFitTagTool)
-  theMuonCombinedTool = getPublicToolClone("TrigMuonCombinedToolCB", "MuonCombinedTool", MuonCombinedTagTools=tools, OutputLevel=DEBUG)
-  theMuonCombinedAlg = CfgMgr.MuonCombinedAlg("TrigMuonCombinedAlg", MuonCandidateLocation="CombinedMuonCandidates", MuonCombinedTool=theMuonCombinedTool, CombinedTagMaps=["muidcoTagMap"], OutputLevel=DEBUG)
+  theMuonCombinedTool = getPublicToolClone("TrigMuonCombinedToolCB_"+name, "MuonCombinedTool", MuonCombinedTagTools=tools, OutputLevel=DEBUG)
+  theMuonCombinedAlg = CfgMgr.MuonCombinedAlg("TrigMuonCombinedAlg_"+name, MuonCandidateLocation="CombinedMuonCandidates", MuonCombinedTool=theMuonCombinedTool, CombinedTagMaps=["muidcoTagMap"], OutputLevel=DEBUG)
 
   #Build muon candidates
-  theCandidateToolCB = getPublicToolClone("MuonCandidateTool_CB", "MuonCandidateTool", TrackBuilder=theTrackBuilderTool)
-  theMuonCandidateAlgCB=CfgMgr.MuonCombinedMuonCandidateAlg("MuonCandidateAlgCB",MuonCandidateTool=theCandidateToolCB,MuonCandidateLocation="MuonCandidates", MSOnlyExtrapolatedTrackLocation="MSOnlyMuonTracksForCB")
+  theCandidateToolCB = getPublicToolClone("MuonCandidateTool_CB_"+name, "MuonCandidateTool", TrackBuilder=theTrackBuilderTool)
+  theMuonCandidateAlgCB=CfgMgr.MuonCombinedMuonCandidateAlg("MuonCandidateAlgCB_"+name,MuonCandidateTool=theCandidateToolCB,MuonCandidateLocation="MuonCandidates", MSOnlyExtrapolatedTrackLocation="MSOnlyMuonTracksForCB")
 
   #Create xAOD Muons
-  thecreatortoolCB= getPublicToolClone("MuonCreatorTool_triggerCB", "MuonCreatorTool", ScatteringAngleTool="", CaloMaterialProvider='TMEF_TrkMaterialProviderTool', MuonSelectionTool="", FillTimingInformation=False, OutputLevel=DEBUG, DoCaloNoiseCut=False, UseCaloCells=False)
+  thecreatortoolCB= getPublicToolClone("MuonCreatorTool_triggerCB_"+name, "MuonCreatorTool", ScatteringAngleTool="", CaloMaterialProvider='TMEF_TrkMaterialProviderTool', MuonSelectionTool="", FillTimingInformation=False, OutputLevel=DEBUG, DoCaloNoiseCut=False, UseCaloCells=False)
 
-  themuoncbcreatoralg = CfgMgr.MuonCreatorAlg("MuonCreatorAlgCB", OutputLevel=DEBUG, MuonCandidateLocation="CombinedMuonCandidates")
+  themuoncbcreatoralg = CfgMgr.MuonCreatorAlg("MuonCreatorAlgCB_"+name, OutputLevel=DEBUG, MuonCandidateLocation="CombinedMuonCandidates")
   themuoncbcreatoralg.MuonCreatorTool=thecreatortoolCB
   themuoncbcreatoralg.MakeClusters=False
   themuoncbcreatoralg.ClusterContainerName=""
@@ -672,6 +699,6 @@ def muEFCBRecoSequence( RoIs, OutputLevel=INFO ):
   sequenceOut = themuoncbcreatoralg.MuonContainerLocation
 
   
-  return muEFCBRecoSequence, sequenceOut
+  return muEFCBRecoSequence, eventAlgs, sequenceOut
 
 
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/python/metDefs.py b/Trigger/TrigValidation/TrigUpgradeTest/python/metDefs.py
index bb89d3c3b13beb24ea895eff0a7b8cbc81764f09..4ea7c2e23854f2181ca2c3614eeb71d17340d7ab 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/python/metDefs.py
+++ b/Trigger/TrigValidation/TrigUpgradeTest/python/metDefs.py
@@ -23,7 +23,7 @@ def metCellAthSequence(ConfigFlags):
     InputMakerAlg= clusterFSInputMaker()
     (recoSequence, sequenceOut) = metCellRecoSequence()
 
-    MetAthSequence =  seqAND("MetAthSequence",[InputMakerAlg, recoSequence ])
+    MetAthSequence =  seqAND("MetCellAthSequence",[InputMakerAlg, recoSequence ])
     return (MetAthSequence, InputMakerAlg, sequenceOut)
 
     
@@ -79,3 +79,126 @@ def metCellRecoSequence():
     seqOut = metAlg.METContainerKey
     return (metCellRecoSequence, seqOut)
 
+
+def metClusterAthSequence(ConfigFlags):
+    from TrigT2CaloCommon.CaloDef import clusterFSInputMaker
+    InputMakerAlg= clusterFSInputMaker()
+    (recoSequence, sequenceOut) = metClusterRecoSequence()
+
+    MetClusterAthSequence =  seqAND("MetClusterAthSequence",[InputMakerAlg, recoSequence ])
+    return (MetClusterAthSequence, InputMakerAlg, sequenceOut)
+
+    
+def metClusterRecoSequence():
+
+    from TrigT2CaloCommon.CaloDef import HLTFSTopoRecoSequence
+    (metClusterRecoSequence, ClustersName) = HLTFSTopoRecoSequence()
+
+
+    #################################################
+    # Add EFMissingETAlg and associated tools
+    #################################################
+    from TrigEFMissingET.TrigEFMissingETConf import EFMissingETAlgMT, EFMissingETFromClustersMT, EFMissingETFromHelper
+    metAlg = EFMissingETAlgMT( name="EFMET" )
+    metAlg.OutputLevel=WARNING
+    helperTool = EFMissingETFromHelper("theHelperTool") 
+    metAlg.HelperTool= helperTool 
+    metAlg.METContainerKey = "HLT_MET"
+    
+        #///////////////////////////////////////////
+        # Setup monitoring for EFMissingETAlg
+        #///////////////////////////////////////////
+    metMon = GenericMonitoringTool("METMonTool")
+    metMon.Histograms = [ defineHistogram( "TIME_Total", path='EXPERT', title="Time spent Alg", xbins=100, xmin=0, xmax=100 ),
+                          defineHistogram( "TIME_Loop", path='EXPERT', title="Time spent in Tools loop", xbins=100, xmin=0, xmax=100 )]
+    from TrigEFMissingET.TrigEFMissingETMonitoring import ( hEx_log, hEy_log, hEz_log, hMET_log, hSumEt_log,
+                                                            hMET_lin, hSumEt_lin,
+                                                            hXS, hMETPhi, hMETStatus,
+                                                            hCompEx, hCompEy, hCompEz, hCompEt, hCompSumEt, hCompSumE,
+                                                            hCompEt_lin, hCompSumEt_lin )
+
+    metMon.Histograms  = [ hEx_log, hEy_log, hEz_log, hMET_log, hSumEt_log ]
+    metMon.Histograms += [ hMET_lin, hSumEt_lin ]
+    metMon.Histograms += [ hXS, hMETPhi, hMETStatus]
+    metMon.Histograms += [ hCompEx, hCompEy, hCompEz, hCompEt, hCompSumEt, hCompSumE ]
+    metMon.Histograms += [ hCompEt_lin, hCompSumEt_lin ]
+    metAlg.MonTool = metMon
+
+        #///////////////////////////////////////////
+        # Add EFMissingETFromClusters tool
+        #///////////////////////////////////////////
+    from TrigEFMissingET.TrigEFMissingETConf import EFMissingETFromClustersMT
+    clusterTool = EFMissingETFromClustersMT( name="METFromClustersTool" )
+
+    ### WARNING: this setting does not work for the scheduler: the variable is set, but the scheduler retrieves the default one
+    clusterTool.ClustersCollection = ClustersName
+
+    
+    metAlg.METTools.append(clusterTool)
+
+    metClusterRecoSequence += metAlg
+
+    seqOut = metAlg.METContainerKey
+    return (metClusterRecoSequence, seqOut)
+
+def metJetAthSequence(ConfigFlags):
+    from TrigT2CaloCommon.CaloDef import clusterFSInputMaker
+    InputMakerAlg= clusterFSInputMaker()
+    (recoSequence, sequenceOut) = metJetRecoSequence()
+
+    MetAthSequence =  seqAND("MetJetAthSequence",[InputMakerAlg, recoSequence ])
+    return (MetAthSequence, InputMakerAlg, sequenceOut)
+
+
+def metJetRecoSequence(RoIs = 'FSJetRoI'):
+
+    from TrigUpgradeTest.jetDefs import jetRecoSequence
+    (recoSequence, JetsName) = jetRecoSequence(RoIs)
+
+
+    #################################################
+    # Add EFMissingETAlg and associated tools
+    #################################################
+    from TrigEFMissingET.TrigEFMissingETConf import EFMissingETAlgMT, EFMissingETFromHelper
+    metAlg = EFMissingETAlgMT( name="EFMET" )
+    metAlg.OutputLevel=WARNING
+    helperTool = EFMissingETFromHelper("theHelperTool") 
+    metAlg.HelperTool= helperTool 
+    metAlg.METContainerKey = "HLT_MET_mht"
+    
+        #///////////////////////////////////////////
+        # Setup monitoring for EFMissingETAlg
+        #///////////////////////////////////////////
+    metMon = GenericMonitoringTool("METMonTool")
+    metMon.Histograms = [ defineHistogram( "TIME_Total", path='EXPERT', title="Time spent Alg", xbins=100, xmin=0, xmax=100 ),
+                          defineHistogram( "TIME_Loop", path='EXPERT', title="Time spent in Tools loop", xbins=100, xmin=0, xmax=100 )]
+    from TrigEFMissingET.TrigEFMissingETMonitoring import ( hEx_log, hEy_log, hEz_log, hMET_log, hSumEt_log,
+                                                            hMET_lin, hSumEt_lin,
+                                                            hXS, hMETPhi, hMETStatus,
+                                                            hCompEx, hCompEy, hCompEz, hCompEt, hCompSumEt, hCompSumE,
+                                                            hCompEt_lin, hCompSumEt_lin )
+
+    metMon.Histograms  = [ hEx_log, hEy_log, hEz_log, hMET_log, hSumEt_log ]
+    metMon.Histograms += [ hMET_lin, hSumEt_lin ]
+    metMon.Histograms += [ hXS, hMETPhi, hMETStatus]
+    metMon.Histograms += [ hCompEx, hCompEy, hCompEz, hCompEt, hCompSumEt, hCompSumE ]
+    metMon.Histograms += [ hCompEt_lin, hCompSumEt_lin ]
+    metAlg.MonTool = metMon
+
+        #///////////////////////////////////////////
+        # Add EFMissingETFromCells tool
+        #///////////////////////////////////////////
+    from TrigEFMissingET.TrigEFMissingETConf import EFMissingETFromJetsMT
+    mhtTool = EFMissingETFromJetsMT( name="METFromJetsTool" )
+
+    ### This warning was copied from metCellRecoSequence(). Does this apply here? - @ggallard
+    ### WARNING: this setting does not work for the scheduler: the variable is set, but the scheduler retrieves the default one
+    mhtTool.JetsCollection=JetsName
+    
+    metAlg.METTools.append(mhtTool)
+
+    recoSequence += metAlg
+
+    seqOut = metAlg.METContainerKey
+    return (recoSequence, seqOut)
+
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/python/metMenuDefs.py b/Trigger/TrigValidation/TrigUpgradeTest/python/metMenuDefs.py
index 0c57a73be3fae3fc354a1420efb7ff79ab7175e6..22a8dccca615f686dd3692f5a663cb2162a2b3a3 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/python/metMenuDefs.py
+++ b/Trigger/TrigValidation/TrigUpgradeTest/python/metMenuDefs.py
@@ -1,4 +1,4 @@
-#  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+#  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 #
 
 from AthenaCommon.Constants import VERBOSE,DEBUG,INFO,WARNING
@@ -24,3 +24,38 @@ def metCellMenuSequence():
                           Hypo        = metHypoAlg,
                           HypoToolGen = TrigMETCellHypoToolFromDict )
 
+    
+def metClusterMenuSequence():
+    # menu components   
+    # retrieve the reco seuqnece
+    from TrigUpgradeTest.metDefs import metClusterAthSequence
+    (metClusterSequence, InputMakerAlg, sequenceOut) = RecoFragmentsPool.retrieve(metClusterAthSequence,ConfigFlags)
+  
+    #hypo
+    from TrigMissingETHypo.TrigMissingETHypoConfigMT import MissingETHypoAlgMT, TrigMETCellHypoToolFromDict, MissingETHypoToolMT
+
+    metHypoAlg = MissingETHypoAlgMT("METHypoAlg")
+    metHypoAlg.METContainerKey=sequenceOut
+    metHypoAlg.OutputLevel=DEBUG
+
+    return  MenuSequence( Sequence    = metClusterSequence,
+                          Maker       = InputMakerAlg,
+                          Hypo        = metHypoAlg,
+                          HypoToolGen = TrigMETCellHypoToolFromDict )
+def metJetMenuSequence():
+    # menu components   
+    # retrieve the reco seuqnece
+    from TrigUpgradeTest.metDefs import metJetAthSequence
+    (metJetSequence, InputMakerAlg, sequenceOut) = RecoFragmentsPool.retrieve(metJetAthSequence,ConfigFlags)
+  
+    #hypo
+    from TrigMissingETHypo.TrigMissingETHypoConfigMT import MissingETHypoAlgMT, TrigMETJetHypoToolFromName, MissingETHypoToolMT
+
+    metHypoAlg = MissingETHypoAlgMT("METHypoAlg")
+    metHypoAlg.METContainerKey=sequenceOut
+    metHypoAlg.OutputLevel=DEBUG
+
+    return  MenuSequence( Sequence    = metJetSequence,
+                          Maker       = InputMakerAlg,
+                          Hypo        = metHypoAlg,
+                          HypoToolGen = TrigMETJetHypoToolFromName )
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/python/muMenuDefs.py b/Trigger/TrigValidation/TrigUpgradeTest/python/muMenuDefs.py
index fc6a247959614bba6c44741a1b1c1634ed2e5763..b7b2d96273362adce991801ba033ef37252d85fb 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/python/muMenuDefs.py
+++ b/Trigger/TrigValidation/TrigUpgradeTest/python/muMenuDefs.py
@@ -52,7 +52,7 @@ muonCombinedRecFlags.doCaloTrkMuId = False
 muonCombinedRecFlags.printSummary = False
 from RecExConfig.RecFlags import rec
 from AthenaCommon.AlgSequence import AthSequencer
-from ViewAlgs.ViewAlgsConf import EventViewCreatorAlgorithm
+from ViewAlgs.ViewAlgsConf import EventViewCreatorAlgorithm, EventViewCreatorAlgorithmWithMuons
 
 ServiceMgr.ToolSvc.TrigDataAccess.ApplyOffsetCorrection = False
 
@@ -202,7 +202,7 @@ def muEFCBStep():
 
     ### get EF reco sequence ###    
     from TrigUpgradeTest.MuonSetup import muEFCBRecoSequence
-    muEFCBRecoSequence, sequenceOut = muEFCBRecoSequence( efcbViewsMaker.InViewRoIs, OutputLevel=DEBUG )
+    muEFCBRecoSequence, eventAlgs, sequenceOut = muEFCBRecoSequence( efcbViewsMaker.InViewRoIs, "RoI", OutputLevel=DEBUG )
  
     efcbViewsMaker.ViewNodeName = muEFCBRecoSequence.name()
     
@@ -252,6 +252,39 @@ def muEFSAFSStep():
                          Hypo        = trigMuonEFSAFSHypo,
                          HypoToolGen = TrigMuonEFMSonlyHypoToolFromDict )
 
+### EF CB full scan ###
+def muEFCBFSStep():
+
+    efcbfsInputMaker = EventViewCreatorAlgorithmWithMuons("EFCBFSInputMaker")
+    efcbfsInputMaker.ViewFallThrough = True
+    efcbfsInputMaker.ViewPerRoI = True
+    efcbfsInputMaker.Views = "MUCBFSViews"
+    efcbfsInputMaker.InViewRoIs = "MUCBFSRoIs"
+    efcbfsInputMaker.RoIsLink = "roi"
+    efcbfsInputMaker.InViewMuons = "InViewMuons"
+    efcbfsInputMaker.MuonsLink = "feature"
+
+    from TrigUpgradeTest.MuonSetup import muEFCBRecoSequence
+    muEFCBFSRecoSequence, eventAlgs, sequenceOut = muEFCBRecoSequence( efcbfsInputMaker.InViewRoIs, "FS", OutputLevel=DEBUG )
+ 
+    efcbfsInputMaker.ViewNodeName = muEFCBFSRecoSequence.name()
+    
+    
+    # setup EFCB hypo
+    from TrigMuonHypoMT.TrigMuonHypoMTConfig import TrigMuonEFCombinerHypoAlg
+    trigMuonEFCBFSHypo = TrigMuonEFCombinerHypoAlg( "TrigMuonEFFSCombinerHypoAlg" )
+    trigMuonEFCBFSHypo.OutputLevel = DEBUG
+    trigMuonEFCBFSHypo.MuonDecisions = sequenceOut
+    
+    muonEFCBFSSequence = seqAND( "muonEFFSCBSequence", eventAlgs + [efcbfsInputMaker, muEFCBFSRecoSequence] )
+
+    from TrigMuonHypoMT.TrigMuonHypoMTConfig import TrigMuonEFCombinerHypoToolFromDict
+
+    return MenuSequence( Sequence    = muonEFCBFSSequence,
+                         Maker       = efcbfsInputMaker,
+                         Hypo        = trigMuonEFCBFSHypo,
+                         HypoToolGen = TrigMuonEFCombinerHypoToolFromDict )
+
 
 ### l2Muiso step ###
 def muIsoStep():
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/EmuNewJO.ref b/Trigger/TrigValidation/TrigUpgradeTest/share/EmuNewJO.ref
new file mode 100644
index 0000000000000000000000000000000000000000..4b9adbc6363b95194800f2eae3317791a922600e
--- /dev/null
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/EmuNewJO.ref
@@ -0,0 +1,20 @@
+TrigSignatureMo...   INFO HLT_e5                        2         2         1         1         1
+TrigSignatureMo...   INFO HLT_e5 decisions                                  2         2
+TrigSignatureMo...   INFO HLT_e5_e8                     2         2         1         0         1
+TrigSignatureMo...   INFO HLT_e5_e8 decisions                               6         0
+TrigSignatureMo...   INFO HLT_e5_v2                     0         0         0         0         0
+TrigSignatureMo...   INFO HLT_e5_v2 decisions                               0         0
+TrigSignatureMo...   INFO HLT_e5_v3                     1         1         1         1         1
+TrigSignatureMo...   INFO HLT_e5_v3 decisions                               2         2
+TrigSignatureMo...   INFO HLT_e8                        4         4         3         3         3
+TrigSignatureMo...   INFO HLT_e8 decisions                                  5         5
+TrigSignatureMo...   INFO HLT_g5                        2         2         1         0         1
+TrigSignatureMo...   INFO HLT_g5 decisions                                  2         0
+TrigSignatureMo...   INFO HLT_mu20                      1         1         0         0         0
+TrigSignatureMo...   INFO HLT_mu20 decisions                                0         0
+TrigSignatureMo...   INFO HLT_mu8                       2         2         2         2         2
+TrigSignatureMo...   INFO HLT_mu8 decisions                                 2         2
+TrigSignatureMo...   INFO HLT_mu8_1step                 2         2         2         0         2
+TrigSignatureMo...   INFO HLT_mu8_1step decisions                           2         0
+TrigSignatureMo...   INFO HLT_mu8_e8                    1         1         1         1         1
+TrigSignatureMo...   INFO HLT_mu8_e8 decisions                              4         4
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/EmuNewJOTest.py b/Trigger/TrigValidation/TrigUpgradeTest/share/EmuNewJOTest.py
new file mode 100644
index 0000000000000000000000000000000000000000..c63ee0bf86c63c993d472480acdfe7a9d1b7b44f
--- /dev/null
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/EmuNewJOTest.py
@@ -0,0 +1,101 @@
+# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+
+from AthenaCommon.Configurable import Configurable
+Configurable.configurableRun3Behavior=1
+
+from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
+from AthenaConfiguration.AllConfigFlags import ConfigFlags as flags
+from AthenaCommon.Constants import INFO, DEBUG, VERBOSE
+from AthenaCommon.Logging import logging
+from ByteStreamCnvSvc.ByteStreamConfig import TrigBSReadCfg
+from TrigUpgradeTest.TriggerHistSvcConfig import TriggerHistSvcConfig
+from MuonConfig.MuonCablingConfig import RPCCablingConfigCfg, TGCCablingConfigCfg
+from TrigConfigSvc.TrigConfigSvcConfig import TrigConfigSvcCfg
+from TriggerJobOpts.TriggerConfig import triggerSummaryCfg, triggerMonitoringCfg, \
+    setupL1DecoderFromMenu, collectHypos, collectFilters
+from TriggerMenuMT.HLTMenuConfig.Menu.HLTCFConfig_newJO import generateDecisionTree
+from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import MenuSequence
+from AthenaCommon.CFElements import seqOR
+from RegionSelector.RegSelConfig import regSelCfg
+from TrigUpgradeTest.InDetConfig import TrigInDetCondConfig
+from TrigUpgradeTest.EmuStepProcessingConfig import generateL1DecoderAndChains
+
+log = logging.getLogger('EmuNewJOTest')
+log.setLevel(VERBOSE)
+
+flags.needFlagsCategory("Trigger")
+flags.Input.isMC = False
+flags.Input.Files= ["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1"]
+
+flags.Trigger.L1Decoder.forceEnableAllChains = True
+
+flags.lock()
+
+acc = ComponentAccumulator()
+acc.merge(TrigBSReadCfg(flags))
+acc.merge(TriggerHistSvcConfig(flags))
+
+l1DecoderAlg, HLTChains = generateL1DecoderAndChains()
+setupL1DecoderFromMenu( flags, l1DecoderAlg )
+
+l1DecoderAcc = ComponentAccumulator()
+l1DecoderAcc.mergeAll( TGCCablingConfigCfg( flags ) )
+l1DecoderAcc.mergeAll( RPCCablingConfigCfg( flags ) )
+l1DecoderAcc.merge( TrigConfigSvcCfg( flags ) )
+acc.merge(l1DecoderAcc)
+
+
+from TriggerMenuMT.HLTMenuConfig.Menu.DictFromChainName import DictFromChainName
+toChainDictTranslator = DictFromChainName()
+chainDicts = [toChainDictTranslator.getChainDict(chain.name) for chain in HLTChains]
+
+## Set ca in all sequences to none
+for index, chain in enumerate(HLTChains):
+    for step in chain.steps:
+        for seqIndex, seq in enumerate(step.sequences):
+            hypoAlg = seq.hypo.Alg.__class__(seq.hypo.Alg.name(), **seq.hypo.Alg.getValuedProperties())
+            hypoTool = seq.hypoToolConf.hypoToolGen(chainDicts[index])
+            hypoAlg.HypoTools = [hypoTool]
+
+            sequenceAcc = ComponentAccumulator()
+            sequenceAcc.addSequence(seq.sequence.Alg)
+            seq.ca = sequenceAcc
+            sequenceAcc.wasMerged()
+
+            ms = MenuSequence( Sequence = seq.sequence.Alg,
+                               Maker    = seq.maker.Alg,
+                               Hypo     =  hypoAlg,
+                               HypoToolGen = None,
+                               CA = sequenceAcc)
+
+            step.sequences[seqIndex] = ms
+
+menuAcc = generateDecisionTree(HLTChains)
+
+HLTSteps = menuAcc.getSequence("HLTAllSteps")
+hypos = collectHypos(HLTSteps)
+filters = collectFilters(HLTSteps)
+
+summaryAcc, summaryAlg = triggerSummaryCfg(flags, hypos)
+acc.merge(summaryAcc)
+
+monitoringAcc, monitoringAlg = triggerMonitoringCfg( flags, hypos, l1DecoderAlg )
+acc.merge( monitoringAcc )
+
+topSequenceName = "HLTTop"
+HLTTopSequence = seqOR(topSequenceName, [l1DecoderAlg, HLTSteps, summaryAlg, monitoringAlg])
+acc.addSequence(HLTTopSequence)
+
+acc.merge(menuAcc)
+acc.merge(regSelCfg(flags))
+acc.merge(TrigInDetCondConfig(flags))
+
+acc.getEventAlgo( "TrigSignatureMoniMT").OutputLevel=DEBUG
+
+acc.printConfig()
+
+fname = "EmuNewJOTest.pkl"
+log.debug("Storing config in the config %s", fname)
+with file(fname, "w") as p:
+    acc.store( p, nEvents=4, useBootStrapFile=False, threaded=True )
+    p.close()
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/EmuStepProcessingTest.py b/Trigger/TrigValidation/TrigUpgradeTest/share/EmuStepProcessingTest.py
index ce526f1aef90968621d6a77864ef849a6574ecfb..193765b26d904b015067b9a0202d1f002a96050a 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/EmuStepProcessingTest.py
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/EmuStepProcessingTest.py
@@ -10,192 +10,11 @@
 # ATLAS default Application Configuration options
 #--------------------------------------------------------------
 
-# Configure the scheduler
-from AthenaCommon.AlgScheduler import AlgScheduler
-AlgScheduler.ShowControlFlow( True )
-AlgScheduler.ShowDataFlow( True )
-
-# add chain names in Menu/MenuChains.py
-
-# 4 events
-
-data = {'noreco': [';', ';', ';',';']}  # in the lists there are the events
-
-data['emclusters'] = [ ';',
-                    'eta:1,phi:1,et:180000; eta:1,phi:-1.2,et:35000;',
-                    'eta:0.5,phi:0,et:120000; eta:1,phi:-1.2,et:65000;',
-                    'eta:-0.6,phi:1.7,et:9000;']
-
-data['msmu']  = [';',
-                 ';',
-                 'eta:-1.2,phi:0.7,pt:6500,pt2:8500; eta:-1.1,phi:0.6,pt:8500,pt2:8500;',
-                 'eta:-1.7,phi:-0.2,pt:9500,pt2:8500;']
-
-#data['ctp'] = [ 'HLT_e20 HLT_e5_e8 HLT_e5 HLT_e8 HLT_e5v22 HLT_g5',
-data['ctp'] = [ 'HLT_e20 HLT_e5_e8 HLT_e5 HLT_e8 HLT_g5',
-                'HLT_e20 HLT_e5_e8 HLT_e5 HLT_e8 HLT_g5 HLT_e5_v3',
-                'HLT_mu8 HLT_mu8_1step HLT_e20 HLT_e8 HLT_mu8_e8 HLT_e3_e5',
-                'HLT_mu20 HLT_mu8 HLT_mu8_1step HLT_2mu8 HLT_e8' ]
-
-
-data['l1emroi'] = [ ';',
-                    '1,1,0,EM3,EM7,EM15,EM20,EM50,EM100,2EM3; 1,-1.2,0,EM3,EM7,2EM3',
-                    '-0.6,0.2,0,EM3,EM7,EM15,EM20,EM50,EM100; 1,-1.1,0,EM3,EM7,EM15,EM20,EM50',
-                    '-0.6,1.5,0,EM3,EM7,EM7']
-
-data['l1muroi'] = [';',
-                   '0,0,0,MU0;',
-                   '-1,0.5,0,MU6,MU8; -1,0.5,0,MU6,MU8,MU10',
-                   '-1.5,-0.1,0,MU6,MU8']
-
-data['tracks'] = ['eta:1,phi:1,pt:120000; eta:1,phi:-1.2,et:32000;',
-                  'eta:1,phi:1,pt:120000; eta:1,phi:-1.2,et:32000;',
-                  'eta:0.5,phi:0,pt:130000; eta:1,phi:-1.2,pt:60000;eta:-1.2,phi:0.7,pt:6700; eta:-1.1,phi:0.6,pt:8600;',
-                  'eta:-0.6,phi:1.7,et:9000;'] # no MU track for MS candidate 'eta:-1.7,phi:-0.2,pt:9500;'
-
-data['mucomb'] = [';',
-                  ';',
-                  'eta:-1.2,phi:0.7,pt:6600; eta:-1.1,phi:0.6,pt:8600;',
-                  ';']
-
-data['electrons'] = [';',
-                     'eta:1,phi:1,pt:120000; eta:1,phi:-1.2,et:32000;',
-                     ';',
-                     ';']
-data['photons'] = [';',
-                   'eta:1,phi:1,pt:130000;',
-                   ';',
-                   ';']
-
-
-
-from TrigUpgradeTest.TestUtils import writeEmulationFiles
-writeEmulationFiles(data)
-
-
-from AthenaCommon.CFElements import parOR, seqAND, stepSeq
-
+from TrigUpgradeTest.EmuStepProcessingConfig import generateL1DecoderAndChains
 
 # signatures
 from TriggerMenuMT.HLTMenuConfig.Menu.HLTCFConfig import makeHLTTree
-from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import MenuSequence, Chain, ChainStep
-
-
-doMuon=True
-doElectron=True
-doCombo=True
-
-HLTChains = []
-EnabledElChains = []
-EnabledMuChains = []
-EnabledMuComboChains = []
-EnabledElComboChains = []
-
-
-# muon chains
-if doMuon:
-    from TrigUpgradeTest.HLTSignatureConfig import muStep1MenuSequence, muStep2MenuSequence
-    muStep1 = muStep1MenuSequence("v1")
-    muStep2 = muStep2MenuSequence("v1")
-
-
-    MuChains  = [
-        Chain(name='HLT_mu20', Seed="L1_MU10",      ChainSteps=[ChainStep("Step1_mu", [muStep1]) , ChainStep("Step2_mu", [muStep2] )]) ,
-        Chain(name='HLT_mu8_1step', Seed="L1_MU6",   ChainSteps=[ChainStep("Step1_mu", [muStep1]) ]) ,
-        Chain(name='HLT_mu8',  Seed="L1_MU6",       ChainSteps=[ChainStep("Step1_mu", [muStep1]) , ChainStep("Step2_mu",  [muStep2] ) ] )
-        ]
 
-    HLTChains += MuChains
-    EnabledMuChains= [c.seed.strip().split("_")[1] +" : "+ c.name for c in MuChains]
-
-
-
-
-## #electron chains
-if doElectron:
-    from TrigUpgradeTest.HLTSignatureConfig import elStep1MenuSequence, elStep2MenuSequence, gammStep1MenuSequence
-    # electron
-    elStep1 = elStep1MenuSequence("v1")
-    elStep2 = elStep2MenuSequence("v1","v1")
-    elStep2v2 = elStep2MenuSequence("v2","v2")
-    elStep2v3 = elStep2MenuSequence("v2","v3")
-    # gamma
-    gammStep1 = gammStep1MenuSequence("v1")
-    
-    ElChains  = [
-        Chain(name='HLT_e5'   , Seed="L1_EM7", ChainSteps=[ ChainStep("Step1_em",  [elStep1]), ChainStep("Step2_em",  [elStep2]) ] ),
-        Chain(name='HLT_e5_v2', Seed="L1_EM7", ChainSteps=[ ChainStep("Step1_em",  [elStep1]), ChainStep("Step2v2_em",  [elStep2v2]) ] ),
-        Chain(name='HLT_e5_v3', Seed="L1_EM7", ChainSteps=[ ChainStep("Step1_em",  [elStep1]), ChainStep("Step2v3_em",  [elStep2v3]) ] ),
-        Chain(name='HLT_e8'   , Seed="L1_EM7", ChainSteps=[ ChainStep("Step1_em",  [elStep1]), ChainStep("Step2_em",  [elStep2]) ] ),
-        Chain(name='HLT_g5'   , Seed="L1_EM7", ChainSteps=[ ChainStep("Step1_gam", [gammStep1]) ] )
-        ]
-
-    HLTChains += ElChains
-    EnabledElChains= [c.seed.strip().split("_")[1] +" : "+ c.name for c in ElChains]
-
-
-# combined chain
-if doCombo:
-    from TrigUpgradeTest.HLTSignatureConfig import elStep1MenuSequence, muStep1MenuSequence, elStep2MenuSequence, muStep2MenuSequence
-    elStep1 = elStep1MenuSequence("v1")
-    muStep1 = muStep1MenuSequence("v1")
-    elStep2 = elStep2MenuSequence("v1","v1")
-    muStep2 = muStep2MenuSequence("v1")
-
-    
-    CombChains =[
-        Chain(name='HLT_mu8_e8',  Seed="L1_MU6_EM7", ChainSteps=[ ChainStep("Step1_mu_em",  [muStep1, elStep1]), ChainStep("Step2_mu_em",  [muStep2, elStep2])] ),
-        Chain(name='HLT_e5_e8',   Seed="L1_2EM3",    ChainSteps=[ ChainStep("Step1_2em",[elStep1, elStep1]) ])
-        ]
-
-    HLTChains += CombChains
-    for c in CombChains:
-        seeds=c.seed.split("_")
-        seeds.pop(0) #remove first L1 string
-        for s in seeds:
-            if "MU" in s: EnabledMuComboChains.append(s +" : "+ c.name)
-            if "EM" in s: EnabledElComboChains.append(s +" : "+ c.name) 
-
-    print "enabled Combo chains: ", EnabledMuComboChains,EnabledElComboChains
-
-
-# this is a temporary hack to include new test chains
-EnabledChainNamesToCTP = dict([ (c.name, c.seed)  for c in HLTChains])
-
-
-
-
-########################## L1 #################################################
-
-L1UnpackingSeq = parOR("L1UnpackingSeq")
-from L1Decoder.L1DecoderConf import CTPUnpackingEmulationTool, RoIsUnpackingEmulationTool, L1Decoder
-l1Decoder = L1Decoder( OutputLevel=DEBUG, RoIBResult="" )
-l1Decoder.prescaler.EventInfo=""
-l1Decoder.ChainToCTPMapping = EnabledChainNamesToCTP
-l1Decoder.L1DecoderSummaryKey = "L1DecoderSummary"
-
-ctpUnpacker = CTPUnpackingEmulationTool( OutputLevel =  DEBUG, ForceEnableAllChains=False , InputFilename="ctp.dat" )
-l1Decoder.ctpUnpacker = ctpUnpacker
-
-emUnpacker = RoIsUnpackingEmulationTool("EMRoIsUnpackingTool", OutputLevel=DEBUG, InputFilename="l1emroi.dat", OutputTrigRoIs="L1EMRoIs", Decisions="L1EM" )
-emUnpacker.ThresholdToChainMapping = EnabledElChains + EnabledElComboChains
-emUnpacker.Decisions="L1EM"
-print "EMRoIsUnpackingTool enables chians:"
-print emUnpacker.ThresholdToChainMapping
-
-muUnpacker = RoIsUnpackingEmulationTool("MURoIsUnpackingTool", OutputLevel=DEBUG, InputFilename="l1muroi.dat",  OutputTrigRoIs="L1MURoIs", Decisions="L1MU" )
-muUnpacker.ThresholdToChainMapping = EnabledMuChains + EnabledMuComboChains
-muUnpacker.Decisions="L1MU"
-print "MURoIsUnpackingTool enables chians:"
-print muUnpacker.ThresholdToChainMapping
-
-l1Decoder.roiUnpackers = [emUnpacker, muUnpacker]
-
-#print l1Decoder
-L1UnpackingSeq += l1Decoder
-print L1UnpackingSeq
-
-########################## L1 #################################################
 
 # steps: sequential AND of 1=Filter 2=Processing
 # chainstep=single chain step
@@ -203,10 +22,9 @@ print L1UnpackingSeq
 # filters: one SeqFilter per step, per chain
 # inputMakers: one per each first RecoAlg in a step (so one per step), one input per chain that needs that step
 
-
 from AthenaCommon.AlgSequence import AlgSequence, AthSequencer, dumpSequence
 topSequence = AlgSequence()
-#topSequence += L1UnpackingSeq
+l1Decoder, HLTChains = generateL1DecoderAndChains()
 topSequence += l1Decoder
 ##### Make all HLT #######
 makeHLTTree(HLTChains)
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/fullMenu.py b/Trigger/TrigValidation/TrigUpgradeTest/share/fullMenu.py
index 1e43e23888da7c39767fbafc0fce35807278f898..49fa2a6d9ed7fbfe7305acc5927ca3a94999077b 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/fullMenu.py
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/fullMenu.py
@@ -21,6 +21,7 @@ doMuon   = True
 doJet    = True
 doMET    = True
 doBJet   = False
+doTau    = False
 doCombo  = True
 
 from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import Chain, ChainStep
@@ -127,7 +128,7 @@ if (doJet):
 
 
 ##################################################################
-# jet chains
+# bjet chains
 ##################################################################
 if (doBJet):
     from TrigUpgradeTest.bjetMenuDefs import getBJetSequence
@@ -142,6 +143,16 @@ if (doBJet):
         ]
     testChains += bjetChains
     
+if (doTau):
+  from TrigUpgradeTest.tauMenuDefs import tauCaloSequence
+  #, tauCaloRecSequence
+  step1=ChainStep("Step1_tau", [tauCaloSequence()])
+  #step2=ChainStep("Step2_taucalorec", [tauCaloRecSequence()])
+  tauChains = [
+      Chain(name='HLT_tau0_perf_ptonly_L1TAU12',  Seed="L1_TAU12",  ChainSteps=[step1] ),
+      Chain(name='HLT_tau25_medium1_tracktwo', Seed="L1_TAU12IM",  ChainSteps=[step1] ),
+      ]
+  testChains += tauChains
 
 ##################################################################
 # MET chains
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/metTest.py b/Trigger/TrigValidation/TrigUpgradeTest/share/met.fromCells.py
similarity index 100%
rename from Trigger/TrigValidation/TrigUpgradeTest/share/metTest.py
rename to Trigger/TrigValidation/TrigUpgradeTest/share/met.fromCells.py
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/met.fromClusters.py b/Trigger/TrigValidation/TrigUpgradeTest/share/met.fromClusters.py
new file mode 100644
index 0000000000000000000000000000000000000000..79a8b8e9ae65f3e4bf84fb5b9f808ebaa8f46e12
--- /dev/null
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/met.fromClusters.py
@@ -0,0 +1,101 @@
+#
+#  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+#
+OutputLevel=WARNING
+include("TrigUpgradeTest/testHLT_MT.py")
+
+from AthenaCommon.AlgSequence import AlgSequence
+topSequence = AlgSequence()
+
+import math
+from TrigT2CaloCommon.TrigT2CaloCommonConf import TrigCaloDataAccessSvc#, TestCaloDataAccess
+from AthenaMonitoring.GenericMonitoringTool import GenericMonitoringTool, defineHistogram
+
+mon = GenericMonitoringTool("CaloDataAccessSvcMon")
+mon.Histograms += [defineHistogram( "TIME_locking_LAr_RoI", path='EXPERT', title="Time spent in unlocking the LAr collection", xbins=100, xmin=0, xmax=100 ),
+                   defineHistogram( "roiROBs_LAr", path='EXPERT', title="Number of ROBs unpacked in RoI requests", xbins=20, xmin=0, xmax=20 ),
+                   defineHistogram( "TIME_locking_LAr_FullDet", path='EXPERT', title="Time spent in unlocking the LAr collection", xbins=100, xmin=0, xmax=100 ),
+                   defineHistogram( "roiEta_LAr,roiPhi_LAr", type="TH2F", path='EXPERT', title="Geometric usage", xbins=50, xmin=-5, xmax=5, ybins=64, ymin=-math.pi, ymax=math.pi )]
+
+svcMgr += TrigCaloDataAccessSvc()
+svcMgr.TrigCaloDataAccessSvc.MonTool = mon
+svcMgr.TrigCaloDataAccessSvc.OutputLevel=WARNING
+
+from L1Decoder.L1DecoderConf import CreateFullScanRoI
+topSequence += CreateFullScanRoI()
+
+
+#################################################
+# Get topoclusters
+#################################################
+from TrigT2CaloCommon.CaloDef import HLTFSTopoRecoSequence
+clusterSequence, clusterContainer = HLTFSTopoRecoSequence( RoIs="FullScanRoIs" )
+topSequence += clusterSequence 
+
+#################################################
+# Add EFMissingETFrom** algorithm
+#################################################
+
+from TrigEFMissingET.TrigEFMissingETConf import EFMissingETAlgMT, EFMissingETFromClustersMT, EFMissingETFromHelper
+
+clusterTool = EFMissingETFromClustersMT( name="METFromClustersTool" )
+clusterTool.ClustersCollection = clusterContainer
+
+helperTool = EFMissingETFromHelper("theHelperTool") 
+helperTool.OutputLevel=DEBUG
+metAlg = EFMissingETAlgMT( name="EFMET" )
+
+
+metAlg.METTools=[ clusterTool ]
+metAlg.HelperTool= helperTool 
+metAlg.OutputLevel=DEBUG
+metAlg.METContainerKey = "HLT_MET_Clusters"
+
+metMon = GenericMonitoringTool("METMonTool")
+metMon.Histograms = [ defineHistogram( "TIME_Total", path='EXPERT', title="Time spent Alg", xbins=100, xmin=0, xmax=100 ),
+                      defineHistogram( "TIME_Loop", path='EXPERT', title="Time spent in Tools loop", xbins=100, xmin=0, xmax=100 )]
+from TrigEFMissingET.TrigEFMissingETMonitoring import ( hEx_log, hEy_log, hEz_log, hMET_log, hSumEt_log, 
+                                                 hMET_lin, hSumEt_lin, 
+                                                 hXS, hMETPhi, hMETStatus,
+                                                 hCompEx, hCompEy, hCompEz, hCompEt, hCompSumEt, hCompSumE,
+                                                 hCompEt_lin, hCompSumEt_lin )
+
+metMon.Histograms  = [ hEx_log, hEy_log, hEz_log, hMET_log, hSumEt_log ]
+metMon.Histograms += [ hMET_lin, hSumEt_lin ]
+metMon.Histograms += [ hXS, hMETPhi, hMETStatus]
+metMon.Histograms += [ hCompEx, hCompEy, hCompEz, hCompEt, hCompSumEt, hCompSumE ]
+metMon.Histograms += [ hCompEt_lin, hCompSumEt_lin ]
+
+metAlg.MonTool = metMon
+topSequence += metAlg
+
+#################################################
+# Add TrigMissingETHypo algorithm and tool
+#################################################
+from TrigMissingETHypo.TrigMissingETHypoConfigMT import MissingETHypoAlgMT, MissingETHypoToolMT
+
+def makeMETHypoTool():
+    hypoTool = MissingETHypoToolMT("HLT_xe10")
+    hypoTool.metThreshold = 10
+    return hypoTool
+
+hypoAlg = MissingETHypoAlgMT("METHypoAlg")
+hypoAlg.HypoTools=[makeMETHypoTool()]
+for t in hypoAlg.HypoTools:
+    t.OutputLevel=VERBOSE
+hypoAlg.METContainerKey=metAlg.METContainerKey
+
+# Not sure how to implement monitoring at the moment. 
+# Left here in case will be useful.
+# Will be removed if not
+'''
+from TrigMissingETHypo.TrigMissingETHypoMonitoringTool import TrigMissingETHypoMonitoringTool
+hypoMon = TrigMissingETHypoMonitoringTool()
+hypoAlg.onlineMonitoring()
+'''
+
+hypoAlg.OutputLevel=DEBUG
+hypoAlg.HypoInputDecisions = "L1MET"
+hypoAlg.HypoOutputDecisions = "EFMETDecisions"
+topSequence += hypoAlg
+
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/met.fromJets.py b/Trigger/TrigValidation/TrigUpgradeTest/share/met.fromJets.py
new file mode 100644
index 0000000000000000000000000000000000000000..b0d9b222979ac5cc20c90ea502397b083feaf77f
--- /dev/null
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/met.fromJets.py
@@ -0,0 +1,92 @@
+#
+#  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+#
+OutputLevel=WARNING
+include("TrigUpgradeTest/testHLT_MT.py")
+
+from AthenaCommon.AlgSequence import AlgSequence
+topSequence = AlgSequence()
+
+import math
+from TrigT2CaloCommon.TrigT2CaloCommonConf import TrigCaloDataAccessSvc#, TestCaloDataAccess
+from AthenaMonitoring.GenericMonitoringTool import GenericMonitoringTool, defineHistogram
+
+mon = GenericMonitoringTool("CaloDataAccessSvcMon")
+mon.Histograms += [defineHistogram( "TIME_locking_LAr_RoI", path='EXPERT', title="Time spent in unlocking the LAr collection", xbins=100, xmin=0, xmax=100 ),
+                   defineHistogram( "roiROBs_LAr", path='EXPERT', title="Number of ROBs unpacked in RoI requests", xbins=20, xmin=0, xmax=20 ),
+                   defineHistogram( "TIME_locking_LAr_FullDet", path='EXPERT', title="Time spent in unlocking the LAr collection", xbins=100, xmin=0, xmax=100 ),
+                   defineHistogram( "roiEta_LAr,roiPhi_LAr", type="TH2F", path='EXPERT', title="Geometric usage", xbins=50, xmin=-5, xmax=5, ybins=64, ymin=-math.pi, ymax=math.pi )]
+
+svcMgr += TrigCaloDataAccessSvc()
+svcMgr.TrigCaloDataAccessSvc.MonTool = mon
+svcMgr.TrigCaloDataAccessSvc.OutputLevel=WARNING
+
+
+#################################################
+# Create RoI and get jets
+#################################################
+from L1Decoder.L1DecoderConf import CreateFullScanRoI
+topSequence += CreateFullScanRoI()
+
+from TrigUpgradeTest.jetDefs import jetRecoSequence
+(jetSequence, jetsKey) = jetRecoSequence( RoIs="FullScanRoIs" )
+topSequence += jetSequence
+
+#################################################
+# Add EFMissingETFrom** algorithm
+#################################################
+
+from TrigEFMissingET.TrigEFMissingETConf import EFMissingETAlgMT, EFMissingETFromJetsMT, EFMissingETFromHelper
+
+metAlg = EFMissingETAlgMT( name="EFMET" )
+
+mhtTool = EFMissingETFromJetsMT( name="METFromJetsTool" )
+mhtTool.JetsCollection = jetsKey
+mhtTool.OutputLevel=DEBUG
+metAlg.METTools=[ mhtTool ]
+
+helperTool = EFMissingETFromHelper("theHelperTool") 
+metAlg.HelperTool= helperTool 
+
+metAlg.OutputLevel=DEBUG
+metAlg.METContainerKey="HLT_MET_mht"
+
+metMon = GenericMonitoringTool("METMonTool")
+metMon.Histograms = [ defineHistogram( "TIME_Total", path='EXPERT', title="Time spent Alg", xbins=100, xmin=0, xmax=100 ),
+                      defineHistogram( "TIME_Loop", path='EXPERT', title="Time spent in Tools loop", xbins=100, xmin=0, xmax=100 )]
+from TrigEFMissingET.TrigEFMissingETMonitoring import ( hEx_log, hEy_log, hEz_log, hMET_log, hSumEt_log, 
+                                                 hMET_lin, hSumEt_lin, 
+                                                 hXS, hMETPhi, hMETStatus,
+                                                 hCompEx, hCompEy, hCompEz, hCompEt, hCompSumEt, hCompSumE,
+                                                 hCompEt_lin, hCompSumEt_lin )
+
+metMon.Histograms  = [ hEx_log, hEy_log, hEz_log, hMET_log, hSumEt_log ]
+metMon.Histograms += [ hMET_lin, hSumEt_lin ]
+metMon.Histograms += [ hXS, hMETPhi, hMETStatus]
+metMon.Histograms += [ hCompEx, hCompEy, hCompEz, hCompEt, hCompSumEt, hCompSumE ]
+metMon.Histograms += [ hCompEt_lin, hCompSumEt_lin ]
+
+metAlg.MonTool = metMon
+topSequence += metAlg
+
+#################################################
+# Add TrigMissingETHypo algorithm and tool
+#################################################
+from TrigMissingETHypo.TrigMissingETHypoConfigMT import MissingETHypoAlgMT, MissingETHypoToolMT
+
+def makeMETHypoTool():
+    hypoTool = MissingETHypoToolMT("HLT_xe10")
+    hypoTool.metThreshold = 10
+    return hypoTool
+
+hypoAlg = MissingETHypoAlgMT("METHypoAlg")
+hypoAlg.HypoTools=[makeMETHypoTool()]
+for t in hypoAlg.HypoTools:
+    t.OutputLevel=VERBOSE
+hypoAlg.METContainerKey=metAlg.METContainerKey
+
+hypoAlg.OutputLevel=DEBUG
+hypoAlg.HypoInputDecisions = "L1MET"
+hypoAlg.HypoOutputDecisions = "EFMETDecisions"
+topSequence += hypoAlg
+
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/met.menu.py b/Trigger/TrigValidation/TrigUpgradeTest/share/met.menu.py
index c8c4b06111d9fb2b8a29e6d4a8e9ee21d20183a5..07534b576b7e2eed91158cd3407d46e07a793be9 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/met.menu.py
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/met.menu.py
@@ -1,5 +1,5 @@
 #
-#  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+#  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 #
 
 # import flags
@@ -11,13 +11,14 @@ include("TrigUpgradeTest/testHLT_MT.py")
 from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import Chain, ChainStep
 
 
-from TrigUpgradeTest.metMenuDefs import metCellMenuSequence
+from TrigUpgradeTest.metMenuDefs import metCellMenuSequence, metJetMenuSequence
 
 metCellSeq = metCellMenuSequence()
 metCellStep = ChainStep("Step1_met_cell", [metCellSeq])
+
 testChains = [
    Chain(name="HLT_xe65_L1XE50", Seed="L1_XE50", ChainSteps=[metCellStep]),
-   Chain(name="HLT_xe30_L1XE10", Seed="L1_XE10", ChainSteps=[metCellStep])
+   Chain(name="HLT_xe30_L1XE10", Seed="L1_XE10", ChainSteps=[metCellStep]),
 ]
 
 
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/met_standalone.ref b/Trigger/TrigValidation/TrigUpgradeTest/share/met_fromCells.ref
similarity index 100%
rename from Trigger/TrigValidation/TrigUpgradeTest/share/met_standalone.ref
rename to Trigger/TrigValidation/TrigUpgradeTest/share/met_fromCells.ref
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/met_fromClusters.ref b/Trigger/TrigValidation/TrigUpgradeTest/share/met_fromClusters.ref
new file mode 100644
index 0000000000000000000000000000000000000000..b90c7d4a93437701f5ca2041521027f38321aece
--- /dev/null
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/met_fromClusters.ref
@@ -0,0 +1,10 @@
+METHypoAlg                              0   0     DEBUG The MET value is 13
+METHypoAlg                              1   0     DEBUG The MET value is 23
+METHypoAlg                              2   0     DEBUG The MET value is 35
+METHypoAlg                              3   0     DEBUG The MET value is 20
+METHypoAlg                              4   0     DEBUG The MET value is 21
+METHypoAlg                              5   0     DEBUG The MET value is 59
+METHypoAlg                              6   0     DEBUG The MET value is 32
+METHypoAlg                              7   0     DEBUG The MET value is 51
+METHypoAlg                              8   0     DEBUG The MET value is 31
+METHypoAlg                              9   0     DEBUG The MET value is 39
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/met_fromJets.ref b/Trigger/TrigValidation/TrigUpgradeTest/share/met_fromJets.ref
new file mode 100644
index 0000000000000000000000000000000000000000..1d78a55d2ff4145387f34b3a62d5bcee62fe5ede
--- /dev/null
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/met_fromJets.ref
@@ -0,0 +1,10 @@
+METHypoAlg                              0   0     DEBUG The MET value is 11
+METHypoAlg                              1   0     DEBUG The MET value is 47
+METHypoAlg                              2   0     DEBUG The MET value is 12
+METHypoAlg                              3   0     DEBUG The MET value is 34
+METHypoAlg                              4   0     DEBUG The MET value is 13
+METHypoAlg                              5   0     DEBUG The MET value is 43
+METHypoAlg                              6   0     DEBUG The MET value is 12
+METHypoAlg                              7   0     DEBUG The MET value is 52
+METHypoAlg                              8   0     DEBUG The MET value is 19
+METHypoAlg                              9   0     DEBUG The MET value is 48
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/mu.menu.py b/Trigger/TrigValidation/TrigUpgradeTest/share/mu.menu.py
index 920f6f7f66425c79cfcbdd36d994da5dc429fe2e..26d2f97bc9e3522c7b2d873406a8914d7b30c40a 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/mu.menu.py
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/mu.menu.py
@@ -39,7 +39,7 @@ if  TriggerFlags.doMuon==True:
     ##########################################
 
     from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import Chain, ChainStep
-    from TrigUpgradeTest.muMenuDefs import muFastStep, muCombStep, muEFMSStep, muEFSAStep, muIsoStep, muEFCBStep, muEFSAFSStep, inDetSetup
+    from TrigUpgradeTest.muMenuDefs import muFastStep, muCombStep, muEFMSStep, muEFSAStep, muIsoStep, muEFCBStep, muEFSAFSStep, muEFCBFSStep, inDetSetup
 
     inDetSetup()
 
@@ -57,6 +57,8 @@ if  TriggerFlags.doMuon==True:
     step4muEFCB=ChainStep("Step4_muEFCB", [ muEFCBStep() ])
     # Full scan MS tracking step
     stepFSmuEFSA=ChainStep("Step_FSmuEFSA", [muEFSAFSStep()])
+    stepFSmuEFCB=ChainStep("Step_FSmuEFCB", [muEFCBFSStep()])
+
 
     ## single muon trigger  
     MenuChains += [Chain(name='HLT_mu6fast',   Seed="L1_MU6",  ChainSteps=[ step1mufast ])]
@@ -70,7 +72,7 @@ if  TriggerFlags.doMuon==True:
     MenuChains += [Chain(name='HLT_2mu6',     Seed="L1_MU6", ChainSteps=[ step1mufast, step2muComb, step3muEFSA, step4muEFCB ])]        
 
     #FS Muon trigger
-    MenuChains += [Chain(name='HLT_mu6nol1', Seed="L1_MU6", ChainSteps=[stepFSmuEFSA])] 
+    MenuChains += [Chain(name='HLT_mu6nol1', Seed="L1_MU6", ChainSteps=[stepFSmuEFSA, stepFSmuEFCB])] 
     
     
     #################################
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/mu.withViews.py b/Trigger/TrigValidation/TrigUpgradeTest/share/mu.withViews.py
index 494842f7c2d56cbc2866e92c8e0790f040c966d0..6f5e1d25bb815e013a1cc1c03c83e8e42383d8c9 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/mu.withViews.py
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/mu.withViews.py
@@ -304,7 +304,7 @@ if TriggerFlags.doMuon:
 
     ### get EF reco sequence ###
     from TrigUpgradeTest.MuonSetup import muEFCBRecoSequence
-    muEFCBRecoSequence, muEFCBSequenceOut = muEFCBRecoSequence( efCBMuViewsMaker.InViewRoIs, OutputLevel=DEBUG )
+    muEFCBRecoSequence, eventAlgs, muEFCBSequenceOut = muEFCBRecoSequence( efCBMuViewsMaker.InViewRoIs, "RoI", OutputLevel=DEBUG )
  
     efCBMuViewsMaker.ViewNodeName = muEFCBRecoSequence.name()
 
@@ -323,7 +323,7 @@ if TriggerFlags.doMuon:
     muonEFCBDecisionsDumper = DumpDecisions("muonEFCBDecisionsDumper", OutputLevel=DEBUG, Decisions = trigMuonEFCBHypo.HypoOutputDecisions )
 
     ### make sequence ### 
-    muEFCBSequence = seqAND("muEFCBSequence", [efCBMuViewsMaker, muEFCBRecoSequence, trigMuonEFCBHypo])
+    muEFCBSequence = seqAND("muEFCBSequence", eventAlgs+[efCBMuViewsMaker, muEFCBRecoSequence, trigMuonEFCBHypo])
 
     ### make step ### 
     muonEFCBStep = stepSeq("muonEFCBStep", filterEFCBAlg, [muEFCBSequence, muonEFCBDecisionsDumper])
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/muMenu.ref b/Trigger/TrigValidation/TrigUpgradeTest/share/muMenu.ref
index 40cec9c91507044bb75b21d8cb2fc5b944259851..6e46b1d1387d63ae4753bfd09f1b96d111f42ce5 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/muMenu.ref
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/muMenu.ref
@@ -18,19 +18,17 @@ TriggerSummaryStep2                     6   0     DEBUG  +++ HLT_mu6 ID#16721627
 TriggerSummaryStep2                     6   0     DEBUG  +++ HLT_2mu6Comb ID#2762422737
 TriggerSummaryStep2                     6   0     DEBUG  +++ HLT_2mu6 ID#3347104206
 TriggerSummaryStep3                     6   0     DEBUG  +++ HLT_mu6 ID#1672162766
-TriggerSummaryStep3                     6   0     DEBUG  +++ HLT_2mu6 ID#3347104206
-TriggerSummaryStep4                     6   0     DEBUG  +++ HLT_mu6 ID#1672162766
-TrigSignatureMoniMT                                INFO HLT_2mu6                      10        10        1         1         1         0         0         
-TrigSignatureMoniMT                                INFO HLT_2mu6 decisions                                2         2         2         0         
+TrigSignatureMoniMT                                INFO HLT_2mu6                      10        10        1         1         0         0         0         
+TrigSignatureMoniMT                                INFO HLT_2mu6 decisions                                2         2         0         0         
 TrigSignatureMoniMT                                INFO HLT_2mu6Comb                  10        10        1         1         0         0         1         
 TrigSignatureMoniMT                                INFO HLT_2mu6Comb decisions                            2         2         0         0         
 TrigSignatureMoniMT                                INFO HLT_mu20_ivar                 10        10        1         1         1         0         1         
 TrigSignatureMoniMT                                INFO HLT_mu20_ivar decisions                           1         1         1         0         
-TrigSignatureMoniMT                                INFO HLT_mu6                       10        10        2         2         1         1         1         
-TrigSignatureMoniMT                                INFO HLT_mu6 decisions                                 3         3         2         1         
+TrigSignatureMoniMT                                INFO HLT_mu6                       10        10        2         2         1         0         0         
+TrigSignatureMoniMT                                INFO HLT_mu6 decisions                                 3         3         4         0         
 TrigSignatureMoniMT                                INFO HLT_mu6Comb                   10        10        2         2         0         0         2         
 TrigSignatureMoniMT                                INFO HLT_mu6Comb decisions                             3         3         0         0         
 TrigSignatureMoniMT                                INFO HLT_mu6fast                   10        10        2         0         0         0         2         
 TrigSignatureMoniMT                                INFO HLT_mu6fast decisions                             3         0         0         0         
-TrigSignatureMoniMT                                INFO HLT_mu6nol1                   10        10        2         0         0         0         2         
-TrigSignatureMoniMT                                INFO HLT_mu6nol1 decisions                             3         0         0         0         
+TrigSignatureMoniMT                                INFO HLT_mu6nol1                   10        10        2         0         0         0         0         
+TrigSignatureMoniMT                                INFO HLT_mu6nol1 decisions                             5         0         0         0         
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/newJOtest.py b/Trigger/TrigValidation/TrigUpgradeTest/share/newJOtest.py
index f569bc47d3e2f77eae00af5ccba93ea8c9078b2e..b68a1f8219538b5e019a0c538290a70b7fbc0e60 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/newJOtest.py
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/newJOtest.py
@@ -22,6 +22,8 @@ flags.Detector.GeometryMDT   = True
 flags.Detector.GeometryTGC   = True
 flags.Detector.GeometryCSC   = True     
 flags.Detector.GeometryRPC   = True     
+flags.Trigger.writeBS=True # switches on HLTResultMT creation
+
 
 flags.needFlagsCategory('Trigger')
 setupMenu(flags)
@@ -76,12 +78,9 @@ acc.foreach_component("*HLTTop/*GenericMonitoringTool*").OutputLevel = WARNING #
 acc.printConfig()
 
 
+
 fname = "newJOtest.pkl"
 print "Storing config in the config", fname
 with file(fname, "w") as p:
     acc.store( p, nEvents=10, useBootStrapFile=False, threaded=True )
     p.close()
-
-
-
-
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/test/test_emu_newjo.sh b/Trigger/TrigValidation/TrigUpgradeTest/test/test_emu_newjo.sh
new file mode 100755
index 0000000000000000000000000000000000000000..ea2e1c7a3069b61d822f3cbb1d63fe36d447a910
--- /dev/null
+++ b/Trigger/TrigValidation/TrigUpgradeTest/test/test_emu_newjo.sh
@@ -0,0 +1,30 @@
+#!/bin/sh
+# art-type: build
+# art-include: master/Athena
+
+rm -rf EmuNewJOTest.py bootstrap.pkl bootstrap.py
+
+# this is a hack to pre-confgure scheduler and other MT services,
+#will be taken away once NEW system has better means to influence the bootstrap content
+cat <<EOF >> bootstrap.py
+from AthenaCommon.AppMgr import theApp, ServiceMgr as svcMgr
+svcMgr.AvalancheSchedulerSvc.ShowControlFlow=True
+svcMgr.AvalancheSchedulerSvc.ShowDataDependencies=True
+EOF
+
+athena --threads=1 --config-only=bootstrap.pkl bootstrap.py
+
+
+get_files -jo TrigUpgradeTest/EmuNewJOTest.py
+python EmuNewJOTest.py # generate pickle
+status=$?
+if [ ${status} -ne 0 ]
+then
+    echo "ERROR in configuration generation stage, stopping"
+    exit -1
+else
+    echo
+    echo "JOs reading stage finished, launching Athena from pickle file"
+    echo
+    athena EmuNewJOTest.pkl
+fi
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/test/test_met_fromCells.sh b/Trigger/TrigValidation/TrigUpgradeTest/test/test_met_fromCells.sh
new file mode 100755
index 0000000000000000000000000000000000000000..0d21061f0e7b2b5fc01485c4edae4a700e3da017
--- /dev/null
+++ b/Trigger/TrigValidation/TrigUpgradeTest/test/test_met_fromCells.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+# art-type: build
+# art-ci: master
+
+athena --threads=1 --evtMax=10 --filesInput="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1" TrigUpgradeTest/met.fromCells.py 
+
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/test/test_met_fromClusters.sh b/Trigger/TrigValidation/TrigUpgradeTest/test/test_met_fromClusters.sh
new file mode 100755
index 0000000000000000000000000000000000000000..5a04d7ec91d2626970850f6c5e4f1ecdd13d9807
--- /dev/null
+++ b/Trigger/TrigValidation/TrigUpgradeTest/test/test_met_fromClusters.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+# art-type: build
+# art-ci: master
+
+athena --threads=1 --evtMax=10 --filesInput="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1" TrigUpgradeTest/met.fromClusters.py 
+
diff --git a/Trigger/TrigValidation/TrigUpgradeTest/test/test_met_standalone.sh b/Trigger/TrigValidation/TrigUpgradeTest/test/test_met_fromJets.sh
similarity index 90%
rename from Trigger/TrigValidation/TrigUpgradeTest/test/test_met_standalone.sh
rename to Trigger/TrigValidation/TrigUpgradeTest/test/test_met_fromJets.sh
index a72ce3984e0d4b7cd52686e5979482b35e9fe72b..595ba52d0cb82f75d7e566fdec6832e855b6baea 100755
--- a/Trigger/TrigValidation/TrigUpgradeTest/test/test_met_standalone.sh
+++ b/Trigger/TrigValidation/TrigUpgradeTest/test/test_met_fromJets.sh
@@ -2,5 +2,5 @@
 # art-type: build
 # art-ci: master
 
-athena --threads=1 --evtMax=10 --filesInput="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1" TrigUpgradeTest/metTest.py 
+athena --threads=1 --evtMax=10 --filesInput="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1" TrigUpgradeTest/met.fromJets.py 
 
diff --git a/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py b/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py
index b9d1ad7ebafa2ae42e8a391bded383fdeed131a5..1be86b7e7f9fc9334197c291c9d5bb83edcd792d 100644
--- a/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py
+++ b/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py
@@ -59,8 +59,36 @@ TriggerHLTList = [
 
 EDMDetails = {}
 
-EDMDetails[ "TrigRoiDescriptorCollection" ]         = {'persistent':"TrigRoiDescriptorCollection_p3",     'typealias':'Roi', 'collection':'TrigRoiDescriptorCollection' }
+EDMDetails[ "TrigRoiDescriptorCollection" ]     = {'persistent':"TrigRoiDescriptorCollection_p3"}
 
+EDMDetails[ "xAOD::TrigCompositeAuxContainer" ] = {'persistent':"xAOD::TrigCompositeAuxContainer_v2"}
+
+EDMDetails[ "xAOD::TrigEMClusterAuxContainer" ] = {'persistent':"xAOD::TrigEMClusterAuxContainer_v2"}
+
+
+
+def persistent( transient ):
+    """
+    Persistent EDM claass, for xAOD it is the actual class version
+    
+    Uses list defined above. If absent assumes v1
+    """
+    if transient in EDMDetails:
+        return EDMDetails[transient]['persistent']
+    return transient+"_v1"
+
+
+def tpMap():
+    """
+    List 
+    """
+    l = {}
+    for tr in EDMDetails.keys():
+        if "xAOD" in tr:
+            continue
+        l[tr] = persistent(tr)
+    return l
+        
 
 
         
diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/MenuConfigFlags.py b/Trigger/TriggerCommon/TriggerJobOpts/python/MenuConfigFlags.py
index 40f786a0a38761b862f98572daf041037a174f6f..d50d4661bdd71d9885aed2ae1207a6c4f406f209 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/python/MenuConfigFlags.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/python/MenuConfigFlags.py
@@ -1,3 +1,4 @@
+
 # Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
 
 from AthenaConfiguration.AthConfigFlags import AthConfigFlags
@@ -29,7 +30,7 @@ class MenuUtils:
                 for chain in v.get():
                     hlt = chain[0]
                     l1 = chain[1]
-                    seeding[hlt] = l1
+                    seeding[hlt] = l1[0] # this is the item name
         return seeding
 
 import unittest
diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfig.py b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfig.py
index 9fbf72f64a17698d05e01c90944b93e1a575fe94..40a6a7e5428f6db0c6a335dee62a9b0266efaa1e 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfig.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfig.py
@@ -32,7 +32,7 @@ def collectHypos( steps ):
                     __log.info( "found hypo " + alg.name() + " in " +stepSeq.name() )
                     hypos[stepSeq.name()].append( alg )
                 else:
-                    __log.info("DID NOT FIND HYPO" + alg.name())
+                    __log.verbose("Not a hypo" + alg.name())
     return hypos
 
 def __decisionsFromHypo( hypo ):
@@ -43,6 +43,19 @@ def __decisionsFromHypo( hypo ):
         return [ t.name() for t in hypo.HypoTools ], hypo.HypoOutputDecisions
 
 
+def collectViewMakers( steps ):
+    """ collect all view maker algorithms in the configuration """
+    makers = {} # map with name, instance and encompasing recoSequence
+    for stepSeq in steps.getChildren():
+        for recoSeq in stepSeq.getChildren():
+            algsInSeq = flatAlgorithmSequences( recoSeq )
+            for seq,algs in algsInSeq.iteritems():
+                for alg in algs:
+                    if "EventViewCreator" in alg.getFullName(): # TODO base it on checking types of write handles once available
+                        makers[alg.name()] = (alg, recoSeq)
+    __log.info("Found View Makers: {}".format( " ".join( makers.keys() ) ) )
+    return makers
+
 
 def collectFilters( steps ):
     """
@@ -170,6 +183,46 @@ def triggerOutputStreamCfg( flags, decObj, outputType ):
 
     return acc
 
+def triggerBSOutputCfg( flags, decObj ):
+    """
+    Configure output to be saved in BS
+    """
+    acc = ComponentAccumulator()
+
+
+
+    from TrigEDMConfig.TriggerEDMRun3 import TriggerHLTList, persistent
+    from TrigOutputHandling.TrigOutputHandlingConf import HLTResultMTMakerAlg # , StreamTagMakerTool, TriggerBitsMakerTool     # TODO add config of these two
+    from TrigOutputHandling.TrigOutputHandlingConfig import TriggerEDMSerialiserToolCfg, HLTResultMTMakerCfg
+    
+    serialiser = TriggerEDMSerialiserToolCfg("Serialiser")
+    for coll in decObj:
+        serialiser.addCollectionListToMainResult( [ "{}#remap_{}".format( persistent("xAOD::TrigCompositeContainer"), coll ),
+                                                    "{}#remap_{}Aux.".format( persistent("xAOD::TrigCompositeAuxContainer"), coll )] )
+
+    # EDM
+    EDMCollectionsToRecord=filter( lambda x: "BS" in x[1],  TriggerHLTList )    
+    for item in EDMCollectionsToRecord:
+        typeName, collName = item[0].split("#")
+        serialisedTypeColl="{}#{}".format(persistent(typeName), collName)
+        __log.info( "Serialising {}".format( serialisedTypeColl ) ) 
+        serialiser.addCollectionListToMainResult( [ serialisedTypeColl ] )
+        
+        
+    # not configuring the two tools below now as we soon will change method to configure them (via TrigConfigSvc)
+    #stmaker                       = StreamTagMakerTool()
+    #bitsmaker                     = TriggerBitsMakerTool()
+    
+    
+    hltResultMakerTool            = HLTResultMTMakerCfg("MakerTool") # want short nme to see in the log
+    hltResultMakerTool.MakerTools = [ serialiser ] #, stmaker, bitsmaker ] 
+    hltResultMakerAlg             = HLTResultMTMakerAlg()
+    hltResultMakerAlg.ResultMaker = hltResultMakerTool
+    acc.addEventAlgo( hltResultMakerAlg )
+
+    return acc
+
+
 def triggerAddMissingEDMCfg( flags, decObj ):
 
     from DecisionHandling.DecisionHandlingConf import TriggerSummaryAlg
@@ -182,19 +235,32 @@ def triggerAddMissingEDMCfg( flags, decObj ):
     EDMFillerAlg.OutputTools += [ DecisionObjectsFiller ]
 
     from TrigEDMConfig.TriggerEDMRun3 import TriggerHLTList
-    collectionsThatNeedMerging = filter( lambda x: len(x) >= 4 and x[3].startswith("inViews:"),  TriggerHLTList )
-    for c in collectionsThatNeedMerging:
-        tool = HLTEDMCreator(c[0].split("#")[1]+"merger")
-        ctype, cname = c[0].split("#")
-        ctype = ctype.split(":")[-1]
-        viewsColl = c[3].split(":")[-1]
-        setattr(tool, ctype+"Views", [ viewsColl ] )
-        setattr(tool, ctype+"InViews", [ cname ] )
-        setattr(tool, ctype, [ cname ] )
+    needMerging = filter( lambda x: len(x) >= 4 and x[3].startswith("inViews:"),  TriggerHLTList )
+    __log.info("These collections need merging: {}".format( " ".join([ c[0] for c in needMerging ])) )
+    # group by the view collection name/view maker   
+    from collections import defaultdict
+    groupedByView = defaultdict(list)
+    [ groupedByView[c[3]].append( c ) for c in needMerging ]    
+
+    for view, colls in groupedByView.iteritems():
+        viewCollName = view.split(":")[1]
+        tool = HLTEDMCreator( "Merger{}".format( viewCollName ) )
+        from AthenaCommon.Constants import DEBUG
+        tool.OutputLevel = DEBUG        
+        for coll in colls:        
+            ctype, cname = coll[0].split("#")
+            ctype = ctype.split(":")[-1]
+            viewsColl = coll[3].split(":")[-1]
+            setattr(tool, ctype+"Views", [ viewsColl ] )
+            setattr(tool, ctype+"InViews", [ cname ] )
+            setattr(tool, ctype, [ cname ] )
+
+        # need to add TC collections that need to be remap
+        #hypo = findClosestHypo( viewCollName )        
+        #tool.TrigCompositeContainer += hypo.HypoOutputDecisions
+        
         EDMFillerAlg.OutputTools += [ tool ]
-#egammaViewsMerger.TrigEMClusterContainerViews = [ "EMCaloViews" ]
-#egammaViewsMerger.TrigEMClusterContainerInViews = [ clustersKey ]
-#egammaViewsMerger.TrigEMClusterContainer = [ clustersKey ]
+        
 
     return EDMFillerAlg
 
@@ -239,7 +305,7 @@ def triggerRunCfg( flags, menu=None ):
     # collect hypothesis algorithms from all sequence
     hypos = collectHypos( HLTSteps )
     filters = collectFilters( HLTSteps )
-
+    
     summaryAcc, summaryAlg = triggerSummaryCfg( flags, hypos )
     acc.merge( summaryAcc )
 
@@ -257,19 +323,25 @@ def triggerRunCfg( flags, menu=None ):
 
     acc.merge( menuAcc )
 
-    # output
-    # if any output stream is requested, schedule "gap" filling algorithm
-    if flags.Output.ESDFileName != "" or flags.Output.AODFileName != "":
-        acc.addEventAlgo( triggerAddMissingEDMCfg( flags, decObj ), sequenceName= "HLTTop" )
+    
+    
 
-    # configure streams
-    if flags.Output.ESDFileName != "":
-        acc.merge( triggerOutputStreamCfg( flags, decObj, "ESD" ) )
 
-    if flags.Output.AODFileName != "":
-        acc.merge( triggerOutputStreamCfg( flags, decObj, "AOD" ) )
+    # output        
+    # if any output stream is requested, schedule merging & gap filling algorithm
+    if any( (flags.Output.ESDFileName != "", flags.Output.AODFileName != "", flags.Trigger.writeBS) ):
+        # configure views merging
+        acc.addEventAlgo( triggerAddMissingEDMCfg( flags, decObj ), sequenceName="HLTTop" )
+            
+        # configure streams
+        if flags.Output.ESDFileName != "":
+            acc.merge( triggerOutputStreamCfg( flags, decObj, "ESD" ) )
 
+        if flags.Output.AODFileName != "":
+            acc.merge( triggerOutputStreamCfg( flags, decObj, "AOD" ) )
 
+        if flags.Trigger.writeBS:                
+            acc.merge( triggerBSOutputCfg( flags, decObj ) )
 
     return acc
 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CommonSequences/InDetSetup.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CommonSequences/InDetSetup.py
index b1aa29abf870dd2cf334e0324e8938ddc0ee1210..bdc46f8930109051f30db821df01e7ea4874417c 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CommonSequences/InDetSetup.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CommonSequences/InDetSetup.py
@@ -15,12 +15,12 @@ def makeInDetAlgs( whichSignature='' ):
   #Create IdentifiableCaches
   from InDetPrepRawDataFormation.InDetPrepRawDataFormationConf import InDet__CacheCreator
   InDetCacheCreatorTrigViews = InDet__CacheCreator(name = "InDetCacheCreatorTrigViews" + signature,
-                                       Pixel_ClusterKey = "PixelTrigClustersCache",
-                                       SCT_ClusterKey   = "SCT_ClustersCache",
-                                       SpacePointCachePix = "PixelSpacePointCache",
-                                       SpacePointCacheSCT   = "SctSpacePointCache",
-                                       SCTRDOCacheKey       = "SctRDOCache",
-                                       PixRDOCacheKey = "PixRDOCache",)
+                                       Pixel_ClusterKey = "PixelTrigClustersCache" + signature,
+                                       SCT_ClusterKey   = "SCT_ClustersCache" + signature,
+                                       SpacePointCachePix = "PixelSpacePointCache" + signature,
+                                       SpacePointCacheSCT   = "SctSpacePointCache" + signature,
+                                       SCTRDOCacheKey       = "SctRDOCache" + signature,
+                                       PixRDOCacheKey = "PixRDOCache" + signature)
                                        #OutputLevel=DEBUG)
   eventAlgs.append(InDetCacheCreatorTrigViews)
 
@@ -245,7 +245,7 @@ def makeInDetAlgs( whichSignature='' ):
     if not hasattr(condSeq, "InDetSiElementPropertiesTableCondAlg"):
       # Setup alignment folders and conditions algorithms
       from SiSpacePointFormation.SiSpacePointFormationConf import InDet__SiElementPropertiesTableCondAlg
-      condSeq += InDet__SiElementPropertiesTableCondAlg(name = "InDetSiElementPropertiesTableCondAlg" + signature)
+      condSeq += InDet__SiElementPropertiesTableCondAlg(name = "InDetSiElementPropertiesTableCondAlg")
 
   from TrigInDetConf.TrigInDetPostTools import  InDetTrigParticleCreatorToolFTF
 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT_newJO.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT_newJO.py
index ad79a5b31416599b0e154ba37e7e9829adc1070c..7aba19dee893bc2a4c8daadc34db2f680390cc46 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT_newJO.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT_newJO.py
@@ -84,7 +84,7 @@ def generateMenu( flags ):
     useReworked = True
 
     if useReworked:
-        menuAcc = generateDecisionTree(menuChains, allChainDicts)
+        menuAcc = generateDecisionTree(menuChains)
     else:
         menuAcc = ComponentAccumulator()
         mainSequenceName = 'HLTAllSteps'
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig_newJO.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig_newJO.py
index a074748583d68226d94c0a1504fe7484caa11342..1e88b553b2d6be061aa4326e52b7a00c9182db4b 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig_newJO.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig_newJO.py
@@ -1,7 +1,12 @@
 # Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 
+from collections import defaultdict
+from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
 from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponentsNaming import CFNaming
 from TriggerMenuMT.HLTMenuConfig.Menu.HLTCFConfig import buildFilter, makeSummary
+from TriggerMenuMT.HLTMenuConfig.Menu.HLTCFDot import stepCF_DataFlow_to_dot, \
+    stepCF_ControlFlow_to_dot, all_DataFlow_to_dot
+from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import CFSequence
 from AthenaCommon.CFElements import parOR, seqAND
 from AthenaCommon.Logging import logging
 from AthenaCommon.Constants import VERBOSE
@@ -10,27 +15,17 @@ log = logging.getLogger('HLTCFConfig_newJO')
 log.setLevel( VERBOSE )
 
 
-def connectStepToFilter(chainStep, filterNode):
-    filter_output = filterNode.getOutputList()
-    if len(filter_output) == 0:
-        raise ValueError('ERROR: no filter outputs are set')
+def printStepsMatrix(matrix):
+    print('----- Steps matrix ------')
+    for nstep in matrix:
+        print('step {}:'.format(nstep))
+        for chainName in matrix[nstep]:
+            namesInCell = map(lambda el: el.name, matrix[nstep][chainName])
+            print('---- {}: {}'.format(chainName, namesInCell))
+    print('-------------------------')
 
-    if len(filter_output) != len(chainStep.sequences):
-        msg = 'ERROR: found {} filter outputs and {} MenuSequences in step {}'.format(len(filter_output),
-            len(chainStep.sequences), chainStep.name)
-        raise ValueError(msg)
-
-    for nseq, sequence in enumerate(chainStep.sequences):
-        output = filter_output[nseq]
-        log.debug("Found input %s to sequence::%s from Filter::%s (from seed %s)", output,
-                  sequence.name, filterNode.Alg.name(), sequence.seed)
-        sequence.connectToFilter(output)
-
-
-def generateDecisionTree(chains, allChainDicts):
-    from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
-    from collections import defaultdict
 
+def generateDecisionTree(chains):
     acc = ComponentAccumulator()
     mainSequenceName = 'HLTAllSteps'
     acc.addSequence( seqAND(mainSequenceName) )
@@ -40,24 +35,30 @@ def generateDecisionTree(chains, allChainDicts):
     chainStepsMatrix = defaultdict(lambda: defaultdict(list))
 
     ## Fill chain steps matrix
-    for chain in chains:
+    for index, chain in enumerate(chains):
         for stepNumber, chainStep in enumerate(chain.steps):
-            chainName = chainStep.name.split('_')[0]
-            chainStepsMatrix[stepNumber][chainName].append(chain)
+            chainStepsMatrix[stepNumber][chainStep.name].append(chain)
+
+    printStepsMatrix(chainStepsMatrix)
+
+    allCFSequences = []
 
     ## Matrix with steps lists generated. Creating filters for each cell
-    for nstep in chainStepsMatrix:
+    for nstep in sorted(chainStepsMatrix.keys()):
         stepDecisions = []
 
-        stepName = 'Step{}'.format(nstep)
+        stepName = CFNaming.stepName(nstep)
 
         stepFilterNodeName = '{}{}'.format(stepName, CFNaming.FILTER_POSTFIX)
         filterAcc = ComponentAccumulator()
         filterAcc.addSequence( parOR(stepFilterNodeName) )
 
-        stepRecoNodeName = '{}_{}'.format(mainSequenceName, stepName)
+        stepRecoNodeName = CFNaming.stepRecoNodeName(mainSequenceName, stepName)
+        stepRecoNode = parOR(stepRecoNodeName)
         recoAcc = ComponentAccumulator()
-        recoAcc.addSequence( parOR(stepRecoNodeName) )
+        recoAcc.addSequence(stepRecoNode)
+
+        CFSequences = []
 
         for chainName in chainStepsMatrix[nstep]:
             chainsInCell = chainStepsMatrix[nstep][chainName]
@@ -72,12 +73,13 @@ def generateDecisionTree(chains, allChainDicts):
             else:
                 filter_input = [output for sequence in firstChain.steps[nstep - 1].sequences for output in sequence.outputs]
 
+            chainStep = firstChain.steps[nstep]
+
             # One aggregated filter per chain (one per column in matrix)
-            filterName = 'Filter_{}'.format( firstChain.steps[nstep].name )
+            filterName = CFNaming.filterName(chainStep.name)
             sfilter = buildFilter(filterName, filter_input)
             filterAcc.addEventAlgo(sfilter.Alg, sequenceName = stepFilterNodeName)
 
-            chainStep = firstChain.steps[nstep]
             stepReco = parOR('{}{}'.format(chainStep.name, CFNaming.RECO_POSTFIX))
             stepView = seqAND('{}{}'.format(chainStep.name, CFNaming.VIEW_POSTFIX), [stepReco])
             viewWithFilter = seqAND(chainStep.name, [sfilter.Alg, stepView])
@@ -85,18 +87,25 @@ def generateDecisionTree(chains, allChainDicts):
 
             stepsAcc = ComponentAccumulator()
 
+            CFSequenceAdded = False
+
             for chain in chainsInCell:
-                for seq in chain.steps[nstep].sequences:
+                step = chain.steps[nstep]
+                CFSeq = CFSequence(step, sfilter)
+                if not CFSequenceAdded:
+                    CFSequences.append(CFSeq)
+                    CFSequenceAdded = True
+                for seq in step.sequences:
                     if seq.ca is None:
                         raise ValueError('ComponentAccumulator missing in sequence {} in chain {}'.format(seq.name, chain.name))
                     stepsAcc.merge( seq.ca )
-                    recoAcc.addEventAlgo( seq.hypo.Alg, sequenceName = stepView.getName() )
+                    recoAcc.addEventAlgo(seq.hypo.Alg, sequenceName = stepView.getName())
+                if step.isCombo:
+                    recoAcc.addEventAlgo(step.combo.Alg, sequenceName = stepView.getName())
                 sfilter.setChains(chain.name)
 
             recoAcc.merge(stepsAcc, sequenceName = stepReco.getName())
 
-            connectStepToFilter(chainStep, sfilter)
-
             for sequence in chainStep.sequences:
                 stepDecisions += sequence.outputs
 
@@ -106,4 +115,13 @@ def generateDecisionTree(chains, allChainDicts):
         summary = makeSummary('TriggerSummary{}'.format(stepName), stepDecisions)
         acc.addSequence(summary, parentName = mainSequenceName)
 
+        allCFSequences.append(CFSequences)
+
+        stepCF_DataFlow_to_dot(stepRecoNodeName, CFSequences)
+        stepCF_ControlFlow_to_dot(stepRecoNode)
+
+    acc.printConfig()
+
+    all_DataFlow_to_dot(mainSequenceName, allCFSequences)
+
     return acc
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
index d8333ba5259020536f665a6caef20017ee07e1ba..cd5c52b50970bedc3b91a323e8698eaf33d3c6fe 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
@@ -37,9 +37,9 @@ def setupMenu():
 
      ]
     TriggerFlags.EgammaSlice.signatures = [
-        ['HLT_e3_etcut_L1EM3',      [],  [PhysicsStream], ['RATE:SingleElectron', 'BW:Electron'], -1],
-        ['HLT_e5_etcut_L1EM3',      [],  [PhysicsStream], ['RATE:SingleElectron', 'BW:Electron'], -1],
-        ['HLT_e7_etcut_L1EM3',      [],  [PhysicsStream], ['RATE:SingleElectron', 'BW:Electron'], -1],
+        ['HLT_e3_etcut_L1EM3',      ['L1_EM3', ['EM3']],  [PhysicsStream], ['RATE:SingleElectron', 'BW:Electron'], -1],
+        ['HLT_e5_etcut_L1EM3',      ['L1_EM3', ['EM3']],  [PhysicsStream], ['RATE:SingleElectron', 'BW:Electron'], -1],
+        ['HLT_e7_etcut_L1EM3',      ['L1_EM3', ['EM3']],  [PhysicsStream], ['RATE:SingleElectron', 'BW:Electron'], -1],
         #['e20_L1EM10',   [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Electron'], -1],        
         ]
     TriggerFlags.CombinedSlice.signatures = [
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1_newJO.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1_newJO.py
index 1a16de80f5d8a7354fdd7320246d30c0fb2e7d52..ca823abc8cb86fffeea5cdf6100e1a7cdf40226c 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1_newJO.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1_newJO.py
@@ -2,8 +2,16 @@
 
 def get_flag_item(chainName, L1itemsChainParts, groups):
     PhysicsStream = 'Main'
-    L1item = chainName.split('_')[-1].replace('L1', 'L1_')
-    return [chainName, L1item, [PhysicsStream], groups, -1]
+
+    if L1itemsChainParts == []:
+        L1item = 'L1_'+chainName.split('_L1')[-1]
+        L1thresholds = L1item.split('_')[1:]
+        L1itemsChainParts = [L1item, L1thresholds ]
+    elif L1itemsChainParts[0] is None:
+        L1item = 'L1_'+chainName.split('_L1')[-1]
+        L1itemsChainParts[0] = L1item
+        
+    return [chainName, L1itemsChainParts, [PhysicsStream], groups, -1]
 
 def setupMenu(flags):
     """