diff --git a/Calorimeter/CaloUtils/CaloUtils/CaloCellDetPos.h b/Calorimeter/CaloUtils/CaloUtils/CaloCellDetPos.h
index af52edb21703b98b47d7f0e802a75f0e4893b17a..ef46fbea5bd11c18353319244cd2e0aa1963c388 100644
--- a/Calorimeter/CaloUtils/CaloUtils/CaloCellDetPos.h
+++ b/Calorimeter/CaloUtils/CaloUtils/CaloCellDetPos.h
@@ -40,7 +40,8 @@ class CaloCellDetPos
    * @param  double etaDet   : estimated eta detector in nominal calo frame
    * @param  double phiDet   : estimated phi detector in nominal calo frame
    */
-  bool getDetPosition(CaloCell_ID::CaloSample sam , double etaAtlas, double phiAtlas, double & etaDet, double & phiDet);
+  bool getDetPosition(CaloCell_ID::CaloSample sam , double etaAtlas, double phiAtlas, 
+                      double & etaDet, double & phiDet) const;
 
 
   /**
@@ -52,7 +53,8 @@ class CaloCellDetPos
    * @param  double phiAtlas : estimated phi detector in aligned Atlas frame
    */
 
-  bool getAtlasPosition(CaloCell_ID::CaloSample sam , double etaDet, double phiDet, double & etaAtlas, double & phiAtlas);
+  bool getAtlasPosition(CaloCell_ID::CaloSample sam , double etaDet, double phiDet, 
+                        double & etaAtlas, double & phiAtlas) const;
 
   private:
 
diff --git a/Calorimeter/CaloUtils/src/CaloCellDetPos.cxx b/Calorimeter/CaloUtils/src/CaloCellDetPos.cxx
index c22c226e2069660ada098299fd5ef860aff1ba19..73b10158a4b223ca3785596bc090b723eb1954bd 100644
--- a/Calorimeter/CaloUtils/src/CaloCellDetPos.cxx
+++ b/Calorimeter/CaloUtils/src/CaloCellDetPos.cxx
@@ -20,7 +20,7 @@ CaloCellDetPos::~CaloCellDetPos()
 {}
 
 bool CaloCellDetPos::getDetPosition(CaloCell_ID::CaloSample sam, double etaAtlas, 
-                                    double phiAtlas, double& etaDet, double& phiDet)
+                                    double phiAtlas, double& etaDet, double& phiDet) const
 {
 
   const CaloDetDescrManager* calo_mgr;
@@ -39,7 +39,7 @@ bool CaloCellDetPos::getDetPosition(CaloCell_ID::CaloSample sam, double etaAtlas
 }
 
 bool CaloCellDetPos::getAtlasPosition(CaloCell_ID::CaloSample sam, double etaDet, 
-                                      double phiDet, double& etaAtlas, double& phiAtlas)
+                                      double phiDet, double& etaAtlas, double& phiAtlas) const
 {
 
   const CaloDetDescrManager* calo_mgr;
diff --git a/Control/AthenaMonitoring/share/hist_diff.sh b/Control/AthenaMonitoring/share/hist_diff.sh
index f75ff83fd00970d487cfd1223ae10244b62d6673..60ddc2ff0296975b752d2f1ad3e1686ad5ee59c2 100755
--- a/Control/AthenaMonitoring/share/hist_diff.sh
+++ b/Control/AthenaMonitoring/share/hist_diff.sh
@@ -1,23 +1,41 @@
 #!/bin/bash
 
-if [[ ! -f $1 ]] ; then { echo "$1 does not exist"; exit 1; } ; fi
-if [[ ! -f $2 ]] ; then { echo "$2 does not exist"; exit 1; } ; fi
+FILE1=$1
+FILE2=$2
+shift 2
+
+GREPOPTS='-E ""'
+while getopts "x:" opt; do
+    case ${opt} in
+	x )
+	    echo "Will ignore: $OPTARG"
+	    GREPOPTS="-v -E $OPTARG"
+	    ;;
+	\? )
+	    echo "Invalid option: -$OPTARG"
+	    exit 1
+	    ;;
+    esac
+done
+
+if [[ ! -f $FILE1 ]] ; then { echo "$1 does not exist"; exit 1; } ; fi
+if [[ ! -f $FILE2 ]] ; then { echo "$2 does not exist"; exit 1; } ; fi
 
 LOG1=$(mktemp FILE1.XXXXXXX)
 LOG2=$(mktemp FILE2.XXXXXXX)
 
-hist_file_dump.py $1 --hash > $LOG1
+hist_file_dump.py $FILE1 --hash | grep $GREPOPTS > $LOG1
 RV=$?
-if [ $RV != 0 ]; then { echo "Failure dumping $1"; rm -f $LOG1 $LOG2; exit $RV ; }; fi
-hist_file_dump.py $2 --hash > $LOG2
+if [ $RV != 0 ]; then { echo "Failure dumping $FILE1"; rm -f $LOG1 $LOG2; exit $RV ; }; fi
+hist_file_dump.py $FILE2 --hash | grep $GREPOPTS > $LOG2
 RV=$?
-if [ $RV != 0 ]; then { echo "Failure dumping $2"; rm -f $LOG1 $LOG2; exit $RV ; }; fi
+if [ $RV != 0 ]; then { echo "Failure dumping $FILE2"; rm -f $LOG1 $LOG2; exit $RV ; }; fi
 
 diff  $LOG1 $LOG2
 RV=$?
 if [ $RV != 0 ]; then
-    echo "$1 <"
-    echo "$2 >"
+    echo "$FILE1 <"
+    echo "$FILE2 >"
     echo "Files differ"
 else
     echo "Files match"
diff --git a/Control/AthenaMonitoring/test/test_run3dq_r21_esd.sh b/Control/AthenaMonitoring/test/test_run3dq_r21_esd.sh
index 85055a596f6a9d1ad0a1eedc2a50507f30ea2ffc..a019e5a9ee39ebcff619f98914e908b9ba700857 100755
--- a/Control/AthenaMonitoring/test/test_run3dq_r21_esd.sh
+++ b/Control/AthenaMonitoring/test/test_run3dq_r21_esd.sh
@@ -11,5 +11,5 @@ echo "art-result: $? HIST_Creation"
 ArtPackage=$1
 ArtJobName=$2
 art.py download ${ArtPackage} ${ArtJobName}
-hist_diff.sh ExampleMonitorOutput.root ./ref-*/ExampleMonitorOutput.root
+hist_diff.sh ExampleMonitorOutput.root ./ref-*/ExampleMonitorOutput.root -x TIME_execute
 echo "art-result: $? HIST_Diff"
diff --git a/Control/AthenaMonitoring/test/test_run3dq_r21_esd_mc.sh b/Control/AthenaMonitoring/test/test_run3dq_r21_esd_mc.sh
index f8f4ac0c73c56241222fbbdd4618e8f181fd3621..bdeb68408b85c9e822cc598a78e3f441db4205d7 100755
--- a/Control/AthenaMonitoring/test/test_run3dq_r21_esd_mc.sh
+++ b/Control/AthenaMonitoring/test/test_run3dq_r21_esd_mc.sh
@@ -11,5 +11,5 @@ echo "art-result: $? HIST_Creation"
 ArtPackage=$1
 ArtJobName=$2
 art.py download ${ArtPackage} ${ArtJobName}
-hist_diff.sh ExampleMonitorOutput.root ./ref-*/ExampleMonitorOutput.root
+hist_diff.sh ExampleMonitorOutput.root ./ref-*/ExampleMonitorOutput.root -x TIME_execute
 echo "art-result: $? HIST_Diff"
diff --git a/Control/AthenaMonitoring/test/test_run3dq_r21_esd_mt.sh b/Control/AthenaMonitoring/test/test_run3dq_r21_esd_mt.sh
index 9e580205c6e64675405a87b63e30b822ea440851..f56b099e939cb4c1525e00c5e5686ae6bcb6203d 100755
--- a/Control/AthenaMonitoring/test/test_run3dq_r21_esd_mt.sh
+++ b/Control/AthenaMonitoring/test/test_run3dq_r21_esd_mt.sh
@@ -11,5 +11,11 @@ echo "art-result: $? HIST_Creation"
 ArtPackage=$1
 ArtJobName=$2
 art.py download ${ArtPackage} ${ArtJobName}
-hist_diff.sh ExampleMonitorOutput.root ./ref-*/ExampleMonitorOutput.root
+hist_diff.sh ExampleMonitorOutput.root ./ref-*/ExampleMonitorOutput.root -x TIME_execute
 echo "art-result: $? HIST_Diff"
+rm -rf ref-*
+
+art.py download AthenaMonitoring test_run3eq_r21_esd.sh
+hist_diff.sh ExampleMonitorOutput.root ./ref-*/ExampleMonitorOutput.root -x TIME_execute
+echo "art-result: $? HIST_Diff_Serial"
+
diff --git a/Control/AthenaMonitoring/test/test_run3dq_r22_esd.sh b/Control/AthenaMonitoring/test/test_run3dq_r22_esd.sh
index 59c55230ab015d1ca7b7a33e0dc4f95ffbe9807d..a458e861085b0688cf161fede472a3d9b1b9f56f 100755
--- a/Control/AthenaMonitoring/test/test_run3dq_r22_esd.sh
+++ b/Control/AthenaMonitoring/test/test_run3dq_r22_esd.sh
@@ -14,5 +14,5 @@ rm -rf ref-*
 ArtPackage=$1
 ArtJobName=$2
 art.py download ${ArtPackage} ${ArtJobName}
-hist_diff.sh ExampleMonitorOutput.root ./ref-*/ExampleMonitorOutput.root
+hist_diff.sh ExampleMonitorOutput.root ./ref-*/ExampleMonitorOutput.root -x TIME_execute
 echo "art-result: $? HIST_Diff"
diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/python/PoolWriteConfig.py b/Database/AthenaPOOL/AthenaPoolCnvSvc/python/PoolWriteConfig.py
new file mode 100644
index 0000000000000000000000000000000000000000..e695062b04fe498aa6e3a8dacc1fba2476107cdf
--- /dev/null
+++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/python/PoolWriteConfig.py
@@ -0,0 +1,31 @@
+"""Configuration for POOL file writing
+
+Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+"""
+from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
+from AthenaPoolCnvSvc.AthenaPoolCnvSvcConf import AthenaPoolCnvSvc
+
+
+def PoolWriteCfg(configFlags, **kwargs):
+    """Return ComponentAccumulator configured to Write POOL files"""
+    # based on WriteAthenaPool._configureWriteAthenaPool
+    acc = ComponentAccumulator()
+
+    PoolAttributes = []
+    # Switch off splitting by setting default SplitLevel to 0
+    PoolAttributes += ["DEFAULT_SPLITLEVEL ='0'"]
+    # Set as default the member-wise streaming, ROOT default
+    PoolAttributes += ["STREAM_MEMBER_WISE = '1'"]
+
+    # Increase default BasketSize to 32K, ROOT default (but overwritten by POOL)
+    PoolAttributes += ["DEFAULT_BUFFERSIZE = '32000'"]
+
+    # Turn off auto_flush for DataHeader container to avoid basket optimization
+    PoolAttributes += ["ContainerName = 'POOLContainer(DataHeader)'; BRANCH_BASKET_SIZE = '256000'"]
+    PoolAttributes += ["ContainerName = 'POOLContainerForm(DataHeaderForm)'; BRANCH_BASKET_SIZE = '1024000'"]
+    PoolAttributes += ["ContainerName = 'TTree=POOLContainerForm(DataHeaderForm)'; CONTAINER_SPLITLEVEL = '99'"]
+
+    kwargs.setdefault("PoolAttributes", PoolAttributes)
+
+    acc.addService(AthenaPoolCnvSvc(**kwargs))
+    return acc
diff --git a/ForwardDetectors/ForwardSimulation/ForwardRegion_EventCnv/ForwardRegion_EventTPCnv/CMakeLists.txt b/ForwardDetectors/ForwardSimulation/ForwardRegion_EventCnv/ForwardRegion_EventTPCnv/CMakeLists.txt
index 187aecd6e0c919e70a072b7e63c83a59c749c158..958d89332fcc61ce060c1d5632d95fed9c3fba51 100644
--- a/ForwardDetectors/ForwardSimulation/ForwardRegion_EventCnv/ForwardRegion_EventTPCnv/CMakeLists.txt
+++ b/ForwardDetectors/ForwardSimulation/ForwardRegion_EventCnv/ForwardRegion_EventTPCnv/CMakeLists.txt
@@ -10,6 +10,7 @@ atlas_depends_on_subdirs( PUBLIC
                           Database/AthenaPOOL/AthenaPoolCnvSvc
                           ForwardDetectors/ForwardSimulation/ForwardRegion_SimEv
                           PRIVATE
+                          AtlasTest/TestTools
                           DetectorDescription/Identifier
                           GaudiKernel )
 
@@ -30,3 +31,12 @@ atlas_add_dictionary( ForwardRegion_EventTPCnvDict
                       INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
                       LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaPoolCnvSvcLib ForwardRegion_SimEv Identifier GaudiKernel ForwardRegion_EventTPCnv )
 
+
+
+atlas_add_test( SimulationHitCnv_p1_test
+                SOURCES
+                test/SimulationHitCnv_p1_test.cxx
+                INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
+                LINK_LIBRARIES ForwardRegion_EventTPCnv )
+
+                    
diff --git a/ForwardDetectors/ForwardSimulation/ForwardRegion_EventCnv/ForwardRegion_EventTPCnv/share/SimulationHitCnv_p1_test.ref b/ForwardDetectors/ForwardSimulation/ForwardRegion_EventCnv/ForwardRegion_EventTPCnv/share/SimulationHitCnv_p1_test.ref
new file mode 100644
index 0000000000000000000000000000000000000000..bf6bb996dc77c17451184c892048c0af20845b11
--- /dev/null
+++ b/ForwardDetectors/ForwardSimulation/ForwardRegion_EventCnv/ForwardRegion_EventTPCnv/share/SimulationHitCnv_p1_test.ref
@@ -0,0 +1,2 @@
+ForwardRegion_EventTPCnv/test/SimulationHitCnv_p1_test
+test1
diff --git a/ForwardDetectors/ForwardSimulation/ForwardRegion_EventCnv/ForwardRegion_EventTPCnv/test/SimulationHitCnv_p1_test.cxx b/ForwardDetectors/ForwardSimulation/ForwardRegion_EventCnv/ForwardRegion_EventTPCnv/test/SimulationHitCnv_p1_test.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..83b20c594f951a5f0a5120eeb9eeae742923e8d0
--- /dev/null
+++ b/ForwardDetectors/ForwardSimulation/ForwardRegion_EventCnv/ForwardRegion_EventTPCnv/test/SimulationHitCnv_p1_test.cxx
@@ -0,0 +1,93 @@
+/*
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+*/
+/**
+ * @file ForwardRegion_EventTPCnv/test/SimulationHitCnv_p1_test.cxx
+ * @author scott snyder <snyder@bnl.gov>
+ * @date Oct, 2019
+ * @brief Regression tests.
+ */
+
+#undef NDEBUG
+#include "ForwardRegion_EventTPCnv/SimulationHitCnv_p1.h"
+#include "TestTools/leakcheck.h"
+#include "GaudiKernel/MsgStream.h"
+#include <cassert>
+#include <iostream>
+
+
+void compare (const CLHEP::Hep3Vector& p1,
+              const CLHEP::Hep3Vector& p2)
+{
+  assert (p1.x() == p2.x());
+  assert (p1.y() == p2.y());
+  assert (p1.z() == p2.z());
+}
+
+
+void compare (const SimulationHit::StepPoint& p1,
+              const SimulationHit::StepPoint& p2)
+{
+  assert (p1.time == p2.time);
+  assert (p2.kinetic_energy == p2.kinetic_energy);
+  compare (p1.position, p2.position);
+  compare (p1.direction, p2.direction);
+  compare (p1.momentum, p2.momentum);
+}
+
+
+void compare (const SimulationHit& p1,
+              const SimulationHit& p2)
+{
+  compare (p1.pre(), p2.pre());
+  compare (p1.post(), p2.post());
+  assert (p1.depositEnergy() == p2.depositEnergy());
+  assert (p1.particleEncoding() == p2.particleEncoding());
+  assert (p1.trackID() == p2.trackID());
+  assert (p1.parentID() == p2.parentID());
+}
+
+
+void testit (const SimulationHit& trans1)
+{
+  MsgStream log (0, "test");
+  SimulationHitCnv_p1 cnv;
+  SimulationHit_p1 pers;
+  cnv.transToPers (&trans1, &pers, log);
+  SimulationHit trans2;
+  cnv.persToTrans (&pers, &trans2, log);
+  compare (trans1, trans2);
+}
+
+void test1()
+{
+  std::cout << "test1\n";
+  Athena_test::Leakcheck check;
+
+  SimulationHit trans1 (2.5,
+                        CLHEP::Hep3Vector (3.5, 4.5, 5.5),
+                        6.5,
+                        CLHEP::Hep3Vector (7.5, 8.5, 9.5),
+                        CLHEP::Hep3Vector (10.5, 11.5, 12.5),
+
+                        13.5,
+                        CLHEP::Hep3Vector (14.5, 15.5, 16.5),
+                        17.5,
+                        CLHEP::Hep3Vector (18.5, 19.5, 20.5),
+                        CLHEP::Hep3Vector (21.5, 22.5, 23.5),
+
+                        24.5,
+                        25,
+                        26,
+                        27);
+                                  
+  testit (trans1);
+}
+
+
+int main()
+{
+  std::cout << "ForwardRegion_EventTPCnv/test/SimulationHitCnv_p1_test\n";
+  test1();
+  return 0;
+}
diff --git a/Generators/CavernBkgGenerator/CavernBkgGenerator/GenerateCavernBkg.h b/Generators/CavernBkgGenerator/CavernBkgGenerator/GenerateCavernBkg.h
index a02c2f4d7b24ff578219d0f14006e2f70dde33bc..5eab6c8eeda0b88053d867d678c50136d5d792c5 100644
--- a/Generators/CavernBkgGenerator/CavernBkgGenerator/GenerateCavernBkg.h
+++ b/Generators/CavernBkgGenerator/CavernBkgGenerator/GenerateCavernBkg.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 GENERATECAVERNBKG_H
@@ -49,7 +49,6 @@ private:
   std::string            m_infile;
   //@}
 
-  McEventCollection*     m_mcEvtColl;
   std::vector<long int>  m_seeds;
 
   // Accessors to the event
diff --git a/Generators/CavernBkgGenerator/CavernBkgGenerator/MuonBackgroundConverter.h b/Generators/CavernBkgGenerator/CavernBkgGenerator/MuonBackgroundConverter.h
index 72230ac078508d8c2ba985e41314ffaf1ac5bfe3..002e7f0c2c5a8a2f70e5a2672713ac382940d1c6 100644
--- a/Generators/CavernBkgGenerator/CavernBkgGenerator/MuonBackgroundConverter.h
+++ b/Generators/CavernBkgGenerator/CavernBkgGenerator/MuonBackgroundConverter.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 MUONBACKGROUNDCONVERTER_H
@@ -66,7 +66,7 @@ class MuonBackgroundConverter : public GenModule
     int    m_nEvents;      // event counter
     int    m_phiN;      // rot symmetry = 8
     int    m_safetyFactor; // number of original input events to be merged in one output event 
-    bool   m_smearPhi;     // flag to switch on/off smearing in azimuthal angle phi (pT, p, particles/evt, ... conserved) 
+    //bool   m_smearPhi;     // flag to switch on/off smearing in azimuthal angle phi (pT, p, particles/evt, ... conserved) 
     bool   m_firstHitOnly; // flag to switch on/off removal of multiple hits with same energy (true: only first hit is kept) 
     double m_ctcut;        // lifetime cut
     double m_t0;           // bunch crossing time
diff --git a/Generators/CavernBkgGenerator/src/GenerateCavernBkg.cxx b/Generators/CavernBkgGenerator/src/GenerateCavernBkg.cxx
index 0c9b81800ff35e5bbfcefc4cd26c58a14eb9c340..6c5e79ae1bb84d839df9b35616a07411841b2fa6 100644
--- a/Generators/CavernBkgGenerator/src/GenerateCavernBkg.cxx
+++ b/Generators/CavernBkgGenerator/src/GenerateCavernBkg.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
 */
 
 #include "CavernBkgGenerator/GenerateCavernBkg.h"
@@ -24,7 +24,7 @@ extern "C" {
 
 
 GenerateCavernBkg::GenerateCavernBkg(const string& name, ISvcLocator* pSvcLocator)
-  : GenModule(name, pSvcLocator), m_mcEvtColl(0)
+  : GenModule(name, pSvcLocator)
 {
   declareProperty("InputFile",  m_infile="fvpn21n.dat");
 }
diff --git a/Generators/CavernBkgGenerator/src/MuonBackgroundConverter.cxx b/Generators/CavernBkgGenerator/src/MuonBackgroundConverter.cxx
index 7b7d7ac4b6d002303c370ffd6157858fc7fe0430..e1c95a009713a336a776679ef53cb584e6dbfb15 100644
--- a/Generators/CavernBkgGenerator/src/MuonBackgroundConverter.cxx
+++ b/Generators/CavernBkgGenerator/src/MuonBackgroundConverter.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
 */
 
 // -------------------------------------------------------------
@@ -54,7 +54,7 @@
 MuonBackgroundConverter::MuonBackgroundConverter( const std::string& name, ISvcLocator* pSvcLocator ) 
   : GenModule( name, pSvcLocator ),
     m_nEvents(0),
-    m_smearPhi(false),
+    //m_smearPhi(false),
     m_used(0),
     m_rndmSvc("AtRndmGenSvc", name ),
     m_rndmEngine(0),
diff --git a/Generators/CavernBkgGenerator/src/cavbkg.F b/Generators/CavernBkgGenerator/src/cavbkg.F
index f15c0a0dc48489eb082b4c34a3dbf76d2033e092..1de781115e70e18c6283a9b15312b25615ce7629 100644
--- a/Generators/CavernBkgGenerator/src/cavbkg.F
+++ b/Generators/CavernBkgGenerator/src/cavbkg.F
@@ -197,4 +197,3 @@ C 5012 CONTINUE
       RETURN
 C 1    CONTINUE
       END
-	  
diff --git a/Generators/CavernBkgGenerator/src/vdist.F b/Generators/CavernBkgGenerator/src/vdist.F
index 56a7e9eb21eda5635e8f7bca9d88ff7bc895afdc..946d834c52e9bd1123805dcc517c7e8a1dfd4c6a 100644
--- a/Generators/CavernBkgGenerator/src/vdist.F
+++ b/Generators/CavernBkgGenerator/src/vdist.F
@@ -9,7 +9,8 @@ C
       IF (N.LE.0)            GO TO 24
 C
       DO 9 J=1,N
-    9 XX = XX + (X(J)-Y(J)) **2
+        XX = XX + (X(J)-Y(J)) **2
+ 9    end do
       XX = SQRT (XX)
    24 VDIST = XX
       RETURN
diff --git a/Generators/TruthUtils/TruthUtils/HepMCHelpers.h b/Generators/TruthUtils/TruthUtils/HepMCHelpers.h
index 2e73fa3087326c05df8756d86ca9fea428c773d2..53a150f4a3f2d7df8ce07d995066631a113a496c 100644
--- a/Generators/TruthUtils/TruthUtils/HepMCHelpers.h
+++ b/Generators/TruthUtils/TruthUtils/HepMCHelpers.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
 */
 
 #pragma once
@@ -18,13 +18,6 @@
 //using fastjet::PseudoJet;
 //using fastjet::ClusterSequence;
 
-// Alias BOOST_FOREACH as foreach in this semi-safe way
-#include <boost/foreach.hpp>
-#ifndef foreach
-namespace boost { namespace BOOST_FOREACH = foreach; }
-#define foreach BOOST_FOREACH
-#endif
-
 
 namespace MC {
 
diff --git a/InnerDetector/InDetConditions/PixelConditionsTools/src/PixelByteStreamErrorsTool.cxx b/InnerDetector/InDetConditions/PixelConditionsTools/src/PixelByteStreamErrorsTool.cxx
index 3b9d0a619c1ed7a85e59c865b5f822ab9f93ea0b..9a672fcc4c0bb949a95711f4ce322a84ae41a9bc 100644
--- a/InnerDetector/InDetConditions/PixelConditionsTools/src/PixelByteStreamErrorsTool.cxx
+++ b/InnerDetector/InDetConditions/PixelConditionsTools/src/PixelByteStreamErrorsTool.cxx
@@ -12,7 +12,6 @@ PixelByteStreamErrorsTool::PixelByteStreamErrorsTool(const std::string& type, co
   m_readESD(false)
 { 
   declareProperty("ReadingESD",     m_readESD,"Get summary of BS errors from StoreGate, if available"); 
-  declareProperty("BSErrContainer", m_BSErrContainerKey=std::string("PixelByteStreamErrs"));
   resetCounts();
 }
 
@@ -21,11 +20,14 @@ StatusCode PixelByteStreamErrorsTool::initialize() {
 
   ATH_CHECK(detStore()->retrieve(m_pixelID,"PixelID"));
 
-  m_BSErrContReadKey=m_BSErrContainerKey;
-  ATH_CHECK(m_BSErrContReadKey.initialize());
-
-  m_BSErrContWriteKey=m_BSErrContainerKey;
-  ATH_CHECK(m_BSErrContWriteKey.initialize());
+  if (m_readESD) {
+    ATH_CHECK(m_BSErrContReadKey.initialize());
+    renounce(m_BSErrContWriteKey);
+  }
+  else {
+    renounce(m_BSErrContReadKey);
+    ATH_CHECK(m_BSErrContWriteKey.initialize());
+  }
 
   m_module_errors.reserve(m_pixelID->wafer_hash_max());
   m_moduleROD_errors.reserve(m_pixelID->wafer_hash_max());
diff --git a/InnerDetector/InDetConditions/PixelConditionsTools/src/PixelByteStreamErrorsTool.h b/InnerDetector/InDetConditions/PixelConditionsTools/src/PixelByteStreamErrorsTool.h
index d5036951588389e6988658918449c147f1d611c2..8f281f906926945a2d276bdf9a3ed5e2c88b914f 100644
--- a/InnerDetector/InDetConditions/PixelConditionsTools/src/PixelByteStreamErrorsTool.h
+++ b/InnerDetector/InDetConditions/PixelConditionsTools/src/PixelByteStreamErrorsTool.h
@@ -83,8 +83,8 @@ class PixelByteStreamErrorsTool: public AthAlgTool, public IPixelByteStreamError
   private:
     const PixelID* m_pixelID;
 
-    SG::ReadHandleKey<InDetBSErrContainer>  m_BSErrContReadKey;
-    SG::WriteHandleKey<InDetBSErrContainer> m_BSErrContWriteKey;
+    SG::ReadHandleKey<InDetBSErrContainer>  m_BSErrContReadKey {this, "PixelByteStreamErrsRead", "PixelByteStreamErrs", "PixelByteStreamErrs container key"};
+    SG::WriteHandleKey<InDetBSErrContainer> m_BSErrContWriteKey {this, "PixelByteStreamErrsWrite", "PixelByteStreamErrs", "PixelByteStreamErrs container key"};
 
     mutable std::vector<unsigned int> m_module_errors;
     mutable std::vector<unsigned int> m_moduleROD_errors;
@@ -119,7 +119,6 @@ class PixelByteStreamErrorsTool: public AthAlgTool, public IPixelByteStreamError
     mutable unsigned int m_ServiceRecords[32];
 
     bool m_readESD;
-    std::string m_BSErrContainerKey;
 };
 
 inline InterfaceID& PixelByteStreamErrorsTool::interfaceID() {
diff --git a/InnerDetector/InDetEventCnv/PixelRawDataByteStreamCnv/src/PixelRawDataProviderTool.cxx b/InnerDetector/InDetEventCnv/PixelRawDataByteStreamCnv/src/PixelRawDataProviderTool.cxx
index 013c2f1af6a8880428542bb60c662ed366113cb8..97f3613c27e17f861da8dfd380c1f7e97843eab1 100644
--- a/InnerDetector/InDetEventCnv/PixelRawDataByteStreamCnv/src/PixelRawDataProviderTool.cxx
+++ b/InnerDetector/InDetEventCnv/PixelRawDataByteStreamCnv/src/PixelRawDataProviderTool.cxx
@@ -22,6 +22,7 @@ PixelRawDataProviderTool::PixelRawDataProviderTool(const std::string& type, cons
 {
   declareProperty("LVL1CollectionName",m_LVL1CollectionKey);
   declareProperty("BCIDCollectionName",m_BCIDCollectionKey);
+  declareProperty("checkLVL1ID", m_checkLVL1ID = true);
   declareInterface<IPixelRawDataProviderTool>(this);   
 }
 
@@ -58,7 +59,7 @@ StatusCode PixelRawDataProviderTool::convert(std::vector<const ROBFragment*>& ve
 #endif
 
   //    are we working on a new event ?
-  bool isNewEvent = ((*rob_it)->rod_lvl1_id() != m_LastLvl1ID);
+  bool isNewEvent = m_checkLVL1ID ? ((*rob_it)->rod_lvl1_id() != m_LastLvl1ID) : true;
   if (isNewEvent) {
     m_LVL1Collection = SG::makeHandle(m_LVL1CollectionKey);
     ATH_CHECK(m_LVL1Collection.record(std::make_unique<InDetTimeCollection>()));
diff --git a/InnerDetector/InDetEventCnv/PixelRawDataByteStreamCnv/src/PixelRawDataProviderTool.h b/InnerDetector/InDetEventCnv/PixelRawDataByteStreamCnv/src/PixelRawDataProviderTool.h
index ce49ef183154db14c1f255fa0bcd21489ac60ca4..6bd34caa0b379b810d5d88c1bf0ce8ca042707f2 100644
--- a/InnerDetector/InDetEventCnv/PixelRawDataByteStreamCnv/src/PixelRawDataProviderTool.h
+++ b/InnerDetector/InDetEventCnv/PixelRawDataByteStreamCnv/src/PixelRawDataProviderTool.h
@@ -51,6 +51,7 @@ private:
 
   int m_DecodeErrCount;
   uint32_t m_LastLvl1ID;
+  bool m_checkLVL1ID;
 };
 
 #endif
diff --git a/InnerDetector/InDetSimUtils/TRT_TR_Process/src/TRRegionXMLHandler.cxx b/InnerDetector/InDetSimUtils/TRT_TR_Process/src/TRRegionXMLHandler.cxx
index 7ec330514212c09fae3ef68cf78befce6b56c54e..a723cb87aac0ed4ba60f1f284e19760c4a83a122 100644
--- a/InnerDetector/InDetSimUtils/TRT_TR_Process/src/TRRegionXMLHandler.cxx
+++ b/InnerDetector/InDetSimUtils/TRT_TR_Process/src/TRRegionXMLHandler.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
 */
 
 // class header
@@ -20,7 +20,6 @@
 #include "G4LogicalVolumeStore.hh"// For logical volume setup
 
 // For XML parsigin
-#include <boost/foreach.hpp>
 #include "boost/property_tree/xml_parser.hpp"
 #include "boost/property_tree/ptree.hpp"
 
@@ -81,7 +80,7 @@ void TRRegionXMLHandler::Process(const std::string& name)
   boost::property_tree::ptree pt;
   read_xml(is, pt);
 
-  BOOST_FOREACH( boost::property_tree::ptree::value_type const& v, pt.get_child("FADS") ) {
+  for( boost::property_tree::ptree::value_type const& v : pt.get_child("FADS") ) {
     if( v.first == "TRRegionParameters" ) {
 
       std::string volName=v.second.get<std::string>("<xmlattr>.RadiatorName");
diff --git a/PhysicsAnalysis/AnalysisCommon/IsolationSelection/Root/IsolationCloseByCorrectionTool.cxx b/PhysicsAnalysis/AnalysisCommon/IsolationSelection/Root/IsolationCloseByCorrectionTool.cxx
index a452c52b18ef6263f27445d77851c31d75d67e0f..7c5e6311550d1075fa2c7fae75cb40a10c85b1c4 100644
--- a/PhysicsAnalysis/AnalysisCommon/IsolationSelection/Root/IsolationCloseByCorrectionTool.cxx
+++ b/PhysicsAnalysis/AnalysisCommon/IsolationSelection/Root/IsolationCloseByCorrectionTool.cxx
@@ -493,14 +493,17 @@ namespace CP {
             const xAOD::CaloCluster* cluster = getCluster(par);
             //At the moment no cluster associated with muons is in the derivations
             int nSample = 0;
-            float etaT = 0.0, phiT = 0.0;
+            float etaT = 0.0, phiT = 0.0, dphiT = 0.0;
             if (cluster) {
                 for (unsigned int i = 0; i < CaloSampling::Unknown; i++) {
                     auto s = static_cast<CaloSampling::CaloSample>(i);
                     if (cluster->hasSampling(s)) {
                         ATH_MSG_VERBOSE("Sampling: " << i << "eta-phi (" << cluster->etaSample(s) << ", " << cluster->phiSample(s) << ")");
                         etaT += cluster->etaSample(s);
-                        phiT += cluster->phiSample(s);
+                        if(nSample==0)
+                          phiT = cluster->phiSample(s);
+                        else
+                          dphiT += xAOD::P4Helpers::deltaPhi( cluster->phiSample(s), phiT ); 
                         ++nSample;
                     }
                 }
@@ -508,7 +511,7 @@ namespace CP {
             if (nSample > 0) {
                 ATH_MSG_DEBUG("Eta, phi before sampling: " << eta << ", " << phi << " and after sampling: " << etaT / nSample << ", " << phiT / nSample);
                 eta = etaT / nSample;
-                phi = phiT / nSample;
+                phi = phiT + dphiT / nSample;
             }
         } else if (isEgamma(par)) {
             const xAOD::CaloCluster* cluster = getCluster(par);
diff --git a/PhysicsAnalysis/AnalysisCommon/PMGOverlapRemovalTools/HFORTools/Root/HFOR_Truth.cxx b/PhysicsAnalysis/AnalysisCommon/PMGOverlapRemovalTools/HFORTools/Root/HFOR_Truth.cxx
index c4cb27d31fd06de574eab2f4d0e06ee0737a40b5..d726a46c81e94de007283dd8f25b795fe3a68fb4 100644
--- a/PhysicsAnalysis/AnalysisCommon/PMGOverlapRemovalTools/HFORTools/Root/HFOR_Truth.cxx
+++ b/PhysicsAnalysis/AnalysisCommon/PMGOverlapRemovalTools/HFORTools/Root/HFOR_Truth.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
 */
 
 #include <iostream>
@@ -11,7 +11,6 @@
 #include "boost/current_function.hpp"
 #include <boost/any.hpp>
 
-#include "boost/foreach.hpp"
 #include "boost/property_tree/info_parser.hpp"
 #include "boost/property_tree/xml_parser.hpp"
 
@@ -719,19 +718,19 @@ int HFOR_Truth::readRunConfig(std::string runConfigFile) {
   //std::cout <<  BOOST_CURRENT_FUNCTION << " Configuration Date:    " <<  runConfig.get<std::string>("configuration.date")    << std::endl ;
 
 
-  BOOST_FOREACH(boost::property_tree::ptree::value_type &v, runConfig.get_child("flavor.isLight")) {
+  for(boost::property_tree::ptree::value_type &v : runConfig.get_child("flavor.isLight")) {
     //std::cout << BOOST_CURRENT_FUNCTION << " In flavor isLight: " << v.first.data() << " --> " << v.second.data() << std::endl;
     m_runConfigMap[HFORType::isLight].push_back( atoi(v.first.data()) ) ;
   }
-  BOOST_FOREACH(boost::property_tree::ptree::value_type &v, runConfig.get_child("flavor.isBB")) {
+  for(boost::property_tree::ptree::value_type &v : runConfig.get_child("flavor.isBB")) {
     //std::cout << BOOST_CURRENT_FUNCTION << " In flavor isBB: " << v.first.data() << " --> " << v.second.data() << std::endl;
     m_runConfigMap[HFORType::isBB].push_back( atoi(v.first.data()) ) ;
   }
-  BOOST_FOREACH(boost::property_tree::ptree::value_type &v, runConfig.get_child("flavor.isCC")) {
+  for(boost::property_tree::ptree::value_type &v : runConfig.get_child("flavor.isCC")) {
     //std::cout << BOOST_CURRENT_FUNCTION << " In flavor isCC: " << v.first.data() << " --> " << v.second.data() << std::endl;
     m_runConfigMap[HFORType::isCC].push_back( atoi(v.first.data()) ) ;
   }
-  BOOST_FOREACH(boost::property_tree::ptree::value_type &v, runConfig.get_child("flavor.isC")) {
+  for(boost::property_tree::ptree::value_type &v : runConfig.get_child("flavor.isC")) {
     //std::cout << BOOST_CURRENT_FUNCTION << " In flavor isC: " << v.first.data() << " --> " << v.second.data() << std::endl;
     m_runConfigMap[HFORType::isC].push_back( atoi(v.first.data()) ) ;
   }
diff --git a/PhysicsAnalysis/D3PDMaker/TruthD3PDAnalysis/src/TruthParticleFilterBase.cxx b/PhysicsAnalysis/D3PDMaker/TruthD3PDAnalysis/src/TruthParticleFilterBase.cxx
index c4b0209eb9f968baa6e7c3f65e560a115a8e3d14..242273eecb6115b0cc84837cd9b82d1ee385bcfb 100644
--- a/PhysicsAnalysis/D3PDMaker/TruthD3PDAnalysis/src/TruthParticleFilterBase.cxx
+++ b/PhysicsAnalysis/D3PDMaker/TruthD3PDAnalysis/src/TruthParticleFilterBase.cxx
@@ -1,8 +1,6 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
-
-// $Id$
 /**
  * @file TruthD3PDAnalysis/src/TruthParticleFilterBase.cxx
  * @author scott snyder <snyder@bnl.gov>
@@ -19,7 +17,7 @@
 #include "HepMC/GenEvent.h"
 #include "HepMC/GenVertex.h"
 #include "HepMC/GenParticle.h"
-#include "boost/foreach.hpp"
+#include "boost/range/iterator_range_core.hpp"
 #include <utility>
 
 
@@ -139,7 +137,7 @@ TruthParticleFilterBase::buildMcAod (const McEventCollection* mc_in,
 {
   // Loop over GenEvent's.
   mc_out->reserve (mc_in->size());
-  BOOST_FOREACH (const HepMC::GenEvent* ev_in, *mc_in) {
+  for (const HepMC::GenEvent* ev_in : *mc_in) {
     if (!ev_in) continue;
 
     // Copy the GenEvent.
@@ -180,7 +178,7 @@ TruthParticleFilterBase::filterEvent (const HepMC::GenEvent* ev_in,
                                       HepMC::GenEvent* ev_out)
 {
   // Loop over particles.
-  // (FOREACH doesn't work here because particle_const_iterator
+  // (range-based for doesn't work here because particle_const_iterator
   // isn't consistent in the use of const...)
   for (HepMC::GenEvent::particle_const_iterator ip = ev_in->particles_begin();
        ip != ev_in->particles_end();
@@ -255,18 +253,18 @@ TruthParticleFilterBase::addVertex (const HepMC::GenVertex* v,
     ev->add_vertex (vnew);
 
     // Fill in the existing relations of the new vertex.
-    BOOST_FOREACH(const HepMC::GenParticle* p,
-                  std::make_pair (v->particles_in_const_begin(),
-                                  v->particles_in_const_end()))
+    for (const HepMC::GenParticle* p :
+           boost::make_iterator_range (v->particles_in_const_begin(),
+                                       v->particles_in_const_end()))
     {
       HepMC::GenParticle* pnew = ev->barcode_to_particle (p->barcode());
       if (pnew)
         vnew->add_particle_in (pnew);
     }
 
-    BOOST_FOREACH(const HepMC::GenParticle* p,
-                  std::make_pair (v->particles_out_const_begin(),
-                                  v->particles_out_const_end()))
+    for (const HepMC::GenParticle* p :
+           boost::make_iterator_range (v->particles_out_const_begin(),
+                                       v->particles_out_const_end()))
     {
       HepMC::GenParticle* pnew = ev->barcode_to_particle (p->barcode());
       if (pnew)
diff --git a/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/src/TruthJetFilterTool.cxx b/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/src/TruthJetFilterTool.cxx
index 88b58d712617f705a35433d091df427c1f54b9f3..43ecda7e372764a0e797ab20bad082046f787b08 100644
--- a/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/src/TruthJetFilterTool.cxx
+++ b/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/src/TruthJetFilterTool.cxx
@@ -1,8 +1,6 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
-
-// $Id$
 /**
  * @file TruthD3PDMaker/src/TruthJetFilterTool.cxx
  * @author Renaud Bruneliere <Renaud.Bruneliere@cern.ch>
@@ -18,7 +16,7 @@
 #include "HepMC/GenVertex.h"
 #include "HepMC/GenParticle.h"
 #include "CLHEP/Vector/LorentzVector.h"
-#include "boost/foreach.hpp"
+#include "boost/range/iterator_range_core.hpp"
 #include <utility>
 
 
@@ -174,7 +172,7 @@ TruthJetFilterTool::buildMcAod (const McEventCollection* mc_in,
 {
   // Loop over GenEvent's.
   mc_out->reserve (mc_in->size());
-  BOOST_FOREACH (const HepMC::GenEvent* ev_in, *mc_in) {
+  for (const HepMC::GenEvent* ev_in : *mc_in) {
     if (!ev_in) continue;
 
     // Copy the GenEvent.
@@ -215,7 +213,7 @@ TruthJetFilterTool::filterEvent (const HepMC::GenEvent* ev_in,
 				 HepMC::GenEvent* ev_out)
 {
   // Loop over particles.
-  // (FOREACH doesn't work here because particle_const_iterator
+  // (range-based for doesn't work here because particle_const_iterator
   // isn't consistent in the use of const...)
   for (HepMC::GenEvent::particle_const_iterator ip = ev_in->particles_begin();
        ip != ev_in->particles_end();
@@ -290,18 +288,18 @@ TruthJetFilterTool::addVertex (const HepMC::GenVertex* v,
     ev->add_vertex (vnew);
 
     // Fill in the existing relations of the new vertex.
-    BOOST_FOREACH(const HepMC::GenParticle* p,
-                  std::make_pair (v->particles_in_const_begin(),
-                                  v->particles_in_const_end()))
+    for (const HepMC::GenParticle* p :
+           boost::make_iterator_range (v->particles_in_const_begin(),
+                                       v->particles_in_const_end()))
     {
       HepMC::GenParticle* pnew = ev->barcode_to_particle (p->barcode());
       if (pnew)
         vnew->add_particle_in (pnew);
     }
 
-    BOOST_FOREACH(const HepMC::GenParticle* p,
-                  std::make_pair (v->particles_out_const_begin(),
-                                  v->particles_out_const_end()))
+    for (const HepMC::GenParticle* p :
+           boost::make_iterator_range (v->particles_out_const_begin(),
+                                       v->particles_out_const_end()))
     {
       HepMC::GenParticle* pnew = ev->barcode_to_particle (p->barcode());
       if (pnew)
diff --git a/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/src/TruthLeptonParentAssociationTool.cxx b/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/src/TruthLeptonParentAssociationTool.cxx
index c9df3d75bacf8fea8572b756af6213bb49f2a556..f2b8d9f27f06e744c4772dc3851774d6ef0a8189 100644
--- a/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/src/TruthLeptonParentAssociationTool.cxx
+++ b/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/src/TruthLeptonParentAssociationTool.cxx
@@ -1,8 +1,6 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
-
-// $Id:
 /**
  * @file TruthD3PDMaker/src/TruthLeptonParentAssociationTool.cxx
  * @author Zach Marshall <zach.marshall@cern.ch>
@@ -18,7 +16,6 @@
 #include "McParticleEvent/TruthParticle.h"
 #include "McParticleEvent/TruthParticleContainer.h"
 #include "GeneratorObjects/McEventCollection.h"
-#include "boost/foreach.hpp"
 #include "HepPID/ParticleIDMethods.hh"
 #include <algorithm>
 
@@ -59,7 +56,7 @@ TruthLeptonParentAssociationTool::reset (const TruthParticle& p)
   const DataHandle<McEventCollection> mcec;
   if (evtStore()->retrieve<McEventCollection>(mcec,"GEN_EVENT").isSuccess()){ // Always run on EVGEN anyway...
     // Loop over GenEvent's.
-    BOOST_FOREACH (const HepMC::GenEvent* ev_in, *mcec) {
+    for (const HepMC::GenEvent* ev_in : *mcec) {
       if (!ev_in) continue;
       for (HepMC::GenEvent::particle_const_iterator itrPart = ev_in->particles_begin();
            itrPart!=ev_in->particles_end();++itrPart){
diff --git a/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/src/TruthTauDecayAssociationTool.cxx b/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/src/TruthTauDecayAssociationTool.cxx
index f09fc72ba316bd0649097634880b1fca8516f1c0..f4a2d27f19da820bfc207207e0015d56a5f6a89e 100644
--- a/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/src/TruthTauDecayAssociationTool.cxx
+++ b/PhysicsAnalysis/D3PDMaker/TruthD3PDMaker/src/TruthTauDecayAssociationTool.cxx
@@ -1,8 +1,6 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
-
-// $Id:
 /**
  * @file TruthD3PDMaker/src/TruthTauDecayAssociationTool.cxx
  * @author Zach Marshall <zach.marshall@cern.ch>
@@ -18,7 +16,7 @@
 #include "McParticleEvent/TruthParticle.h"
 #include "McParticleEvent/TruthParticleContainer.h"
 #include "GeneratorObjects/McEventCollection.h"
-#include "boost/foreach.hpp"
+
 
 namespace D3PD {
 
@@ -52,7 +50,7 @@ TruthTauDecayAssociationTool::reset (const TruthParticle& p)
   const DataHandle<McEventCollection> mcec;
   if (evtStore()->retrieve<McEventCollection>(mcec,"GEN_EVENT").isSuccess()){
     // Loop over GenEvent's.
-    BOOST_FOREACH (const HepMC::GenEvent* ev_in, *mcec) {
+    for (const HepMC::GenEvent* ev_in : *mcec) {
       if (!ev_in) continue;
       for (HepMC::GenEvent::particle_const_iterator itrPart = ev_in->particles_begin();
            itrPart!=ev_in->particles_end();++itrPart){
diff --git a/PhysicsAnalysis/MuonID/MuonPerformanceAnalysis/MuonCalibrationFit/MuonCalibrationFit/MuonCalibrationFit.h b/PhysicsAnalysis/MuonID/MuonPerformanceAnalysis/MuonCalibrationFit/MuonCalibrationFit/MuonCalibrationFit.h
index 253615af306f9df516242bb8ac79846d235949ae..6e3a2f9279df8fb2ec3a15b338ad4627a6c0abc0 100644
--- a/PhysicsAnalysis/MuonID/MuonPerformanceAnalysis/MuonCalibrationFit/MuonCalibrationFit/MuonCalibrationFit.h
+++ b/PhysicsAnalysis/MuonID/MuonPerformanceAnalysis/MuonCalibrationFit/MuonCalibrationFit/MuonCalibrationFit.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 MuonCalibrationFit_h
@@ -41,7 +41,6 @@
 #include <GaudiKernel/MsgStream.h>
 
 #include <boost/range/irange.hpp>
-#include <boost/foreach.hpp>
 #include <boost/tokenizer.hpp>
 
 #include "MuonCalibrationFit/Regions.h"
diff --git a/PhysicsAnalysis/MuonID/MuonPerformanceAnalysis/MuonCalibrationFit/src/MuonCalibrationFit.cxx b/PhysicsAnalysis/MuonID/MuonPerformanceAnalysis/MuonCalibrationFit/src/MuonCalibrationFit.cxx
index c82bf8b1a148d38f0c981f99594a941e1d46cc20..6c27d9997a2dba15f01b27bf193ba0ddbdec6402 100644
--- a/PhysicsAnalysis/MuonID/MuonPerformanceAnalysis/MuonCalibrationFit/src/MuonCalibrationFit.cxx
+++ b/PhysicsAnalysis/MuonID/MuonPerformanceAnalysis/MuonCalibrationFit/src/MuonCalibrationFit.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
 */
 
 #include "MuonCalibrationFit/MuonCalibrationFit.h"
@@ -366,27 +366,27 @@ double MuonCalibrationFit::GetChiSquare( const double* par ) {
 void MuonCalibrationFit::DoMonitoringPlots( const double* par ) {
   //::: Data
   std::vector< std::string > names = m_CurrentTemplate->GetMonitoredVariables();
-  BOOST_FOREACH( Tools::Info theInfo, *m_DataSingleInfo ) {
+  for( Tools::Info theInfo : *m_DataSingleInfo ) {
     for( auto name: names ) {
       m_CurrentTemplate->FillMonitoredVariable( Type::Data, name, theInfo.GetFirst( name ), std::max( theInfo.First_Mu_pt, theInfo.Second_Mu_pt ), theInfo.GetMass(), theInfo.IsOS, 1, true ); 
       m_CurrentTemplate->FillMonitoredVariable( Type::Data, name, theInfo.GetSecond( name ), std::max( theInfo.First_Mu_pt, theInfo.Second_Mu_pt ), theInfo.GetMass(), theInfo.IsOS, 1, false ); 
     }
   }
-  BOOST_FOREACH( Tools::Info theInfo, *m_DataBothInfo ) {
+  for( Tools::Info theInfo : *m_DataBothInfo ) {
     for( auto name: names ) {
       m_CurrentTemplate->FillMonitoredVariable( Type::Data, name, theInfo.GetFirst( name ), std::max( theInfo.First_Mu_pt, theInfo.Second_Mu_pt ), theInfo.GetMass(), theInfo.IsOS, 1, true ); 
       m_CurrentTemplate->FillMonitoredVariable( Type::Data, name, theInfo.GetSecond( name ), std::max( theInfo.First_Mu_pt, theInfo.Second_Mu_pt ), theInfo.GetMass(), theInfo.IsOS, 1, true ); 
     }
   }
   //::: Background
-  BOOST_FOREACH( Tools::Info theInfo, *m_BackgroundSingleInfo ) {
+  for( Tools::Info theInfo : *m_BackgroundSingleInfo ) {
     if( ! theInfo.IsOS ) continue;
     for( auto name: names ) {
       m_CurrentTemplate->FillMonitoredVariable( Type::Background, name, theInfo.GetFirst( name ), std::max( theInfo.First_Mu_pt, theInfo.Second_Mu_pt ), theInfo.GetMass(), theInfo.IsOS, theInfo.Weight, true ); 
       m_CurrentTemplate->FillMonitoredVariable( Type::Background, name, theInfo.GetSecond( name ), std::max( theInfo.First_Mu_pt, theInfo.Second_Mu_pt ), theInfo.GetMass(), theInfo.IsOS, theInfo.Weight, false ); 
     }
   }
-  BOOST_FOREACH( Tools::Info theInfo, *m_BackgroundBothInfo ) {
+  for( Tools::Info theInfo : *m_BackgroundBothInfo ) {
     if( ! theInfo.IsOS ) continue;
     for( auto name: names ) {
       m_CurrentTemplate->FillMonitoredVariable( Type::Background, name, theInfo.GetFirst( name ), std::max( theInfo.First_Mu_pt, theInfo.Second_Mu_pt ), theInfo.GetMass(), theInfo.IsOS, theInfo.Weight, true ); 
@@ -396,7 +396,7 @@ void MuonCalibrationFit::DoMonitoringPlots( const double* par ) {
   //::: MonteCarlo
   //::: Single Muon Correction
   TRandom3 rand_gen( 2988100123 );
-  BOOST_FOREACH( Tools::Info theInfo, *m_MonteCarloSingleInfo ) {
+  for( Tools::Info theInfo : *m_MonteCarloSingleInfo ) {
     if( ! theInfo.IsOS ) continue;
     double rnd = rand_gen.Gaus( 0, 1 );
     for( auto name: names ) {
@@ -405,7 +405,7 @@ void MuonCalibrationFit::DoMonitoringPlots( const double* par ) {
     }
   }
   //::: Double Muon Correction
-  BOOST_FOREACH( Tools::Info theInfo, *m_MonteCarloBothInfo ) {
+  for( Tools::Info theInfo : *m_MonteCarloBothInfo ) {
     if( ! theInfo.IsOS ) continue;
     double rnd1 = rand_gen.Gaus( 0, 1 );
     double rnd2 = rand_gen.Gaus( 0, 1 );
@@ -921,7 +921,7 @@ void MuonCalibrationFit::UpdateTemplates( const double* par ) {
   if( ! m_FilledData ) {
     //::: Data
     m_CurrentTemplate->ClearData();
-    BOOST_FOREACH( Tools::Info theInfo, *m_DataSingleInfo ) {
+    for( Tools::Info theInfo : *m_DataSingleInfo ) {
       if( ! theInfo.IsOS ) continue;
       float pt_for_binning = ( theInfo.GetMass() < 10 ) ? std::min( theInfo.First_Mu_pt, theInfo.Second_Mu_pt ) : std::max( theInfo.First_Mu_pt, theInfo.Second_Mu_pt );
       //::://::://:::
@@ -940,7 +940,7 @@ void MuonCalibrationFit::UpdateTemplates( const double* par ) {
       //::: Rho 
       m_CurrentTemplate->FillRho( Type::Data, theInfo.GetRho().first, theInfo.First_Mu_pt );
     }
-    BOOST_FOREACH( Tools::Info theInfo, *m_DataBothInfo ) {
+    for( Tools::Info theInfo : *m_DataBothInfo ) {
       if( ! theInfo.IsOS ) continue;
       float pt_for_binning = ( theInfo.GetMass() < 10 ) ? std::min( theInfo.First_Mu_pt, theInfo.Second_Mu_pt ) : std::max( theInfo.First_Mu_pt, theInfo.Second_Mu_pt );
       //::://::://:::
@@ -958,7 +958,7 @@ void MuonCalibrationFit::UpdateTemplates( const double* par ) {
     }
     //::: Background
     m_CurrentTemplate->ClearBackground();
-    BOOST_FOREACH( Tools::Info theInfo, *m_BackgroundSingleInfo ) {
+    for( Tools::Info theInfo : *m_BackgroundSingleInfo ) {
       if( ! theInfo.IsOS ) continue;
       float pt_for_binning = ( theInfo.GetMass() < 10 ) ? std::min( theInfo.First_Mu_pt, theInfo.Second_Mu_pt ) : std::max( theInfo.First_Mu_pt, theInfo.Second_Mu_pt );
       //::://::://:::
@@ -975,7 +975,7 @@ void MuonCalibrationFit::UpdateTemplates( const double* par ) {
       //::: Rho 
       m_CurrentTemplate->FillRho( Type::Background, theInfo.GetRho().first, theInfo.First_Mu_pt, theInfo.Weight );
     }
-    BOOST_FOREACH( Tools::Info theInfo, *m_BackgroundBothInfo ) {
+    for( Tools::Info theInfo : *m_BackgroundBothInfo ) {
       if( ! theInfo.IsOS ) continue;
       float pt_for_binning = ( theInfo.GetMass() < 10 ) ? std::min( theInfo.First_Mu_pt, theInfo.Second_Mu_pt ) : std::max( theInfo.First_Mu_pt, theInfo.Second_Mu_pt );
       //::://::://:::
@@ -996,7 +996,7 @@ void MuonCalibrationFit::UpdateTemplates( const double* par ) {
   //::: MonteCarlo
   //::: Single Muon Correction
   TRandom3 rand_gen( 2988100123 );
-  BOOST_FOREACH( Tools::Info theInfo, *m_MonteCarloSingleInfo ) {
+  for( Tools::Info theInfo : *m_MonteCarloSingleInfo ) {
     if( ! theInfo.IsOS ) continue;
     //std::cout << "GREP ME ====== " << int( TMath::Abs( theInfo.Gamma ) * 1000000 ) << std::endl;
     for( int index = 0; index < m_NumRandomValues; index++ ) {
@@ -1018,7 +1018,7 @@ void MuonCalibrationFit::UpdateTemplates( const double* par ) {
     }
   }
   //::: Double Muon Correction
-  BOOST_FOREACH( Tools::Info theInfo, *m_MonteCarloBothInfo ) {
+  for( Tools::Info theInfo : *m_MonteCarloBothInfo ) {
     if( ! theInfo.IsOS ) continue;
     //std::cout << "GREP ME ====== " << int( TMath::Abs( theInfo.Gamma ) * 1000000 ) << std::endl;
     //TRandom2 rand_gen( int( TMath::Abs( theInfo.Gamma ) * 1000000 ) );
diff --git a/Projects/AnalysisBase/externals.txt b/Projects/AnalysisBase/externals.txt
index 375f8c252fea35547ffc21fd47945b7a71833475..e2bad52dc1cedeee3cb1709266e15c62ed8cc00c 100644
--- a/Projects/AnalysisBase/externals.txt
+++ b/Projects/AnalysisBase/externals.txt
@@ -6,4 +6,4 @@
 # forbidden.
 
 # The version of atlas/atlasexternals to use:
-AnalysisBaseExternalsVersion = 2.0.44
+AnalysisBaseExternalsVersion = 2.0.45
diff --git a/Projects/AnalysisTop/externals.txt b/Projects/AnalysisTop/externals.txt
index 91233c1cc203314d8d565534c84d1e036b7f8716..c73c82e7411c48218500750e6adf91e7483b52fe 100644
--- a/Projects/AnalysisTop/externals.txt
+++ b/Projects/AnalysisTop/externals.txt
@@ -1,4 +1,4 @@
 # Versions of the various externals to build before starting the build of
 # this project, when doing a full stack nightly build.
 
-AnalysisBaseExternalsVersion = 2.0.44
+AnalysisBaseExternalsVersion = 2.0.45
diff --git a/Projects/AthDataQuality/externals.txt b/Projects/AthDataQuality/externals.txt
index b45c793fa06ebfdbadcb8f9d2aa2202d8955d173..c90085796f93feb03c21d29d4d0ed39b5af1f5ee 100644
--- a/Projects/AthDataQuality/externals.txt
+++ b/Projects/AthDataQuality/externals.txt
@@ -5,4 +5,4 @@
 # an "origin/" prefix before it. For tags however this is explicitly
 # forbidden.
 
-AtlasExternalsVersion = 2.0.44
+AtlasExternalsVersion = 2.0.45
diff --git a/Projects/AthSimulation/externals.txt b/Projects/AthSimulation/externals.txt
index 4f1f116830eb9484cdb8eaadb6342adf8896013b..5ab3323cc28dfd7bf1effb2208c338ce524648c0 100644
--- a/Projects/AthSimulation/externals.txt
+++ b/Projects/AthSimulation/externals.txt
@@ -6,7 +6,7 @@
 # forbidden.
 
 # The version of atlas/atlasexternals to use:
-AthSimulationExternalsVersion = 2.0.44
+AthSimulationExternalsVersion = 2.0.45
 
 # The version of atlas/Gaudi to use:
 GaudiVersion = v32r2.002
diff --git a/Projects/Athena/externals.txt b/Projects/Athena/externals.txt
index fc866fa50525d3daa77435d90cd030402c84a874..b0c9477a58a9a06da7d3fe22f3b5a55d767fd32f 100644
--- a/Projects/Athena/externals.txt
+++ b/Projects/Athena/externals.txt
@@ -6,7 +6,7 @@
 # forbidden.
 
 # The version of atlas/atlasexternals to use:
-AthenaExternalsVersion = 2.0.44
+AthenaExternalsVersion = 2.0.45
 
 # The version of atlas/Gaudi to use:
 GaudiVersion = v32r2.002
diff --git a/Projects/VP1Light/externals.txt b/Projects/VP1Light/externals.txt
index a6d8a9f2a0bc19e75fa832e93b1c6dfd0e53aebf..ca2c4b2aaa5cb30f5a88d6370d2f1c4ef290dccf 100644
--- a/Projects/VP1Light/externals.txt
+++ b/Projects/VP1Light/externals.txt
@@ -6,4 +6,4 @@
 # forbidden.
 
 # The version of atlas/atlasexternals to use:
-VP1LightExternalsVersion = 2.0.44
+VP1LightExternalsVersion = 2.0.45
diff --git a/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCombinedFitTagTool.cxx b/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCombinedFitTagTool.cxx
index ad0a2d28b22cc2a4b844bea3ec564fbf3f0bd808..d5c5a1e087b13874b76f2b380dee970b3bfa1c42 100644
--- a/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCombinedFitTagTool.cxx
+++ b/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCombinedFitTagTool.cxx
@@ -101,7 +101,8 @@ namespace MuonCombined {
       return StatusCode::FAILURE;
     }
     
-    ATH_CHECK( m_vertexKey.initialize() );
+    //The trigger doesn't use the vertex information
+    if(!m_vertexKey.empty()) ATH_CHECK( m_vertexKey.initialize() );
     
     return StatusCode::SUCCESS;
   }
@@ -409,21 +410,23 @@ namespace MuonCombined {
     float bs_z = 0.;
 
     const xAOD::Vertex* matchedVertex { nullptr };
-    SG::ReadHandle<xAOD::VertexContainer> vertices { m_vertexKey };
-    if ( vertices.isValid() )
-    {
-      for (const auto& vx : *vertices)
-      {
-	for (const auto& tpLink : vx->trackParticleLinks())
+    if(!m_vertexKey.empty()){
+      SG::ReadHandle<xAOD::VertexContainer> vertices { m_vertexKey };
+      if ( vertices.isValid() )
 	{
-	  if (*tpLink == &idTrackParticle)
-	  {
-	    matchedVertex = vx;
-	    break;
-	  }
+	  for (const auto& vx : *vertices)
+	    {
+	      for (const auto& tpLink : vx->trackParticleLinks())
+		{
+		  if (*tpLink == &idTrackParticle)
+		    {
+		      matchedVertex = vx;
+		      break;
+		    }
+		}
+	      if (matchedVertex) break;
+	    }
 	}
-	if (matchedVertex) break;
-      }
     }
     if(matchedVertex) {
       bs_x = matchedVertex->x();  
diff --git a/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuonCombinedTools.py b/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuonCombinedTools.py
index 065d578c1606788aa7160156568aa652b5118be3..b6d58328b0ca3373fc40990221b9a5979376b001 100644
--- a/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuonCombinedTools.py
+++ b/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuonCombinedTools.py
@@ -108,6 +108,7 @@ def MuonCombinedFitTagTool(name="MuonCombinedFitTagTool",**kwargs):
         TrigMuonPropagator = Propagator(name = 'TrigMuonPropagator')
         ToolSvc += TrigMuonPropagator
         kwargs.setdefault("TrackBuilder",         getPublicToolClone("TrigMuonTrackBuilder", "CombinedMuonTrackBuilder", Propagator=TrigMuonPropagator) )
+        kwargs.setdefault("VertexContainer", "")
     else:
         kwargs.setdefault("TrackBuilder",         getPublicTool("CombinedMuonTrackBuilder") )
     kwargs.setdefault("TrackQuery",           getPublicTool("MuonTrackQuery") )
diff --git a/Reconstruction/RecoTools/IsolationTool/CMakeLists.txt b/Reconstruction/RecoTools/IsolationTool/CMakeLists.txt
index 3a99578aa63e5d41878b71e20124d21adb845ccd..1aa87fd2170cb3372b22ba085c4c0e34450f27f0 100644
--- a/Reconstruction/RecoTools/IsolationTool/CMakeLists.txt
+++ b/Reconstruction/RecoTools/IsolationTool/CMakeLists.txt
@@ -36,6 +36,7 @@ atlas_depends_on_subdirs(
    Reconstruction/RecoTools/RecoToolInterfaces
    ${extra_deps}
    PRIVATE
+   Event/FourMomUtils
    Calorimeter/CaloGeoHelpers
    ${extra_deps_private} )
 
@@ -52,7 +53,7 @@ atlas_add_library( IsolationToolLib
    InDetTrackSelectionToolLib
    IsolationCorrectionsLib
    ${extra_lib}
-   PRIVATE_LINK_LIBRARIES ${Boost_LIBRARIES} CaloGeoHelpers
+   PRIVATE_LINK_LIBRARIES ${Boost_LIBRARIES} CaloGeoHelpers FourMomUtils
    ${extra_lib_private}
    )
 
diff --git a/Reconstruction/RecoTools/IsolationTool/Root/CaloIsolationTool.cxx b/Reconstruction/RecoTools/IsolationTool/Root/CaloIsolationTool.cxx
index 9e6c98750d5ac6bac0c53307b92c7de167281a7b..578105701c8e009e89aad672e28b017567d7e704 100644
--- a/Reconstruction/RecoTools/IsolationTool/Root/CaloIsolationTool.cxx
+++ b/Reconstruction/RecoTools/IsolationTool/Root/CaloIsolationTool.cxx
@@ -34,6 +34,7 @@
 #include "xAODEgamma/EgammaDefs.h"
 #include "xAODMuon/Muon.h"
 #include "xAODEgamma/EgammaxAODHelpers.h"
+#include "FourMomUtils/xAODP4Helpers.h"
 
 #include "boost/foreach.hpp"
 #include "boost/format.hpp"
@@ -491,7 +492,7 @@ namespace xAOD {
     if(mu){
       auto cluster = mu->cluster();
       if(cluster){
-        float etaT = 0, phiT = 0;
+        float etaT = 0, phiT = 0, dphiT = 0.;
         int nSample = 0;
         for(unsigned int i=0; i<CaloSampling::Unknown; i++) // dangerous?
         { 
@@ -499,12 +500,15 @@ namespace xAOD {
           if(!cluster->hasSampling(s)) continue;
           ATH_MSG_DEBUG("Sampling: " << i << "eta-phi (" << cluster->etaSample(s) << ", " << cluster->phiSample(s) << ")");
           etaT += cluster->etaSample(s);
-          phiT += cluster->phiSample(s);
+          if( nSample == 0 )
+            phiT = cluster->phiSample(s);
+          else
+            dphiT += xAOD::P4Helpers::deltaPhi( cluster->phiSample(s), phiT ) ;
           nSample++;
         }
         if(nSample>0){
           eta = etaT/nSample;
-          phi = phiT/nSample;
+          phi = phiT + dphiT/nSample;
 
           if(m_addCaloDeco && !Decorated.isAvailable(*tp)) decorateTrackCaloPosition(*tp, eta, phi);
           return true;
diff --git a/Reconstruction/RecoTools/TrackToCalo/share/CaloExtensionBuilderAlg_jobOptions.py b/Reconstruction/RecoTools/TrackToCalo/share/CaloExtensionBuilderAlg_jobOptions.py
index 6183c995d8e761bcab0ecc79a5e904cbc0f9ac34..0509e4b9e4850bcbe177e858a841ab6599e069b5 100644
--- a/Reconstruction/RecoTools/TrackToCalo/share/CaloExtensionBuilderAlg_jobOptions.py
+++ b/Reconstruction/RecoTools/TrackToCalo/share/CaloExtensionBuilderAlg_jobOptions.py
@@ -41,6 +41,11 @@ def CaloExtensionBuilder( cutLevel = "TightPrimary", minPT = 100.0 ):
     ToolSvc += pcExtensionTool
 
     CaloExtensionBuilderTool = CaloExtensionBuilderAlg(LastCaloExtentionTool = pcExtensionTool)
+
+    from AthenaCommon.BeamFlags import jobproperties
+    if jobproperties.Beam.beamType() != 'collisions':
+        CaloExtensionBuilderTool.vertexInputContainer = ''
+
     TrackSelectionToolHC = InDet__InDetTrackSelectionTool(name            = "CaloExtensionBuilderTrackSelectionTool",
                                                           minPt           = minPT,
                                                           CutLevel        = cutLevel)#,
diff --git a/Reconstruction/RecoTools/TrackToCalo/src/CaloExtensionBuilderAlg.cxx b/Reconstruction/RecoTools/TrackToCalo/src/CaloExtensionBuilderAlg.cxx
index e9bc83f6f6494e73c904251dfbd00a319a0f70b3..005c579c519b68f6806f662ba0df9726176ef900 100644
--- a/Reconstruction/RecoTools/TrackToCalo/src/CaloExtensionBuilderAlg.cxx
+++ b/Reconstruction/RecoTools/TrackToCalo/src/CaloExtensionBuilderAlg.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
 */
 
 /********************************************************************
@@ -40,7 +40,7 @@ StatusCode Trk::CaloExtensionBuilderAlg::initialize()
 
     ATH_CHECK(m_ParticleCacheKey.initialize());
     ATH_CHECK(m_TrkPartContainerKey.initialize());
-    ATH_CHECK(m_vertexInputContainer.initialize());
+    ATH_CHECK(m_vertexInputContainer.initialize(SG::AllowEmpty));
 
     if (service("ToolSvc", myToolSvc).isFailure()) {
         ATH_MSG_WARNING(" Tool Service Not Found");
@@ -80,37 +80,40 @@ StatusCode Trk::CaloExtensionBuilderAlg::CaloExtensionBuilderAlg::finalize(){
 StatusCode Trk::CaloExtensionBuilderAlg::execute()
 {
     // defining needed objects
-    const xAOD::VertexContainer * vxContainer = 0;
-    const xAOD::Vertex*         primaryVertex = 0;
+    const xAOD::VertexContainer * vxContainer = nullptr;
+    const xAOD::Vertex*         primaryVertex = nullptr;
 
-    SG::ReadHandle<xAOD::VertexContainer> vertexInHandle( m_vertexInputContainer );
-    SG::ReadHandle<xAOD::TrackParticleContainer> tracks(m_TrkPartContainerKey);
+    if (!m_vertexInputContainer.empty()) {
+      SG::ReadHandle<xAOD::VertexContainer> vertexInHandle( m_vertexInputContainer );
 
-    // checking for tracks and vertices being read correctly
-    if (!vertexInHandle.isValid()) {
-      ATH_MSG_ERROR ("Could not retrieve HiveDataObj with key " << vertexInHandle.key());
-      return StatusCode::FAILURE;
-    }
-    if(!tracks.isValid()) {
-        ATH_MSG_FATAL("Failed to retrieve TrackParticle container: "<< m_TrkPartContainerKey.key());
+      // checking for vertices being read correctly
+      if (!vertexInHandle.isValid()) {
+        ATH_MSG_ERROR ("Could not retrieve HiveDataObj with key " << vertexInHandle.key());
         return StatusCode::FAILURE;
-    }
+      }
 
-    // picking primary vertex
-    vxContainer = vertexInHandle.cptr();
-    if (vxContainer->size()>0) {
-      // simple loop through and get the primary vertex
-      xAOD::VertexContainer::const_iterator vxIter    = vxContainer->begin();
-      xAOD::VertexContainer::const_iterator vxIterEnd = vxContainer->end();
-      for ( size_t ivtx = 0; vxIter != vxIterEnd; ++vxIter, ++ivtx ){
-	    // the first and only primary vertex candidate is picked
-        if ( (*vxIter)->vertexType() ==  xAOD::VxType::PriVtx){
+      // picking primary vertex
+      vxContainer = vertexInHandle.cptr();
+      if (vxContainer->size()>0) {
+        // simple loop through and get the primary vertex
+        xAOD::VertexContainer::const_iterator vxIter    = vxContainer->begin();
+        xAOD::VertexContainer::const_iterator vxIterEnd = vxContainer->end();
+        for ( size_t ivtx = 0; vxIter != vxIterEnd; ++vxIter, ++ivtx ){
+          // the first and only primary vertex candidate is picked
+          if ( (*vxIter)->vertexType() ==  xAOD::VxType::PriVtx){
             primaryVertex = (*vxIter);
             break;
+          }
         }
       }
+      ATH_MSG_VERBOSE("size of VxPrimaryContainer is: "  << vxContainer->size() );
+    }
+
+    SG::ReadHandle<xAOD::TrackParticleContainer> tracks(m_TrkPartContainerKey);
+    if(!tracks.isValid()) {
+        ATH_MSG_FATAL("Failed to retrieve TrackParticle container: "<< m_TrkPartContainerKey.key());
+        return StatusCode::FAILURE;
     }
-    ATH_MSG_VERBOSE("size of VxPrimaryContainer is: "  << vxContainer->size() );
 
     // creating and saving the calo extension collection
     SG::WriteHandle<CaloExtensionCollection> lastCache(m_ParticleCacheKey); 
@@ -121,8 +124,8 @@ StatusCode Trk::CaloExtensionBuilderAlg::execute()
     std::vector<bool> mask (ptrTracks->size(),false);
     for (auto track: *tracks){
       if( static_cast<bool>(m_TrkSelection->accept(*track, nullptr)) || 
-          m_TrkDetailedSelection->decision(*track, primaryVertex)    || 
-          m_TrkDetailedSelection->decision(*track, (*vxContainer)[0]) ) {
+          (primaryVertex && m_TrkDetailedSelection->decision(*track, primaryVertex))    || 
+          (vxContainer && m_TrkDetailedSelection->decision(*track, (*vxContainer)[0])) ) {
         mask[track->index()] = true;
       }
     }
@@ -130,4 +133,4 @@ StatusCode Trk::CaloExtensionBuilderAlg::execute()
     ATH_CHECK(m_particleCaloExtensionTool->caloExtensionCollection(*ptrTracks,mask,*ptrPart));
 
     return StatusCode::SUCCESS;
-}
\ No newline at end of file
+}
diff --git a/Reconstruction/egamma/egammaConditions/egammaConditions/ATLAS_CHECK_THREAD_SAFETY b/Reconstruction/egamma/egammaConditions/egammaConditions/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 0000000000000000000000000000000000000000..026c309c02aeb1c8550ffa9457e9d9e520cc570e
--- /dev/null
+++ b/Reconstruction/egamma/egammaConditions/egammaConditions/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Reconstruction/egamma/egammaConditions
diff --git a/Reconstruction/tauRec/CMakeLists.txt b/Reconstruction/tauRec/CMakeLists.txt
index 18579e8ff2997fbce3dde35e66af71c307cd3950..dd1424eadfce9746775766d818673c9111c95117 100644
--- a/Reconstruction/tauRec/CMakeLists.txt
+++ b/Reconstruction/tauRec/CMakeLists.txt
@@ -17,7 +17,7 @@ atlas_depends_on_subdirs( PUBLIC
                           Reconstruction/tauEvent )
 
 # External dependencies:
-find_package( ROOT COMPONENTS TMVA Core Tree MathCore Hist RIO pthread )
+find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
 
 # Component(s) in the package:
 atlas_add_library( tauRecLib
diff --git a/Simulation/FastShower/FastCaloSim/src/ParticleEnergyParametrization.cxx b/Simulation/FastShower/FastCaloSim/src/ParticleEnergyParametrization.cxx
index df3f7af3d11cdb18e85178e159d033b6f19ef351..7514bc533de09fa2180e1124db1014d014c95d2d 100755
--- a/Simulation/FastShower/FastCaloSim/src/ParticleEnergyParametrization.cxx
+++ b/Simulation/FastShower/FastCaloSim/src/ParticleEnergyParametrization.cxx
@@ -78,7 +78,9 @@ Double_t GetRandom (TRandom& rand, const TH1& h)
 } // anonymous namespace
 
 
-ParticleEnergyParametrization::ParticleEnergyParametrization(int id,double E,double eta):TNamed(Form("ParticleShape%d_E%d_eta%d",id,(int)(E+0.1),(int)(eta*100+0.1)),Form("ParticleShape pdgid=%d E=%1.1f eta=%4.2f",id,E,eta)),m_id(id),m_E(E),m_eta(eta) {
+ParticleEnergyParametrization::ParticleEnergyParametrization(int id,double E,double eta):TNamed(Form("ParticleShape%d_E%d_eta%d",id,(int)(E+0.1),(int)(eta*100+0.1)),Form("ParticleShape pdgid=%d E=%1.1f eta=%4.2f",id,E,eta)),m_id(id),m_E(E),m_eta(eta),
+  m_weights_err()
+{
   m_Ecal_vs_dist=0;
   m_h_layer_d_fine=0;
   for(int i=CaloCell_ID_FCS::FirstSample;i<CaloCell_ID_FCS::MaxSample;++i) {
diff --git a/Trigger/TrigT1/L1Topo/L1TopoConfig/L1TopoConfig/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigT1/L1Topo/L1TopoConfig/L1TopoConfig/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 0000000000000000000000000000000000000000..e78a3c4bfd9787598ed35dd3271c8151a25dc664
--- /dev/null
+++ b/Trigger/TrigT1/L1Topo/L1TopoConfig/L1TopoConfig/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Trigger/TrigT1/L1Topo/L1TopoConfig
diff --git a/Trigger/TrigT1/L1Topo/L1TopoConfig/L1TopoConfig/L1TopoConfigOutputList.h b/Trigger/TrigT1/L1Topo/L1TopoConfig/L1TopoConfig/L1TopoConfigOutputList.h
index 7ceaea7e588c11b037e6e2e5a63395543a2bc222..f26762f78bf52037dd8ddedd9e878108f765ff4c 100644
--- a/Trigger/TrigT1/L1Topo/L1TopoConfig/L1TopoConfig/L1TopoConfigOutputList.h
+++ b/Trigger/TrigT1/L1Topo/L1TopoConfig/L1TopoConfig/L1TopoConfigOutputList.h
@@ -1,12 +1,13 @@
 /*
-  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 TopoCore__L1TopoConfigOutputList
-#define TopoCore__L1TopoConfigOutputList
+#ifndef TopoCore_L1TopoConfigOutputList
+#define TopoCore_L1TopoConfigOutputList
 
 #include <vector>
 #include <string>
+#include <unordered_set>
 
 namespace TXC {
   
@@ -116,7 +117,9 @@ namespace TXC {
       std::vector<TriggerLine> m_triggerlines;
 
       TXC::TriggerLine m_undef{"UNDEF","",0,0,0,0,0};
-      
+
+      std::unordered_set<std::string> m_triggernames;
+      std::unordered_set<unsigned int> m_triggercounters;
    };
 
 std::ostream & operator<<(std::ostream &, const L1TopoConfigOutputList &);
diff --git a/Trigger/TrigT1/L1Topo/L1TopoConfig/Root/L1TopoConfigOutputList.cxx b/Trigger/TrigT1/L1Topo/L1TopoConfig/Root/L1TopoConfigOutputList.cxx
index f09ec9472480824589c01d370ab9d7fc9fc4d774..d79485cb745a29f80e7614b0d0c711dfb62b68ab 100644
--- a/Trigger/TrigT1/L1Topo/L1TopoConfig/Root/L1TopoConfigOutputList.cxx
+++ b/Trigger/TrigT1/L1Topo/L1TopoConfig/Root/L1TopoConfigOutputList.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
 */
 
 #include "L1TopoConfig/L1TopoConfigOutputList.h"
@@ -14,9 +14,6 @@ using namespace std;
 using namespace TXC;
 
 
-set<string> triggernames;
-set<unsigned int> triggercounters;
-
 void
 TriggerLine::calcCounter() { 
    //m_counter = 64 * m_module + 16 * m_fpga + 32 * m_clock + m_bit;
@@ -36,11 +33,11 @@ L1TopoConfigOutputList::addOutputListElement(const OutputListElement & output) {
 void
 L1TopoConfigOutputList::addTriggerLine(const TriggerLine & trigger) {
 
-   auto insname = triggernames.insert(trigger.name());
+   auto insname = m_triggernames.insert(trigger.name());
    if(!insname.second)
       TCS_EXCEPTION("Trigger line '" << trigger.name() << "' has been defined more than once");
 
-   auto inscount = triggercounters.insert(trigger.counter());
+   auto inscount = m_triggercounters.insert(trigger.counter());
    if(!inscount.second) {
       string triggerWithSameCounter("");
       for(auto & tl : m_triggerlines)
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CommonSequences/InDetSetup.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CommonSequences/InDetSetup.py
index 1f5abbfe6733e84fb5599e6d7702ab6c2aa64eac..d6c5636cae378811a77bec76a6a14b98e3489744 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CommonSequences/InDetSetup.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CommonSequences/InDetSetup.py
@@ -48,7 +48,8 @@ def makeInDetAlgs( whichSignature='', separateTrackParticleCreator='', rois = 'E
 
     from PixelRawDataByteStreamCnv.PixelRawDataByteStreamCnvConf import PixelRawDataProviderTool
     InDetPixelRawDataProviderTool = PixelRawDataProviderTool(name    = "InDetPixelRawDataProviderTool" + signature,
-                                                             Decoder = InDetPixelRodDecoder)
+                                                             Decoder = InDetPixelRodDecoder,
+                                                             checkLVL1ID = False)
     ToolSvc += InDetPixelRawDataProviderTool
 
     if (InDetTrigFlags.doPrintConfigurables()):
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSetup.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSetup.py
index d4d13d247558578bad1719206f8b1e2d00f17e1c..14533f5289aae2d12e63f3d1ef80872b3d73a0fc 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSetup.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSetup.py
@@ -423,6 +423,7 @@ def muEFSARecoSequence( RoIs, name ):
         condSequence += MdtCondDbAlg("MdtCondDbAlg")
 
   theSegmentFinderAlg = MooSegmentFinderAlg("TrigMuonSegmentMaker_"+name)
+  theSegmentCnvAlg = CfgMgr.xAODMaker__MuonSegmentCnvAlg("MuonSegmentCnvAlg")
   from MuonSegmentTrackMaker.MuonTrackMakerAlgsMonitoring import MuPatTrackBuilderMonitoring
   TrackBuilder = CfgMgr.MuPatTrackBuilder("TrigMuPatTrackBuilder_"+name ,MuonSegmentCollection = "MuonSegments", 
                                           TrackSteering=CfgGetter.getPublicToolClone("TrigMuonTrackSteering", "MuonTrackSteering"), 
@@ -441,6 +442,7 @@ def muEFSARecoSequence( RoIs, name ):
 
   #Algorithms to views
   efAlgs.append( theSegmentFinderAlg )
+  efAlgs.append( theSegmentCnvAlg )
   efAlgs.append( TrackBuilder )
   efAlgs.append( xAODTrackParticleCnvAlg )
   efAlgs.append( theMuonCandidateAlg )
@@ -475,7 +477,10 @@ def muEFCBRecoSequence( RoIs, name ):
   muEFCBRecoSequence = parOR("efcbViewNode_"+name)
   #Need ID tracking related objects and MS tracks from previous steps
   ViewVerifyMS = CfgMgr.AthViews__ViewDataVerifier("muonCBViewDataVerifier")
-  ViewVerifyMS.DataObjects = [( 'Muon::CscStripPrepDataContainer' , 'StoreGateSvc+CSC_Measurements' ),  ( 'Muon::MdtPrepDataContainer' , 'StoreGateSvc+MDT_DriftCircles' ),  ( 'MuonCandidateCollection' , 'StoreGateSvc+MuonCandidates') ]
+  ViewVerifyMS.DataObjects = [( 'Muon::CscStripPrepDataContainer' , 'StoreGateSvc+CSC_Measurements' ),  
+                              ( 'Muon::MdtPrepDataContainer' , 'StoreGateSvc+MDT_DriftCircles' ),  
+                              ( 'MuonCandidateCollection' , 'StoreGateSvc+MuonCandidates'),
+                              ( 'xAOD::MuonSegmentContainer' , 'StoreGateSvc+MuonSegments' ) ]
   muEFCBRecoSequence += ViewVerifyMS
   if "FS" in name:
     #Need to run tracking for full scan chains
@@ -590,7 +595,9 @@ def muEFInsideOutRecoSequence(RoIs, name):
         condSequence += MdtCondDbAlg("MdtCondDbAlg")
 
     theSegmentFinderAlg = MooSegmentFinderAlg("TrigLateMuonSegmentMaker_"+name)
+    theSegmentCnvAlg = CfgMgr.xAODMaker__MuonSegmentCnvAlg("MuonSegmentCnvAlg")
     efAlgs.append(theSegmentFinderAlg)
+    efAlgs.append(theSegmentCnvAlg)
 
     # need to run precisions tracking for late muons, since we don't run it anywhere else
     TrackCollection="TrigFastTrackFinder_Tracks_MuonLate" 
@@ -624,7 +631,8 @@ def muEFInsideOutRecoSequence(RoIs, name):
                                        ( 'Muon::CscStripPrepDataContainer' , 'StoreGateSvc+CSC_Measurements' ),
                                        ( 'Muon::RpcPrepDataContainer' , 'StoreGateSvc+RPC_Measurements' ),
                                        ( 'Muon::TgcPrepDataContainer' , 'StoreGateSvc+TGC_Measurements' ),
-                                       ( 'Muon::HoughDataPerSectorVec' , 'StoreGateSvc+HoughDataPerSectorVec')]
+                                       ( 'Muon::HoughDataPerSectorVec' , 'StoreGateSvc+HoughDataPerSectorVec'),
+                                       ( 'xAOD::MuonSegmentContainer' , 'StoreGateSvc+MuonSegments' )]
     efmuInsideOutRecoSequence += ViewVerifyInsideOut