diff --git a/Calorimeter/CaloIdentifier/CaloIdentifier/ATLAS_CHECK_THREAD_SAFETY b/Calorimeter/CaloIdentifier/CaloIdentifier/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 0000000000000000000000000000000000000000..3243f75be89f8d9d8201b401b189b2878c44e308
--- /dev/null
+++ b/Calorimeter/CaloIdentifier/CaloIdentifier/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Calorimeter/CaloIdentifier
diff --git a/Calorimeter/CaloIdentifier/CaloIdentifier/CaloIDHelper.h b/Calorimeter/CaloIdentifier/CaloIdentifier/CaloIDHelper.h
index 2338b5566aa991fa0fbdedc1ff631852af5bb3fe..f6f1557e1f0e5a45099a8a1d315f8e11d04bc740 100644
--- a/Calorimeter/CaloIdentifier/CaloIdentifier/CaloIDHelper.h
+++ b/Calorimeter/CaloIdentifier/CaloIdentifier/CaloIDHelper.h
@@ -1,7 +1,7 @@
 // This file's extension implies that it's C, but it's really -*- C++ -*-.
 
 /*
-  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$
@@ -79,7 +79,7 @@ public:
      * @return 0 on success; non-zero on failure.
      */
     template <class T>
-    int init (const T& parent,
+    int init (T& parent,
               const std::string& type,
               const MultiRange& full_range,
               Identifier (T::*idfunc) (const ExpandedIdentifier&) const,
@@ -280,7 +280,7 @@ public:
   std::string name() const;
 
   /// Return the message service for this helper (may be null).
-  IMessageSvc* msgSvc() const;
+  IMessageSvc* msgSvc();
 
 
 
diff --git a/Calorimeter/CaloIdentifier/CaloIdentifier/CaloIDHelper.icc b/Calorimeter/CaloIdentifier/CaloIdentifier/CaloIDHelper.icc
index 260fe688cd38c5887fb53cccd2ec2213dc923093..eccf98b4d51a02c47718a65c29e6f74913b418e5 100644
--- a/Calorimeter/CaloIdentifier/CaloIdentifier/CaloIDHelper.icc
+++ b/Calorimeter/CaloIdentifier/CaloIdentifier/CaloIDHelper.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
 */
 
 // $Id$
@@ -25,7 +25,7 @@
 template <class T>
 inline
 int
-CaloIDHelper::HashGroup::init (const T& parent,
+CaloIDHelper::HashGroup::init (T& parent,
                                const std::string& type,
                                const MultiRange& full_range,
                                Identifier (T::*idfunc)
@@ -301,7 +301,7 @@ std::string CaloIDHelper::name() const
  * @brief Return the message service for this helper.
  */
 inline
-IMessageSvc* CaloIDHelper::msgSvc() const
+IMessageSvc* CaloIDHelper::msgSvc()
 {
   return m_msgSvc;
 }
diff --git a/Calorimeter/CaloIdentifier/CaloIdentifier/CaloIdManager.h b/Calorimeter/CaloIdentifier/CaloIdentifier/CaloIdManager.h
index 3e62ccb8cfc41267e724878c439e9ed3ee8e8ad0..37fc1fd14cddecb2668d9c5d63e53a738958dafb 100755
--- a/Calorimeter/CaloIdentifier/CaloIdentifier/CaloIdManager.h
+++ b/Calorimeter/CaloIdentifier/CaloIdentifier/CaloIdManager.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
 */
 
 /***************************************************************************
@@ -48,9 +48,6 @@ public:
     CaloIdManager(void);
     ~CaloIdManager(void);
 
-    ///  Access to singleton
-    static const CaloIdManager* instance          (void);
-
     ///  Access to IdHelper
     const CaloCell_ID*          getCaloCell_ID           (void) const;
     const CaloDM_ID*            getDM_ID                 (void) const;
@@ -94,7 +91,6 @@ public:
 
 private:
 
-    static CaloIdManager*  s_instance;
     bool                   m_isInitialized;
 
     const CaloCell_ID*     m_cell_id;
diff --git a/Calorimeter/CaloIdentifier/src/CaloIdManager.cxx b/Calorimeter/CaloIdentifier/src/CaloIdManager.cxx
index b3690bc43aa9d8100a6ffc2584cae36960a28b03..664132e42b08d6d115575715bf682c756fdd8ad5 100755
--- a/Calorimeter/CaloIdentifier/src/CaloIdManager.cxx
+++ b/Calorimeter/CaloIdentifier/src/CaloIdManager.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
 */
 
 /***************************************************************************
@@ -35,7 +35,6 @@
 #include "GaudiKernel/IMessageSvc.h"
 #include "StoreGate/StoreGateSvc.h"
 
-CaloIdManager * CaloIdManager::s_instance = 0;
 
 CaloIdManager::CaloIdManager(void)
     :
@@ -64,77 +63,6 @@ CaloIdManager::~CaloIdManager(void)
 }
 
 
-const CaloIdManager*
-CaloIdManager::instance                (void)
-{
-    if (s_instance == 0) {
-
-	// The following code can be removed once all useage the singleton has
-	// been removed and replaced by accessing this object via the transient
-	// detector store. Use the instance that's in the transient detector
-	// store if it exists. Otherwise create a new instance, register it in
-	// the store and return that. First, locate the StoreGate instance that's
-	// managing the transient detector store.
-
-	StoreGateSvc* detStore = 0;
-	IMessageSvc*  msgSvc;
-	const CaloIdManager* theMgr;
-
-	ISvcLocator* svcLoc = Gaudi::svcLocator( );
-	StatusCode status   = svcLoc->service( "MessageSvc", msgSvc );
-
-	if ( status.isSuccess( ) ) {
-
-	    MsgStream log(msgSvc, "CaloIdManager" );
-	    status = svcLoc->service( "DetectorStore", detStore );
-
-	    if ( status.isSuccess( ) ) {
-
-		// Test whether the instance already exists in the transient
-		// detector store
-		if ( detStore->contains<CaloIdManager>("CaloIdManager") ) {
-
-		    // The instance already exists - retrieve it and save it locally.
-
-		    status     = detStore->retrieve( theMgr );
-		    if ( status.isSuccess( ) ) {
-		      s_instance = const_cast<CaloIdManager*>(theMgr);
-		    }
-		    else
-		      {
-			log << MSG::ERROR << " Failed to retrieve CaloIdManager " << endmsg;
-		      }
-		}
-
-	    } else {
-		log << MSG::ERROR << "Could not locate DetectorStore" << endmsg;
-	    }
-
-	} else {
-	    std::cerr << "CaloIdManager: Could not locate the MessageSvc!!!"
-		      << std::endl;
-	}
-
-	if (s_instance == 0) {
-	    s_instance = new CaloIdManager;
-
-	    // Register this instance in the transient detector store if it
-	    // hasn't already been done.
-	    if ( 0 != detStore ) {
-		status = detStore->record( s_instance, "CaloIdManager" );
-		if ( ! status.isSuccess( ) ) {
-		  std::cerr << "CaloIdManager: Failed to record CaloIdManager "
-		      << std::endl;
-		}
-	    }
-	}
-
-    }
-
-    return s_instance;
-}
-
-
 const CaloCell_ID*
 CaloIdManager::getCaloCell_ID           (void) const
 {
diff --git a/Calorimeter/CaloIdentifier/test/CaloCell_ID_test.cxx b/Calorimeter/CaloIdentifier/test/CaloCell_ID_test.cxx
index 50543c883cf13faf352cba4d444923a0fd8143b9..19ac74a36c161a813411e2c65e4185d05b3107ed 100644
--- a/Calorimeter/CaloIdentifier/test/CaloCell_ID_test.cxx
+++ b/Calorimeter/CaloIdentifier/test/CaloCell_ID_test.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
 */
 
 // $Id$
@@ -18,13 +18,14 @@
 #include "calocell_id_test_common.cxx"
 
 
-std::unique_ptr<CaloCell_ID> make_calo_id (bool do_neighbours = false)
+std::unique_ptr<CaloCell_ID> make_calo_id (IdDictParser& parser,
+                                           bool do_neighbours = false)
 {
   return make_calo_id_t<CaloCell_ID,
                         LArEM_ID,
                         LArHEC_ID,
                         LArFCAL_ID,
-                        TileID> (do_neighbours);
+                        TileID> (parser, do_neighbours);
 }
 
 
@@ -53,8 +54,9 @@ void test_neighbours (const CaloCell_ID& calo_id)
 
 int main()
 {
-  std::unique_ptr<CaloCell_ID> calo_id = make_calo_id();
-  std::unique_ptr<CaloCell_ID> calo_id_n = make_calo_id(true);
+  std::unique_ptr<IdDictParser> parser = make_parser();
+  std::unique_ptr<CaloCell_ID> calo_id = make_calo_id(*parser);
+  std::unique_ptr<CaloCell_ID> calo_id_n = make_calo_id(*parser, true);
   try {
     test_cells (*calo_id);
     test_sample (*calo_id, false);
diff --git a/Calorimeter/CaloIdentifier/test/CaloCell_SuperCell_ID_test.cxx b/Calorimeter/CaloIdentifier/test/CaloCell_SuperCell_ID_test.cxx
index c598bc829da12d4e440f760cf842e34147df85a0..71f41acf39aa4efea1a45277c1937f5b3e2b4a2c 100644
--- a/Calorimeter/CaloIdentifier/test/CaloCell_SuperCell_ID_test.cxx
+++ b/Calorimeter/CaloIdentifier/test/CaloCell_SuperCell_ID_test.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
 */
 
 // $Id$
@@ -18,19 +18,20 @@
 #include "calocell_id_test_common.cxx"
 
 
-std::unique_ptr<CaloCell_SuperCell_ID> make_calo_id ()
+std::unique_ptr<CaloCell_SuperCell_ID> make_calo_id (IdDictParser& parser)
 {
   return make_calo_id_t<CaloCell_SuperCell_ID,
                         LArEM_SuperCell_ID,
                         LArHEC_SuperCell_ID,
                         LArFCAL_SuperCell_ID,
-                        Tile_SuperCell_ID> ();
+                        Tile_SuperCell_ID> (parser);
 }
 
 
 int main()
 {
-  std::unique_ptr<CaloCell_SuperCell_ID> calo_id = make_calo_id();
+  std::unique_ptr<IdDictParser> parser = make_parser();
+  std::unique_ptr<CaloCell_SuperCell_ID> calo_id = make_calo_id(*parser);
   try {
     test_cells (*calo_id, true);
     test_sample (*calo_id, true);
diff --git a/Calorimeter/CaloIdentifier/test/LArEM_ID_test.cxx b/Calorimeter/CaloIdentifier/test/LArEM_ID_test.cxx
index d26c2934fed4d2cd0e4df42e0e164e65c010d840..848417883a56f6b7ee6a803ff261fc720679ceb1 100644
--- a/Calorimeter/CaloIdentifier/test/LArEM_ID_test.cxx
+++ b/Calorimeter/CaloIdentifier/test/LArEM_ID_test.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
 */
 
 // $Id$
@@ -77,8 +77,9 @@ void test4 (const LArEM_ID& em_id)
 
 int main()
 {
-  std::unique_ptr<LArEM_ID> idhelper = make_helper<LArEM_ID_Test>();
-  std::unique_ptr<LArEM_ID> idhelper_n = make_helper<LArEM_ID_Test>(true);
+  std::unique_ptr<IdDictParser> parser = make_parser();
+  std::unique_ptr<LArEM_ID> idhelper = make_helper<LArEM_ID_Test>(*parser);
+  std::unique_ptr<LArEM_ID> idhelper_n = make_helper<LArEM_ID_Test>(*parser, true);
   try {
     test_basic (*idhelper);
     test_connected (*idhelper);
diff --git a/Calorimeter/CaloIdentifier/test/LArEM_SuperCell_ID_test.cxx b/Calorimeter/CaloIdentifier/test/LArEM_SuperCell_ID_test.cxx
index 3d21b5a7555ea930183c282fc336bfa63b28d865..64fe116de8cee96294419be8aec2dfa459d80b5a 100644
--- a/Calorimeter/CaloIdentifier/test/LArEM_SuperCell_ID_test.cxx
+++ b/Calorimeter/CaloIdentifier/test/LArEM_SuperCell_ID_test.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
 */
 
 // $Id$
@@ -79,8 +79,9 @@ void test4 (const LArEM_SuperCell_ID& /*em_id*/)
 
 int main()
 {
-  std::unique_ptr<LArEM_SuperCell_ID> idhelper = make_helper<LArEM_SuperCell_ID_Test>();
-  std::unique_ptr<LArEM_SuperCell_ID> idhelper_n = make_helper<LArEM_SuperCell_ID_Test>(true);
+  std::unique_ptr<IdDictParser> parser = make_parser();
+  std::unique_ptr<LArEM_SuperCell_ID> idhelper = make_helper<LArEM_SuperCell_ID_Test>(*parser);
+  std::unique_ptr<LArEM_SuperCell_ID> idhelper_n = make_helper<LArEM_SuperCell_ID_Test>(*parser,true);
   try {
     test_basic (*idhelper);
     test_connected (*idhelper, true);
diff --git a/Calorimeter/CaloIdentifier/test/LArFCAL_ID_test.cxx b/Calorimeter/CaloIdentifier/test/LArFCAL_ID_test.cxx
index 5bd3898cded86609127490df8158ef0a09e32fa5..ebf0f640f8af1c74b4f11f6eda44ff0f2fe76d3c 100644
--- a/Calorimeter/CaloIdentifier/test/LArFCAL_ID_test.cxx
+++ b/Calorimeter/CaloIdentifier/test/LArFCAL_ID_test.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
 */
 
 // $Id$
@@ -79,12 +79,13 @@ void test_basic (const LArFCAL_ID& idhelper)
 
 int main()
 {
-  IdDictMgr& idd = getDictMgr();
+  std::unique_ptr<IdDictParser> parser = make_parser();
+  IdDictMgr& idd = parser->m_idd;
   idd.add_metadata("FCAL2DNEIGHBORS",     "FCal2DNeighbors-DC3-05-Comm-01.txt");  
   idd.add_metadata("FCAL3DNEIGHBORSNEXT", "FCal3DNeighborsNext-DC3-05-Comm-01.txt");  
   idd.add_metadata("FCAL3DNEIGHBORSPREV", "FCal3DNeighborsPrev-DC3-05-Comm-01.txt");  
-  std::unique_ptr<LArFCAL_ID> idhelper = make_helper<LArFCAL_ID_Test>();
-  std::unique_ptr<LArFCAL_ID> idhelper_n = make_helper<LArFCAL_ID_Test>(true);
+  std::unique_ptr<LArFCAL_ID> idhelper = make_helper<LArFCAL_ID_Test>(*parser);
+  std::unique_ptr<LArFCAL_ID> idhelper_n = make_helper<LArFCAL_ID_Test>(*parser,true);
   try {
     test_basic (*idhelper);
     test_connected (*idhelper, false);
diff --git a/Calorimeter/CaloIdentifier/test/LArFCAL_SuperCell_ID_test.cxx b/Calorimeter/CaloIdentifier/test/LArFCAL_SuperCell_ID_test.cxx
index f91e9df1df0b552f41e567d598df1307f3a3561a..198c31cfdeaa0e6a89aa0f58589fc97f1df3cd42 100644
--- a/Calorimeter/CaloIdentifier/test/LArFCAL_SuperCell_ID_test.cxx
+++ b/Calorimeter/CaloIdentifier/test/LArFCAL_SuperCell_ID_test.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
 */
 
 // $Id$
@@ -48,7 +48,8 @@ void test_basic (const LArFCAL_SuperCell_ID& idhelper)
 
 int main()
 {
-  std::unique_ptr<LArFCAL_SuperCell_ID> idhelper = make_helper<LArFCAL_SuperCell_ID_Test>();
+  std::unique_ptr<IdDictParser> parser = make_parser();
+  std::unique_ptr<LArFCAL_SuperCell_ID> idhelper = make_helper<LArFCAL_SuperCell_ID_Test>(*parser);
   try {
     test_basic (*idhelper);
     test_connected (*idhelper, true);
diff --git a/Calorimeter/CaloIdentifier/test/LArHEC_ID_test.cxx b/Calorimeter/CaloIdentifier/test/LArHEC_ID_test.cxx
index a166c968d5a2b1af770070ee7291ca62553d0981..05b360ba84c80f3354fdedb48920e999e7056e7c 100644
--- a/Calorimeter/CaloIdentifier/test/LArHEC_ID_test.cxx
+++ b/Calorimeter/CaloIdentifier/test/LArHEC_ID_test.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
 */
 
 // $Id$
@@ -76,8 +76,9 @@ void test_neighbors (const LArHEC_ID& idhelper)
 
 int main()
 {
-  std::unique_ptr<LArHEC_ID> idhelper = make_helper<LArHEC_ID_Test>();
-  std::unique_ptr<LArHEC_ID> idhelper_n = make_helper<LArHEC_ID_Test>(true);
+  std::unique_ptr<IdDictParser> parser = make_parser();
+  std::unique_ptr<LArHEC_ID> idhelper = make_helper<LArHEC_ID_Test>(*parser);
+  std::unique_ptr<LArHEC_ID> idhelper_n = make_helper<LArHEC_ID_Test>(*parser,true);
   try {
     test_basic (*idhelper);
     test_connected (*idhelper, false);
diff --git a/Calorimeter/CaloIdentifier/test/LArHEC_SuperCell_ID_test.cxx b/Calorimeter/CaloIdentifier/test/LArHEC_SuperCell_ID_test.cxx
index 890a44176419ecd6610fbca3388ba34c862c0885..0b49c4b090512a2bb9d2fe0c74622cd2a187b27e 100644
--- a/Calorimeter/CaloIdentifier/test/LArHEC_SuperCell_ID_test.cxx
+++ b/Calorimeter/CaloIdentifier/test/LArHEC_SuperCell_ID_test.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
 */
 
 // $Id$
@@ -74,8 +74,9 @@ void test_neighbors (const LArHEC_SuperCell_ID& idhelper)
 
 int main()
 {
-  std::unique_ptr<LArHEC_SuperCell_ID> idhelper = make_helper<LArHEC_SuperCell_ID_Test>();
-  std::unique_ptr<LArHEC_SuperCell_ID> idhelper_n = make_helper<LArHEC_SuperCell_ID_Test>(true);
+  std::unique_ptr<IdDictParser> parser = make_parser();
+  std::unique_ptr<LArHEC_SuperCell_ID> idhelper = make_helper<LArHEC_SuperCell_ID_Test>(*parser);
+  std::unique_ptr<LArHEC_SuperCell_ID> idhelper_n = make_helper<LArHEC_SuperCell_ID_Test>(*parser,true);
   try {
     test_basic (*idhelper);
     test_connected (*idhelper, true);
diff --git a/Calorimeter/CaloIdentifier/test/LArMiniFCAL_ID_test.cxx b/Calorimeter/CaloIdentifier/test/LArMiniFCAL_ID_test.cxx
index d423ab3e1b111e268322a0b5a634a6adb42bb164..7861d1d7baff70c22573198589f0b95c5685ebc6 100644
--- a/Calorimeter/CaloIdentifier/test/LArMiniFCAL_ID_test.cxx
+++ b/Calorimeter/CaloIdentifier/test/LArMiniFCAL_ID_test.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
 */
 
 // $Id$
@@ -241,14 +241,15 @@ void test_neighbors (const LArMiniFCAL_ID& idhelper)
 
 int main()
 {
-  idDictXmlFile = "IdDictLArCalorimeter_sLHC-MiniFcal-00.xml";
-  IdDictMgr& idd = getDictMgr();
+  std::string xmlFile = "IdDictLArCalorimeter_sLHC-MiniFcal-00.xml";
+  std::unique_ptr<IdDictParser> parser = make_parser (idDictType, xmlFile);
+  IdDictMgr& idd = parser->m_idd;
   idd.add_metadata("FCAL2DNEIGHBORS",     "FCal2DNeighbors-DC3-05-Comm-01.txt");  
   idd.add_metadata("FCAL3DNEIGHBORSNEXT", "FCal3DNeighborsNext-DC3-05-Comm-01.txt");  
   idd.add_metadata("FCAL3DNEIGHBORSPREV", "FCal3DNeighborsPrev-DC3-05-Comm-01.txt");  
 
-  std::unique_ptr<LArMiniFCAL_ID> idhelper = make_helper<LArMiniFCAL_ID_Test>();
-  std::unique_ptr<LArMiniFCAL_ID> idhelper_n = make_helper<LArMiniFCAL_ID_Test>(true);
+  std::unique_ptr<LArMiniFCAL_ID> idhelper = make_helper<LArMiniFCAL_ID_Test>(*parser);
+  std::unique_ptr<LArMiniFCAL_ID> idhelper_n = make_helper<LArMiniFCAL_ID_Test>(*parser,true);
   try {
     test_basic (*idhelper);
     test_connected (*idhelper);
diff --git a/Calorimeter/CaloIdentifier/test/TileID_test.cxx b/Calorimeter/CaloIdentifier/test/TileID_test.cxx
index 9d5d6f9b07c2d586f9dc8671b2e229a8c21f4810..6f0a36028d28130d6ed5b371e68a0bf32e37baa1 100644
--- a/Calorimeter/CaloIdentifier/test/TileID_test.cxx
+++ b/Calorimeter/CaloIdentifier/test/TileID_test.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
 */
 
 // $Id$
@@ -103,12 +103,13 @@ void test_neighbors (const TileID& idhelper)
 
 int main()
 {
-  idDictType = "TileCalorimeter";
-  idDictXmlFile = "IdDictTileCalorimeter.xml";
-  IdDictMgr& idd = getDictMgr();
+  std::string type = "TileCalorimeter";
+  std::string xmlFile = "IdDictTileCalorimeter.xml";
+  std::unique_ptr<IdDictParser> parser = make_parser(type, xmlFile);
+  IdDictMgr& idd = parser->m_idd;
   idd.add_metadata("TILENEIGHBORS",       "TileNeighbour_reduced.txt");  
-  std::unique_ptr<TileID> idhelper = make_helper<TileID_Test>();
-  std::unique_ptr<TileID> idhelper_n = make_helper<TileID_Test>(true);
+  std::unique_ptr<TileID> idhelper = make_helper<TileID_Test>(*parser);
+  std::unique_ptr<TileID> idhelper_n = make_helper<TileID_Test>(*parser,true);
   try {
     test_basic (*idhelper);
     test_connected (*idhelper, false);
diff --git a/Calorimeter/CaloIdentifier/test/Tile_SuperCell_ID_test.cxx b/Calorimeter/CaloIdentifier/test/Tile_SuperCell_ID_test.cxx
index 5436169973f326ab0575fd455d0296107629a821..65be4cb02d893bf6cd4ae6747a37d0469bc51641 100644
--- a/Calorimeter/CaloIdentifier/test/Tile_SuperCell_ID_test.cxx
+++ b/Calorimeter/CaloIdentifier/test/Tile_SuperCell_ID_test.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
 */
 
 // $Id$
@@ -51,9 +51,10 @@ void test_basic (const Tile_SuperCell_ID& idhelper)
 
 int main()
 {
-  idDictType = "TileCalorimeter";
-  idDictXmlFile = "IdDictTileCalorimeter.xml";
-  std::unique_ptr<Tile_SuperCell_ID> idhelper = make_helper<Tile_SuperCell_ID_Test>();
+  std::string type = "TileCalorimeter";
+  std::string xmlFile = "IdDictTileCalorimeter.xml";
+  std::unique_ptr<IdDictParser> parser = make_parser (type, xmlFile);
+  std::unique_ptr<Tile_SuperCell_ID> idhelper = make_helper<Tile_SuperCell_ID_Test>(*parser);
   try {
     test_basic (*idhelper);
     test_connected (*idhelper, true);
diff --git a/Calorimeter/CaloIdentifier/test/calocell_id_test_common.cxx b/Calorimeter/CaloIdentifier/test/calocell_id_test_common.cxx
index 468c7fd94847725745c4868a4ee3d3648fb0a6d4..52186f1e6a941362e2ad199f72dc28c4bf93dbf3 100644
--- a/Calorimeter/CaloIdentifier/test/calocell_id_test_common.cxx
+++ b/Calorimeter/CaloIdentifier/test/calocell_id_test_common.cxx
@@ -181,13 +181,10 @@ template <class CALOCELL_ID_T,
           class LARHEC_ID_T,
           class LARFCAL_ID_T,
           class TILE_ID_T>
-std::unique_ptr<CALOCELL_ID_T> make_calo_id_t (bool do_neighbours = false)
+std::unique_ptr<CALOCELL_ID_T> make_calo_id_t (IdDictParser& parser,
+                                               bool do_neighbours = false)
 {
-  //IdDictParser parser;
-  //parser.register_external_entity ("LArCalorimeter",
-  //"IdDictLArCalorimeter_DC3-05-Comm-01.xml");
-  //IdDictMgr& idd = parser.parse ("IdDictParser/ATLAS_IDS.xml");
-  IdDictMgr& idd = getDictMgr();
+  IdDictMgr& idd = parser.m_idd;
 
   // Set some default file names for neighbours (RDS 12/2009):
   if (!do_neighbours) {
@@ -198,10 +195,13 @@ std::unique_ptr<CALOCELL_ID_T> make_calo_id_t (bool do_neighbours = false)
     idd.add_metadata("TILENEIGHBORS",       "TileNeighbour_reduced.txt");  
   }
 
-  std::unique_ptr<LAREM_ID_T> em_id = make_helper<LAREM_ID_T> (do_neighbours,
+  std::unique_ptr<LAREM_ID_T> em_id = make_helper<LAREM_ID_T> (parser,
+                                                               do_neighbours,
                                                                false);
-  std::unique_ptr<LARHEC_ID_T> hec_id = make_helper<LARHEC_ID_T> (do_neighbours);
-  std::unique_ptr<LARFCAL_ID_T> fcal_id = make_helper<LARFCAL_ID_T> (do_neighbours);
+  std::unique_ptr<LARHEC_ID_T> hec_id = make_helper<LARHEC_ID_T> (parser,
+                                                                  do_neighbours);
+  std::unique_ptr<LARFCAL_ID_T> fcal_id = make_helper<LARFCAL_ID_T> (parser,
+                                                                     do_neighbours);
 
 #if 0
   IdDictParser* miniparser = new IdDictParser;
@@ -214,9 +214,9 @@ std::unique_ptr<CALOCELL_ID_T> make_calo_id_t (bool do_neighbours = false)
 #endif
   // Adding in MiniFCAL doesn't really work, because MiniFCAL and FCAL
   // overlap ID assignments!
-  std::unique_ptr<LArMiniFCAL_ID> minifcal_id = make_helper<LArMiniFCAL_ID> (do_neighbours);
+  std::unique_ptr<LArMiniFCAL_ID> minifcal_id = make_helper<LArMiniFCAL_ID> (parser,do_neighbours);
 
-  std::unique_ptr<TILE_ID_T> tile_id = make_helper<TILE_ID_T> (do_neighbours);
+  std::unique_ptr<TILE_ID_T> tile_id = make_helper<TILE_ID_T> (parser, do_neighbours);
 
   auto calo_id = CxxUtils::make_unique<CALOCELL_ID_T> (em_id.release(),
                                                        hec_id.release(),
diff --git a/Calorimeter/CaloIdentifier/test/make_idhelper_common.cxx b/Calorimeter/CaloIdentifier/test/make_idhelper_common.cxx
index e02d2749f9d81a417577dbf348981c1ede86e298..f1f076d9a4c7580da83a8e1e48120e4b3ab9bfc1 100644
--- a/Calorimeter/CaloIdentifier/test/make_idhelper_common.cxx
+++ b/Calorimeter/CaloIdentifier/test/make_idhelper_common.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
 */
 
 // $Id$
@@ -18,29 +18,27 @@
 #include <memory>
 
 
-std::string idDictType = "LArCalorimeter";
-std::string idDictXmlFile = "IdDictLArCalorimeter_DC3-05-Comm-01.xml";
+const std::string idDictType = "LArCalorimeter";
+const std::string idDictXmlFile = "IdDictLArCalorimeter_DC3-05-Comm-01.xml";
 
-IdDictMgr& getDictMgr()
+std::unique_ptr<IdDictParser> make_parser(const std::string& type = idDictType,
+                                          const std::string& xmlFile = idDictXmlFile)
 {
-  static IdDictMgr* mgr = nullptr;
-  if (!mgr) {
-    static IdDictParser parser;
-    parser.register_external_entity (idDictType,
-                                     idDictXmlFile);
-    mgr = &parser.parse ("IdDictParser/ATLAS_IDS.xml");
-  }
-  return *mgr;
+  auto parser = std::make_unique<IdDictParser>();
+  parser->register_external_entity (type, xmlFile);
+  parser->parse ("IdDictParser/ATLAS_IDS.xml");
+  return parser;
 }
 
 
 template <class T>
-std::unique_ptr<T> make_helper (bool do_neighbours = false,
+std::unique_ptr<T> make_helper (const IdDictParser& parser,
+                                bool do_neighbours = false,
                                 bool do_checks = true)
 {
   auto idhelper = CxxUtils::make_unique<T>();
   idhelper->set_do_neighbours (do_neighbours);
-  assert (idhelper->initialize_from_dictionary (getDictMgr()) == 0);
+  assert (idhelper->initialize_from_dictionary (parser.m_idd) == 0);
 
   assert (!idhelper->do_checks());
   if (do_checks) {
diff --git a/Control/AthenaConfiguration/share/confTool.py b/Control/AthenaConfiguration/share/confTool.py
index 36697fcbb395b683b58c415c169b913d1007a5ff..f0d0a5e5c3733007eba2d017a1a20558eb425deb 100755
--- a/Control/AthenaConfiguration/share/confTool.py
+++ b/Control/AthenaConfiguration/share/confTool.py
@@ -8,9 +8,11 @@ import pprint
 import json
 import sys
 import argparse
+import ast
 
 parser = argparse.ArgumentParser(description='Utility to transform/display athena configurations')
 parser.add_argument('--print', dest="pr", action='store_true', help='Prints')
+parser.add_argument('--printComps', dest="prComps", action='store_true', help='Prints only the components')
 parser.add_argument('--diff', dest="diff", action='store_true', help='Diffs two files')
 parser.add_argument('--toJSON', help='Convert to JSON file')
 parser.add_argument('file', nargs='+', help='Files to work with')
@@ -53,6 +55,35 @@ def __print( fname ):
         pprint.pprint(dict(c))
     print "... EOF", fname
 
+def __printComps( fname ):
+    conf = __loadSingleFile( fname )
+    print "... ", fname, "content"
+    def __printdict( d ):
+        for name, k in dict( d ).iteritems():
+            if name in "Histograms":
+                continue
+
+            if isinstance( k, dict ):
+                __printdict( k )
+            elif isinstance(k, str) and '/' in k:
+                if not '[' in k: # not an array
+                    if  k.count('/')  == 1:
+                        print k
+                else: # handle arrays
+                    actualType = ast.literal_eval(k)
+                    if isinstance( actualType, list ):
+                        for el in actualType:
+                            if el.count('/')  == 1 : # ==1 eliminates COOL folders
+                                print el
+
+    for n,c in enumerate(conf):
+        __printdict( c )
+            
+
+
+    print "... EOF", fname
+
+
 def __diff():
     def __merge( c ):
         confdict = {}
@@ -87,10 +118,15 @@ def __diff():
             print "... component %-54s" % comp, "identical"
 
 
+if args.prComps:
+    for fileName in args.file:
+        __printComps( fileName )
+
 if args.pr:
     for fileName in args.file:
         __print( fileName )
 
+
 if args.toJSON:
     if len( args.file ) != 1:
         print "ERROR, can convert single file at a time, got: ", args.file
diff --git a/Control/AthenaKernel/AthenaKernel/GenericMetadataTool.icc b/Control/AthenaKernel/AthenaKernel/GenericMetadataTool.icc
index 7faa6a77381c9047b944ee755b38e623b426d68f..9418c4c7e1433aa4623266973ae0a5b3325d7f89 100644
--- a/Control/AthenaKernel/AthenaKernel/GenericMetadataTool.icc
+++ b/Control/AthenaKernel/AthenaKernel/GenericMetadataTool.icc
@@ -322,8 +322,8 @@ StatusCode GenericMetadataTool<T,U>::buildAthenaInterface(const std::string& inp
   // Make sure sid does not already exist in the MetaCont
   for (auto it = mc->sources().begin(); it != mc->sources().end(); ++it) {
     if (*it==sid) {
-      ATH_MSG_ERROR("Metadata already exists for sid " << sid);
-      return StatusCode::FAILURE;   // Fail if sid already exists
+      ATH_MSG_WARNING("Metadata already exists for sid " << sid);
+      return StatusCode::SUCCESS;   // Assume success if sid already exists
     }
   }
 
diff --git a/Control/AthenaKernel/AthenaKernel/GenericMetadataToolNoAux.icc b/Control/AthenaKernel/AthenaKernel/GenericMetadataToolNoAux.icc
index 0ac316e42a298fc51cab3be733bdf146b2b110a3..1299d8030db447fea3783c9ed07521871363e60d 100644
--- a/Control/AthenaKernel/AthenaKernel/GenericMetadataToolNoAux.icc
+++ b/Control/AthenaKernel/AthenaKernel/GenericMetadataToolNoAux.icc
@@ -290,8 +290,8 @@ StatusCode GenericMetadataToolNoAux<T>::buildAthenaInterface(const std::string&
   // Make sure sid does not already exist in the MetaCont
   for (auto it = mc->sources().begin(); it != mc->sources().end(); ++it) {
     if (*it==sid) {
-      ATH_MSG_ERROR("Metadata already exists for sid " << sid);
-      return StatusCode::FAILURE;   // Fail if sid already exists
+      ATH_MSG_WARNING("Metadata already exists for sid " << sid);
+      return StatusCode::SUCCESS;   // Assume success if sid already exists
     }
   }
 
diff --git a/Control/CxxUtils/test/CachedUniquePtr_test.cxx b/Control/CxxUtils/test/CachedUniquePtr_test.cxx
index d47894580230d9628af460116af808c9d59510d7..b0e4586aa574c5465e958ebad88109fe49ad57d5 100644
--- a/Control/CxxUtils/test/CachedUniquePtr_test.cxx
+++ b/Control/CxxUtils/test/CachedUniquePtr_test.cxx
@@ -60,12 +60,14 @@ void test1()
 
   cp1 = std::move(cp2);
   assert (cp1->m_x == 2);
+  // cppcheck-suppress accessMoved
   assert (!cp2);
   assert (P::s_count == 1);
 
   {
     const CxxUtils::CachedUniquePtr<P> cp3 (std::move (cp1));
     assert (cp3->m_x == 2);
+    // cppcheck-suppress accessMoved
     assert (!cp1);
     assert (P::s_count == 1);
   }
diff --git a/DataQuality/DataQualityUtils/CMakeLists.txt b/DataQuality/DataQualityUtils/CMakeLists.txt
index 5c47606c9eaa9df534042e0927c3d7bc6c3fd3d1..e1c5347592e9de8e30dd406ae673a404629a371b 100644
--- a/DataQuality/DataQualityUtils/CMakeLists.txt
+++ b/DataQuality/DataQualityUtils/CMakeLists.txt
@@ -90,7 +90,6 @@ atlas_add_alias( CreateMDTConfig_algos "CreateMDTConfig_algos.sh" )
 atlas_add_alias( CreateDB_Histo "CreateDB_Histo.py" )
 atlas_add_alias( hancool "hancool.py" )
 atlas_add_alias( handi "handi.py" )
-atlas_add_alias( han-results-print "han-results-print.exe" )
 atlas_add_alias( CreateMDTConfig_config "CreateMDTConfig_config.sh" )
 atlas_add_alias( hancool_histo "hancool_histo.py" )
 atlas_add_alias( CreateMDTConfig_readme "CreateMDTConfig_readme.sh" )
diff --git a/Database/IOVDbSvc/CMakeLists.txt b/Database/IOVDbSvc/CMakeLists.txt
index 4aa82c1ebdf154f90244b400e19d24eb1d931109..1fb547227159cb7c835d385d1fe768e3c69e5882 100644
--- a/Database/IOVDbSvc/CMakeLists.txt
+++ b/Database/IOVDbSvc/CMakeLists.txt
@@ -68,9 +68,7 @@ atlas_add_test( IOVDbSvc_Boost_test
                 test/IOVDbSvc_Boost_test.cxx
                 INCLUDE_DIRS ${COOL_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}        
                 LINK_LIBRARIES ${Boost_LIBRARIES} AthenaBaseComps AthenaKernel SGTools StoreGateLib SGtests GaudiKernel TestTools EventInfo IOVSvcLib xAODEventInfo PersistentDataModel ${COOL_LIBRARIES} 
-                EXTRA_PATTERNS "^HistogramPersis.* INFO|^IOVSvc +DEBUG|^IOVSvcTool +DEBUG" 
-                ENVIRONMENT  "JOBOPTSEARCHPATH=${CMAKE_CURRENT_SOURCE_DIR}/share"
-                )
+                EXTRA_PATTERNS "^HistogramPersis.* INFO|^IOVSvc +DEBUG|^IOVSvcTool +DEBUG" )
                 
 set_target_properties( IOVDbSvc_IOVDbSvc_Boost_test  PROPERTIES ENABLE_EXPORTS True )
 
@@ -78,9 +76,7 @@ atlas_add_test( IOVDbConn_test
                 SOURCES
                 test/IOVDbConn_test.cxx src/IOVDbConn.cxx
                 INCLUDE_DIRS ${COOL_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}        
-                LINK_LIBRARIES ${Boost_LIBRARIES} AthenaBaseComps AthenaKernel SGTools StoreGateLib SGtests GaudiKernel TestTools EventInfo IOVSvcLib xAODEventInfo PersistentDataModel ${COOL_LIBRARIES} CoraCool
-                ENVIRONMENT  "JOBOPTSEARCHPATH=${CMAKE_CURRENT_SOURCE_DIR}/share"
-                )
+                LINK_LIBRARIES ${Boost_LIBRARIES} AthenaBaseComps AthenaKernel SGTools StoreGateLib SGtests GaudiKernel TestTools EventInfo IOVSvcLib xAODEventInfo PersistentDataModel ${COOL_LIBRARIES} CoraCool )
                 
 atlas_add_test( IOVDbStringFunctions_test                
                 SOURCES
@@ -122,9 +118,7 @@ atlas_add_test( IOVDbFolder_test
                 test/IOVDbFolder_test.cxx src/IOVDbFolder.cxx src/IOVDbConn.cxx src/IOVDbParser.cxx src/FolderTypes.cxx src/IOVDbCoolFunctions.cxx src/IOVDbStringFunctions.cxx src/ReadFromFileMetaData.cxx
                 INCLUDE_DIRS ${COOL_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}        
                 LINK_LIBRARIES ${Boost_LIBRARIES} AthenaBaseComps AthenaKernel SGTools StoreGateLib SGtests GaudiKernel TestTools EventInfo IOVSvcLib xAODEventInfo PersistentDataModel ${COOL_LIBRARIES} CoraCool
-                EXTRA_PATTERNS "^HistogramPersis.* INFO|^IOVSvc +DEBUG|^IOVSvcTool +DEBUG" 
-                ENVIRONMENT  "JOBOPTSEARCHPATH=${CMAKE_CURRENT_SOURCE_DIR}/share"
-                )
+                EXTRA_PATTERNS "^HistogramPersis.* INFO|^IOVSvc +DEBUG|^IOVSvcTool +DEBUG"  )
 
 
 if( NOT SIMULATIONBASE )
diff --git a/Database/IOVDbSvc/share/FolderTypes_test.ref b/Database/IOVDbSvc/share/FolderTypes_test.ref
new file mode 100644
index 0000000000000000000000000000000000000000..0bb37e5e4fb6274db0ca7a70747fcf29c1fcbf9d
--- /dev/null
+++ b/Database/IOVDbSvc/share/FolderTypes_test.ref
@@ -0,0 +1,19 @@
+Running 2 test cases...
+
+
+Initializing Gaudi ApplicationMgr using job opts /home/sss/atlas/dvtest/build/joboptions/IOVDbSvc/IOVDbSvc_BoostTest.txt
+JobOptionsSvc        INFO # =======> /home/sss/atlas/dvtest/build/joboptions/IOVDbSvc/IOVDbSvc_BoostTest.txt
+JobOptionsSvc        INFO # (1,1): ApplicationMgr.OutputLevel = 5
+JobOptionsSvc        INFO # (2,1): ApplicationMgr.CreateSvc += ["StoreGateSvc/DetectorStore"]
+JobOptionsSvc        INFO # (3,1): IOVDbSvc.Folders = ["/key1"]
+JobOptionsSvc        INFO # (4,1): EventPersistencySvc.CnvServices += ["AthenaPoolCnvSvc"]
+JobOptionsSvc        INFO # (5,1): MessageSvc.OutputLevel = 5
+JobOptionsSvc        INFO Job options successfully read in from /home/sss/atlas/dvtest/build/joboptions/IOVDbSvc/IOVDbSvc_BoostTest.txt
+ApplicationMgr    SUCCESS 
+====================================================================================================================================
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v27r1p99)
+                                          running on karma on Sun Mar  3 18:21:01 2019
+====================================================================================================================================
+ApplicationMgr Ready
+
+*** No errors detected
diff --git a/Database/IOVDbSvc/share/IOVDbConn_test.ref b/Database/IOVDbSvc/share/IOVDbConn_test.ref
new file mode 100644
index 0000000000000000000000000000000000000000..28037a0591f47045dcfac63f7383f88b52256677
--- /dev/null
+++ b/Database/IOVDbSvc/share/IOVDbConn_test.ref
@@ -0,0 +1,22 @@
+Running 2 test cases...
+
+
+Initializing Gaudi ApplicationMgr using job opts /home/sss/atlas/dvtest/build/joboptions/IOVDbSvc/IOVDbSvc_BoostTest.txt
+JobOptionsSvc        INFO # =======> /home/sss/atlas/dvtest/build/joboptions/IOVDbSvc/IOVDbSvc_BoostTest.txt
+JobOptionsSvc        INFO # (1,1): ApplicationMgr.OutputLevel = 5
+JobOptionsSvc        INFO # (2,1): ApplicationMgr.CreateSvc += ["StoreGateSvc/DetectorStore"]
+JobOptionsSvc        INFO # (3,1): IOVDbSvc.Folders = ["/key1"]
+JobOptionsSvc        INFO # (4,1): EventPersistencySvc.CnvServices += ["AthenaPoolCnvSvc"]
+JobOptionsSvc        INFO # (5,1): MessageSvc.OutputLevel = 5
+JobOptionsSvc        INFO Job options successfully read in from /home/sss/atlas/dvtest/build/joboptions/IOVDbSvc/IOVDbSvc_BoostTest.txt
+ApplicationMgr    SUCCESS 
+====================================================================================================================================
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v27r1p99)
+                                          running on karma on Mon Mar  4 16:55:46 2019
+====================================================================================================================================
+ApplicationMgr Ready
+IOVDbConn_Boost...   INFO Opening COOL connection for sqlite://;schema=IOVDbConnTest.db;dbname=OFLP200
+IOVDbConn_Boost...   INFO *** COOL  exception caught: Connection on "sqlite_file:IOVDbConnTest.db" cannot be established ( CORAL : "ConnectionPool::getSessionFromNewConnection" from "CORAL/Services/ConnectionService" )
+IOVDbConn_Boost...   INFO Create a new conditions database: sqlite://;schema=IOVDbConnTest.db;dbname=OFLP200
+
+*** No errors detected
diff --git a/Database/IOVDbSvc/share/IOVDbCoolFunctions_test.ref b/Database/IOVDbSvc/share/IOVDbCoolFunctions_test.ref
new file mode 100644
index 0000000000000000000000000000000000000000..434668d839bab0aaa28cc2d087f31a8ced5caa2d
--- /dev/null
+++ b/Database/IOVDbSvc/share/IOVDbCoolFunctions_test.ref
@@ -0,0 +1,3 @@
+Running 7 test cases...
+
+*** No errors detected
diff --git a/Database/IOVDbSvc/share/IOVDbFolder_test.ref b/Database/IOVDbSvc/share/IOVDbFolder_test.ref
new file mode 100644
index 0000000000000000000000000000000000000000..28c69fff4086047c9683444ebbdadab511ee05c0
--- /dev/null
+++ b/Database/IOVDbSvc/share/IOVDbFolder_test.ref
@@ -0,0 +1,21 @@
+Running 2 test cases...
+
+
+Initializing Gaudi ApplicationMgr using job opts /afs/cern.ch/user/s/ssnyder/atlas-work3/build-x86_64-centos7-gcc8-dbg/x86_64-centos7-gcc8-dbg/jobOptions/IOVDbSvc/IOVDbSvc_BoostTest.txt
+JobOptionsSvc        INFO # =======> /afs/cern.ch/user/s/ssnyder/atlas-work3/build-x86_64-centos7-gcc8-dbg/x86_64-centos7-gcc8-dbg/jobOptions/IOVDbSvc/IOVDbSvc_BoostTest.txt
+JobOptionsSvc        INFO # (1,1): ApplicationMgr.OutputLevel = 5
+JobOptionsSvc        INFO # (2,1): ApplicationMgr.CreateSvc += ["StoreGateSvc/DetectorStore"]
+JobOptionsSvc        INFO # (3,1): IOVDbSvc.Folders = ["/key1"]
+JobOptionsSvc        INFO # (4,1): EventPersistencySvc.CnvServices += ["AthenaPoolCnvSvc"]
+JobOptionsSvc        INFO # (5,1): MessageSvc.OutputLevel = 5
+JobOptionsSvc        INFO Job options successfully read in from /afs/cern.ch/user/s/ssnyder/atlas-work3/build-x86_64-centos7-gcc8-dbg/x86_64-centos7-gcc8-dbg/jobOptions/IOVDbSvc/IOVDbSvc_BoostTest.txt
+ApplicationMgr    SUCCESS 
+====================================================================================================================================
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v31r0)
+                                          running on lxplus089.cern.ch on Thu Mar 14 17:14:44 2019
+====================================================================================================================================
+ApplicationMgr Ready
+IOVDbFolder_test     INFO Opening COOL connection for sqlite://;schema=IOVDbFolderTest.db;dbname=OFLP200
+
+*** No errors detected
+
\ No newline at end of file
diff --git a/Database/IOVDbSvc/share/IOVDbParser_test.ref b/Database/IOVDbSvc/share/IOVDbParser_test.ref
new file mode 100644
index 0000000000000000000000000000000000000000..2ea4fc62a968a2a1a70beb5e8ad7fbe3eb4cc468
--- /dev/null
+++ b/Database/IOVDbSvc/share/IOVDbParser_test.ref
@@ -0,0 +1,23 @@
+Running 2 test cases...
+
+
+Initializing Gaudi ApplicationMgr using job opts /home/sss/atlas/dvtest/build/joboptions/IOVDbSvc/IOVDbSvc_BoostTest.txt
+JobOptionsSvc        INFO # =======> /home/sss/atlas/dvtest/build/joboptions/IOVDbSvc/IOVDbSvc_BoostTest.txt
+JobOptionsSvc        INFO # (1,1): ApplicationMgr.OutputLevel = 5
+JobOptionsSvc        INFO # (2,1): ApplicationMgr.CreateSvc += ["StoreGateSvc/DetectorStore"]
+JobOptionsSvc        INFO # (3,1): IOVDbSvc.Folders = ["/key1"]
+JobOptionsSvc        INFO # (4,1): EventPersistencySvc.CnvServices += ["AthenaPoolCnvSvc"]
+JobOptionsSvc        INFO # (5,1): MessageSvc.OutputLevel = 5
+JobOptionsSvc        INFO Job options successfully read in from /home/sss/atlas/dvtest/build/joboptions/IOVDbSvc/IOVDbSvc_BoostTest.txt
+ApplicationMgr    SUCCESS 
+====================================================================================================================================
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v27r1p99)
+                                          running on karma on Sun Mar  3 18:21:30 2019
+====================================================================================================================================
+ApplicationMgr Ready
+IOVDbParser_test     INFO Folder extraText, Key: addrHeaderOverriding existing value <address_header service_type="71" clid="40774348" /> to new value <address_header service_type="71" clid="40774348" />
+IOVDbParser_test     INFO Folder extraText, Key: keyOverriding existing value /PIXEL/CablingMap to new value /PIXEL/CablingMap
+IOVDbParser_test     INFO Folder extraText, Key: timeStampOverriding existing value run-lumi to new value time
+IOVDbParser_test     INFO Folder extraText, Key: typeNameOverriding existing value AthenaAttributeList to new value AthenaAttributeList
+
+*** No errors detected
diff --git a/Database/IOVDbSvc/share/IOVDbStringFunctions_test.ref b/Database/IOVDbSvc/share/IOVDbStringFunctions_test.ref
new file mode 100644
index 0000000000000000000000000000000000000000..ed25d3e5764b4e894799ce6776661e9e0057b0f9
--- /dev/null
+++ b/Database/IOVDbSvc/share/IOVDbStringFunctions_test.ref
@@ -0,0 +1,3 @@
+Running 16 test cases...
+
+*** No errors detected
diff --git a/Database/IOVDbSvc/share/IOVDbSvc_BoostTest.ref b/Database/IOVDbSvc/share/IOVDbSvc_BoostTest.ref
new file mode 100644
index 0000000000000000000000000000000000000000..3e71bff51e5b9987cbf5009ea834d2b637a32e86
--- /dev/null
+++ b/Database/IOVDbSvc/share/IOVDbSvc_BoostTest.ref
@@ -0,0 +1,5 @@
+ApplicationMgr.OutputLevel = 5;
+ApplicationMgr.CreateSvc += { "StoreGateSvc/DetectorStore" };
+IOVDbSvc.Folders = { "/key1"};
+EventPersistencySvc.CnvServices += { "AthenaPoolCnvSvc" };
+MessageSvc.OutputLevel = 5;
\ No newline at end of file
diff --git a/Database/IOVDbSvc/share/IOVDbSvc_Boost_test.ref b/Database/IOVDbSvc/share/IOVDbSvc_Boost_test.ref
new file mode 100644
index 0000000000000000000000000000000000000000..7b911368c8834625f45a9177d8794a72a82a39bd
--- /dev/null
+++ b/Database/IOVDbSvc/share/IOVDbSvc_Boost_test.ref
@@ -0,0 +1,20 @@
+
+
+Initializing Gaudi ApplicationMgr using job opts /afs/cern.ch/user/s/ssnyder/atlas-work3/build-x86_64-centos7-gcc8-dbg/x86_64-centos7-gcc8-dbg/jobOptions/IOVDbSvc/IOVDbSvc_BoostTest.txt
+JobOptionsSvc        INFO # =======> /afs/cern.ch/user/s/ssnyder/atlas-work3/build-x86_64-centos7-gcc8-dbg/x86_64-centos7-gcc8-dbg/jobOptions/IOVDbSvc/IOVDbSvc_BoostTest.txt
+JobOptionsSvc        INFO # (1,1): ApplicationMgr.OutputLevel = 5
+JobOptionsSvc        INFO # (2,1): ApplicationMgr.CreateSvc += ["StoreGateSvc/DetectorStore"]
+JobOptionsSvc        INFO # (3,1): IOVDbSvc.Folders = ["/key1"]
+JobOptionsSvc        INFO # (4,1): EventPersistencySvc.CnvServices += ["AthenaPoolCnvSvc"]
+JobOptionsSvc        INFO # (5,1): MessageSvc.OutputLevel = 5
+JobOptionsSvc        INFO Job options successfully read in from /afs/cern.ch/user/s/ssnyder/atlas-work3/build-x86_64-centos7-gcc8-dbg/x86_64-centos7-gcc8-dbg/jobOptions/IOVDbSvc/IOVDbSvc_BoostTest.txt
+ApplicationMgr    SUCCESS 
+====================================================================================================================================
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v31r0)
+                                          running on lxplus089.cern.ch on Thu Mar 14 17:14:43 2019
+====================================================================================================================================
+ApplicationMgr Ready
+Running 10 test cases...
+
+*** No errors detected
+
\ No newline at end of file
diff --git a/Database/IOVDbSvc/share/ReadFromFileMetaData_test.ref b/Database/IOVDbSvc/share/ReadFromFileMetaData_test.ref
new file mode 100644
index 0000000000000000000000000000000000000000..e263596bf8f220c971e23d5adbcb9220cc6fae4c
--- /dev/null
+++ b/Database/IOVDbSvc/share/ReadFromFileMetaData_test.ref
@@ -0,0 +1,19 @@
+Running 2 test cases...
+
+
+Initializing Gaudi ApplicationMgr using job opts /home/sss/atlas/dvtest/build/joboptions/IOVDbSvc/IOVDbSvc_BoostTest.txt
+JobOptionsSvc        INFO # =======> /home/sss/atlas/dvtest/build/joboptions/IOVDbSvc/IOVDbSvc_BoostTest.txt
+JobOptionsSvc        INFO # (1,1): ApplicationMgr.OutputLevel = 5
+JobOptionsSvc        INFO # (2,1): ApplicationMgr.CreateSvc += ["StoreGateSvc/DetectorStore"]
+JobOptionsSvc        INFO # (3,1): IOVDbSvc.Folders = ["/key1"]
+JobOptionsSvc        INFO # (4,1): EventPersistencySvc.CnvServices += ["AthenaPoolCnvSvc"]
+JobOptionsSvc        INFO # (5,1): MessageSvc.OutputLevel = 5
+JobOptionsSvc        INFO Job options successfully read in from /home/sss/atlas/dvtest/build/joboptions/IOVDbSvc/IOVDbSvc_BoostTest.txt
+ApplicationMgr    SUCCESS 
+====================================================================================================================================
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v27r1p99)
+                                          running on karma on Sun Mar  3 18:19:37 2019
+====================================================================================================================================
+ApplicationMgr Ready
+
+*** No errors detected
diff --git a/Database/IOVDbSvc/test/GaudiKernelFixtureBase.h b/Database/IOVDbSvc/test/GaudiKernelFixtureBase.h
index 6f8ecda40a6101cf867ca287f306bba4ab16d471..b8e9a1286154182e51acd7539857938c665e4bba 100644
--- a/Database/IOVDbSvc/test/GaudiKernelFixtureBase.h
+++ b/Database/IOVDbSvc/test/GaudiKernelFixtureBase.h
@@ -32,7 +32,7 @@ struct GaudiKernelFixtureBase{
     //
     CxxUtils::ubsan_suppress ([]() { TInterpreter::Instance(); } );
     if (not gaudiIsInitialised){
-      gaudiIsInitialised=Athena_test::initGaudi(searchPath+"IOVDbSvc_BoostTest.txt", svcLoc);
+      gaudiIsInitialised=Athena_test::initGaudi("IOVDbSvc/IOVDbSvc_BoostTest.txt", svcLoc);
     }
   }
 };
diff --git a/Database/IOVDbSvc/test/IOVDbConn_test.cxx b/Database/IOVDbSvc/test/IOVDbConn_test.cxx
index b7e26e53b80b3f74ea10662c2286576621af0387..5eec908172e2489617387f4ce6046528de3d1853 100644
--- a/Database/IOVDbSvc/test/IOVDbConn_test.cxx
+++ b/Database/IOVDbSvc/test/IOVDbConn_test.cxx
@@ -40,7 +40,9 @@ struct IOVDbConnFixture{
   IOVDbConnFixture():msgSvc("msgSvc","test"),
    connectionString("sqlite://;schema=IOVDbConnTest.db;dbname=OFLP200"),
    log(msgSvc.get(), "IOVDbConn_Boost_test"),
-   connection(connectionString, true, log){
+   connection(connectionString, true, log)
+  {
+    (void)unlink ("IOVDbConnTest.db");
   }
 };
 
diff --git a/DetectorDescription/AtlasDetDescr/AtlasDetDescr/ATLAS_CHECK_THREAD_SAFETY b/DetectorDescription/AtlasDetDescr/AtlasDetDescr/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 0000000000000000000000000000000000000000..f68af6c932bb49676d9edf2db666b48932d91ce0
--- /dev/null
+++ b/DetectorDescription/AtlasDetDescr/AtlasDetDescr/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+DetectorDescription/AtlasDetDescr
diff --git a/DetectorDescription/AtlasDetDescr/AtlasDetDescr/AtlasDetectorID.h b/DetectorDescription/AtlasDetDescr/AtlasDetDescr/AtlasDetectorID.h
index a6dfed9d8715167d4773befdb92519a18b43f90c..0ddfceb48153507f882a4e387d99f6f054d413e4 100755
--- a/DetectorDescription/AtlasDetDescr/AtlasDetDescr/AtlasDetectorID.h
+++ b/DetectorDescription/AtlasDetDescr/AtlasDetDescr/AtlasDetectorID.h
@@ -314,10 +314,10 @@ protected:
 
     /// Flag for subclasses to know whether or not to perform
     /// checks. In general, this is set to false in optimized mode.
-    mutable bool        m_do_checks;
+    bool        m_do_checks;
     /// Flag for subclasses to know whether or not to perform
     /// neighbour initialization
-    mutable bool        m_do_neighbours;
+    bool        m_do_neighbours;
 
     /// pointer to the message service
     IMessageSvc*        m_msgSvc;
diff --git a/Event/ByteStreamCnvSvc/src/ByteStreamMetadataTool.h b/Event/ByteStreamCnvSvc/src/ByteStreamMetadataTool.h
index 6f753dbc6cc325273742ebd685ca04a938e7c9f3..f2a2d3853c3a9fc160a74b8cc0a4e566d707c748 100644
--- a/Event/ByteStreamCnvSvc/src/ByteStreamMetadataTool.h
+++ b/Event/ByteStreamCnvSvc/src/ByteStreamMetadataTool.h
@@ -37,7 +37,7 @@ public:
    StatusCode finalize() override;
    /// Virtual method to update a container with information from another one
    virtual StatusCode updateContainer(ByteStreamMetadataContainer* bsmdc_out,
-                                const ByteStreamMetadataContainer* bsmdc_in );
+                                const ByteStreamMetadataContainer* bsmdc_in ) override;
 };
 
 #endif
diff --git a/Event/EventBookkeeperTools/EventBookkeeperTools/BookkeeperTool.h b/Event/EventBookkeeperTools/EventBookkeeperTools/BookkeeperTool.h
index a905dcbec04f5c19e635516f3eb6751456fdb908..0a6d4a30bda0569a2d9c39cb4191cc4e7e6d5b09 100644
--- a/Event/EventBookkeeperTools/EventBookkeeperTools/BookkeeperTool.h
+++ b/Event/EventBookkeeperTools/EventBookkeeperTools/BookkeeperTool.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef BOOKKEEPERTOOL_H
@@ -12,7 +12,15 @@
  *  $Id: $
  **/
 
-#include "AthenaKernel/GenericMetadataTool.h"
+//#include "GaudiKernel/AlgTool.h"
+#include "AthenaBaseComps/AthAlgTool.h"
+#include "AsgTools/AsgMetadataTool.h"
+#ifdef ASGTOOL_ATHENA
+#include "AthenaKernel/IMetaDataTool.h"
+#endif // ASGTOOL_ATHENA
+#include "GaudiKernel/IIncidentListener.h"
+#include "GaudiKernel/ServiceHandle.h"
+#include "AthenaKernel/ICutFlowSvc.h"
 
 #include "xAODCutFlow/CutBookkeeper.h"
 #include "xAODCutFlow/CutBookkeeperContainer.h"
@@ -21,24 +29,55 @@
 #include <string>
 
 
-class BookkeeperTool : public GenericMetadataTool <xAOD::CutBookkeeperContainer, xAOD::CutBookkeeperAuxContainer> 
+class BookkeeperTool : public asg::AsgMetadataTool
+#ifdef ASGTOOL_ATHENA
+                     , public virtual ::IMetaDataTool
+#endif // ASGTOOL_ATHENA
 {
-public: 
-   // Constructor and Destructor
+   ASG_TOOL_CLASS0(BookkeeperTool)
+public: // Constructor and Destructor
    /// Standard Service Constructor
-   BookkeeperTool(const std::string& type, 
-                  const std::string& name,
-                  const IInterface*  parent);
+   BookkeeperTool(const std::string& name = "BookkeeperTool");
    /// Destructor
    virtual ~BookkeeperTool();
 
+public:
+   //void handle(const Incident& incident);
+   virtual StatusCode metaDataStop();
+   virtual StatusCode beginInputFile() override {return StatusCode::SUCCESS;}
+   virtual StatusCode endInputFile() override {return StatusCode::SUCCESS;}
+   virtual StatusCode beginInputFile(const SG::SourceID&) override;
+   virtual StatusCode endInputFile(const SG::SourceID&) override;
+   virtual StatusCode initialize();
+   virtual StatusCode finalize();
+
 private:
   
-  /// Virtual method to update a container with information from another one
-  virtual StatusCode updateContainer(xAOD::CutBookkeeperContainer* contToUpdate,
-                               const xAOD::CutBookkeeperContainer* otherCont );
+  /// Helper class to update a container with information from another one
+  StatusCode updateContainer( xAOD::CutBookkeeperContainer* contToUpdate,
+                              const xAOD::CutBookkeeperContainer* otherCont );
+
+  StatusCode copyContainerToOutput(const std::string& outname);
+
+  /// Fill Cutflow information
+  StatusCode addCutFlow();
+ 
+  /// Pointer to cut flow svc 
+  //ServiceHandle<ICutFlowSvc> m_cutflowsvc;
+
+  /// The name of the output CutBookkeeperContainer
+  std::string m_outputCollName;
+  
+  /// The name of the input CutBookkeeperContainer
+  std::string  m_inputCollName;
+
+  /// The name of the CutFlowSvc CutBookkeeperContainer
+  std::string m_cutflowCollName;
+
+  bool m_cutflowTaken;
 
 };
 
 #endif
 
+
diff --git a/Event/EventBookkeeperTools/Root/BookkeeperTool.cxx b/Event/EventBookkeeperTools/Root/BookkeeperTool.cxx
index d3fb8a16b355294b7c98360dcdf650d7ce1e2e2c..057d9762e22b33ca5344d539dc719e16b6c88aec 100644
--- a/Event/EventBookkeeperTools/Root/BookkeeperTool.cxx
+++ b/Event/EventBookkeeperTools/Root/BookkeeperTool.cxx
@@ -1,7 +1,7 @@
 ///////////////////////// -*- C++ -*- /////////////////////////////
 
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 */
 
 // Implementation file for class BookkeeperTool
@@ -13,28 +13,241 @@
 // STL include
 #include <algorithm>
 
-#include "AthenaKernel/MetaCont.h"
-#include "AthenaKernel/ClassID_traits.h"
+// #include "FillEBCFromFlat.h"
+
+#include "GaudiKernel/Incident.h"
+#include "GaudiKernel/FileIncident.h"
+#include "GaudiKernel/IIncidentSvc.h"
 #include "AthenaKernel/errorcheck.h"
-#include "AthenaKernel/GenericMetadataTool.h"
-#include "AthenaKernel/ICutFlowSvc.h"
 #include "AthenaBaseComps/AthCheckMacros.h"
-#include "AthContainersInterfaces/IConstAuxStoreMeta.h"
 
-BookkeeperTool::BookkeeperTool(const std::string& type, 
-                               const std::string& name,
-                               const IInterface*  parent)
-  : GenericMetadataTool <xAOD::CutBookkeeperContainer, xAOD::CutBookkeeperAuxContainer>(type,name,parent)
+
+BookkeeperTool::BookkeeperTool(const std::string& name)
+  : asg::AsgMetadataTool(name),
+    m_cutflowTaken(false)
 {
+  declareProperty("OutputCollName", m_outputCollName="CutBookkeepers",  
+    "The default name of the xAOD::CutBookkeeperContainer for output files");
+  declareProperty("InputCollName", m_inputCollName = "CutBookkeepers",
+    "The default name of the xAOD::CutBookkeeperContainer for input files");
+  declareProperty("CutFlowCollName", m_cutflowCollName = "CutBookkeepersFile",
+    "The default name of the xAOD::CutBookkeeperContainer for CutFlowSvc");
+#ifdef ASGTOOL_ATHENA
+  declareInterface< ::IMetaDataTool >( this );
+#endif // ASGTOOL_ATHENA
 }
 
+
+
 BookkeeperTool::~BookkeeperTool()
 {
 }
 
 
+
+StatusCode
+BookkeeperTool::initialize()
+{
+  ATH_MSG_DEBUG( "Initializing " << name() << " - package version " << PACKAGE_VERSION );
+
+  ATH_MSG_DEBUG("InputCollName = " << m_inputCollName);
+  ATH_MSG_DEBUG("OutputCollName = " << m_outputCollName);
+  ATH_MSG_DEBUG("CutFlowCollName = " << m_cutflowCollName);
+
+  return StatusCode::SUCCESS;
+}
+
+
+//__________________________________________________________________________
+StatusCode BookkeeperTool::beginInputFile(const SG::SourceID&)
+{
+  //OPENING NEW INPUT FILE
+  //Things to do:
+  // 1) note that a file is currently opened
+  // 2) Load CutBookkeepers from input file
+  //    2a) if incomplete from input, directly propagate to output
+  //    2b) if complete from input, wait for EndInputFile to decide what to do in output
+
+  // reset cutflow taken marker
+  m_cutflowTaken = false;
+
+  // Get the incomplete bookkeeper collection of the input metadata store
+  const xAOD::CutBookkeeperContainer* input_inc = 0;
+  // Construct input and output incomplete names
+  std::string inCollName = "Incomplete" + m_inputCollName;
+  std::string outCollName = "Incomplete" + m_outputCollName;
+  if (inputMetaStore()->contains<xAOD::CutBookkeeperContainer>(inCollName) ) {
+    StatusCode ssc = inputMetaStore()->retrieve( input_inc, inCollName );
+    if (ssc.isSuccess()) {
+      // First make sure there is an incomplete container in the output store
+      if( !(outputMetaStore()->contains<xAOD::CutBookkeeperContainer>(outCollName)) ) {
+        xAOD::CutBookkeeperContainer* inc = new xAOD::CutBookkeeperContainer();
+        xAOD::CutBookkeeperAuxContainer* auxinc = new xAOD::CutBookkeeperAuxContainer();
+        inc->setStore(auxinc);
+        ATH_CHECK(outputMetaStore()->record(inc,outCollName));
+        ATH_CHECK(outputMetaStore()->record(auxinc,outCollName+"Aux."));
+      }
+      // retrieve the incomplete output container
+      xAOD::CutBookkeeperContainer* incompleteBook(NULL);
+      ATH_CHECK(outputMetaStore()->retrieve( incompleteBook, outCollName));
+      // update incomplete output with any incomplete input
+      ATH_CHECK(this->updateContainer(incompleteBook,input_inc));
+      ATH_MSG_DEBUG("Successfully merged input incomplete bookkeepers with output");
+    }
+  }
+  else {
+    ATH_MSG_INFO("No incomplete bookkeepers in this file " << inCollName);
+  }
+
+  // Get the complete bookkeeper collection of the input metadata store
+  const xAOD::CutBookkeeperContainer* input_com = 0;
+  inCollName = m_inputCollName;
+  outCollName = m_outputCollName;
+  if (inputMetaStore()->contains<xAOD::CutBookkeeperContainer>(inCollName) ) {
+    if ( (inputMetaStore()->retrieve( input_com, inCollName )).isSuccess() ) {
+      // Check if a tmp is there. IT SHOULD NOT BE
+      //xAOD::CutBookkeeperContainer* incompleteBook(NULL);
+      if( !(outputMetaStore()->contains<xAOD::CutBookkeeperContainer>(outCollName+"tmp")) ) {
+        // Now create the tmp container
+        xAOD::CutBookkeeperContainer* tmp = new xAOD::CutBookkeeperContainer();
+        xAOD::CutBookkeeperAuxContainer* auxtmp = new xAOD::CutBookkeeperAuxContainer();
+        tmp->setStore(auxtmp);
+        if (updateContainer(tmp,input_com).isSuccess()) {
+          ATH_CHECK(outputMetaStore()->record(tmp,outCollName+"tmp"));
+          ATH_CHECK(outputMetaStore()->record(auxtmp,outCollName+"tmpAux."));
+        }
+        else {
+          ATH_MSG_WARNING("Could not update tmp container from input complete conatiner");
+        }
+      }
+    }
+    else {
+      ATH_MSG_WARNING("tmp collection already exists");
+      return StatusCode::SUCCESS;
+    }
+    ATH_MSG_DEBUG("Successfully copied complete bookkeepers to temp container");
+  }
+
+  //  Now make sure the output containers are in the output store
+  //
+  //  Make sure complete container exists in output
+  if( !(outputMetaStore()->contains<xAOD::CutBookkeeperContainer>(m_outputCollName)) ) {
+      // Now create the complete container
+    xAOD::CutBookkeeperContainer* inc = new xAOD::CutBookkeeperContainer();
+    xAOD::CutBookkeeperAuxContainer* auxinc = new xAOD::CutBookkeeperAuxContainer();
+    inc->setStore(auxinc);
+    ATH_CHECK(outputMetaStore()->record(inc,m_outputCollName));
+    ATH_CHECK(outputMetaStore()->record(auxinc,m_outputCollName+"Aux."));
+  }
+  else {
+    ATH_MSG_WARNING("complete collection already exists");
+    //return StatusCode::SUCCESS;
+  }
+  //  Make sure incomplete container exists in output
+  std::string inc_name = "Incomplete"+m_outputCollName;
+  if( !(outputMetaStore()->contains<xAOD::CutBookkeeperContainer>(inc_name)) ) {
+      // Now create the complete container
+    xAOD::CutBookkeeperContainer* coll = new xAOD::CutBookkeeperContainer();
+    xAOD::CutBookkeeperAuxContainer* auxcoll = new xAOD::CutBookkeeperAuxContainer();
+    coll->setStore(auxcoll);
+    ATH_CHECK(outputMetaStore()->record(coll,inc_name));
+    ATH_CHECK(outputMetaStore()->record(auxcoll,inc_name+"Aux."));
+  }
+  else {
+    ATH_MSG_WARNING("incomplete collection already exists");
+  }
+  
+  return StatusCode::SUCCESS;
+}
+
+
+StatusCode BookkeeperTool::endInputFile(const SG::SourceID&)
+{
+
+  if (copyContainerToOutput(m_outputCollName).isFailure()) return StatusCode::FAILURE;
+
+  if (!m_cutflowTaken) {
+    if (addCutFlow().isFailure()) {
+      ATH_MSG_ERROR("Could not add CutFlow information");
+    }
+    m_cutflowTaken = true;
+  }
+  else {
+    ATH_MSG_DEBUG("Cutflow information written into container before endInputFile");
+  }
+    
+  return StatusCode::SUCCESS;
+}
+
+StatusCode BookkeeperTool::metaDataStop()
+{
+  //TERMINATING THE JOB (EndRun)
+  //Things to do:
+  // 1) Create new incomplete CutBookkeepers if relevant
+  // 2) Print cut flow summary
+  // 3) Write root file if requested
+  //  Make sure incomplete container exists in output
+  std::string inc_name = "Incomplete"+m_outputCollName;
+  if (copyContainerToOutput(inc_name).isFailure()) return StatusCode::FAILURE;
+
+
+  if (!m_cutflowTaken) {
+    if (addCutFlow().isFailure()) {
+      ATH_MSG_ERROR("Could not add CutFlow information");
+    }
+  }
+  else {
+    ATH_MSG_DEBUG("Cutflow information written into container before metaDataStop");
+  }
+
+  // Reset after metadata stop
+  m_cutflowTaken = false;
+  
+  return StatusCode::SUCCESS;
+}
+
+
+StatusCode
+BookkeeperTool::finalize()
+{
+  ATH_MSG_DEBUG( "Finalizing " << name() << " - package version " << PACKAGE_VERSION );
+  return StatusCode::SUCCESS;
+}
+
+
+StatusCode BookkeeperTool::addCutFlow()
+{
+  // Add the information from the current processing to the complete output
+  // --> same paradigm as original CutFlowSvc
+  // Get the complete bookkeeper collection of the output meta-data store
+  xAOD::CutBookkeeperContainer* completeBook(NULL); 
+  if( !(outputMetaStore()->retrieve( completeBook, m_outputCollName) ).isSuccess() ) {
+    ATH_MSG_ERROR( "Could not get complete CutBookkeepers from output MetaDataStore" );
+    return StatusCode::FAILURE;
+  }
+
+  // Get the bookkeeper from the current processing
+  const xAOD::CutBookkeeperContainer* fileCompleteBook(NULL);
+  if( outputMetaStore()->contains<xAOD::CutBookkeeperContainer>(m_cutflowCollName) ) {
+    if( !(outputMetaStore()->retrieve( fileCompleteBook, m_cutflowCollName) ).isSuccess() ) {
+      ATH_MSG_WARNING( "Could not get CutFlowSvc CutBookkeepers from output MetaDataStore" );
+    }
+    else {
+      // update the complete output with the complete input
+      ATH_CHECK(this->updateContainer(completeBook,fileCompleteBook));
+    }
+  }
+  else {
+    ATH_MSG_INFO("No cutflow container " << m_cutflowCollName);
+  }
+
+  return StatusCode::SUCCESS;
+}
+
+
 namespace {
 
+
 xAOD::CutBookkeeper*
 resolveLink (const xAOD::CutBookkeeper* old,
              xAOD::CutBookkeeperContainer& contToUpdate,
@@ -111,9 +324,6 @@ BookkeeperTool::updateContainer( xAOD::CutBookkeeperContainer* contToUpdate,
         foundEBKToUpdate = true;
         break;
       }
-      else {
-        ATH_MSG_INFO("otherEBK("<<otherEBK->name()<<") != ebkToUpdate("<<ebkToUpdate->name());
-      }
     } // End: Inner loop over contToUpdate
     if (!foundEBKToUpdate) {
       xAOD::CutBookkeeper* newEBK = new xAOD::CutBookkeeper();
@@ -175,3 +385,34 @@ BookkeeperTool::updateContainer( xAOD::CutBookkeeperContainer* contToUpdate,
   return StatusCode::SUCCESS;
 }
 
+
+StatusCode BookkeeperTool::copyContainerToOutput(const std::string& outname)
+{
+
+  // Get the complete bookkeeper collection of the output meta-data store
+  xAOD::CutBookkeeperContainer* contBook(nullptr); 
+  if( !(outputMetaStore()->retrieve( contBook, outname) ).isSuccess() ) {
+    ATH_MSG_ERROR( "Could not get " << outname << " CutBookkeepers from output MetaDataStore" );
+    return StatusCode::FAILURE;
+  }
+
+  // Get the tmp bookkeeper from the input
+  const xAOD::CutBookkeeperContainer* tmpBook(NULL);
+  if ( outputMetaStore()->contains<xAOD::CutBookkeeperContainer>(outname+"tmp") ) {
+    if( !(outputMetaStore()->retrieve( tmpBook, outname+"tmp") ).isSuccess() ) {
+      ATH_MSG_WARNING( "Could not get tmp CutBookkeepers from output MetaDataStore" );
+    }
+    else {
+      // update the complete output with the complete input
+      ATH_CHECK(this->updateContainer(contBook,tmpBook));
+      // remove the tmp container
+      const SG::IConstAuxStore* tmpBookAux = tmpBook->getConstStore();
+      ATH_CHECK(outputMetaStore()->removeDataAndProxy(tmpBook));
+      ATH_CHECK(outputMetaStore()->removeDataAndProxy(tmpBookAux));
+    }
+  }
+    
+  return StatusCode::SUCCESS;
+}
+
+
diff --git a/Event/EventBookkeeperTools/python/CutFlowHelpers.py b/Event/EventBookkeeperTools/python/CutFlowHelpers.py
index 8ffb7d2c98c442cf6dfe176bf3a315dc5ca49ccb..cc2bfad15783a66e95ba82918fc412ff5cef5ef8 100644
--- a/Event/EventBookkeeperTools/python/CutFlowHelpers.py
+++ b/Event/EventBookkeeperTools/python/CutFlowHelpers.py
@@ -44,7 +44,6 @@ def GetCurrentStreamName( msg, athFile=None ):
 
 
 def CreateCutFlowSvc( svcName="CutFlowSvc", athFile=None, seq=None, addAlgInPlace=False, addMetaDataToAllOutputFiles=True, SGkey="CutBookkeepers" ):
-    print "CreateCutFlowSvc"
     """
     Helper to create the CutFlowSvc, extract the needed information from
     the input file, and also schedule all the needed stuff.
@@ -64,7 +63,8 @@ def CreateCutFlowSvc( svcName="CutFlowSvc", athFile=None, seq=None, addAlgInPlac
     import AthenaCommon.CfgMgr as CfgMgr
     if not hasattr(svcMgr,"CutFlowSvc"): svcMgr += CfgMgr.CutFlowSvc()
     svcMgr.CutFlowSvc.InputStream   = inputStreamName
-
+    #if not hasattr(svcMgr,"FileCutFlowSvc"): svcMgr += CfgMgr.FileCutFlowSvc()
+    #svcMgr.FileCutFlowSvc.InputStream   = inputStreamName
 
     # Make sure MetaDataSvc is ready
     if not hasattr(svcMgr,'MetaDataSvc'):
@@ -79,19 +79,18 @@ def CreateCutFlowSvc( svcName="CutFlowSvc", athFile=None, seq=None, addAlgInPlac
     outname = "CutBookkeepers"
     cutflowtool = BookkeeperTool(outname+"Tool",
                                  InputCollName = inname,
-                                 OutputCollName= outname,
-                                 ProcessMetadataCollName=inname+"File") 
+                                 OutputCollName= outname) 
     svcMgr.ToolSvc += cutflowtool
 
-
     # Add tool to MetaDataSvc
     svcMgr.MetaDataSvc.MetaDataTools += [cutflowtool]
-    for x in svcMgr.MetaDataSvc.MetaDataTools:
-        print x
 
     # Add pdf sum of weights counts if appropriate
     from AthenaCommon.GlobalFlags  import globalflags
     if globalflags.DataSource() == 'geant4':
+        #from PyUtils import AthFile
+        #afc = AthFile.fopen( svcMgr.EventSelector.InputCollections[0] )
+
         # PDF
         name = "PDFSumOfWeights"
         pdfweighttool = BookkeeperTool(name,
@@ -143,8 +142,7 @@ def CreateCutFlowSvc( svcName="CutFlowSvc", athFile=None, seq=None, addAlgInPlac
         MSMgr.AddMetaDataItemToAllStreams( "xAOD::CutBookkeeperAuxContainer#"+SGkey+"Aux.*" )
         MSMgr.AddMetaDataItemToAllStreams( "xAOD::CutBookkeeperContainer#Incomplete"+SGkey )
         MSMgr.AddMetaDataItemToAllStreams( "xAOD::CutBookkeeperAuxContainer#Incomplete"+SGkey+"Aux.*" )
-        #SGkey = "FileBookkeepers"
-        SGkey = "CutBookkeepersFile"
+        SGkey = "FileBookkeepers"
         MSMgr.AddMetaDataItemToAllStreams( "xAOD::CutBookkeeperContainer#"+SGkey )
         MSMgr.AddMetaDataItemToAllStreams( "xAOD::CutBookkeeperAuxContainer#"+SGkey+"Aux.*" )
         MSMgr.AddMetaDataItemToAllStreams( "xAOD::CutBookkeeperContainer#Incomplete"+SGkey )
@@ -172,6 +170,7 @@ def CreateBookkeeperTool( name="CutBookkeepers" ):
   svcMgr.ToolSvc += cutflowtool
 
   # Add tool to MetaDataSvc
-  svcMgr.MetaDataSvc.MetaDataTools += [cutflowtool]
+  #svcMgr.MetaDataSvc.MetaDataTools += [cutflowtool]
 
   return
+
diff --git a/Event/xAOD/xAODTrigger/xAODTrigger/versions/TrigComposite_v1.icc b/Event/xAOD/xAODTrigger/xAODTrigger/versions/TrigComposite_v1.icc
index 598f26110174cef2457cc5c9481e81e35d5ed487..016689ee602a965386bb643464c5c4b9b784c376 100644
--- a/Event/xAOD/xAODTrigger/xAODTrigger/versions/TrigComposite_v1.icc
+++ b/Event/xAOD/xAODTrigger/xAODTrigger/versions/TrigComposite_v1.icc
@@ -227,7 +227,7 @@ namespace xAOD {
        links.push_back( ElementLink< CONTAINER >(linkColKeys()[ i ],
                                                  linkColIndices()[ i ]) );
      }
-     return std::move(links);
+     return links;
   }
 
 } // namespace xAOD
diff --git a/Generators/GeneratorObjects/src/HepMcParticleLink.cxx b/Generators/GeneratorObjects/src/HepMcParticleLink.cxx
index 8bbcfddf44157596c225d276715614e450e838fa..bbbdc2afb3f80bbe3dedde27b17828aafcee6239 100644
--- a/Generators/GeneratorObjects/src/HepMcParticleLink.cxx
+++ b/Generators/GeneratorObjects/src/HepMcParticleLink.cxx
@@ -172,7 +172,8 @@ const HepMC::GenParticle* HepMcParticleLink::cptr() const
   if (!p) {
     if (0 == barcode()) {
 #if 0
-      mlog() << MSG::DEBUG
+      MsgStream log (Athena::getMessageSvc(), "HepMcParticleLink");
+      log << MSG::DEBUG
              << "cptr: no truth particle associated with this hit (barcode==0)."
              << " Probably this is a noise hit" << endmsg;
 #endif
@@ -186,7 +187,16 @@ const HepMC::GenParticle* HepMcParticleLink::cptr() const
         pEvt = pEvtColl->at(0);
       }
       else if (position != ExtendedBarCode::UNDEFINED) {
-        pEvt = pEvtColl->at (position);
+        if (position < pEvtColl->size()) {
+          pEvt = pEvtColl->at (position);
+        }
+        else {
+#if 0
+          MsgStream log (Athena::getMessageSvc(), "HepMcParticleLink");
+          log << MSG::WARNING << "cptr: position = " << position << ", McEventCollection size = "<< pEvtColl->size() << endmsg;
+#endif
+          return nullptr;
+        }
       }
       else {
         pEvt = pEvtColl->find (index);
diff --git a/Generators/GeneratorObjectsTPCnv/src/HepMcParticleLinkCnv_p1.cxx b/Generators/GeneratorObjectsTPCnv/src/HepMcParticleLinkCnv_p1.cxx
index a231c671b466e02a079b37f671a31c28ca860a42..322d8255909c6d43284cf8990faa7b61b3990599 100755
--- a/Generators/GeneratorObjectsTPCnv/src/HepMcParticleLinkCnv_p1.cxx
+++ b/Generators/GeneratorObjectsTPCnv/src/HepMcParticleLinkCnv_p1.cxx
@@ -23,10 +23,12 @@ void HepMcParticleLinkCnv_p1::persToTrans( const HepMcParticleLink_p1* persObj,
                                            HepMcParticleLink* transObj,
                                            MsgStream &/*msg*/ )
 {
+  EBC_EVCOLL evColl = EBC_MAINEVCOLL;
+  if (persObj->m_mcEvtIndex>0) evColl = EBC_FIRSTPUEVCOLL; // HACK
   transObj->setExtendedBarCode
     ( HepMcParticleLink::ExtendedBarCode( persObj->m_barcode,
                                           persObj->m_mcEvtIndex,
-                                          EBC_MAINEVCOLL,
+                                          evColl,
                                           HepMcParticleLink::IS_POSITION) );
   return;
 }
diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTErrMonTool.h b/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTErrMonTool.h
index 6066a5abbe26b88d1a82ae5b11dcc3592520d1e9..5a4a65a4c6c8df9a353957ee490d66c907166126 100644
--- a/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTErrMonTool.h
+++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTErrMonTool.h
@@ -13,22 +13,22 @@
 #ifndef SCTERRMONTOOL_H
 #define SCTERRMONTOOL_H
 #include "AthenaMonitoring/ManagedMonitorToolBase.h"
-#include "GaudiKernel/ServiceHandle.h"
-#include <string>
-#include <vector>
-#include <map>
-#include <utility>
 
-//for CondDB
 #include "InDetConditionsSummaryService/IInDetConditionsTool.h"
+#include "InDetRawData/SCT_RDO_Container.h"
 #include "SCT_ConditionsTools/ISCT_ConfigurationConditionsTool.h"
 #include "SCT_ConditionsTools/ISCT_ByteStreamErrorsTool.h"
 #include "SCT_ConditionsTools/ISCT_DCSConditionsTool.h"
 #include "SCT_Monitoring/SCT_MonitoringNumbers.h"
-
 #include "StoreGate/ReadHandleKey.h"
 #include "xAODEventInfo/EventInfo.h"
-#include "InDetRawData/SCT_RDO_Container.h"
+
+#include "GaudiKernel/ServiceHandle.h"
+
+#include <string>
+#include <vector>
+#include <map>
+#include <utility>
 
 /** Forward declarations*/
 class IInterface;
@@ -58,12 +58,12 @@ class SCTErrMonTool : public ManagedMonitorToolBase
   typedef std::map< IdentifierHash, moduleGeo_t > geoContainer_t;
 
  public:
-  SCTErrMonTool(const std::string & type,const std::string & name,const IInterface* parent);
+  SCTErrMonTool(const std::string& type,const std::string& name,const IInterface* parent);
   virtual ~SCTErrMonTool();
   //
   /**    @name Methods reimplemented from baseclass */
   //@{
-  //initialize 11.09.2016
+  //initialize
   virtual StatusCode initialize() final;
   //book
   virtual StatusCode bookHistograms() final;
@@ -71,7 +71,7 @@ class SCTErrMonTool : public ManagedMonitorToolBase
   virtual StatusCode fillHistograms() final;
   //post processing
   virtual StatusCode procHistograms() final;
-  //Recurrent 11.09.2016
+  //Recurrent
   virtual StatusCode bookHistogramsRecurrent() final;
   //book
   virtual StatusCode copyHistograms() final;
@@ -80,7 +80,7 @@ class SCTErrMonTool : public ManagedMonitorToolBase
 
  private:
   static const int NREGIONS_INC_GENERAL=SCT_Monitoring::N_REGIONS+1;
-  typedef TProfile2D_LW * Prof2_t;
+  typedef TProfile2D_LW* Prof2_t;
   typedef std::vector<Prof2_t> VecProf2_t;
   StatusCode checkRateHists();
   StatusCode fillByteStreamErrors();
@@ -92,8 +92,8 @@ class SCTErrMonTool : public ManagedMonitorToolBase
   //@name Histograms related members
   //@{
   // Pointers to hit error histograms
-  TH1F_LW * m_firstHit[NREGIONS_INC_GENERAL];
-  TH1F_LW * m_secondHit[NREGIONS_INC_GENERAL];
+  TH1F_LW* m_firstHit[NREGIONS_INC_GENERAL];
+  TH1F_LW* m_secondHit[NREGIONS_INC_GENERAL];
   //@}
 
   enum CategoryErrors { MASKEDLINKALL=0, SUMMARY, BADERR, LINKLEVEL, RODLEVEL, MASKEDCHIP, N_ERRCATEGORY};
@@ -125,13 +125,13 @@ class SCTErrMonTool : public ManagedMonitorToolBase
   TH2F_LW* m_numErrorsPerLumi[NREGIONS_INC_GENERAL];
   TProfile2D_LW* m_rateErrorsPerLumi[NREGIONS_INC_GENERAL];
 
-  TH1I *m_nErrors;
-  TH1I *m_nLinksWithErrors;
-  int *m_nErrors_buf;
-  int *m_nLinksWithErrors_buf;
+  TH1I* m_nErrors;
+  TH1I* m_nLinksWithErrors;
+  int* m_nErrors_buf;
+  int* m_nLinksWithErrors_buf;
   int m_nErrors_pos;
 
-  TH1I *m_MaskedAllLinks; // maskedLinks||maskedRODs
+  TH1I* m_MaskedAllLinks; // maskedLinks||maskedRODs
 
   //Count number of events
   int m_numberOfEventsLumi;
@@ -147,14 +147,13 @@ class SCTErrMonTool : public ManagedMonitorToolBase
 
   int fillByteStreamErrorsHelper(const std::set<IdentifierHash>* errors, TH2F_LW* histo[SCT_ByteStreamErrors::NUM_ERROR_TYPES][NREGIONS_INC_GENERAL][SCT_Monitoring::N_ENDCAPSx2], bool lumi2DHist, int err_type);
   void numByteStreamErrors(const std::set<IdentifierHash>* errors, int& ntot, int& nbar, int& neca, int& necc);
-  StatusCode bookErrHistosHelper(MonGroup & mg, TString name, TString title, TString titlehitmap, TProfile2D_LW* &tprof, TH2F_LW* &th, const int layer, const bool barrel=true);
+  StatusCode bookErrHistosHelper(MonGroup& mg, TString name, TString title, TString titlehitmap, TProfile2D_LW*& tprof, TH2F_LW*& th, const int layer, const bool barrel=true);
 
-  StatusCode bookErrHistosHelper(MonGroup & mg, TString name, TString title, TProfile2D_LW* &tprof, const int layer, const bool barrel=true);
+  StatusCode bookErrHistosHelper(MonGroup& mg, TString name, TString title, TProfile2D_LW*& tprof, const int layer, const bool barrel=true);
 
-  std::vector<TH2F_LW *> m_p2DmapHistoVectorAll[NREGIONS_INC_GENERAL];
+  std::vector<TH2F_LW*> m_p2DmapHistoVectorAll[NREGIONS_INC_GENERAL];
 
   /// "Magic numbers" for an SCT module
-  //unsigned int m_nplanes; //to be determined from SCT Helper
   enum { Confbins = 6, ConfbinsDetailed = 5 };
   // NOTE: The following is not the usual index order, which goes C, Barrel, A
   enum {iECm=0, iBARREL=1, iECp=2, iGEN=3 }; //iECp==EA, iECm==EC
@@ -207,28 +206,28 @@ class SCTErrMonTool : public ManagedMonitorToolBase
   StatusCode resetConfigurationDetails();
 
   /// Pointer to 1D histogram of Number of SCT Clusters per LBs
-  TProfile_LW * m_Conf[NREGIONS_INC_GENERAL];
-  TProfile_LW * m_ConfRN[NREGIONS_INC_GENERAL];
-  TProfile_LW * m_ConfNew[NREGIONS_INC_GENERAL];
-  TProfile_LW * m_ConfOutModules[NREGIONS_INC_GENERAL];
-  TProfile_LW * m_ConfOnline[NREGIONS_INC_GENERAL];
+  TProfile_LW* m_Conf[NREGIONS_INC_GENERAL];
+  TProfile_LW* m_ConfRN[NREGIONS_INC_GENERAL];
+  TProfile_LW* m_ConfNew[NREGIONS_INC_GENERAL];
+  TProfile_LW* m_ConfOutModules[NREGIONS_INC_GENERAL];
+  TProfile_LW* m_ConfOnline[NREGIONS_INC_GENERAL];
 
-  TProfile_LW * m_ByteStreamVsLB[SCT_ByteStreamErrors::NUM_ERROR_TYPES][NREGIONS_INC_GENERAL];
-  TProfile_LW * m_ByteStreamWithSctFlagVsLB[SCT_ByteStreamErrors::NUM_ERROR_TYPES][NREGIONS_INC_GENERAL];
-  TProfile_LW * m_ByteStreamCategorisedVsLB[CategoryErrors::N_ERRCATEGORY][NREGIONS_INC_GENERAL];
-  TProfile_LW * m_LinksWithCategorisedErrorsVsLB[CategoryErrors::N_ERRCATEGORY][NREGIONS_INC_GENERAL];
-  TProfile_LW * m_LinksWithCategorisedErrorsVsLBLayer[CategoryErrors::N_ERRCATEGORY][NREGIONS_INC_GENERAL][SCT_Monitoring::N_DISKSx2];
+  TProfile_LW* m_ByteStreamVsLB[SCT_ByteStreamErrors::NUM_ERROR_TYPES][NREGIONS_INC_GENERAL];
+  TProfile_LW* m_ByteStreamWithSctFlagVsLB[SCT_ByteStreamErrors::NUM_ERROR_TYPES][NREGIONS_INC_GENERAL];
+  TProfile_LW* m_ByteStreamCategorisedVsLB[CategoryErrors::N_ERRCATEGORY][NREGIONS_INC_GENERAL];
+  TProfile_LW* m_LinksWithCategorisedErrorsVsLB[CategoryErrors::N_ERRCATEGORY][NREGIONS_INC_GENERAL];
+  TProfile_LW* m_LinksWithCategorisedErrorsVsLBLayer[CategoryErrors::N_ERRCATEGORY][NREGIONS_INC_GENERAL][SCT_Monitoring::N_DISKSx2];
 
-  TProfile_LW * m_LinksWithRODErrorsVsLB_check[NREGIONS_INC_GENERAL];
+  TProfile_LW* m_LinksWithRODErrorsVsLB_check[NREGIONS_INC_GENERAL];
 
-  TH1F_LW * m_NumberOfSCTFlagErrorsVsLB;
-  TH1F_LW * m_NumberOfEventsVsLB;
-  TProfile_LW * m_FractionOfSCTFlagErrorsPerLB;
+  TH1F_LW* m_NumberOfSCTFlagErrorsVsLB;
+  TH1F_LW* m_NumberOfEventsVsLB;
+  TProfile_LW* m_FractionOfSCTFlagErrorsPerLB;
 
-  TProfile * m_ConfEffOnline;
-  TProfile_LW * m_ConfNoiseOnline;
-  TProfile_LW * m_ConfNoiseOnlineRecent;
-  TProfile_LW * m_DetailedConfiguration;
+  TProfile* m_ConfEffOnline;
+  TProfile_LW* m_ConfNoiseOnline;
+  TProfile_LW* m_ConfNoiseOnlineRecent;
+  TProfile_LW* m_DetailedConfiguration;
 
   /** a handle on the Hist/TTree registration service */
   ServiceHandle<ITHistSvc> m_thistSvc;
@@ -254,7 +253,7 @@ class SCTErrMonTool : public ManagedMonitorToolBase
   //@}
 
   Prof2_t
-    prof2Factory(const std::string & name, const std::string & title, const unsigned int&, VecProf2_t & storageVector);
+    prof2Factory(const std::string& name, const std::string& title, const unsigned int&, VecProf2_t& storageVector);
 
   bool syncDisabledSCT();
   bool syncErrorSCT();
@@ -263,7 +262,7 @@ class SCTErrMonTool : public ManagedMonitorToolBase
   bool eventVsWafer();
 
   void fillWafer( moduleGeo_t module,  TH2F* histo );
-  double calculateDetectorCoverage(const TH2F * histo );
+  double calculateDetectorCoverage(const TH2F* histo );
 
   enum ProblemForCoverage {
     all, //All SCT module for counting good module
@@ -278,15 +277,15 @@ class SCTErrMonTool : public ManagedMonitorToolBase
 
   std::vector<moduleGeo_t> m_geo;
   std::set<IdentifierHash> m_SCTHash[numberOfProblemForCoverage];
-  TH2F * m_mapSCT[numberOfProblemForCoverage];
+  TH2F* m_mapSCT[numberOfProblemForCoverage];
 
   const unsigned int m_nBinsEta;
   const double m_rangeEta;
   const unsigned int m_nBinsPhi;
   const double m_WafersThreshold;
 
-  TProfile * m_detectorCoverageVsLbs[numberOfProblemForCoverage];
-  TProfile * m_PSTripModulesVsLbs;
+  TProfile* m_detectorCoverageVsLbs[numberOfProblemForCoverage];
+  TProfile* m_PSTripModulesVsLbs;
 
   float m_PSTripModules;
 
diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTHitEffMonTool.h b/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTHitEffMonTool.h
index 6fc600cf11aa8884599965c419888e694ef6da0b..13a9801d673a422772ca9faf223fa8fe90f87060 100644
--- a/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTHitEffMonTool.h
+++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTHitEffMonTool.h
@@ -11,42 +11,35 @@
 
 #ifndef SCTEFFICIENCYTOOL_H
 #define SCTEFFICIENCYTOOL_H
-//STL
-#include <string>
-#include <array>
-
-//Gaudi
-#include "GaudiKernel/ToolHandle.h"
-#include "GaudiKernel/ServiceHandle.h"
-#include "MagFieldInterfaces/IMagFieldSvc.h"
 
-//Athena
 #include "AthenaMonitoring/ManagedMonitorToolBase.h"
 
-//cannot fwd declare due to typedefs
-#include "TrkTrack/Track.h" 
-#include "TrkTrack/TrackCollection.h"
-#include "TrkToolInterfaces/ITrackHoleSearchTool.h"
-#include "TrkToolInterfaces/IResidualPullCalculator.h"
-#include "TrkToolInterfaces/IRIO_OnTrackCreator.h"
-
-#include "TrigAnalysisInterfaces/IBunchCrossingTool.h"
-
-//SCT
-#include "SCT_Monitoring/SCT_MonitoringNumbers.h"
-
-//
+#include "CommissionEvent/ComTime.h"
 #include "InDetPrepRawData/SCT_ClusterContainer.h"
-
+#include "InDetReadoutGeometry/SiDetectorElementCollection.h"
+#include "MagFieldInterfaces/IMagFieldSvc.h"
+#include "SCT_Monitoring/SCT_MonitoringNumbers.h"
 #include "StoreGate/ReadCondHandleKey.h"
 #include "StoreGate/ReadHandleKey.h"
-#include "CommissionEvent/ComTime.h"
-#include "InDetReadoutGeometry/SiDetectorElementCollection.h"
+#include "TrigAnalysisInterfaces/IBunchCrossingTool.h"
+#include "TrkToolInterfaces/ITrackHoleSearchTool.h"
+#include "TrkToolInterfaces/IResidualPullCalculator.h"
+#include "TrkToolInterfaces/IRIO_OnTrackCreator.h"
+#include "TrkTrack/Track.h" 
+#include "TrkTrack/TrackCollection.h"
 #include "xAODEventInfo/EventInfo.h"
 
+//Gaudi
+#include "GaudiKernel/ToolHandle.h"
+#include "GaudiKernel/ServiceHandle.h"
+
 //ROOT
 #include "TString.h"
 
+//STL
+#include <string>
+#include <array>
+
 class Identifier;
 class PixelID;
 class SCT_ID;
@@ -77,7 +70,7 @@ class SCTHitEffMonTool : public ManagedMonitorToolBase  {
  public:
   typedef Trk::Track Track;
   /** Constructor */
-  SCTHitEffMonTool (const std::string &type, const std::string &name, const IInterface* parent);
+  SCTHitEffMonTool (const std::string& type, const std::string& name, const IInterface* parent);
   /** Destructor */
   virtual ~SCTHitEffMonTool () = default;
 
@@ -97,37 +90,37 @@ private:
   StatusCode failCut (Bool_t value, std::string name);
 
   /** Method to compute incident angle of track to wafer */
-  StatusCode findAnglesToWaferSurface (const Amg::Vector3D &mom, const Identifier id,
+  StatusCode findAnglesToWaferSurface (const Amg::Vector3D& mom, const Identifier id,
                                        const InDetDD::SiDetectorElementCollection* elements,
-                                       Double_t &theta, Double_t &phi);
+                                       Double_t& theta, Double_t& phi);
 
   /** Method to find the chip just before a given hit */
   Int_t previousChip (Double_t xl, Int_t side, bool swap);
 
   /** Computes residual of a hit to a track */
   Double_t getResidual (const Identifier& surfaceID,
-   const Trk::TrackParameters * trkParam,
+   const Trk::TrackParameters* trkParam,
    const InDet::SCT_ClusterContainer* p_sctclcontainer);
 
   /** Single histogram booking method */
-  template < class T > StatusCode bookEffHisto (T*& histo, MonGroup & MG, 
+  template < class T > StatusCode bookEffHisto (T*& histo, MonGroup& MG, 
                                                 TString name, TString title,
                                                 Int_t nbin, Double_t x1, Double_t x2);
 
-  template < class T > StatusCode bookEffHisto (T*& histo, MonGroup & MG, 
+  template < class T > StatusCode bookEffHisto (T*& histo, MonGroup& MG, 
                                                 TString name, TString title,
                                                 Int_t nbinx, Double_t x1, Double_t x2,
                                                 Int_t nbiny, Double_t y1, Double_t y2);
 
-  template < class T > StatusCode bookEffHisto (T*& histo, MonGroup & MG, 
+  template < class T > StatusCode bookEffHisto (T*& histo, MonGroup& MG, 
                                                 TString name, TString title,
-                                                Int_t nbinx, Double_t * xbins,
-                                                Int_t nbiny, Double_t * ybins);
+                                                Int_t nbinx, Double_t* xbins,
+                                                Int_t nbiny, Double_t* ybins);
 
   SG::ReadHandle<TrackCollection> m_TrackName;
-  IChronoStatSvc * m_chrono;
+  IChronoStatSvc* m_chrono;
 
-  const std::map < Identifier, unsigned int > * m_badChips;
+  const std::map < Identifier, unsigned int >* m_badChips;
   ServiceHandle<MagField::IMagFieldSvc>  m_fieldServiceHandle;
   ToolHandle<Trig::IBunchCrossingTool> m_bunchCrossingTool;
 
@@ -178,21 +171,21 @@ private:
   typedef std::array < TH2F*, SCT_Monitoring::N_REGIONS > TH2FArray;
   typedef std::array < std::array < TH2F*, SCT_Monitoring::N_ENDCAPS >, SCT_Monitoring::N_REGIONS > TH2FArrayLayer;
 
-  std::array < std::array < TProfile2D *, 2 >, SCT_Monitoring::N_LAYERS_TOTAL > m_effMap;
-  std::array < std::array < TProfile2D *, 2 >, SCT_Monitoring::N_LAYERS_TOTAL > m_effMapFirstBCID;
-  std::array < std::array < TProfile2D *, 2 >, SCT_Monitoring::N_LAYERS_TOTAL > m_ineffMap;
-  std::array < std::array < TProfile *, 2 >, SCT_Monitoring::N_LAYERS_TOTAL > m_effLumiBlock;
-  std::array < TProfile2D *, SCT_Monitoring::N_LAYERS_TOTAL > m_accMap;
-  std::array < TProfile2D *, SCT_Monitoring::N_LAYERS_TOTAL > m_accPhysMap;
-  std::array < std::array < TProfile2D *, SCT_Monitoring::N_ENDCAPSx2 >, SCT_Monitoring::N_REGIONS > m_layerResidualHistos;
-
-  TProfile * m_Eff_Total;
-  TProfile * m_Eff_TotalBCID;
-  TProfile * m_Eff_hashCodeHisto;
-  TProfile * m_Eff_LumiBlockHisto_Total;
+  std::array < std::array < TProfile2D*, 2 >, SCT_Monitoring::N_LAYERS_TOTAL > m_effMap;
+  std::array < std::array < TProfile2D*, 2 >, SCT_Monitoring::N_LAYERS_TOTAL > m_effMapFirstBCID;
+  std::array < std::array < TProfile2D*, 2 >, SCT_Monitoring::N_LAYERS_TOTAL > m_ineffMap;
+  std::array < std::array < TProfile*, 2 >, SCT_Monitoring::N_LAYERS_TOTAL > m_effLumiBlock;
+  std::array < TProfile2D*, SCT_Monitoring::N_LAYERS_TOTAL > m_accMap;
+  std::array < TProfile2D*, SCT_Monitoring::N_LAYERS_TOTAL > m_accPhysMap;
+  std::array < std::array < TProfile2D*, SCT_Monitoring::N_ENDCAPSx2 >, SCT_Monitoring::N_REGIONS > m_layerResidualHistos;
+
+  TProfile* m_Eff_Total;
+  TProfile* m_Eff_TotalBCID;
+  TProfile* m_Eff_hashCodeHisto;
+  TProfile* m_Eff_LumiBlockHisto_Total;
   TH1F* m_effdistribution;
 
-  TProfile2D * m_effHashLumiB;
+  TProfile2D* m_effHashLumiB;
 
   TProfArray m_Eff_summaryHisto;
   TProfArray m_Eff_summaryHistoFirstBCID;
@@ -232,8 +225,8 @@ private:
   TProfArray m_Eff_nTrk; 
   TProfArray m_Eff_nGoodTrk; 
 
-  std::array < TProfile2D *, SCT_Monitoring::N_REGIONS > m_inEffStrip;
-  std::array < TProfile2D *, SCT_Monitoring::N_REGIONS > m_inEffChip;
+  std::array < TProfile2D*, SCT_Monitoring::N_REGIONS > m_inEffStrip;
+  std::array < TProfile2D*, SCT_Monitoring::N_REGIONS > m_inEffChip;
 
   TH1FArray m_EventHisto;
   TH1FArray m_SelectionHisto;
@@ -254,18 +247,24 @@ private:
   TH1FArray m_chi2Histo;
   TH1FArray m_localHitXHisto, m_localHitYHistos; 
 
-  TH1F * m_mNHitHisto, *m_barrelNHitHisto,  *m_pNHitHisto;
-  TH1F * m_SCTNHitHisto, *m_trtNHitHisto,  *m_pixelNHitHisto;
-  TH1F * m_PtTkHisto;
-  TH1F * m_etaTkHisto;
-  TH1F * m_d0TkHisto;
-  TH1F * m_d0PrecTkHisto;
-  TH1F * m_nTrkHisto, * m_nTrkParsHisto, * m_nTrkGoodHisto;
-  TH1F * m_LumiBlock;
-  TH1F * m_z0TkHisto;
-  TH1F * m_hashCodeHisto;
-
-  TH2I * m_badModFineMap;
+  TH1F* m_mNHitHisto;
+  TH1F* m_barrelNHitHisto;
+  TH1F* m_pNHitHisto;
+  TH1F* m_SCTNHitHisto;
+  TH1F* m_trtNHitHisto;
+  TH1F* m_pixelNHitHisto;
+  TH1F* m_PtTkHisto;
+  TH1F* m_etaTkHisto;
+  TH1F* m_d0TkHisto;
+  TH1F* m_d0PrecTkHisto;
+  TH1F* m_nTrkHisto;
+  TH1F* m_nTrkParsHisto;
+  TH1F* m_nTrkGoodHisto;
+  TH1F* m_LumiBlock;
+  TH1F* m_z0TkHisto;
+  TH1F* m_hashCodeHisto;
+
+  TH2I* m_badModFineMap;
 
   TH2FArray m_localHitHisto, m_localMissHisto, m_localUnasHisto;
   TH2FArray m_localHitGHisto;
@@ -278,13 +277,13 @@ private:
   TH2FArrayLayer m_xlResidualE1Histo;
   TH2FArrayLayer m_xlResidualUnasHisto;
 
-  TGraphErrors * m_badModMap;
-  TGraphErrors * m_badChipMap;
+  TGraphErrors* m_badModMap;
+  TGraphErrors* m_badChipMap;
 
   Int_t m_countEvent;
-  const PixelID * m_pixelId;
-  const SCT_ID * m_sctId;
-  const TRT_ID * m_trtId;
+  const PixelID* m_pixelId;
+  const SCT_ID* m_sctId;
+  const TRT_ID* m_trtId;
 
   SG::ReadHandleKey<ComTime> m_comTimeName;
   SG::ReadHandleKey<xAOD::EventInfo> m_eventInfoKey;
diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTHitsNoiseMonTool.h b/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTHitsNoiseMonTool.h
index 4a6d91a97b7a87178a426a70f453a4ad6892f082..722645b925c4dc0a0beeb310132753df80bf9476 100644
--- a/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTHitsNoiseMonTool.h
+++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTHitsNoiseMonTool.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
 */
 
 /**    @file SCTHitsNoiseMonTool.h
@@ -18,24 +18,22 @@
 #ifndef SCTHITSNOISEMONTOOL_H
 #define SCTHITSNOISEMONTOOL_H
 
-#include <string>
-#include <vector>
-#include <map>
-#include "AthenaMonitoring/ManagedMonitorToolBase.h"
-#include "SCT_Monitoring/SCT_MonitoringNumbers.h"
 #include "SCT_Monitoring/SCTMotherTrigMonTool.h"
 
-#include "TrkTrack/Track.h"
-#include "TrkTrack/TrackCollection.h"
-
+#include "InDetRawData/SCT_RDO_Container.h"
 #include "InDetReadoutGeometry/SiDetectorElementCollection.h"
+#include "InDetPrepRawData/SCT_ClusterContainer.h"
+#include "SCT_Monitoring/SCT_MonitoringNumbers.h"
 #include "StoreGate/ReadCondHandleKey.h"
-
 #include "StoreGate/ReadHandleKey.h"
 #include "TrkSpacePoint/SpacePointContainer.h"
-#include "InDetRawData/SCT_RDO_Container.h"
+#include "TrkTrack/Track.h"
+#include "TrkTrack/TrackCollection.h"
 #include "xAODEventInfo/EventInfo.h"
-#include "InDetPrepRawData/SCT_ClusterContainer.h"
+
+#include <string>
+#include <vector>
+#include <map>
 
 // Forward declarations
 class IInterface;
@@ -61,7 +59,7 @@ class PairBuilder;
 class SCTHitsNoiseMonTool : public SCTMotherTrigMonTool{
  public:
   typedef unsigned int  ChipNumberType;
-  SCTHitsNoiseMonTool(const std::string & type, const std::string & name,const IInterface* parent); 
+  SCTHitsNoiseMonTool(const std::string& type, const std::string& name,const IInterface* parent); 
   ~SCTHitsNoiseMonTool();
   virtual StatusCode initialize() final;
   /**    @name Book, fill & check (reimplemented from baseclass) */
@@ -80,12 +78,12 @@ class SCTHitsNoiseMonTool : public SCTMotherTrigMonTool{
   //@} 
   
  private:
-  typedef TProfile2D * Prof2_t;
-  typedef TProfile_LW * Prof_t;
-  typedef TH1I * H1I_t;
-  typedef TH2I_LW * H2I_t;
-  typedef TH1F_LW * H1_t;
-  typedef TH2F_LW * H2_t;
+  typedef TProfile2D* Prof2_t;
+  typedef TProfile_LW* Prof_t;
+  typedef TH1I* H1I_t;
+  typedef TH2I_LW* H2I_t;
+  typedef TH1F_LW* H1_t;
+  typedef TH2F_LW* H2_t;
   typedef std::vector<Prof2_t> VecProf2_t;
   typedef std::vector<H1I_t> VecH1I_t;
   typedef std::vector<H2I_t> VecH2I_t;
@@ -116,17 +114,17 @@ class SCTHitsNoiseMonTool : public SCTMotherTrigMonTool{
   VecProf2_t m_pnoiseoccupancymapHistoVectorECmTrigger;
   
   TH1F* m_nSP;
-  int *m_nSP_buf;
+  int* m_nSP_buf;
   int m_nSP_pos;
   TH1F* m_nHits;
-  int *m_nHits_buf;
+  int* m_nHits_buf;
   int m_nHits_pos;
   TH1F* m_nmaxHits;
-  int *m_nmaxHits_buf;
-  Identifier *m_nmaxModule_buf;
+  int* m_nmaxHits_buf;
+  Identifier* m_nmaxModule_buf;
   TH1F* m_nminHits;
-  int *m_nminHits_buf;
-  Identifier *m_nminModule_buf;
+  int* m_nminHits_buf;
+  Identifier* m_nminModule_buf;
 
   //Histograms with hits per luminosity block
   H1_t m_numBarrelHitsPerLumiBlock;
@@ -322,7 +320,7 @@ class SCTHitsNoiseMonTool : public SCTMotherTrigMonTool{
   StatusCode bookGeneralNoiseOccupancyMaps( const unsigned int systemIndex);
   //Book hit occupancy map histograms
   StatusCode bookGeneralHitOccupancyMaps( const unsigned int systemIndex);
-	
+
   // Book Hits Histograms
   StatusCode 
     bookGeneralHits( const unsigned int systemIndex);
@@ -372,7 +370,6 @@ class SCTHitsNoiseMonTool : public SCTMotherTrigMonTool{
   int m_occTriggerECm_lb[SCT_Monitoring::NBINS_LBs+1];
   int m_eventsTrigger_lb;
   
-  //Added 09.09.2016
   VecProf2_t m_phitoccupancymapHistoVector;
   VecProf2_t m_phitoccupancymapHistoVectorRecent;
   VecProf2_t m_phitoccupancymapHistoVectorTrigger;
@@ -382,7 +379,7 @@ class SCTHitsNoiseMonTool : public SCTMotherTrigMonTool{
   VecProf2_t m_phitoccupancymapHistoVectorECm;
   VecProf2_t m_phitoccupancymapHistoVectorECmRecent;
   VecProf2_t m_phitoccupancymapHistoVectorECmTrigger;
-	
+
   //Histograms with HO distribution
   TH1F* m_BARHO;
   TH1F* m_BARHOTrigger;
@@ -392,7 +389,7 @@ class SCTHitsNoiseMonTool : public SCTMotherTrigMonTool{
   TH1F* m_ECpHOTrigger;
   TH1F* m_SCTHO;
   TH1F* m_SCTHOTrigger;
-	
+
   //---- results required no triggers
   // # of hits vs LBs
   Prof_t m_HallHitsBAR_vsLB;
@@ -430,7 +427,7 @@ class SCTHitsNoiseMonTool : public SCTMotherTrigMonTool{
   std::map<Identifier, float> m_hitoccSumUnbiased;
   std::map<Identifier, float> m_hitoccSumUnbiasedTrigger;
   std::map<Identifier, float> m_hitoccSumUnbiasedRecent;
-	
+
   std::map<Identifier, float> m_hitoccSumUnbiased_lb;
   std::map<Identifier, float> m_hitoccSumUnbiasedBAR_lb;
   std::map<Identifier, float> m_hitoccSumUnbiasedECp_lb;
@@ -483,27 +480,27 @@ class SCTHitsNoiseMonTool : public SCTMotherTrigMonTool{
   ///Determines whether a local summary is written
   int m_localSummary;
   H1_t
-    h1Factory(const std::string & name, const std::string & title, MonGroup & registry, VecH1_t & storageVector, const float lo, const float hi, const unsigned int nbins);
+    h1Factory(const std::string& name, const std::string& title, MonGroup& registry, VecH1_t& storageVector, const float lo, const float hi, const unsigned int nbins);
   H1_t
-    h1Factory(const std::string & name, const std::string & title, MonGroup & registry, const float lo, const float hi, const unsigned int nbins);
+    h1Factory(const std::string& name, const std::string& title, MonGroup& registry, const float lo, const float hi, const unsigned int nbins);
 
   TH1F*
-    th1Factory(const std::string & name, const std::string & title, MonGroup & registry, std::vector<TH1F*> & storageVector, const float lo, const float hi, const unsigned int nbins);
+    th1Factory(const std::string& name, const std::string& title, MonGroup& registry, std::vector<TH1F*>& storageVector, const float lo, const float hi, const unsigned int nbins);
   TH1F*
-    th1Factory(const std::string & name, const std::string & title, MonGroup & registry, const float lo, const float hi, const unsigned int nbins);
+    th1Factory(const std::string& name, const std::string& title, MonGroup& registry, const float lo, const float hi, const unsigned int nbins);
 
   H2_t
-    h2Factory(const std::string & name, const std::string & title, const SCT_Monitoring::Bec bec, MonGroup & registry, VecH2_t & storageVector);
+    h2Factory(const std::string& name, const std::string& title, const SCT_Monitoring::Bec bec, MonGroup& registry, VecH2_t& storageVector);
   H2I_t
-    h2IFactory(const std::string & name, const std::string & title, MonGroup & registry, int nbinx, float xlo, float xhi, int nbiny, float ylo, float yhi);
+    h2IFactory(const std::string& name, const std::string& title, MonGroup& registry, int nbinx, float xlo, float xhi, int nbiny, float ylo, float yhi);
   Prof2_t
-    prof2Factory(const std::string & name, const std::string & title, const SCT_Monitoring::Bec bec, MonGroup & registry, VecProf2_t & storageVector);
+    prof2Factory(const std::string& name, const std::string& title, const SCT_Monitoring::Bec bec, MonGroup& registry, VecProf2_t& storageVector);
   Prof2_t
-    prof2DFactory(const std::string & name, const std::string & title, MonGroup & registry, int nbinx, float xlo, float xhi, int nbiny, float ylo, float yhi);
+    prof2DFactory(const std::string& name, const std::string& title, MonGroup& registry, int nbinx, float xlo, float xhi, int nbiny, float ylo, float yhi);
   Prof_t
-    profFactory(const std::string & name, const std::string & title, MonGroup & registry, int nbin, float lo, float hi);
+    profFactory(const std::string& name, const std::string& title, MonGroup& registry, int nbin, float lo, float hi);
   Prof_t
-    profFactory(const std::string & name, const std::string & title, MonGroup & registry);
+    profFactory(const std::string& name, const std::string& title, MonGroup& registry);
   //@}
 
   //@name Tool methods
@@ -513,7 +510,7 @@ class SCTHitsNoiseMonTool : public SCTMotherTrigMonTool{
  
   ///Format the position as a string
   std::string
-    positionString(const Identifier & plane) const;
+    positionString(const Identifier& plane) const;
   //@}
 
   SG::ReadHandleKey<xAOD::EventInfo> m_eventInfoKey;
diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTLorentzMonTool.h b/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTLorentzMonTool.h
index 8754d1efb3947905ce4ce135bc56139a4cbe4de9..2397e9675cf557e9efb68ab6d6bc09b1178ca111 100644
--- a/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTLorentzMonTool.h
+++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTLorentzMonTool.h
@@ -18,27 +18,23 @@
 #ifndef SCTLORENTZMONTOOL_H
 #define SCTLORENTZMONTOOL_H
 
-#include <string>
-#include <vector>
-
-// for Updator
-#include "TrkToolInterfaces/IUpdator.h"
-
-#include "AthenaMonitoring/ManagedMonitorToolBase.h"
-#include "TrkToolInterfaces/IResidualPullCalculator.h"
 #include "SCT_Monitoring/SCTMotherTrigMonTool.h"
-#include "SCT_Monitoring/SCT_MonitoringNumbers.h"
-#include "GaudiKernel/ServiceHandle.h"
-#include "GaudiKernel/ToolHandle.h"
-
-//for vertexTool
-#include "ITrackToVertex/ITrackToVertex.h" //for  m_trackToVertexTool
 
 #include "InDetReadoutGeometry/SiDetectorElementCollection.h"
+#include "ITrackToVertex/ITrackToVertex.h" //for  m_trackToVertexTool
+#include "SCT_Monitoring/SCT_MonitoringNumbers.h"
 #include "StoreGate/ReadCondHandleKey.h"
 #include "StoreGate/ReadHandleKey.h"
+#include "TrkToolInterfaces/IResidualPullCalculator.h"
+#include "TrkToolInterfaces/IUpdator.h"
 #include "TrkTrack/TrackCollection.h"
 
+#include "GaudiKernel/ServiceHandle.h"
+#include "GaudiKernel/ToolHandle.h"
+
+#include <string>
+#include <vector>
+
 // Forward declarations
 class IInterface;
 class TH1I;
@@ -52,21 +48,19 @@ class SCT_ID;
 ///Concrete monitoring tool derived from SCTMotherTrigMonTool
 class SCTLorentzMonTool : public SCTMotherTrigMonTool{
  public:
-  SCTLorentzMonTool(const std::string & type, const std::string & name, const IInterface* parent);
+  SCTLorentzMonTool(const std::string& type, const std::string& name, const IInterface* parent);
   virtual ~SCTLorentzMonTool() = default;
   //initialize
   virtual StatusCode initialize() final;
    /**    @name Book, fill & check (reimplemented from baseclass) */
 //@{
   ///Book histograms in initialization
-  //  virtual StatusCode bookHistograms(bool isNewEventsBlock, bool isNewLumiBlock, bool isNewRun);
-  virtual StatusCode bookHistograms();          // hidetoshi 14.01.21
-  virtual StatusCode bookHistogramsRecurrent(); // hidetoshi 14.01.21
+  virtual StatusCode bookHistograms();
+  virtual StatusCode bookHistogramsRecurrent();
   ///Fill histograms in each loop
   virtual StatusCode fillHistograms() ;
   ///process histograms at the end (we only use 'isEndOfRun')
-  //  virtual StatusCode procHistograms( bool isEndOfEventsBlock, bool isEndOfLumiBlock, bool isEndOfRun );
-  virtual StatusCode procHistograms();          // hidetoshi 14.01.21
+  virtual StatusCode procHistograms();
   ///helper function used in procHistograms
   StatusCode checkHists(bool fromFinalize);
 //@}
@@ -74,9 +68,9 @@ class SCTLorentzMonTool : public SCTMotherTrigMonTool{
 private:
   //@name typedefs centralised to enable easy changing of types
   //@{
-  typedef TProfile * Prof_t;
-  typedef TH1F * H1_t;
-  typedef TH2F * H2_t;
+  typedef TProfile* Prof_t;
+  typedef TH1F* H1_t;
+  typedef TH2F* H2_t;
   typedef std::vector<Prof_t> VecProf_t;
   typedef std::vector<H1_t> VecH1_t;
   typedef std::vector<H2_t> VecH2_t;
@@ -106,28 +100,24 @@ private:
 
   //@name Service members
   //@{
-  /// Kalman Updator for SCT Unbiased states in Residual calculation
-  //  ToolHandle<Trk::IUpdator> m_updator;
-
   ///SCT Helper class
   const SCT_ID* m_pSCTHelper;
   //@}
   //@name  Histograms related methods
   //@{
   // Book Histograms
-  //  StatusCode bookLorentzHistos(bool isNewRun,bool isNewLumiBlock);
-  StatusCode bookLorentzHistos();                                           // hidetoshi 14.01.22
+  StatusCode bookLorentzHistos();
   //@}
 
   //@name Service methods
   //@{
   // Calculate the local angle of incidence
-  int findAnglesToWaferSurface ( const float (&vec)[3], const float &sinAlpha, const Identifier &id, const InDetDD::SiDetectorElementCollection* elements, float &theta, float &phi );
+  int findAnglesToWaferSurface ( const float (&vec)[3], const float& sinAlpha, const Identifier& id, const InDetDD::SiDetectorElementCollection* elements, float& theta, float& phi );
 
   ///Factory + register for the 2D profiles, returns whether successfully registered
-  Prof_t  pFactory(const std::string & name, const std::string & title, int nbinsx, float xlow, float xhigh, MonGroup & registry, int& iflag);
+  Prof_t  pFactory(const std::string& name, const std::string& title, int nbinsx, float xlow, float xhigh, MonGroup& registry, int& iflag);
   ///Factory + register for the 1D histograms, returns whether successfully registered
-  bool h1Factory(const std::string & name, const std::string & title, const float extent, MonGroup & registry, VecH1_t & storageVector);
+  bool h1Factory(const std::string& name, const std::string& title, const float extent, MonGroup& registry, VecH1_t& storageVector);
   //@}
 };
 
diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTMotherTrigMonTool.h b/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTMotherTrigMonTool.h
index 527ad41df5aa8010acd20317dca3320f16de2a77..d889f703a425f818001d898f90c85b27ffdcf172 100644
--- a/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTMotherTrigMonTool.h
+++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTMotherTrigMonTool.h
@@ -11,16 +11,15 @@
 #ifndef SCTMotherTrigMonTool_H
 #define SCTMotherTrigMonTool_H
 
-//Local includes
 #include "AthenaMonitoring/ManagedMonitorToolBase.h"
 
+#include "StoreGate/ReadHandleKey.h"
+#include "xAODEventInfo/EventInfo.h"
+
 //Standard C++
 #include <string>
 #include <bitset>
 
-#include "StoreGate/ReadHandleKey.h"
-#include "xAODEventInfo/EventInfo.h"
-
 //Fwd declarations
 class IInterface;
 class StatusCode;
@@ -29,7 +28,7 @@ class StatusCode;
 class SCTMotherTrigMonTool : public ManagedMonitorToolBase {
 public:
   ///Constructor    
-  SCTMotherTrigMonTool( const std::string & type, const std::string & name,const IInterface* parent); 
+  SCTMotherTrigMonTool( const std::string& type, const std::string& name,const IInterface* parent); 
 
   ///Destructor
   virtual ~SCTMotherTrigMonTool() = default;
@@ -47,9 +46,9 @@ protected:
   ///Get the status of a particular trigger bit (trigger bit 0-7)
   bool hasTriggerFired(const unsigned int trigger) const;
   ///Check if the event belongs to Stream = StreamName
-  bool isStream(const std::string & StreamName);
+  bool isStream(const std::string& StreamName);
   ///Check if the event passes L1 item
-  bool isCalibrationNoise(const std::string & L1_Item);
+  bool isCalibrationNoise(const std::string& L1_Item);
   ///Abbreviations for level 1 trigger types
   const static std::string m_triggerNames[8];
   ///Format and output (INFO msg level) the fired triggers
diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTRatioNoiseMonTool.h b/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTRatioNoiseMonTool.h
index 34e1f79c8f5f0cb26c96f6aa790c4730475c9410..f1232c2811b1d3ddfa69376e8044a08562d3922b 100644
--- a/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTRatioNoiseMonTool.h
+++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTRatioNoiseMonTool.h
@@ -18,22 +18,20 @@
 #ifndef SCTRATIONOISEMONTOOL_H
 #define SCTRATIONOISEMONTOOL_H
 
-#include <string>
-#include <vector>
+#include "SCT_Monitoring/SCTMotherTrigMonTool.h"
 
-// for Updator
+#include "InDetRawData/SCT_RDO_Container.h"
+#include "InDetConditionsSummaryService/IInDetConditionsTool.h"
+#include "SCT_Monitoring/SCT_MonitoringNumbers.h"
+#include "StoreGate/ReadHandleKey.h"
 #include "TrkToolInterfaces/IUpdator.h"
+#include "xAODEventInfo/EventInfo.h"
 
-#include "AthenaMonitoring/ManagedMonitorToolBase.h"
-
-#include "SCT_Monitoring/SCTMotherTrigMonTool.h"
-#include "SCT_Monitoring/SCT_MonitoringNumbers.h"
 #include "GaudiKernel/ToolHandle.h"
-#include "InDetConditionsSummaryService/IInDetConditionsTool.h"
 
-#include "StoreGate/ReadHandleKey.h"
-#include "InDetRawData/SCT_RDO_Container.h"
-#include "xAODEventInfo/EventInfo.h"
+#include <string>
+#include <vector>
+
 
 // Forward declarations
 class IInterface;
@@ -57,19 +55,19 @@ class SCT_ID;
 ///Concrete monitoring tool derived from SCTMotherTrigMonTool
 class SCTRatioNoiseMonTool : public SCTMotherTrigMonTool{
  public:
-  SCTRatioNoiseMonTool(const std::string & type, const std::string & name, const IInterface* parent);
+  SCTRatioNoiseMonTool(const std::string& type, const std::string& name, const IInterface* parent);
   virtual ~SCTRatioNoiseMonTool() = default;
   // initialize
   virtual StatusCode initialize() final;
    /**    @name Book, fill & check (reimplemented from baseclass) */
 //@{
   ///Book histograms in initialization
-  virtual StatusCode bookHistogramsRecurrent();                                                     // hidetoshi 14.01.21
-  virtual StatusCode bookHistograms();                                                              // hidetoshi 14.01.21
+  virtual StatusCode bookHistogramsRecurrent();
+  virtual StatusCode bookHistograms();
   ///Fill histograms in each loop
   virtual StatusCode fillHistograms() ;
   ///process histograms at the end (we only use 'isEndOfRun')
-  virtual StatusCode procHistograms();                                                              // hidetoshi 14.01.21
+  virtual StatusCode procHistograms();
   ///helper function used in procHistograms
   StatusCode checkHists(bool fromFinalize);
 //@}
@@ -78,12 +76,12 @@ class SCTRatioNoiseMonTool : public SCTMotherTrigMonTool{
 private:
   //@name typedefs centralised to enable easy changing of types
   //@{
-  typedef TProfile * Prof_t;
-  typedef TProfile2D * Prof2_t;
-  typedef TH1F_LW * H1_t;
-  typedef TH2F_LW * H2_t;
-  typedef TH1I * H1I_t;
-  typedef TH2I * H2I_t;
+  typedef TProfile* Prof_t;
+  typedef TProfile2D* Prof2_t;
+  typedef TH1F_LW* H1_t;
+  typedef TH2F_LW* H2_t;
+  typedef TH1I* H1I_t;
+  typedef TH2I* H2I_t;
   typedef std::vector<Prof2_t> VecProf2_t;
   typedef std::vector<Prof_t> VecProf_t;
   typedef std::vector<H1_t> VecH1_t;
@@ -249,14 +247,13 @@ private:
   //@name  Histograms related methods
   //@{
   // Book Histograms
-  //  StatusCode bookRatioNoiseHistos(bool isNewRun,bool isNewLumiBlock);  // hidetoshi 14.01.22
-  StatusCode bookRatioNoiseHistos();                                       // hidetoshi 14.01.22
+  StatusCode bookRatioNoiseHistos();
   //@}
 
   //@name Service methods
   //@{
   // Calculate the local angle of incidence
-  int findAnglesToWaferSurface ( const float (&vec)[3], const float &sinAlpha, const Identifier &id, float &theta, float &phi );
+  int findAnglesToWaferSurface ( const float (&vec)[3], const float& sinAlpha, const Identifier& id, float& theta, float& phi );
   float calculateNoiseOccupancyUsingRatioMethod(const float numberOneSide, const float numberZeroSide);
   float calculateOneSideNoiseOccupancyUsingRatioMethod(const float numberOneSide, const float numberZeroSide);
   bool isBarrel(const int moduleNumber);
@@ -266,19 +263,19 @@ private:
 
   ///Factory + register for the 2D profiles, returns whether successfully registered
   Prof_t 
-    pFactory(const std::string & name, const std::string & title, MonGroup & registry, const float lo, const float hi, const unsigned int nbins);
+    pFactory(const std::string& name, const std::string& title, MonGroup& registry, const float lo, const float hi, const unsigned int nbins);
   H1_t
-    h1Factory(const std::string & name, const std::string & title, MonGroup & registry, VecH1_t & storageVector, const float lo, const float hi, const unsigned int nbins);
+    h1Factory(const std::string& name, const std::string& title, MonGroup& registry, VecH1_t& storageVector, const float lo, const float hi, const unsigned int nbins);
   H1_t
-    h1Factory(const std::string & name, const std::string & title, MonGroup & registry, const float lo, const float hi, const unsigned int nbins);
+    h1Factory(const std::string& name, const std::string& title, MonGroup& registry, const float lo, const float hi, const unsigned int nbins);
   H2_t
-    h2Factory(const std::string & name, const std::string & title, MonGroup & registry, const float lo_x, const float hi_x, const unsigned int nbins_x, const float lo_y, const float hi_y, const unsigned int nbins_y);
+    h2Factory(const std::string& name, const std::string& title, MonGroup& registry, const float lo_x, const float hi_x, const unsigned int nbins_x, const float lo_y, const float hi_y, const unsigned int nbins_y);
   H1I_t
-    h1IFactory(const std::string & name, const std::string & title, MonGroup & registry, VecH1I_t & storageVector, const float lo, const float hi, const unsigned int nbins);
+    h1IFactory(const std::string& name, const std::string& title, MonGroup& registry, VecH1I_t& storageVector, const float lo, const float hi, const unsigned int nbins);
   H1I_t
-    h1IFactory(const std::string & name, const std::string & title, MonGroup & registry, const float lo, const float hi, const unsigned int nbins);
+    h1IFactory(const std::string& name, const std::string& title, MonGroup& registry, const float lo, const float hi, const unsigned int nbins);
   Prof2_t
-    prof2Factory(const std::string & name, const std::string & title, const unsigned int&, MonGroup & registry, VecProf2_t & storageVector);
+    prof2Factory(const std::string& name, const std::string& title, const unsigned int&, MonGroup& registry, VecProf2_t& storageVector);
  
   //@}
 };
diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTSummaryMonTool.h b/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTSummaryMonTool.h
index e5af5176a4e8c2f330b45a1e2a567cdd95ee18f9..b428f38dca0cd2f64a098072d52c564d3ba0373b 100644
--- a/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTSummaryMonTool.h
+++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTSummaryMonTool.h
@@ -17,11 +17,10 @@
 #ifndef SCTSummaryMonTool_H
 #define SCTSummaryMonTool_H
 
-#include <string>
-
-#include "AthenaMonitoring/ManagedMonitorToolBase.h"
 #include "SCT_Monitoring/SCTMotherTrigMonTool.h"
 
+#include <string>
+
 // Forward declarations
 class IInterface;
 class StatusCode;
@@ -30,7 +29,7 @@ class StatusCode;
 ///Concrete monitoring tool derived from SCTMotherTrigMonTool
 class SCTSummaryMonTool : public SCTMotherTrigMonTool{
  public:
-  SCTSummaryMonTool(const std::string & type, const std::string & name, const IInterface* parent);
+  SCTSummaryMonTool(const std::string& type, const std::string& name, const IInterface* parent);
   virtual ~SCTSummaryMonTool() = default;
    /**    @name Book, fill & check (reimplemented from baseclass) */
 //@{
diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTTracksMonTool.h b/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTTracksMonTool.h
index d713accbb928e992744ead0abce7eaf48e6f21d8..1fb76d94a26e473551344a4c7e7ffc5917d2a6d6 100644
--- a/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTTracksMonTool.h
+++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCTTracksMonTool.h
@@ -13,22 +13,19 @@
 #ifndef SCTTRACKSMONTOOL_H
 #define SCTTRACKSMONTOOL_H
 
-#include <string>
-#include <vector>
-
-// for Updator
-#include "TrkToolInterfaces/IUpdator.h"
-
-#include "AthenaMonitoring/ManagedMonitorToolBase.h"
-#include "TrkToolInterfaces/IResidualPullCalculator.h"
 #include "SCT_Monitoring/SCTMotherTrigMonTool.h"
+
 #include "SCT_Monitoring/SCT_MonitoringNumbers.h"
+#include "StoreGate/ReadHandleKey.h"
+#include "TrkToolInterfaces/IResidualPullCalculator.h"
+#include "TrkToolInterfaces/IUpdator.h"
+#include "TrkTrack/TrackCollection.h"
 
 #include "GaudiKernel/ServiceHandle.h"
 #include "GaudiKernel/ToolHandle.h"
 
-#include "StoreGate/ReadHandleKey.h"
-#include "TrkTrack/TrackCollection.h"
+#include <string>
+#include <vector>
 
 // Forward declarations
 class IInterface;
@@ -43,19 +40,19 @@ class SCT_ID;
 ///Concrete monitoring tool derived from SCTMotherTrigMonTool
 class SCTTracksMonTool : public SCTMotherTrigMonTool{
  public:
-  SCTTracksMonTool(const std::string & type, const std::string & name, const IInterface* parent); 
+  SCTTracksMonTool(const std::string& type, const std::string& name, const IInterface* parent); 
   virtual ~SCTTracksMonTool() = default;
   //initialize
   virtual StatusCode initialize() final;
    /**    @name Book, fill & check (reimplemented from baseclass) */
 //@{
   ///Book histograms in initialization
-  virtual StatusCode bookHistogramsRecurrent();                                                     // hidetoshi 12.01.21
-  virtual StatusCode bookHistograms();                                                              // hidetoshi 12.01.21 
+  virtual StatusCode bookHistogramsRecurrent();
+  virtual StatusCode bookHistograms();
   ///Fill histograms in each loop
   virtual StatusCode fillHistograms() ;
   ///process histograms at the end (we only use 'isEndOfRun')
-  virtual StatusCode procHistograms();                                                                       // hidetoshi 12.01.21 
+  virtual StatusCode procHistograms();
   ///helper function used in procHistograms
   StatusCode checkHists(bool fromFinalize);
 //@} 
@@ -63,25 +60,25 @@ class SCTTracksMonTool : public SCTMotherTrigMonTool{
 private:
   //@name typedefs centralised to enable easy changing of types
   //@{
-  typedef TProfile2D * Prof2_t;
-  typedef TProfile * Prof_t;
-  typedef TH1F * H1_t;
-  typedef TH2F * H2_t;
+  typedef TProfile2D* Prof2_t;
+  typedef TProfile* Prof_t;
+  typedef TH1F* H1_t;
+  typedef TH2F* H2_t;
   typedef std::vector<Prof2_t> VecProf2_t;
   typedef std::vector<H1_t> VecH1_t;
   typedef std::vector<H2_t> VecH2_t;
   //@}
-  TH1I *m_nTracks;
-  int *m_nTracks_buf;
+  TH1I* m_nTracks;
+  int* m_nTracks_buf;
   int m_nTracks_pos;
-  TH1I *m_trackTrigger;
-  TProfile *m_trackTriggerRate;
-  TH1F *m_totalBarrelResidual;
-  TH1F *m_totalEndCapAResidual;
-  TH1F *m_totalEndCapCResidual;
-  TH1F *m_totalBarrelPull;
-  TH1F *m_totalEndCapAPull;
-  TH1F *m_totalEndCapCPull;
+  TH1I* m_trackTrigger;
+  TProfile* m_trackTriggerRate;
+  TH1F* m_totalBarrelResidual;
+  TH1F* m_totalEndCapAResidual;
+  TH1F* m_totalEndCapCResidual;
+  TH1F* m_totalBarrelPull;
+  TH1F* m_totalEndCapAPull;
+  TH1F* m_totalEndCapCPull;
 
   int m_numberOfEvents;
   //@name Histograms related members
@@ -174,7 +171,6 @@ private:
   //@name  Histograms related methods
   //@{
   // Book Track related  Histograms
-  // hidetoshi 14.01.22
   StatusCode bookTrackHistos(const SCT_Monitoring::Bec becVal);
   StatusCode bookGeneralHistos();
   StatusCode bookPositiveEndCapTrackHistos(){ return bookTrackHistos(SCT_Monitoring::ENDCAP_A);}
@@ -187,13 +183,13 @@ private:
   float calculatePull(const float, const float, const float);
   
   ///Factory + register for the 2D histos, returns whether successfully registered
-  StatusCode h2Factory(const std::string & name, const std::string & title, const SCT_Monitoring::Bec bec, MonGroup & registry, VecH2_t & storageVector);
+  StatusCode h2Factory(const std::string& name, const std::string& title, const SCT_Monitoring::Bec bec, MonGroup& registry, VecH2_t& storageVector);
   
   ///Factory + register for the 2D profiles, returns whether successfully registered
-  StatusCode p2Factory(const std::string & name, const std::string & title, const SCT_Monitoring::Bec bec, MonGroup & registry, VecProf2_t & storageVector);
+  StatusCode p2Factory(const std::string& name, const std::string& title, const SCT_Monitoring::Bec bec, MonGroup& registry, VecProf2_t& storageVector);
   
   ///Factory + register for the 1D histograms, returns whether successfully registered
-  StatusCode h1Factory(const std::string & name, const std::string & title, const float extent, MonGroup & registry, VecH1_t & storageVector);
+  StatusCode h1Factory(const std::string& name, const std::string& title, const float extent, MonGroup& registry, VecH1_t& storageVector);
   //@}
 };
 
diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCT_ClusterStruct.h b/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCT_ClusterStruct.h
deleted file mode 100644
index 317cc07664f4de6fd13e6f2fa258792225be9e0a..0000000000000000000000000000000000000000
--- a/InnerDetector/InDetMonitoring/SCT_Monitoring/SCT_Monitoring/SCT_ClusterStruct.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-/*
- *  SCT_ClusterStruct.h
- *  
- *
- *  Created by Shaun Roe on 24/05/2005.
- *
- */
-
-#ifndef SCT_ClusterStruct_H
-#define SCT_ClusterStruct_H
-///Simple struct to hold the first strip and number of strips in a cluster
-struct SCT_ClusterStruct{
-	unsigned int firstStrip;
-	unsigned int numberOfStrips;
-};
-
-#endif
-
diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTErrMonTool.cxx b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTErrMonTool.cxx
index b21cf22ad9b0ad56e15155d115581940ccfe442f..7be62108fb70fabab50acf904a65c3f9ada175bd 100644
--- a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTErrMonTool.cxx
+++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTErrMonTool.cxx
@@ -9,31 +9,32 @@
  */
 
 #include "SCT_Monitoring/SCTErrMonTool.h"
-#include "SCT_Monitoring/SCT_ClusterStruct.h"
 #include "GaudiKernel/ITHistSvc.h"
 
 // conditions stuff
 #include "InDetConditionsSummaryService/InDetHierarchy.h"
-#include "TH1F.h"
-#include "TH2F.h"
-#include "TH2I.h"
-#include "TProfile.h"
-#include "TProfile2D.h"
-#include "LWHists/TH1F_LW.h"
-#include "LWHists/TH2F_LW.h"
-#include "LWHists/TH2I_LW.h"
-#include "LWHists/TProfile_LW.h"
-#include "LWHists/TProfile2D_LW.h"
-#include "InDetRawData/SCT3_RawData.h"
-#include "InDetRawData/InDetRawDataContainer.h"
-#include "InDetRawData/InDetRawDataCLASS_DEF.h"
+
 #include "AthContainers/DataVector.h"
 #include "Identifier/Identifier.h"
 #include "InDetIdentifier/SCT_ID.h"
+#include "InDetRawData/SCT3_RawData.h"
+#include "InDetRawData/InDetRawDataContainer.h"
+#include "InDetRawData/InDetRawDataCLASS_DEF.h"
 #include "InDetReadoutGeometry/SCT_DetectorManager.h"
 #include "InDetReadoutGeometry/SiDetectorElement.h"
-#include "cArrayUtilities.h"
+#include "LWHists/TH1F_LW.h"
+#include "LWHists/TH2F_LW.h"
+#include "LWHists/TH2I_LW.h"
+#include "LWHists/TProfile_LW.h"
+#include "LWHists/TProfile2D_LW.h"
 #include "StoreGate/ReadHandle.h"
+
+#include "TH1F.h"
+#include "TH2F.h"
+#include "TH2I.h"
+#include "TProfile.h"
+#include "TProfile2D.h"
+
 #include <vector>
 #include <set>
 #include <iostream>
@@ -48,7 +49,7 @@ namespace {
   const bool testOffline(false);
 
   int
-  numberOfInefficientSides(TH2 *pHistogramArray[], const int xbin, const int ybin, const float threshold) {
+  numberOfInefficientSides(TH2* pHistogramArray[], const int xbin, const int ybin, const float threshold) {
     float histogramBinContent0 = pHistogramArray[0]->GetBinContent(xbin, ybin);
     float histogramBinContent1 = pHistogramArray[1]->GetBinContent(xbin, ybin);
     int side0Inefficient = (histogramBinContent0 > threshold);
@@ -58,7 +59,7 @@ namespace {
   }
 
   bool
-  eitherSideIsOverThreshold(TH2 *pHistogramArray[], const int xbin, const int ybin, const float threshold) {
+  eitherSideIsOverThreshold(TH2* pHistogramArray[], const int xbin, const int ybin, const float threshold) {
     float histogramBinContent0 = pHistogramArray[0]->GetBinContent(xbin, ybin);
     float histogramBinContent1 = pHistogramArray[1]->GetBinContent(xbin, ybin);
 
@@ -66,14 +67,14 @@ namespace {
   }
 
   bool
-  checkOverThreshold(TH2 *pHistogram, const int xbin, const int ybin, const float threshold) {
+  checkOverThreshold(TH2* pHistogram, const int xbin, const int ybin, const float threshold) {
     float histogramBinContent = pHistogram->GetBinContent(xbin, ybin);
 
     return(histogramBinContent > threshold);
   }
 
   bool
-  thereAreEnoughEntries(TH2 *pHistogramArray[], const float threshold) {
+  thereAreEnoughEntries(TH2* pHistogramArray[], const float threshold) {
     float histogramEntries0 = pHistogramArray[0]->GetEntries();
     float histogramEntries1 = pHistogramArray[1]->GetEntries();
 
@@ -81,7 +82,7 @@ namespace {
   }
 
   void
-  fillRateHistogram(const TH2F_LW *sourceHisto, TProfile2D_LW *targetHisto, const int xbin, const int ybin,
+  fillRateHistogram(const TH2F_LW* sourceHisto, TProfile2D_LW* targetHisto, const int xbin, const int ybin,
                     const float centreX, const float centreY, const int nEvent) {
     const float content = sourceHisto->GetBinContent(xbin, ybin);
 
@@ -90,7 +91,7 @@ namespace {
   }
 
   void
-  countNoisyModules(const int regionIndex, const int generalIndex, TH2 *pHistogram[],
+  countNoisyModules(const int regionIndex, const int generalIndex, TH2* pHistogram[],
                     const float threshold, int countArray[]) {
     const int xbins(pHistogram[0]->GetNbinsX() + 1);
     const int ybins(pHistogram[0]->GetNbinsY() + 1);
@@ -106,7 +107,7 @@ namespace {
   }
 
   void
-  countNoisyModulesRN(const int regionIndex, const int generalIndex, TH2 *pHistogram[],
+  countNoisyModulesRN(const int regionIndex, const int generalIndex, TH2* pHistogram[],
                       const float threshold, int countArray[]) {
     const int xbins(pHistogram[0]->GetNbinsX() + 1);
     const int ybins(pHistogram[0]->GetNbinsY() + 1);
@@ -130,7 +131,7 @@ namespace {
  *  the first and second plane numbers to be used, and the timebin.
  */
 // ====================================================================================================
-SCTErrMonTool::SCTErrMonTool(const std::string &type, const std::string &name, const IInterface *parent)
+SCTErrMonTool::SCTErrMonTool(const std::string& type, const std::string& name, const IInterface* parent)
   : ManagedMonitorToolBase(type, name, parent),
     m_firstHit{},
   m_secondHit{},
@@ -323,7 +324,7 @@ SCTErrMonTool::copyHistograms() {
       const int xbins(m_LinksWithCategorisedErrorsVsLB[CategoryErrors::RODLEVEL][reg]->GetNbinsX() + 1);
       for (int xb(1); xb != xbins; ++xb) {
         double nentry=m_LinksWithCategorisedErrorsVsLB[CategoryErrors::RODLEVEL][reg]->GetBinContent(xb);
-        for(int ientry=0; ientry<nentry; ientry++){
+        for (int ientry=0; ientry<nentry; ientry++){
           m_LinksWithRODErrorsVsLB_check[reg]->Fill(m_LinksWithCategorisedErrorsVsLB[CategoryErrors::RODLEVEL][reg]->GetXaxis()->GetBinCenter(xb),
                                                     m_LinksWithCategorisedErrorsVsLB[CategoryErrors::RODLEVEL][reg]->GetBinContent(xb));
         }
@@ -411,7 +412,7 @@ SCTErrMonTool::bookHistograms() {
     ATH_MSG_WARNING("Error in bookErrHistosGen()");
   }
 
-  for(int reg=0; reg<N_REGIONS; reg++){
+  for (int reg=0; reg<N_REGIONS; reg++){
     if (bookConfMaps(reg).isFailure()) {
       ATH_MSG_WARNING("Error in bookConfMaps(): " << "SCT" + subDetNameShort[reg]);
     }
@@ -564,16 +565,15 @@ SCTErrMonTool::fillHistograms() {
   // Use new IDC
   SCT_RDO_Container::const_iterator lastCol = p_rdocontainer->end();
   for (SCT_RDO_Container::const_iterator col_it = p_rdocontainer->begin(); col_it != lastCol; ++col_it) {
-    const InDetRawDataCollection<SCT_RDORawData> *SCT_Collection(*col_it);
+    const InDetRawDataCollection<SCT_RDORawData>* SCT_Collection(*col_it);
     if (!SCT_Collection) continue;  // select only SCT RDOs
 
     DataVector<SCTRawDataType>::const_iterator p_rdo_end = SCT_Collection->end();
-    //const InDetRawDataCollection<SCT_RDORawData> *rd(*col_it);
 
     Identifier SCT_Identifier = SCT_Collection->identify();
     for (DataVector<SCTRawDataType>::const_iterator p_rdo = SCT_Collection->begin(); p_rdo != p_rdo_end; ++p_rdo) {
       count_SCT_RDO++;
-      const SCT3_RawData *rdo3 = dynamic_cast<const SCT3_RawData *>(*p_rdo);
+      const SCT3_RawData* rdo3 = dynamic_cast<const SCT3_RawData*>(*p_rdo);
       SCT_Identifier = (*p_rdo)->identify();
       int barrel_ec = m_pSCTHelper->barrel_ec(SCT_Identifier);
       if (barrel_ec == BARREL) ++numSCTRDOs;
@@ -600,7 +600,7 @@ SCTErrMonTool::fillHistograms() {
         }
       }
     }
-  }// end for(SCT_RDO_Container...
+  }// end for (SCT_RDO_Container...
 
   if (numSCTRDOs != 0) {
     double scale = 100. / double(numSCTRDOs);
@@ -661,7 +661,7 @@ SCTErrMonTool::checkRateHists() {
       float cyb = 0;
       int evt = m_numberOfEvents;
       int evt_lumi = m_numberOfEventsLumi;
-      for(int reg=0; reg<N_REGIONS; reg++){
+      for (int reg=0; reg<N_REGIONS; reg++){
         if (m_doPerLumiErrors && endOfLumiBlockFlag()) {
           const int xbins = m_numErrorsPerLumi[reg]->GetNbinsX() + 1;
           const int ybins = m_numErrorsPerLumi[reg]->GetNbinsY() + 1;
@@ -751,8 +751,8 @@ SCTErrMonTool::procHistograms() {
 //          SCTErrMonTool :: fillByteStreamErrorsHelper, Martin Flechl 10/09/2009
 // ====================================================================================================
 int
-SCTErrMonTool::fillByteStreamErrorsHelper(const std::set<IdentifierHash> *errors,
-                                          TH2F_LW *histo[SCT_ByteStreamErrors::NUM_ERROR_TYPES][NREGIONS_INC_GENERAL][SCT_Monitoring::N_ENDCAPSx2],
+SCTErrMonTool::fillByteStreamErrorsHelper(const std::set<IdentifierHash>* errors,
+                                          TH2F_LW* histo[SCT_ByteStreamErrors::NUM_ERROR_TYPES][NREGIONS_INC_GENERAL][SCT_Monitoring::N_ENDCAPSx2],
                                           bool lumi2DHist, int err_type) {
 
   //--- Check categories of the BS error
@@ -855,7 +855,7 @@ SCTErrMonTool::fillByteStreamErrorsHelper(const std::set<IdentifierHash> *errors
 //          SCTErrMonTool :: numByteStreamErrors, Daniel Damiani 04/07/2011
 // ====================================================================================================
 void
-SCTErrMonTool::numByteStreamErrors(const std::set<IdentifierHash> *errors, int &ntot, int &nbar, int &neca, int &necc) {
+SCTErrMonTool::numByteStreamErrors(const std::set<IdentifierHash>* errors, int& ntot, int& nbar, int& neca, int& necc) {
 
   for (auto fit: *errors) {
     if (fit.is_valid()) {
@@ -905,7 +905,7 @@ SCTErrMonTool::fillByteStreamErrors() {
     }
   }
 
-  if(m_sctflag) {
+  if (m_sctflag) {
     return StatusCode::SUCCESS;
   }
 
@@ -1109,8 +1109,8 @@ SCTErrMonTool::fillByteStreamErrors() {
 // Avoids duplicate code in the bookErrHistosXXXX functions; added 8/9/09, Martin Flechl
 // ====================================================================================================
 StatusCode
-SCTErrMonTool::bookErrHistosHelper(MonGroup &mg, TString name, TString title, TString titlehitmap,
-                                   TProfile2D_LW * &tprof, TH2F_LW * &th, const int layer, const bool barrel) {
+SCTErrMonTool::bookErrHistosHelper(MonGroup& mg, TString name, TString title, TString titlehitmap,
+                                   TProfile2D_LW*& tprof, TH2F_LW*& th, const int layer, const bool barrel) {
   ostringstream streamhitmap;
 
   streamhitmap << layer / 2 << "_" << layer % 2;
@@ -1147,7 +1147,7 @@ SCTErrMonTool::bookErrHistosHelper(MonGroup &mg, TString name, TString title, TS
 // Avoids duplicate code in the bookErrHistosXXXX functions; added 08/08/11, Daniel Damiani
 // ====================================================================================================
 StatusCode
-SCTErrMonTool::bookErrHistosHelper(MonGroup &mg, TString name, TString title, TProfile2D_LW * &tprof, const int layer,
+SCTErrMonTool::bookErrHistosHelper(MonGroup& mg, TString name, TString title, TProfile2D_LW*& tprof, const int layer,
                                    const bool barrel) {
   ostringstream streamhitmap;
 
@@ -1313,8 +1313,8 @@ SCTErrMonTool::bookErrHistosGen() {
     m_nLinksWithErrors->GetYaxis()->SetTitle("Num of Links with Errors");
     size_t nErrors_buf_size;
     nErrors_buf_size = m_evtsbins * sizeof(int);
-    m_nErrors_buf = (int *) malloc(nErrors_buf_size);
-    m_nLinksWithErrors_buf = (int *) malloc(nErrors_buf_size);
+    m_nErrors_buf = (int*) malloc(nErrors_buf_size);
+    m_nLinksWithErrors_buf = (int*) malloc(nErrors_buf_size);
     m_nErrors_pos = 0;
     if (Errors.regHist(m_nErrors).isFailure()) {
       ATH_MSG_WARNING("Couldn't book nErrors vs event number hist");
@@ -1554,7 +1554,7 @@ SCTErrMonTool::bookConfMaps(int reg=-1) { // reg = 0:EC, 1:B, 2:EA
     m_p2DmapHistoVectorAll[reg].clear();
     for (int layer(0); layer != nLayers; ++layer) {
       std::string mapName = "modulemap" + std::string(subDetNameShort[reg].Data()) + std::to_string(int(layer/2)) + "_" + std::to_string(int(layer%2));
-      TH2F_LW *hitsHisto_tmp = TH2F_LW::create(TString(mapName.c_str()),
+      TH2F_LW* hitsHisto_tmp = TH2F_LW::create(TString(mapName.c_str()),
                                                TString(("Module Out of Configuration : "+std::string(subDetName[reg].Data())+", "+
                                                         std::string(layerName[reg].Data())+" "+std::to_string(int(layer/2))+
                                                         " side "+std::to_string(int(layer%2))).c_str()),
@@ -1603,7 +1603,7 @@ SCTErrMonTool::fillCondDBMaps() {
   };
 
   bool failedbooking = false;
-  TH2 *hitsHisto_tmp[2];
+  TH2* hitsHisto_tmp[2];
 
   // Pointers are deleted by regHist() method
   std::string stem;
@@ -1633,7 +1633,7 @@ SCTErrMonTool::fillCondDBMaps() {
   }
 
   // region
-  for(int reg=0; reg<N_REGIONS; reg++){
+  for (int reg=0; reg<N_REGIONS; reg++){
     int nLayers = n_layers[reg];
     for (int lyr = 0; lyr < nLayers; ++lyr) {
 
@@ -1754,7 +1754,7 @@ SCTErrMonTool::fillConfigurationDetails() {
     }
   }
 
-  const std::map<Identifier, unsigned int> *badChips = m_ConfigurationTool->badChips(); // bad chips
+  const std::map<Identifier, unsigned int>* badChips = m_ConfigurationTool->badChips(); // bad chips
   unsigned int nBadChips(0);
   for (auto chip : *badChips) {
     unsigned int status = chip.second;
@@ -1840,7 +1840,7 @@ SCTErrMonTool::resetConfigurationDetails() {
 //                          SCTErrMonTool :: getHisto, Martin Flechl 14/9/2009
 // ====================================================================================================
 bool
-SCTErrMonTool::getHisto(const int layer, const int reg, const int type, TH2 *histo[2]) {
+SCTErrMonTool::getHisto(const int layer, const int reg, const int type, TH2* histo[2]) {
   const string trm[3][N_REGIONS] = {
     {"SCT/SCTEC/Noise/noiseoccupancymapECm_","SCT/SCTB/Noise/noiseoccupancymap_", "SCT/SCTEA/Noise/noiseoccupancymapECp_"},
     {"SCT/SCTEC/eff/ineffm_", "SCT/SCTB/eff/ineff_", "SCT/SCTEA/eff/ineffp_"},
@@ -1882,7 +1882,7 @@ SCTErrMonTool::getHisto(const int layer, const int reg, const int type, TH2 *his
 //                          SCTErrMonTool :: getHistoRecent, Dan Damiani  21/7/2011
 // ====================================================================================================
 bool
-SCTErrMonTool::getHistoRecent(const int layer, const int reg, const int type, TH2 *histo[2]) {
+SCTErrMonTool::getHistoRecent(const int layer, const int reg, const int type, TH2* histo[2]) {
   const string trm[1][N_REGIONS] = {
     {"SCT/SCTEC/Noise/noiseoccupancymaprecentECm_", "SCT/SCTB/Noise/noiseoccupancymaprecent_", "SCT/SCTEA/Noise/noiseoccupancymaprecentECp_"}
   };
@@ -1900,8 +1900,8 @@ SCTErrMonTool::getHistoRecent(const int layer, const int reg, const int type, TH
 }
 
 SCTErrMonTool::Prof2_t
-SCTErrMonTool::prof2Factory(const std::string &name, const std::string &title, const unsigned int &bec,
-                            VecProf2_t &storageVector) {
+SCTErrMonTool::prof2Factory(const std::string& name, const std::string& title, const unsigned int& bec,
+                            VecProf2_t& storageVector) {
   int firstEta(FIRST_ETA_BIN), lastEta(LAST_ETA_BIN), firstPhi(FIRST_PHI_BIN), lastPhi(LAST_PHI_BIN), nEta(N_ETA_BINS),
     nPhi(N_PHI_BINS);
 
@@ -1954,8 +1954,7 @@ SCTErrMonTool::isEndcapA(const int moduleNumber) {
 //====================================================================================================
 //                          SCTErrMonTool :: fillWafer, Keisuke Kouda 12.09.2016
 //====================================================================================================
-void SCTErrMonTool::fillWafer( moduleGeo_t module, TH2F * histo )
-//void SCTErrMonTool::fillWafer( moduleGeo_t module, TProfile2D * profile )
+void SCTErrMonTool::fillWafer( moduleGeo_t module, TH2F* histo )
 {
   double etaMin(module.first.first), etaMax(module.first.second);
   double phiMin(module.second.first), phiMax(module.second.second);
@@ -2014,7 +2013,7 @@ bool SCTErrMonTool::syncErrorSCT()
   //BadLinkLevelError
   for (SCT_ByteStreamErrors::errorTypes linkLevelBadErrors: SCT_ByteStreamErrors::LinkLevelBadErrors)
     {
-      const std::set<IdentifierHash> * sctErrors = m_byteStreamErrTool->getErrorSet( linkLevelBadErrors );
+      const std::set<IdentifierHash>* sctErrors = m_byteStreamErrTool->getErrorSet( linkLevelBadErrors );
       for (const IdentifierHash& waferHash: *sctErrors)
         {
           m_SCTHash[badLinkError].insert(waferHash);
@@ -2024,7 +2023,7 @@ bool SCTErrMonTool::syncErrorSCT()
   //BadRODLevelError
   for (SCT_ByteStreamErrors::errorTypes RodLevelBadErrors: SCT_ByteStreamErrors::RodLevelBadErrors)
     {
-      const std::set<IdentifierHash> * sctErrors = m_byteStreamErrTool->getErrorSet( RodLevelBadErrors );
+      const std::set<IdentifierHash>* sctErrors = m_byteStreamErrTool->getErrorSet( RodLevelBadErrors );
 
       for (const IdentifierHash& waferHash: *sctErrors)
         {
@@ -2035,7 +2034,7 @@ bool SCTErrMonTool::syncErrorSCT()
   //BadError = BadLinkLevelError + BadRODLevelError
   for (SCT_ByteStreamErrors::errorTypes tmpBadError: SCT_ByteStreamErrors::BadErrors)       
     {
-      const std::set<IdentifierHash> * sctErrors = m_byteStreamErrTool->getErrorSet( tmpBadError );
+      const std::set<IdentifierHash>* sctErrors = m_byteStreamErrTool->getErrorSet( tmpBadError );
       for (const IdentifierHash& waferHash: *sctErrors)
         {
           m_SCTHash[badError].insert(waferHash);
@@ -2107,7 +2106,7 @@ bool SCTErrMonTool::psTripDCSSCT()
 //====================================================================================================
 //                          SCTErrMonTool :: calculateDetectorCoverage, Keisuke Kouda 12.09.2016
 //====================================================================================================
-double SCTErrMonTool::calculateDetectorCoverage( const TH2F * histo )
+double SCTErrMonTool::calculateDetectorCoverage( const TH2F* histo )
 {
   double detector_coverage = 0.;
   double occupancy = 0;
diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTHitEffMonTool.cxx b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTHitEffMonTool.cxx
index c509749d608a808272203552ba655ca35b9654ea..088d69aa7a9fcb5fd884a778343b5d36bd6e6bdf 100644
--- a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTHitEffMonTool.cxx
+++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTHitEffMonTool.cxx
@@ -5,26 +5,6 @@
 /** Tool to measure the intrinsic single hit efficiency in the SCT
  */
 
-// std and STL includes
-#include <cmath>
-// #include <ostream>
-#include <sstream>
-#include <limits>
-#include <algorithm>
-#include <limits>       // std::numeric_limits
-#include <array>
-
-
-
-// Gaudi
-#include "GaudiKernel/IChronoStatSvc.h"
-
-// ROOT
-#include "TH2I.h"
-#include "TProfile2D.h"
-#include "TProfile.h"
-#include "TGraphErrors.h"
-
 // Athena
 #include "AthenaKernel/errorcheck.h"
 #include "Identifier/IdentifierHash.h"
@@ -52,16 +32,25 @@
 #include "SCT_Monitoring/SCTHitEffMonTool.h"
 #include "SCT_NameFormatter.h"
 #include "SCT_ConditionsTools/ISCT_ConfigurationConditionsTool.h"
-// macros (ugh)
-#define DEBUG(x) ATH_MSG_DEBUG(x)
-#define INFO(x) ATH_MSG_INFO(x)
-#define WARNING(x) ATH_MSG_WARNING(x)
-#define ERROR(x) ATH_MSG_ERROR(x)
-#define VERBOSE(x) ATH_MSG_VERBOSE(x)
 
-using namespace SCT_Monitoring;
+// Gaudi
+#include "GaudiKernel/IChronoStatSvc.h"
 
+// ROOT
+#include "TH2I.h"
+#include "TProfile2D.h"
+#include "TProfile.h"
+#include "TGraphErrors.h"
 
+// std and STL includes
+#include <cmath>
+#include <sstream>
+#include <limits>
+#include <algorithm>
+#include <limits>       // std::numeric_limits
+#include <array>
+
+using namespace SCT_Monitoring;
 
 namespace {// anonymous namespace for functions at file scope
   const bool testOffline(false);
@@ -74,9 +63,9 @@ namespace {// anonymous namespace for functions at file scope
   };
 
   template< typename T > Identifier
-  surfaceOnTrackIdentifier(const T &tsos, const bool useTrackParameters = true) {
+  surfaceOnTrackIdentifier(const T& tsos, const bool useTrackParameters = true) {
     Identifier result(0); // default constructor produces invalid value
-    const Trk::MeasurementBase *mesb = tsos->measurementOnTrack();
+    const Trk::MeasurementBase* mesb = tsos->measurementOnTrack();
 
     if (mesb and mesb->associatedSurface().associatedDetectorElement()) {
       result = mesb->associatedSurface().associatedDetectorElement()->identify();
@@ -90,7 +79,7 @@ namespace {// anonymous namespace for functions at file scope
   constexpr Double_t radianDegrees(180. / M_PI);
 
   float
-  amgPseudoRapidity(const Amg::Vector3D &position) {
+  amgPseudoRapidity(const Amg::Vector3D& position) {
     float pseudo(0.);
     float ma = position.mag(), dz = position.z();
 
@@ -113,7 +102,7 @@ using std::ostringstream;
 using std::string;
 
 // Constructor with parameters:
-SCTHitEffMonTool::SCTHitEffMonTool(const string &type, const string &name, const IInterface *parent) :
+SCTHitEffMonTool::SCTHitEffMonTool(const string& type, const string& name, const IInterface* parent) :
   ManagedMonitorToolBase(type, name, parent),
   m_TrackName(std::string("ResolvedSCTTracks")),// original track collection
   m_chrono(nullptr),
@@ -321,7 +310,7 @@ SCTHitEffMonTool::SCTHitEffMonTool(const string &type, const string &name, const
 /*---------------------------------------------------------*/
 StatusCode
 SCTHitEffMonTool::initialize() {
-  INFO("Initializing SCTHitEffMonTool");
+  ATH_MSG_INFO("Initializing SCTHitEffMonTool");
 
   CHECK(detStore()->retrieve(m_sctId, "SCT_ID"));
   CHECK(detStore()->retrieve(m_pixelId, "PixelID"));
@@ -332,14 +321,14 @@ SCTHitEffMonTool::initialize() {
   }
   CHECK(ManagedMonitorToolBase::initialize());
   CHECK(m_holeSearchTool.retrieve());
-  INFO("Retrieved hole search tool " << m_holeSearchTool);
+  ATH_MSG_INFO("Retrieved hole search tool " << m_holeSearchTool);
   CHECK(m_residualPullCalculator.retrieve());
-  INFO("Retrieved pull calculator tool " << m_residualPullCalculator);
+  ATH_MSG_INFO("Retrieved pull calculator tool " << m_residualPullCalculator);
   CHECK(m_rotcreator.retrieve());
-  INFO("Retrieved tool " << m_rotcreator);
+  ATH_MSG_INFO("Retrieved tool " << m_rotcreator);
   CHECK(m_fieldServiceHandle.retrieve());
   CHECK(m_bunchCrossingTool.retrieve());
-  INFO("Retrieved BunchCrossing tool " << m_bunchCrossingTool);
+  ATH_MSG_INFO("Retrieved BunchCrossing tool " << m_bunchCrossingTool);
 
   m_path = (m_useIDGlobal) ? ("/InDetGlobal/") : ("");
 
@@ -375,18 +364,18 @@ SCTHitEffMonTool::bookHistograms() {
     return StatusCode::SUCCESS;
   }
   if (m_isCosmic) {
-    WARNING("Running on cosmics: releasing d0 cut and forcing use of TRT timing");
+    ATH_MSG_WARNING("Running on cosmics: releasing d0 cut and forcing use of TRT timing");
   }
   if (not m_fieldServiceHandle->solenoidOn()) {
-    WARNING("Running with solenoid off: releasing pT cut");
+    ATH_MSG_WARNING("Running with solenoid off: releasing pT cut");
     m_minPt = -1.;
   }
   if (newRunFlag()) {
     m_badChips = m_configConditions->badChips();
-    INFO("Found " << m_badChips->size() << " bad chips");
+    ATH_MSG_INFO("Found " << m_badChips->size() << " bad chips");
     for (std::map<Identifier, unsigned int>::const_iterator chip(m_badChips->begin()); chip != m_badChips->end();
          ++chip) {
-      VERBOSE("Module " << m_sctId->wafer_hash(chip->first) << ", chip " << chip->second);
+      ATH_MSG_VERBOSE("Module " << m_sctId->wafer_hash(chip->first) << ", chip " << chip->second);
     }
 
     std::array < MonGroup, N_REGIONS + 1 > histGroupE = {{
@@ -503,7 +492,7 @@ SCTHitEffMonTool::bookHistograms() {
       for (Long_t i(0); i != n_layers[isub]; ++i) {
         const int detIndex = becIdxLayer2Index(isub, i);
         if (detIndex == -1) {
-          WARNING("Subdetector region (barrel, endcap A, endcap C) could not be determined");
+          ATH_MSG_WARNING("Subdetector region (barrel, endcap A, endcap C) could not be determined");
           continue;
         }
         for (Long_t j(0); j != 2; ++j) {
@@ -732,18 +721,18 @@ SCTHitEffMonTool::bookHistograms() {
 StatusCode
 SCTHitEffMonTool::bookHistogramsRecurrent() {
   if (m_isCosmic) {
-    WARNING("Running on cosmics: releasing d0 cut and forcing use of TRT timing");
+    ATH_MSG_WARNING("Running on cosmics: releasing d0 cut and forcing use of TRT timing");
   }
   if (not m_fieldServiceHandle->solenoidOn()) {
-    WARNING("Running with solenoid off: releasing pT cut");
+    ATH_MSG_WARNING("Running with solenoid off: releasing pT cut");
     m_minPt = -1.;
   }
   if (newRunFlag()) {
     m_badChips = m_configConditions->badChips();
-    INFO("Found " << m_badChips->size() << " bad chips");
+    ATH_MSG_INFO("Found " << m_badChips->size() << " bad chips");
     for (std::map<Identifier, unsigned int>::const_iterator chip(m_badChips->begin()); chip != m_badChips->end();
          ++chip) {
-      VERBOSE("Module " << m_sctId->wafer_hash(chip->first) << ", chip " << chip->second);
+      ATH_MSG_VERBOSE("Module " << m_sctId->wafer_hash(chip->first) << ", chip " << chip->second);
     }
 
     std::array < MonGroup, N_REGIONS + 1 > histGroupE = {{
@@ -855,7 +844,7 @@ SCTHitEffMonTool::bookHistogramsRecurrent() {
       for (Long_t i(0); i != n_layers[isub]; ++i) {
         const int detIndex(becIdxLayer2Index(isub, i));
         if (detIndex == -1) {
-          WARNING("Detector region (barrel, endcap A, endcap C) could not be determined");
+          ATH_MSG_WARNING("Detector region (barrel, endcap A, endcap C) could not be determined");
           continue;
         }
         for (Long_t j(0); j != 2; ++j) {
@@ -1082,22 +1071,23 @@ StatusCode
 SCTHitEffMonTool::fillHistograms() {
   errorcheck::ReportMessage::hideErrorLocus(true);
 
-  VERBOSE("SCTHitEffMonTool::fillHistograms()");
+  ATH_MSG_VERBOSE("SCTHitEffMonTool::fillHistograms()");
   Double_t timecor(-20.);
   if (m_useTRTPhase or m_isCosmic) {
     SG::ReadHandle<ComTime> theComTime(m_comTimeName);
     if (theComTime.isValid()) {
       timecor = theComTime->getTime();
-      VERBOSE("Retrieved ComTime object with name " << m_comTimeName.key() << " found: Time = " << timecor);
+      ATH_MSG_VERBOSE("Retrieved ComTime object with name " << m_comTimeName.key() << " found: Time = " << timecor);
     } else {
       timecor = -18.;
-      WARNING("ComTime object not found with name " << m_comTimeName.key());
+      ATH_MSG_WARNING("ComTime object not found with name " << m_comTimeName.key());
     }
   }
   // If we are going to use TRT phase in anger, need run-dependent corrections.
   SG::ReadHandle<xAOD::EventInfo> pEvent(m_eventInfoKey);
   if (not pEvent.isValid()) {
-    return ERROR("Could not find EventInfo"), StatusCode::FAILURE;
+    ATH_MSG_ERROR("Could not find EventInfo");
+    return StatusCode::FAILURE;
   }
   unsigned BCID = pEvent->bcid();
   int BCIDpos = m_bunchCrossingTool->distanceFromFront(BCID);
@@ -1110,18 +1100,18 @@ SCTHitEffMonTool::fillHistograms() {
   // ---- First try if m_tracksName is a TrackCollection
   SG::ReadHandle<TrackCollection>tracks(m_TrackName);
   if (not tracks.isValid()) {
-    WARNING("Tracks not found: " << tracks << " / " << m_TrackName.key());
+    ATH_MSG_WARNING("Tracks not found: " << tracks << " / " << m_TrackName.key());
     if (m_chronotime) {
       m_chrono->chronoStop("SCTHitEff");
     }
     return StatusCode::SUCCESS;
   } else {
-    VERBOSE("Successfully retrieved " << m_TrackName.key() << " : " << tracks->size() << " items");
+    ATH_MSG_VERBOSE("Successfully retrieved " << m_TrackName.key() << " : " << tracks->size() << " items");
   }
 
   SG::ReadHandle<InDet::SCT_ClusterContainer> p_sctclcontainer(m_sctContainerName);
   if (not p_sctclcontainer.isValid()) {
-    WARNING("SCT clusters container not found: " << m_sctContainerName.key());
+    ATH_MSG_WARNING("SCT clusters container not found: " << m_sctContainerName.key());
     if (m_chronotime) {
       m_chrono->chronoStop("SCTHitEff");
     }
@@ -1151,7 +1141,7 @@ SCTHitEffMonTool::fillHistograms() {
   const TrackCollection::const_iterator endOfTracks(tracks->end());
   for (TrackCollection::const_iterator itr(tracks->begin()); itr != endOfTracks; ++itr) {
     nTrk++;
-    const Trk::Track *pthisTrack(*itr);
+    const Trk::Track* pthisTrack(*itr);
     if (not pthisTrack) {
       continue;
     }
@@ -1168,8 +1158,8 @@ SCTHitEffMonTool::fillHistograms() {
     if (pthisTrack->perigeeParameters() == 0) {
       continue;
     }
-    const Trk::Perigee *perigee = pthisTrack->perigeeParameters();
-    const AmgVector(5) & perigeeParameters(perigee->parameters());
+    const Trk::Perigee* perigee = pthisTrack->perigeeParameters();
+    const AmgVector(5)& perigeeParameters(perigee->parameters());
     const float d0(perigeeParameters[Trk::d0]);
     const float z0(perigeeParameters[Trk::z0]);
     const float perigeeTheta(perigeeParameters[Trk::theta]);
@@ -1189,8 +1179,8 @@ SCTHitEffMonTool::fillHistograms() {
   // Loop over original track collection
   //  const TrackCollection::const_iterator endOfTracks(tracks->end());
   for (TrackCollection::const_iterator itr(tracks->begin()); itr != endOfTracks; ++itr) {
-    VERBOSE("Starting new track");
-    const Trk::Track *pthisTrack(*itr);
+    ATH_MSG_VERBOSE("Starting new track");
+    const Trk::Track* pthisTrack(*itr);
     if (not pthisTrack) {
       continue;
     }
@@ -1206,8 +1196,8 @@ SCTHitEffMonTool::fillHistograms() {
     if (pthisTrack->perigeeParameters() == 0) {
       continue;
     }
-    const Trk::Perigee *perigee = pthisTrack->perigeeParameters();
-    const AmgVector(5) & perigeeParameters(perigee->parameters());
+    const Trk::Perigee* perigee = pthisTrack->perigeeParameters();
+    const AmgVector(5)& perigeeParameters(perigee->parameters());
     const float d0(perigeeParameters[Trk::d0]);
     const float z0(perigeeParameters[Trk::z0]);
     const float perigeeTheta(perigeeParameters[Trk::theta]);
@@ -1229,18 +1219,18 @@ SCTHitEffMonTool::fillHistograms() {
     bool useDetector[N_REGIONS] = {
       false, false, false
     };
-    const Trk::TrackSummary *summary = pthisTrack->trackSummary();
+    const Trk::TrackSummary* summary = pthisTrack->trackSummary();
 
     if (summary and summary->get(Trk::numberOfSCTHits) < 1) {
       continue;
     }
 
-    const Trk::Track *trackWithHoles = m_holeSearchTool->getTrackWithHoles(*pthisTrack);
+    const Trk::Track* trackWithHoles = m_holeSearchTool->getTrackWithHoles(*pthisTrack);
     if (not trackWithHoles) {
-      WARNING("trackWithHoles pointer is invalid");
+      ATH_MSG_WARNING("trackWithHoles pointer is invalid");
       continue;
     }
-    VERBOSE("Found " << trackWithHoles->trackStateOnSurfaces()->size() << " states on track");
+    ATH_MSG_VERBOSE("Found " << trackWithHoles->trackStateOnSurfaces()->size() << " states on track");
     // loop over all hits on track
     DataVector<const Trk::TrackStateOnSurface>::const_iterator TSOSItr =
       trackWithHoles->trackStateOnSurfaces()->begin();
@@ -1288,7 +1278,7 @@ SCTHitEffMonTool::fillHistograms() {
             zmax = std::max(zpos, zmax);
             zmin = std::min(zpos, zmin);
           }else {
-            WARNING("No track parameter found. Zmin and Zmax not recalculated.");
+            ATH_MSG_WARNING("No track parameter found. Zmin and Zmax not recalculated.");
           }
         }else { // else use layer/side number : better but does not work for cosmics
           if (m_sctId->is_sct(surfaceID)) {
@@ -1316,7 +1306,7 @@ SCTHitEffMonTool::fillHistograms() {
     }
 
     for (TSOSItr = trackWithHoles->trackStateOnSurfaces()->begin(); TSOSItr != TSOSItrE; ++TSOSItr) {
-      VERBOSE("Starting new hit");
+      ATH_MSG_VERBOSE("Starting new hit");
       surfaceID = surfaceOnTrackIdentifier(*TSOSItr);
 
       if (failCut(m_sctId->is_sct(surfaceID), "hit cut: is in SCT")) {
@@ -1327,13 +1317,13 @@ SCTHitEffMonTool::fillHistograms() {
       if (failCut(not (isub == INVALID_INDEX), "hit cut: valid sub-detector")) {
         continue;
       }
-      VERBOSE("New SCT candidate: " << m_sctId->print_to_string(surfaceID));
+      ATH_MSG_VERBOSE("New SCT candidate: " << m_sctId->print_to_string(surfaceID));
 
       Int_t side(m_sctId->side(surfaceID));
       Int_t layer(m_sctId->layer_disk(surfaceID));
       const int detIndex = becIdxLayer2Index(isub, layer);
       if (detIndex == -1) {
-        WARNING("The detector region (barrel, endcap A, endcap C) could not be determined");
+        ATH_MSG_WARNING("The detector region (barrel, endcap A, endcap C) could not be determined");
         continue;
       }
       Int_t histnumber(detIndex);
@@ -1342,7 +1332,7 @@ SCTHitEffMonTool::fillHistograms() {
       Identifier module_id(m_sctId->module_id(surfaceID));
       Float_t layerPlusHalfSide(float(layer) + float(side) * 0.5);
       Float_t dedicated_layerPlusHalfSide(float(layer) + float((side + 1) % 2) * 0.5);
-      const Trk::TrackParameters *trkParamOnSurface((*TSOSItr)->trackParameters());
+      const Trk::TrackParameters* trkParamOnSurface((*TSOSItr)->trackParameters());
       Double_t trackHitResidual(getResidual(surfaceID, trkParamOnSurface, &*p_sctclcontainer));
 
 
@@ -1382,7 +1372,7 @@ SCTHitEffMonTool::fillHistograms() {
       Double_t phiUp(90.);
       Double_t theta(90.);
       if (trkParamOnSurface and not findAnglesToWaferSurface(trkParamOnSurface->momentum(), surfaceID, elements, theta, phiUp)) {
-        WARNING("Error from findAngles");
+        ATH_MSG_WARNING("Error from findAngles");
       }
 
       if (m_detailed) {
@@ -1423,7 +1413,7 @@ SCTHitEffMonTool::fillHistograms() {
           m_Eff_timecorHisto[isub]->Fill(timecor, eff);
         }
       }
-      DEBUG("Use TRT phase " << m_useTRTPhase << " is cosmic? " << m_isCosmic << " timecor " << timecor);
+      ATH_MSG_DEBUG("Use TRT phase " << m_useTRTPhase << " is cosmic? " << m_isCosmic << " timecor " << timecor);
       if (m_useTRTPhase or m_isCosmic) {
         if (timecor == 0) {
           continue;
@@ -1476,7 +1466,7 @@ SCTHitEffMonTool::fillHistograms() {
         if (failCut(timecor >= tmin and timecor <= tmax, "track cut: timing cut")) {
           continue;
         }
-        DEBUG(timecor << " " << tmin << " " << tmax);
+        ATH_MSG_DEBUG(timecor << " " << tmin << " " << tmax);
       }
       if (m_detailed) {
         m_SelectionHisto[isub]->Fill(3.); // Past TRT time/Hits selection
@@ -1489,7 +1479,7 @@ SCTHitEffMonTool::fillHistograms() {
           zpos = (*TSOSItr)->trackParameters()->position().z();
           enclosingHits = (zpos > zmin)and(zpos < zmax);
         }else {
-          WARNING("No track parameters found. Cannot determine whether it is an enclosed hit.");
+          ATH_MSG_WARNING("No track parameters found. Cannot determine whether it is an enclosed hit.");
           enclosingHits = false;
         }
       }else {
@@ -1657,7 +1647,7 @@ SCTHitEffMonTool::fillHistograms() {
       // Check bad chips
       Bool_t nearBadChip(false);
       IdentifierHash waferHash = m_sctId->wafer_hash(surfaceID);
-      const InDetDD::SiDetectorElement *pElement = elements->getDetectorElement(waferHash);
+      const InDetDD::SiDetectorElement* pElement = elements->getDetectorElement(waferHash);
       bool swap = (pElement->swapPhiReadoutDirection()) ? true : false;
       Int_t chipPos(previousChip(xl, side, swap));
       unsigned int status(0);
@@ -1677,7 +1667,7 @@ SCTHitEffMonTool::fillHistograms() {
       if (m_vetoBadChips and failCut(not nearBadChip, "hit cut: not near bad chip")) {
         continue;
       }
-      VERBOSE("Candidate passed all cuts");
+      ATH_MSG_VERBOSE("Candidate passed all cuts");
       m_Eff_summaryHisto_old[isub]->Fill(layerPlusHalfSide, eff); // in order to calculate m_EffsummaryIncBadMod
       m_Eff_summaryHisto[isub]->Fill(dedicated_layerPlusHalfSide, eff); // adjustment for dedicated_title()
       m_Eff_hashCodeHisto->Fill(Double_t(sideHash), eff);
@@ -1742,7 +1732,7 @@ SCTHitEffMonTool::fillHistograms() {
       const int ieta(m_sctId->eta_module(surfaceID));
       const int iphi(m_sctId->phi_module(surfaceID));
       m_effMap[histnumber][side]->Fill(ieta, iphi, eff);
-      if( BCIDpos <= 0 ){
+      if ( BCIDpos <= 0 ){
         m_effMapFirstBCID[histnumber][side]->Fill(ieta, iphi, eff);
       }
       m_effLumiBlock[histnumber][side]->Fill(pEvent->lumiBlock(), eff);
@@ -1753,7 +1743,7 @@ SCTHitEffMonTool::fillHistograms() {
         m_ineffMap[histnumber][side]->Fill(ieta, iphi, (eff == 0));
       }
       if (testOffline) {
-        INFO("Filling " << histnumber << ", " << side << " eta " << ieta << " phi " << iphi);
+        ATH_MSG_INFO("Filling " << histnumber << ", " << side << " eta " << ieta << " phi " << iphi);
       }
     } // End of loop over hits/holes
     if (m_detailed) {
@@ -1792,7 +1782,7 @@ SCTHitEffMonTool::fillHistograms() {
     delete trackWithHoles;
     trackWithHoles = 0;
   }
-  VERBOSE("finished loop over tracks = " << (*tracks).size());
+  ATH_MSG_VERBOSE("finished loop over tracks = " << (*tracks).size());
   if (m_detailed) {
     m_nTrkHisto->Fill(nTrk);
     m_nTrkParsHisto->Fill(nTrkPars);
@@ -1818,8 +1808,8 @@ SCTHitEffMonTool::procHistograms() {
       return StatusCode::FAILURE;
     }
 
-    const std::set<Identifier> *badModules = m_configConditions->badModules();
-    INFO("Found " << badModules->size() << " bad modules");
+    const std::set<Identifier>* badModules = m_configConditions->badModules();
+    ATH_MSG_INFO("Found " << badModules->size() << " bad modules");
     std::array < std::array < double, N_ENDCAPS >, N_REGIONS > MaxEta;
     std::array < std::array < double, N_ENDCAPS >, N_REGIONS > MaxPhi;
     for (int isub(0); isub < N_REGIONS; ++isub) {
@@ -1868,7 +1858,7 @@ SCTHitEffMonTool::procHistograms() {
           eff = (accSide[0] + accSide[1]) / 2;
         }
       }else {
-        VERBOSE("Bad module : " << *wafItr << " " << m_sctId->wafer_hash(*wafItr));
+        ATH_MSG_VERBOSE("Bad module : " << *wafItr << " " << m_sctId->wafer_hash(*wafItr));
         m_badModMap->SetPoint(m_badModMap->GetN(), amgPseudoRapidity(position), position.phi());
         m_badModMap->SetPointError(m_badModMap->GetN() - 1, dEta / 2, dPhi / 2);
         m_badModMap->GetXaxis()->SetRangeUser(-3, 3);
@@ -1892,7 +1882,7 @@ SCTHitEffMonTool::procHistograms() {
       mapOfInEff[*wafItr] = eff;
       Int_t histnumber(becIdxLayer2Index(isub, layer));
       if (histnumber == -1) {
-        WARNING("Barrel-or-endcap index is invalid");
+        ATH_MSG_WARNING("Barrel-or-endcap index is invalid");
         return StatusCode::FAILURE;
       }
       m_accMap[histnumber]->Fill(m_sctId->eta_module(*wafItr), m_sctId->phi_module(*wafItr), (1. - eff) * N_CHIPS * 2);
@@ -1917,7 +1907,7 @@ SCTHitEffMonTool::procHistograms() {
         std::sort(phibins[isub][i].begin(), phibins[isub][i].end());
         Int_t histnumber(becIdxLayer2Index(isub, i));
         if (histnumber < 0) {
-          WARNING("Barrel-or-endcap index is invalid");
+          ATH_MSG_WARNING("Barrel-or-endcap index is invalid");
           return StatusCode::FAILURE;
         }
         CHECK(bookEffHisto(m_accPhysMap[histnumber], histGroupE[isub],
@@ -1946,14 +1936,11 @@ SCTHitEffMonTool::procHistograms() {
       Identifier surfaceID(bMod->first);
       Int_t histnumber(becIdxLayer2Index(bec2Index(m_sctId->barrel_ec(surfaceID)), m_sctId->layer_disk(surfaceID)));
       if (histnumber < 0) {
-        WARNING("Barrel-or-endcap index is invalid");
+        ATH_MSG_WARNING("Barrel-or-endcap index is invalid");
         return StatusCode::FAILURE;
       }
       IdentifierHash waferHash = m_sctId->wafer_hash(surfaceID);
-      const InDetDD::SiDetectorElement *element = elements->getDetectorElement(waferHash);
-      //      const HepGeom::Point3D<float> position = element->center();
-      //      m_accPhysMap[histnumber]->Fill(position.pseudoRapidity(), position.phi(), (1. - bMod->second) * N_CHIPS *
-      // 2);
+      const InDetDD::SiDetectorElement* element = elements->getDetectorElement(waferHash);
       const Amg::Vector3D position = element->center();
       m_accPhysMap[histnumber]->Fill(amgPseudoRapidity(position), position.phi(), (1. - bMod->second) * N_CHIPS * 2);
     }
@@ -1983,10 +1970,10 @@ SCTHitEffMonTool::procHistograms() {
 StatusCode
 SCTHitEffMonTool::failCut(Bool_t value, std::string name) {
   if (value) {
-    VERBOSE("Passed " << name);
+    ATH_MSG_VERBOSE("Passed " << name);
     return StatusCode::FAILURE;
   }
-  VERBOSE("Failed " << name);
+  ATH_MSG_VERBOSE("Failed " << name);
   return StatusCode::SUCCESS;
 }
 
@@ -2007,22 +1994,19 @@ SCTHitEffMonTool::previousChip(Double_t xl, Int_t side, bool swap) {
 }
 
 StatusCode
-SCTHitEffMonTool::findAnglesToWaferSurface(const Amg::Vector3D &mom, const Identifier id, 
+SCTHitEffMonTool::findAnglesToWaferSurface(const Amg::Vector3D& mom, const Identifier id, 
                                            const InDetDD::SiDetectorElementCollection* elements,
-                                           Double_t &theta, Double_t &phi) {
+                                           Double_t& theta, Double_t& phi) {
   phi = 90.;
   theta = 90.;
 
   const Identifier waferId = m_sctId->wafer_id(id);
   const IdentifierHash waferHash = m_sctId->wafer_hash(waferId);
-  const InDetDD::SiDetectorElement *element = elements->getDetectorElement(waferHash);
+  const InDetDD::SiDetectorElement* element = elements->getDetectorElement(waferHash);
   if (not element) {
-    VERBOSE("findAnglesToWaferSurface: failed to find detector element for id = " << m_sctId->print_to_string(id));
+    ATH_MSG_VERBOSE("findAnglesToWaferSurface: failed to find detector element for id = " << m_sctId->print_to_string(id));
     return StatusCode::FAILURE;
   }
-  //  Double_t pNormal(mom * element->normal());
-  //  Double_t pEta(mom * element->etaAxis());
-  //  Double_t pPhi(mom * element->phiAxis());
   Double_t pNormal(mom.dot(element->normal()));
   Double_t pEta(mom.dot(element->etaAxis()));
   Double_t pPhi(mom.dot(element->phiAxis()));
@@ -2040,41 +2024,41 @@ SCTHitEffMonTool::findAnglesToWaferSurface(const Amg::Vector3D &mom, const Ident
 }
 
 template <class T> StatusCode
-SCTHitEffMonTool::bookEffHisto(T * &histo, MonGroup &MG, TString name, TString title, Int_t nbin, Double_t x1,
+SCTHitEffMonTool::bookEffHisto(T*& histo, MonGroup& MG, TString name, TString title, Int_t nbin, Double_t x1,
                                Double_t x2) {
   histo = new T(name, title, nbin, x1, x2);
   CHECK(MG.regHist(histo));
-  VERBOSE("Registered " << name << " at " << histo);
+  ATH_MSG_VERBOSE("Registered " << name << " at " << histo);
   return StatusCode::SUCCESS;
 }
 
 template <class T> StatusCode
-SCTHitEffMonTool::bookEffHisto(T * &histo, MonGroup &MG, TString name, TString title,
+SCTHitEffMonTool::bookEffHisto(T*& histo, MonGroup& MG, TString name, TString title,
                                Int_t nbinx, Double_t x1, Double_t x2,
                                Int_t nbiny, Double_t y1, Double_t y2) {
   histo = new T(name, title, nbinx, x1, x2, nbiny, y1, y2);
   CHECK(MG.regHist(histo));
-  VERBOSE("Registered " << name << " at " << histo);
+  ATH_MSG_VERBOSE("Registered " << name << " at " << histo);
   return StatusCode::SUCCESS;
 }
 
 template <class T> StatusCode
-SCTHitEffMonTool::bookEffHisto(T * &histo, MonGroup &MG, TString name, TString title,
-                               Int_t nbinx, Double_t *xbins, Int_t nbiny, Double_t *ybins) {
+SCTHitEffMonTool::bookEffHisto(T*& histo, MonGroup& MG, TString name, TString title,
+                               Int_t nbinx, Double_t* xbins, Int_t nbiny, Double_t* ybins) {
   histo = new T(name, title, nbinx, xbins, nbiny, ybins);
   CHECK(MG.regHist(histo));
-  VERBOSE("Registered " << name << " at " << histo);
+  ATH_MSG_VERBOSE("Registered " << name << " at " << histo);
   return StatusCode::SUCCESS;
 }
 
 // Find the residual to track.
 Double_t
-SCTHitEffMonTool::getResidual(const Identifier &surfaceID, const Trk::TrackParameters *trkParam,
-                              const InDet::SCT_ClusterContainer *p_sctclcontainer) {
+SCTHitEffMonTool::getResidual(const Identifier& surfaceID, const Trk::TrackParameters* trkParam,
+                              const InDet::SCT_ClusterContainer* p_sctclcontainer) {
   Double_t trackHitResidual(-999.);
 
   if (not trkParam) {
-    WARNING("Not track parameters found. Returning default residual value.");
+    ATH_MSG_WARNING("Not track parameters found. Returning default residual value.");
     return trackHitResidual;
   }
   IdentifierHash idh(m_sctId->wafer_hash(surfaceID));
@@ -2083,16 +2067,15 @@ SCTHitEffMonTool::getResidual(const Identifier &surfaceID, const Trk::TrackParam
   for (; containerIterator != containerEnd; ++containerIterator) {
     for (InDet::SCT_ClusterCollection::const_iterator rioIterator((*containerIterator)->begin());
          rioIterator != (*containerIterator)->end(); ++rioIterator) {
-      if (not (*rioIterator)or not (*rioIterator)->detectorElement()) {
-        WARNING("NULL pointer to RIO or detElement");
+      if (not (*rioIterator) or not (*rioIterator)->detectorElement()) {
+        ATH_MSG_WARNING("nullptr to RIO or detElement");
         continue;
       }
       if (m_sctId->wafer_id(surfaceID) == m_sctId->wafer_id(((*rioIterator)->detectorElement())->identify())) {
-        const Trk::PrepRawData *rioo(dynamic_cast<const Trk::PrepRawData *>(*rioIterator));
-        const Trk::RIO_OnTrack *rio(m_rotcreator->correct(*rioo, *trkParam));
+        const Trk::PrepRawData* rioo(dynamic_cast<const Trk::PrepRawData *>(*rioIterator));
+        const Trk::RIO_OnTrack* rio(m_rotcreator->correct(*rioo, *trkParam));
         if (!m_residualPullCalculator.empty()) {
-          //          if(m_residualPullCalculator->residualPull(rio, trkParam,Trk::ResidualPull::Unbiased)==0)continue;
-          const Trk::ResidualPull *residualPull(m_residualPullCalculator->residualPull(rio, trkParam,
+          const Trk::ResidualPull* residualPull(m_residualPullCalculator->residualPull(rio, trkParam,
                                                                                        Trk::ResidualPull::Unbiased));
           if (residualPull == 0) {
             continue;
diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTHitsNoiseMonTool.cxx b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTHitsNoiseMonTool.cxx
index e18850fb3b3977cb3e0338278aa16addc0c3dc17..0fdd7ad6cc72407ac8dbf53ee6fda107f739ba93 100644
--- a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTHitsNoiseMonTool.cxx
+++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTHitsNoiseMonTool.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
 */
 
 /**    @file SCTHitsNoiseMonTool.cxx
@@ -11,54 +11,45 @@
  *    'The end of all of our exploring...' (Shaun, March 2008)
  */
 
-#include "SCT_NameFormatter.h"
-
-#include <sstream> // ?
-#include <iostream>
-#include <fstream> // for writing an xml summary (debugging)
-#include <algorithm>
-
-
-#include "GaudiKernel/IJobOptionsSvc.h"
 #include "SCT_Monitoring/SCTHitsNoiseMonTool.h"
-#include "SCT_Monitoring/SCT_ClusterStruct.h"
 
-#include "TMath.h"
-#include "TH1F.h"
-#include "TH2I.h"
-#include "TH2F.h"
-#include "TProfile.h"
-#include "TProfile2D.h"
-#include "LWHists/TH1F_LW.h"
-#include "LWHists/TH2F_LW.h"
-#include "LWHists/TH2I_LW.h"
-#include "LWHists/TProfile_LW.h"
-#include "LWHists/TProfile2D_LW.h"
+#include "cArrayUtilities.h"
+#include "SCT_NameFormatter.h"
 
+#include "AthContainers/DataVector.h"
 #include "InDetRawData/SCT3_RawData.h"
-#include "InDetRawData/SCT_TB03_RawData.h" // ?
 #include "InDetRawData/InDetRawDataContainer.h" // ?
 #include "InDetRawData/InDetRawDataCLASS_DEF.h" // ?
-#include "AthContainers/DataVector.h"
 #include "Identifier/Identifier.h"
 #include "InDetIdentifier/SCT_ID.h"
-
+#include "InDetPrepRawData/SCT_ClusterContainer.h"
+#include "InDetRIO_OnTrack/SiClusterOnTrack.h"
+#include "LWHists/TH1F_LW.h"
+#include "LWHists/TH2F_LW.h"
+#include "LWHists/TH2I_LW.h"
+#include "LWHists/TProfile_LW.h"
+#include "LWHists/TProfile2D_LW.h"
 #include "SCT_ConditionsTools/ISCT_ConfigurationConditionsTool.h"
-
-#include "PathResolver/PathResolver.h" // ?
-#include "InDetPrepRawData/SCT_ClusterContainer.h" // ?
+#include "StoreGate/ReadHandle.h"
+#include "TrkEventUtils/RoT_Extractor.h"
+#include "TrkRIO_OnTrack/RIO_OnTrack.h"
 #include "TrkSpacePoint/SpacePoint.h"
 #include "TrkSpacePoint/SpacePointCollection.h"
 #include "TrkSpacePoint/SpacePointOverlapCollection.h"
 #include "TrkSpacePoint/SpacePointCLASS_DEF.h"
 
-#include "TrkRIO_OnTrack/RIO_OnTrack.h"
-#include "TrkEventUtils/RoT_Extractor.h"
-#include "InDetRIO_OnTrack/TRT_DriftCircleOnTrack.h" // ?
-#include "InDetRIO_OnTrack/PixelClusterOnTrack.h" // ?
-#include "cArrayUtilities.h"
+#include "GaudiKernel/IJobOptionsSvc.h"
 
-#include "StoreGate/ReadHandle.h"
+#include "TMath.h"
+#include "TH1F.h"
+#include "TH2I.h"
+#include "TH2F.h"
+#include "TProfile.h"
+#include "TProfile2D.h"
+
+#include <iostream>
+#include <fstream> // for writing an xml summary (debugging)
+#include <algorithm>
 
 typedef Trk::SpacePoint SpacePoint;
 using namespace std;
@@ -70,7 +61,7 @@ namespace { // use anonymous namespace to restrict scope to this file, equivalen
   // is a variable in the specified range?
   template <typename T>
   bool
-  inRange(const T &variable, const T &lo, const T &hi) {
+  inRange(const T& variable, const T& lo, const T& hi) {
     return not ((variable < lo)or(variable > hi)); // assumes both less_than and greater_than exist for this type
   }
 
@@ -139,9 +130,9 @@ namespace { // use anonymous namespace to restrict scope to this file, equivalen
  *  numbers to be used, and the timebin.
  */
 // ====================================================================================================
-SCTHitsNoiseMonTool::SCTHitsNoiseMonTool(const std::string &type,
-                                         const std::string &name,
-                                         const IInterface *parent) :
+SCTHitsNoiseMonTool::SCTHitsNoiseMonTool(const std::string& type,
+                                         const std::string& name,
+                                         const IInterface* parent) :
   SCTMotherTrigMonTool(type, name, parent),
   m_nSP(nullptr),
   m_nSP_buf(nullptr),
@@ -298,12 +289,12 @@ SCTHitsNoiseMonTool::SCTHitsNoiseMonTool(const std::string &type,
   m_eventInfoKey(std::string("EventInfo")),
   m_clusContainerKey("SCT_Clusters") {
     /** sroe 3 Sept 2015:
-	histoPathBase is declared as a property in the base class, assigned to m_path
-	with default as empty string.
-	Declaring it here as well gives rise to compilation warning
-	WARNING duplicated property name 'histoPathBase', see https://its.cern.ch/jira/browse/GAUDI-1023
+        histoPathBase is declared as a property in the base class, assigned to m_path
+        with default as empty string.
+        Declaring it here as well gives rise to compilation warning
+        WARNING duplicated property name 'histoPathBase', see https://its.cern.ch/jira/browse/GAUDI-1023
 
-	declareProperty("histoPathBase", m_stream = "/stat"); **/
+        declareProperty("histoPathBase", m_stream = "/stat"); **/
     m_stream = "/stat";
     declareProperty("localSummary", m_localSummary = 0);
     declareProperty("doHitmapHistos", m_boolhitmaps = true);
@@ -634,11 +625,11 @@ SCTHitsNoiseMonTool::fillHistograms() {
         }
         m_hitoccTrigger_lb[m_current_lb] += (1E5) * m_hitoccSumUnbiasedTrigger_lb[*planeIterator] / m_eventsTrigger_lb;
         m_hitoccTriggerBAR_lb[m_current_lb] += (1E5) * m_hitoccSumUnbiasedTriggerBAR_lb[*planeIterator] /
-	  m_eventsTrigger_lb;
+          m_eventsTrigger_lb;
         m_hitoccTriggerECp_lb[m_current_lb] += (1E5) * m_hitoccSumUnbiasedTriggerECp_lb[*planeIterator] /
-	  m_eventsTrigger_lb;
+          m_eventsTrigger_lb;
         m_hitoccTriggerECm_lb[m_current_lb] += (1E5) * m_hitoccSumUnbiasedTriggerECm_lb[*planeIterator] /
-	  m_eventsTrigger_lb;
+          m_eventsTrigger_lb;
         if ((1E5) * m_hitoccSumUnbiasedTrigger_lb[*planeIterator] / m_eventsTrigger_lb > 100.) {
           m_noisyMWithHOTrigger100[m_current_lb]++;
         }
@@ -825,16 +816,16 @@ SCTHitsNoiseMonTool::generalHistsandNoise() {
   std::vector<int> ECp_local_nhitslayer(N_DISKSx2, 0);
   std::vector<int> ECm_local_nhitslayer(N_DISKSx2, 0);
   //
-  std::vector<H2_t> *hitHistogramVectors[3] = {
+  std::vector<H2_t>* hitHistogramVectors[3] = {
     &m_phitsHistoVectorECm, &m_phitsHistoVector, &m_phitsHistoVectorECp
   };
-  std::vector<H2_t> *hitHistogramVectorsRecent[3] = {
+  std::vector<H2_t>* hitHistogramVectorsRecent[3] = {
     &m_phitsHistoVectorRecentECm, &m_phitsHistoVectorRecent, &m_phitsHistoVectorRecentECp
   };
   H1_t hitPerLumiBlockHists[3] = {
     m_numHitsPerLumiBlockECm, m_numBarrelHitsPerLumiBlock, m_numHitsPerLumiBlockECp
   };
-  std::vector<int> *hitsInLayer[3] = {
+  std::vector<int>* hitsInLayer[3] = {
     &ECm_local_nhitslayer, &barrel_local_nhitslayer, &ECp_local_nhitslayer
   };
   const bool doThisSubsystem[3] = {
@@ -846,7 +837,7 @@ SCTHitsNoiseMonTool::generalHistsandNoise() {
   SpacePointContainer::const_iterator spContainerIteratorEnd = sctContainer->end();
   // Outer Loop on RDO Collection
   for (; col_it != lastCol; ++col_it) {
-    const InDetRawDataCollection<SCTRawDataType> *SCT_Collection(*col_it);
+    const InDetRawDataCollection<SCTRawDataType>* SCT_Collection(*col_it);
     if (!SCT_Collection) {
       continue;  // select only SCT RDOs
     }
@@ -871,11 +862,11 @@ SCTHitsNoiseMonTool::generalHistsandNoise() {
         DataVector<Trk::SpacePoint>::const_iterator nextSpacePoint = (*spContainerIterator)->begin();
         DataVector<Trk::SpacePoint>::const_iterator nextSpacePointEnd = (*spContainerIterator)->end();
         for (; nextSpacePoint != nextSpacePointEnd; ++nextSpacePoint) {
-          const Trk::SpacePoint &sp = **nextSpacePoint;
+          const Trk::SpacePoint& sp = **nextSpacePoint;
           // the following is nasty; the 'normal' sides (where the sp is defined) swap from layer to layer. To be safe,
           // we get both sides
-          const VecId_t &rdoList0 = sp.clusterList().first->rdoList();
-          const VecId_t &rdoList1 = sp.clusterList().second->rdoList();
+          const VecId_t& rdoList0 = sp.clusterList().first->rdoList();
+          const VecId_t& rdoList1 = sp.clusterList().second->rdoList();
           // copy to mySetOfSPIds. Use inserter(set, iterator_hint) for a set, or back_inserter(vec) for vector...
           copy(rdoList0.begin(), rdoList0.end(), inserter(mySetOfSPIds, mySetOfSPIds.end()));
           copy(rdoList1.begin(), rdoList1.end(), inserter(mySetOfSPIds, mySetOfSPIds.end()));
@@ -889,7 +880,7 @@ SCTHitsNoiseMonTool::generalHistsandNoise() {
     DataVector<SCTRawDataType>::const_iterator p_rdo = SCT_Collection->begin();
     DataVector<SCTRawDataType>::const_iterator end_rdo = SCT_Collection->end();
     for (; p_rdo != end_rdo; ++p_rdo) {
-      const SCT3_RawData *rdo3 = dynamic_cast<const SCT3_RawData *>(*p_rdo);
+      const SCT3_RawData* rdo3 = dynamic_cast<const SCT3_RawData*>(*p_rdo);
       int tbin;// = (*p_rdo)->getTimeBin();
       if (rdo3 != 0) {
         tbin = (rdo3)->getTimeBin();
@@ -1230,7 +1221,7 @@ SCTHitsNoiseMonTool::generalHistsandNoise() {
     }
   }
 
-  // if(m_environment!=AthenaMonManager::online){ // Uncomment this line to turn off cluster hists in online
+  // if (m_environment!=AthenaMonManager::online){ // Uncomment this line to turn off cluster hists in online
   // Fill Cluster size histogram
   SG::ReadHandle<InDet::SCT_ClusterContainer> p_clucontainer(m_clusContainerKey);
   if (not p_clucontainer.isValid()) {
@@ -1239,7 +1230,7 @@ SCTHitsNoiseMonTool::generalHistsandNoise() {
   InDet::SCT_ClusterContainer::const_iterator clucol_it = p_clucontainer->begin();
   InDet::SCT_ClusterContainer::const_iterator lastcluCol = p_clucontainer->end();
   for (; clucol_it != lastcluCol; ++clucol_it) {
-    const InDet::SCT_ClusterCollection *SCT_Collection(*clucol_it);
+    const InDet::SCT_ClusterCollection* SCT_Collection(*clucol_it);
     if (!SCT_Collection) {
       continue; // select only SCT RDOs
     }
@@ -1248,7 +1239,7 @@ SCTHitsNoiseMonTool::generalHistsandNoise() {
     DataVector<InDet::SCT_Cluster>::const_iterator clus_end = SCT_Collection->end();
     for (; p_clu != clus_end; ++p_clu) {
       Identifier cluId = (*p_clu)->identify();
-      const InDet::SCT_Cluster &cluster = **p_clu;
+      const InDet::SCT_Cluster& cluster = **p_clu;
       int GroupSize = cluster.rdoList().size();
       // Fill  Cluster Size histogram
       int elementIndex = 2 * m_pSCTHelper->layer_disk(cluId) + m_pSCTHelper->side(cluId);
@@ -1394,13 +1385,13 @@ SCTHitsNoiseMonTool::bookGeneralHits(const unsigned int systemIndex) {
     }
   }
   if (newRunFlag()) {
-    VecH2_t *hitsArray[] = {
+    VecH2_t* hitsArray[] = {
       &m_phitsHistoVectorECm, &m_phitsHistoVector, &m_phitsHistoVectorECp
     };
-    VecH2_t *hitsArrayRecent[] = {
+    VecH2_t* hitsArrayRecent[] = {
       &m_phitsHistoVectorRecentECm, &m_phitsHistoVectorRecent, &m_phitsHistoVectorRecentECp
     };
-    VecH1_t *nClustersArray[] = {
+    VecH1_t* nClustersArray[] = {
       &m_ncluHistoVectorECm, &m_ncluHistoVector, &m_ncluHistoVectorECp
     };
     (hitsArray[systemIndex])->clear();
@@ -1414,7 +1405,7 @@ SCTHitsNoiseMonTool::bookGeneralHits(const unsigned int systemIndex) {
       string streamhits = "hits" + abbreviations[systemIndex] + "_" + layerSide.name();
       std::string histotitle = "SCT Hitmap for " + names[systemIndex] + ": " + layerSide.title();
       std::string histotitlerecent = "SCT Hitmap from recent events for " + names[systemIndex] + ": " +
-	layerSide.title();
+        layerSide.title();
       h2Factory(streamhitmap, histotitle, bec, hitHists, *(hitsArray[systemIndex]));
       if (m_environment == AthenaMonManager::online) {
         h2Factory(streamhitmaprecent, histotitlerecent, bec, hitHists, *(hitsArrayRecent[systemIndex]));
@@ -1498,10 +1489,10 @@ SCTHitsNoiseMonTool::bookClusterSize() {
 StatusCode
 SCTHitsNoiseMonTool::bookGeneralCluSize(const unsigned int systemIndex) {
   const SCT_Monitoring::Bec bec(index2Bec(systemIndex));
-  VecH1_t *clusterSizeArray[] = {
+  VecH1_t* clusterSizeArray[] = {
     &m_clusizeHistoVectorECm, &m_clusizeHistoVector, &m_clusizeHistoVectorECp
   };
-  VecH1_t *clusterSizeArrayRecent[] = {
+  VecH1_t* clusterSizeArrayRecent[] = {
     &m_clusizeHistoVectorRecentECm, &m_clusizeHistoVectorRecent, &m_clusizeHistoVectorRecentECp
   };
 
@@ -1519,8 +1510,8 @@ SCTHitsNoiseMonTool::bookGeneralCluSize(const unsigned int systemIndex) {
     ATH_MSG_FATAL("Invalid subsystem index, should be 0-2, was " << systemIndex);
     return StatusCode::FAILURE;
   }
-  VecH1_t &clusterSizeVector = *(clusterSizeArray[systemIndex]);
-  VecH1_t &clusterSizeVectorRecent = *(clusterSizeArrayRecent[systemIndex]);
+  VecH1_t& clusterSizeVector = *(clusterSizeArray[systemIndex]);
+  VecH1_t& clusterSizeVectorRecent = *(clusterSizeArrayRecent[systemIndex]);
   if (newRunFlag()) {
     clusterSizeVector.clear();
     clusterSizeVectorRecent.clear();
@@ -1536,7 +1527,7 @@ SCTHitsNoiseMonTool::bookGeneralCluSize(const unsigned int systemIndex) {
       if (m_environment == AthenaMonManager::online) {
         const string streamclusizerecent = "clusize_recent" + abbreviations[systemIndex] + "_" + layerSide.name();
         std::string histotitlerecent = "SCT " + names[systemIndex] + " Cluster size from recent events: " +
-	  layerSide.title();
+          layerSide.title();
         h1Factory(streamclusizerecent, histotitlerecent, clusterSize, clusterSizeVectorRecent, 0., 200., 200);
         // clusterSizeVectorRecent[systemIndex]->GetXaxis()->SetTitle("Cluster Size");
         // clusterSizeVectorRecent[systemIndex]->GetYaxis()->SetTitle("Num of Events");
@@ -1561,14 +1552,14 @@ SCTHitsNoiseMonTool::bookGeneralNoiseOccupancyMaps(const unsigned int systemInde
     const unsigned int limits[] = {
       N_DISKSx2, N_BARRELSx2, N_DISKSx2
     };
-    VecProf2_t *storageVectors[] = {
+    VecProf2_t* storageVectors[] = {
       &m_pnoiseoccupancymapHistoVectorECm, &m_pnoiseoccupancymapHistoVector, &m_pnoiseoccupancymapHistoVectorECp
     };
-    VecProf2_t *storageVectorsTrigger[] = {
+    VecProf2_t* storageVectorsTrigger[] = {
       &m_pnoiseoccupancymapHistoVectorECmTrigger, &m_pnoiseoccupancymapHistoVectorTrigger,
       &m_pnoiseoccupancymapHistoVectorECpTrigger
     };
-    VecProf2_t *storageVectorsRecent[] = {
+    VecProf2_t* storageVectorsRecent[] = {
       &m_pnoiseoccupancymapHistoVectorECmRecent, &m_pnoiseoccupancymapHistoVectorRecent,
       &m_pnoiseoccupancymapHistoVectorECpRecent
     };
@@ -1582,13 +1573,13 @@ SCTHitsNoiseMonTool::bookGeneralNoiseOccupancyMaps(const unsigned int systemInde
       LayerSideFormatter layerSide(i, systemIndex);
       const string streamhitmap = "noiseoccupancymap" + abbreviations[systemIndex] + "_" + layerSide.name();
       const string streamhitmaptrigger = "noiseoccupancymaptrigger" + abbreviations[systemIndex] + "_" +
-	layerSide.name();
+        layerSide.name();
       const string streamhitmaprecent = "noiseoccupancymaprecent" + abbreviations[systemIndex] + "_" + layerSide.name();
       std::string histotitle = "SCT Noise Occupancy map for " + names[systemIndex] + ": " + layerSide.title();
       std::string histotitletrigger = "SCT Noise Occupancy map for " + m_NOTrigger + " Trigger and " +
-	names[systemIndex] + ": " + layerSide.title();
+        names[systemIndex] + ": " + layerSide.title();
       std::string histotitlerecent = "SCT Noise Occupancy map in recent events for " + names[systemIndex] + ": " +
-	layerSide.title();
+        layerSide.title();
       prof2Factory(streamhitmap, histotitle, bec, noiseOccMaps, *(storageVectors[systemIndex]));
       prof2Factory(streamhitmaptrigger, histotitletrigger, bec, noiseOccMaps, *(storageVectorsTrigger[systemIndex]));
       if (m_environment == AthenaMonManager::online) {
@@ -1751,14 +1742,14 @@ SCTHitsNoiseMonTool::bookGeneralHitOccupancyMaps(const unsigned int systemIndex)
     const unsigned int limits[] = {
       N_DISKSx2, N_BARRELSx2, N_DISKSx2
     };
-    VecProf2_t *storageVectorsHO[] = {
+    VecProf2_t* storageVectorsHO[] = {
       &m_phitoccupancymapHistoVectorECm, &m_phitoccupancymapHistoVector, &m_phitoccupancymapHistoVectorECp
     };
-    VecProf2_t *storageVectorsTriggerHO[] = {
+    VecProf2_t* storageVectorsTriggerHO[] = {
       &m_phitoccupancymapHistoVectorECmTrigger, &m_phitoccupancymapHistoVectorTrigger,
       &m_phitoccupancymapHistoVectorECpTrigger
     };
-    VecProf2_t *storageVectorsRecentHO[] = {
+    VecProf2_t* storageVectorsRecentHO[] = {
       &m_phitoccupancymapHistoVectorECmRecent, &m_phitoccupancymapHistoVectorRecent,
       &m_phitoccupancymapHistoVectorECpRecent
     };
@@ -1774,13 +1765,13 @@ SCTHitsNoiseMonTool::bookGeneralHitOccupancyMaps(const unsigned int systemIndex)
       LayerSideFormatter layerSide(i, systemIndex);
       const string streamhitmapR = "hitoccupancymap" + abbreviations[systemIndex] + "_" + layerSide.name();
       const string streamhitmaptriggerR = "hitoccupancymaptrigger" + abbreviations[systemIndex] + "_" +
-	layerSide.name();
+        layerSide.name();
       const string streamhitmaprecentR = "hitoccupancymaprecent" + abbreviations[systemIndex] + "_" + layerSide.name();
       std::string histotitleR = "SCT Hit Occupancy map for " + names[systemIndex] + ": " + layerSide.title();
       std::string histotitletriggerR = "SCT Hit Occupancy map for " + m_NOTrigger + " Trigger and " +
-	names[systemIndex] + ": " + layerSide.title();
+        names[systemIndex] + ": " + layerSide.title();
       std::string histotitlerecentR = "SCT Hit Occupancy map in recent events for " + names[systemIndex] + ": " +
-	layerSide.title();
+        layerSide.title();
       prof2Factory(streamhitmapR, histotitleR, bec, hitOccMaps, *(storageVectorsHO[systemIndex]));
       prof2Factory(streamhitmaptriggerR, histotitletriggerR, bec, hitOccMaps, *(storageVectorsTriggerHO[systemIndex]));
       if (m_environment == AthenaMonManager::online) {
@@ -2099,141 +2090,141 @@ SCTHitsNoiseMonTool::checkNoiseMaps(bool final) {
         }
       }
 
-      if(m_current_lb<=SCT_Monitoring::NBINS_LBs) {
-	m_noisyM100[m_current_lb] = 0;
-	m_noisyM1000[m_current_lb] = 0;
-	m_noisyM10000[m_current_lb] = 0;
-	m_occ_lb[m_current_lb] = 0;
-	m_occBAR_lb[m_current_lb] = 0;
-	m_occECp_lb[m_current_lb] = 0;
-	m_occECm_lb[m_current_lb] = 0;
-	m_noisyMTrigger100[m_current_lb] = 0;
-	m_noisyMTrigger1000[m_current_lb] = 0;
-	m_noisyMTrigger10000[m_current_lb] = 0;
-	m_occTrigger_lb[m_current_lb] = 0;
-	m_occTriggerBAR_lb[m_current_lb] = 0;
-	m_occTriggerECp_lb[m_current_lb] = 0;
-	m_occTriggerECm_lb[m_current_lb] = 0;
-	m_noisyMWithHO100[m_current_lb] = 0;
-	m_noisyMWithHO1000[m_current_lb] = 0;
-	m_noisyMWithHO10000[m_current_lb] = 0;
-	m_hitocc_lb[m_current_lb] = 0;
-	m_hitoccBAR_lb[m_current_lb] = 0;
-	m_hitoccECp_lb[m_current_lb] = 0;
-	m_hitoccECm_lb[m_current_lb] = 0;
-	m_noisyMWithHOTrigger100[m_current_lb] = 0;
-	m_noisyMWithHOTrigger1000[m_current_lb] = 0;
-	m_noisyMWithHOTrigger10000[m_current_lb] = 0;
-	m_hitoccTrigger_lb[m_current_lb] = 0;
-	m_hitoccTriggerBAR_lb[m_current_lb] = 0;
-	m_hitoccTriggerECp_lb[m_current_lb] = 0;
-	m_hitoccTriggerECm_lb[m_current_lb] = 0;
-
-	int nlinks = 0;
-	int nlinksBAR = 0;
-	int nlinksECp = 0;
-	int nlinksECm = 0;
-	SCT_ID::const_id_iterator planeIterator(m_pSCTHelper->wafer_begin());
-	SCT_ID::const_id_iterator planeEnd = m_pSCTHelper->wafer_end();
-	for (; planeIterator not_eq planeEnd; ++planeIterator) {
-	  Identifier planeId(*planeIterator);
-	  const int bec(m_pSCTHelper->barrel_ec(planeId));
-	  // Don't initialize a value for disabled  modules
-	  if (!m_ConfigurationTool->isGood(*planeIterator, InDetConditions::SCT_SIDE)) {
-	    continue;
-	  }
-	  if (m_events_lb > 0) {
-	    m_occ_lb[m_current_lb] += (1E5) * m_occSumUnbiased_lb[*planeIterator] / m_events_lb;
-	    m_occBAR_lb[m_current_lb] += (1E5) * m_occSumUnbiasedBAR_lb[*planeIterator] / m_events_lb;
-	    m_occECp_lb[m_current_lb] += (1E5) * m_occSumUnbiasedECp_lb[*planeIterator] / m_events_lb;
-	    m_occECm_lb[m_current_lb] += (1E5) * m_occSumUnbiasedECm_lb[*planeIterator] / m_events_lb;
-	    if ((1E5) * m_occSumUnbiased_lb[*planeIterator] / m_events_lb > 100.) {
-	      m_noisyM100[m_current_lb]++;
-	    }
-	    if ((1E5) * m_occSumUnbiased_lb[*planeIterator] / m_events_lb > 1000.) {
-	      m_noisyM1000[m_current_lb]++;
-	    }
-	    if ((1E5) * m_occSumUnbiased_lb[*planeIterator] / m_events_lb > 10000.) {
-	      m_noisyM10000[m_current_lb]++;
-	    }
-	    m_hitocc_lb[m_current_lb] += (1E5) * m_hitoccSumUnbiased_lb[*planeIterator] / m_events_lb;
-	    m_hitoccBAR_lb[m_current_lb] += (1E5) * m_hitoccSumUnbiasedBAR_lb[*planeIterator] / m_events_lb;
-	    m_hitoccECp_lb[m_current_lb] += (1E5) * m_hitoccSumUnbiasedECp_lb[*planeIterator] / m_events_lb;
-	    m_hitoccECm_lb[m_current_lb] += (1E5) * m_hitoccSumUnbiasedECm_lb[*planeIterator] / m_events_lb;
-	    if ((1E5) * m_hitoccSumUnbiased_lb[*planeIterator] / m_events_lb > 100.) {
-	      m_noisyMWithHO100[m_current_lb]++;
-	    }
-	    if ((1E5) * m_hitoccSumUnbiased_lb[*planeIterator] / m_events_lb > 1000.) {
-	      m_noisyMWithHO1000[m_current_lb]++;
-	    }
-	    if ((1E5) * m_hitoccSumUnbiased_lb[*planeIterator] / m_events_lb > 10000.) {
-	      m_noisyMWithHO10000[m_current_lb]++;
-	    }
-	  }
-	  if (m_eventsTrigger_lb > 0) {
-	    m_occTrigger_lb[m_current_lb] += (1E5) * m_occSumUnbiasedTrigger_lb[*planeIterator] / m_eventsTrigger_lb;
-	    m_occTriggerBAR_lb[m_current_lb] += (1E5) * m_occSumUnbiasedTriggerBAR_lb[*planeIterator] /
-	      m_eventsTrigger_lb;
-	    m_occTriggerECp_lb[m_current_lb] += (1E5) * m_occSumUnbiasedTriggerECp_lb[*planeIterator] /
-	      m_eventsTrigger_lb;
-	    m_occTriggerECm_lb[m_current_lb] += (1E5) * m_occSumUnbiasedTriggerECm_lb[*planeIterator] /
-	      m_eventsTrigger_lb;
-	    if ((1E5) * m_occSumUnbiasedTrigger_lb[*planeIterator] / m_eventsTrigger_lb > 100.) {
-	      m_noisyMTrigger100[m_current_lb]++;
-	    }
-	    if ((1E5) * m_occSumUnbiasedTrigger_lb[*planeIterator] / m_eventsTrigger_lb > 1000.) {
-	      m_noisyMTrigger1000[m_current_lb]++;
-	    }
-	    if ((1E5) * m_occSumUnbiasedTrigger_lb[*planeIterator] / m_eventsTrigger_lb > 10000.) {
-	      m_noisyMTrigger10000[m_current_lb]++;
-	    }
-	    m_hitoccTrigger_lb[m_current_lb] += (1E5) * m_hitoccSumUnbiasedTrigger_lb[*planeIterator] /
-	      m_eventsTrigger_lb;
-	    m_hitoccTriggerBAR_lb[m_current_lb] += (1E5) * m_hitoccSumUnbiasedTriggerBAR_lb[*planeIterator] /
-	      m_eventsTrigger_lb;
-	    m_hitoccTriggerECp_lb[m_current_lb] += (1E5) * m_hitoccSumUnbiasedTriggerECp_lb[*planeIterator] /
-	      m_eventsTrigger_lb;
-	    m_hitoccTriggerECm_lb[m_current_lb] += (1E5) * m_hitoccSumUnbiasedTriggerECm_lb[*planeIterator] /
-	      m_eventsTrigger_lb;
-	    if ((1E5) * m_hitoccSumUnbiasedTrigger_lb[*planeIterator] / m_eventsTrigger_lb > 100.) {
-	      m_noisyMWithHOTrigger100[m_current_lb]++;
-	    }
-	    if ((1E5) * m_hitoccSumUnbiasedTrigger_lb[*planeIterator] / m_eventsTrigger_lb > 1000.) {
-	      m_noisyMWithHOTrigger1000[m_current_lb]++;
-	    }
-	    if ((1E5) * m_hitoccSumUnbiasedTrigger_lb[*planeIterator] / m_eventsTrigger_lb > 10000.) {
-	      m_noisyMWithHOTrigger10000[m_current_lb]++;
-	    }
-	  }
-	  if (bec == BARREL)  nlinksBAR++; 
-	  if (bec == ENDCAP_A)nlinksECp++;
-	  if (bec == ENDCAP_C)nlinksECm++;
-	  nlinks++;
-	}
-	if (nlinks >0){
-	  m_occ_lb[m_current_lb] /= nlinks;
-	  m_occTrigger_lb[m_current_lb] /= nlinks;
-	  m_hitocc_lb[m_current_lb] /= nlinks;
-	  m_hitoccTrigger_lb[m_current_lb] /= nlinks;
-	}
-	if (nlinksBAR >0){
-	  m_occBAR_lb[m_current_lb] /= nlinksBAR;
-	  m_occTriggerBAR_lb[m_current_lb] /= nlinksBAR;
-	  m_hitoccBAR_lb[m_current_lb] /= nlinksBAR;
-	  m_hitoccTriggerBAR_lb[m_current_lb] /= nlinksBAR;
-	}
-	if (nlinksECp >0){
-	  m_occECp_lb[m_current_lb] /= nlinksECp;
-	  m_occTriggerECp_lb[m_current_lb] /= nlinksECp;
-	  m_hitoccECp_lb[m_current_lb] /= nlinksECp;
-	  m_hitoccTriggerECp_lb[m_current_lb] /= nlinksECp;
-	}
-	if (nlinksECm >0){
-	  m_occECm_lb[m_current_lb] /= nlinksECm;
-	  m_occTriggerECm_lb[m_current_lb] /= nlinksECm;
-	  m_hitoccECm_lb[m_current_lb] /= nlinksECm;
-	  m_hitoccTriggerECm_lb[m_current_lb] /= nlinksECm;
-	}
+      if (m_current_lb<=SCT_Monitoring::NBINS_LBs) {
+        m_noisyM100[m_current_lb] = 0;
+        m_noisyM1000[m_current_lb] = 0;
+        m_noisyM10000[m_current_lb] = 0;
+        m_occ_lb[m_current_lb] = 0;
+        m_occBAR_lb[m_current_lb] = 0;
+        m_occECp_lb[m_current_lb] = 0;
+        m_occECm_lb[m_current_lb] = 0;
+        m_noisyMTrigger100[m_current_lb] = 0;
+        m_noisyMTrigger1000[m_current_lb] = 0;
+        m_noisyMTrigger10000[m_current_lb] = 0;
+        m_occTrigger_lb[m_current_lb] = 0;
+        m_occTriggerBAR_lb[m_current_lb] = 0;
+        m_occTriggerECp_lb[m_current_lb] = 0;
+        m_occTriggerECm_lb[m_current_lb] = 0;
+        m_noisyMWithHO100[m_current_lb] = 0;
+        m_noisyMWithHO1000[m_current_lb] = 0;
+        m_noisyMWithHO10000[m_current_lb] = 0;
+        m_hitocc_lb[m_current_lb] = 0;
+        m_hitoccBAR_lb[m_current_lb] = 0;
+        m_hitoccECp_lb[m_current_lb] = 0;
+        m_hitoccECm_lb[m_current_lb] = 0;
+        m_noisyMWithHOTrigger100[m_current_lb] = 0;
+        m_noisyMWithHOTrigger1000[m_current_lb] = 0;
+        m_noisyMWithHOTrigger10000[m_current_lb] = 0;
+        m_hitoccTrigger_lb[m_current_lb] = 0;
+        m_hitoccTriggerBAR_lb[m_current_lb] = 0;
+        m_hitoccTriggerECp_lb[m_current_lb] = 0;
+        m_hitoccTriggerECm_lb[m_current_lb] = 0;
+
+        int nlinks = 0;
+        int nlinksBAR = 0;
+        int nlinksECp = 0;
+        int nlinksECm = 0;
+        SCT_ID::const_id_iterator planeIterator(m_pSCTHelper->wafer_begin());
+        SCT_ID::const_id_iterator planeEnd = m_pSCTHelper->wafer_end();
+        for (; planeIterator not_eq planeEnd; ++planeIterator) {
+          Identifier planeId(*planeIterator);
+          const int bec(m_pSCTHelper->barrel_ec(planeId));
+          // Don't initialize a value for disabled  modules
+          if (!m_ConfigurationTool->isGood(*planeIterator, InDetConditions::SCT_SIDE)) {
+            continue;
+          }
+          if (m_events_lb > 0) {
+            m_occ_lb[m_current_lb] += (1E5) * m_occSumUnbiased_lb[*planeIterator] / m_events_lb;
+            m_occBAR_lb[m_current_lb] += (1E5) * m_occSumUnbiasedBAR_lb[*planeIterator] / m_events_lb;
+            m_occECp_lb[m_current_lb] += (1E5) * m_occSumUnbiasedECp_lb[*planeIterator] / m_events_lb;
+            m_occECm_lb[m_current_lb] += (1E5) * m_occSumUnbiasedECm_lb[*planeIterator] / m_events_lb;
+            if ((1E5) * m_occSumUnbiased_lb[*planeIterator] / m_events_lb > 100.) {
+              m_noisyM100[m_current_lb]++;
+            }
+            if ((1E5) * m_occSumUnbiased_lb[*planeIterator] / m_events_lb > 1000.) {
+              m_noisyM1000[m_current_lb]++;
+            }
+            if ((1E5) * m_occSumUnbiased_lb[*planeIterator] / m_events_lb > 10000.) {
+              m_noisyM10000[m_current_lb]++;
+            }
+            m_hitocc_lb[m_current_lb] += (1E5) * m_hitoccSumUnbiased_lb[*planeIterator] / m_events_lb;
+            m_hitoccBAR_lb[m_current_lb] += (1E5) * m_hitoccSumUnbiasedBAR_lb[*planeIterator] / m_events_lb;
+            m_hitoccECp_lb[m_current_lb] += (1E5) * m_hitoccSumUnbiasedECp_lb[*planeIterator] / m_events_lb;
+            m_hitoccECm_lb[m_current_lb] += (1E5) * m_hitoccSumUnbiasedECm_lb[*planeIterator] / m_events_lb;
+            if ((1E5) * m_hitoccSumUnbiased_lb[*planeIterator] / m_events_lb > 100.) {
+              m_noisyMWithHO100[m_current_lb]++;
+            }
+            if ((1E5) * m_hitoccSumUnbiased_lb[*planeIterator] / m_events_lb > 1000.) {
+              m_noisyMWithHO1000[m_current_lb]++;
+            }
+            if ((1E5) * m_hitoccSumUnbiased_lb[*planeIterator] / m_events_lb > 10000.) {
+              m_noisyMWithHO10000[m_current_lb]++;
+            }
+          }
+          if (m_eventsTrigger_lb > 0) {
+            m_occTrigger_lb[m_current_lb] += (1E5) * m_occSumUnbiasedTrigger_lb[*planeIterator] / m_eventsTrigger_lb;
+            m_occTriggerBAR_lb[m_current_lb] += (1E5) * m_occSumUnbiasedTriggerBAR_lb[*planeIterator] /
+              m_eventsTrigger_lb;
+            m_occTriggerECp_lb[m_current_lb] += (1E5) * m_occSumUnbiasedTriggerECp_lb[*planeIterator] /
+              m_eventsTrigger_lb;
+            m_occTriggerECm_lb[m_current_lb] += (1E5) * m_occSumUnbiasedTriggerECm_lb[*planeIterator] /
+              m_eventsTrigger_lb;
+            if ((1E5) * m_occSumUnbiasedTrigger_lb[*planeIterator] / m_eventsTrigger_lb > 100.) {
+              m_noisyMTrigger100[m_current_lb]++;
+            }
+            if ((1E5) * m_occSumUnbiasedTrigger_lb[*planeIterator] / m_eventsTrigger_lb > 1000.) {
+              m_noisyMTrigger1000[m_current_lb]++;
+            }
+            if ((1E5) * m_occSumUnbiasedTrigger_lb[*planeIterator] / m_eventsTrigger_lb > 10000.) {
+              m_noisyMTrigger10000[m_current_lb]++;
+            }
+            m_hitoccTrigger_lb[m_current_lb] += (1E5) * m_hitoccSumUnbiasedTrigger_lb[*planeIterator] /
+              m_eventsTrigger_lb;
+            m_hitoccTriggerBAR_lb[m_current_lb] += (1E5) * m_hitoccSumUnbiasedTriggerBAR_lb[*planeIterator] /
+              m_eventsTrigger_lb;
+            m_hitoccTriggerECp_lb[m_current_lb] += (1E5) * m_hitoccSumUnbiasedTriggerECp_lb[*planeIterator] /
+              m_eventsTrigger_lb;
+            m_hitoccTriggerECm_lb[m_current_lb] += (1E5) * m_hitoccSumUnbiasedTriggerECm_lb[*planeIterator] /
+              m_eventsTrigger_lb;
+            if ((1E5) * m_hitoccSumUnbiasedTrigger_lb[*planeIterator] / m_eventsTrigger_lb > 100.) {
+              m_noisyMWithHOTrigger100[m_current_lb]++;
+            }
+            if ((1E5) * m_hitoccSumUnbiasedTrigger_lb[*planeIterator] / m_eventsTrigger_lb > 1000.) {
+              m_noisyMWithHOTrigger1000[m_current_lb]++;
+            }
+            if ((1E5) * m_hitoccSumUnbiasedTrigger_lb[*planeIterator] / m_eventsTrigger_lb > 10000.) {
+              m_noisyMWithHOTrigger10000[m_current_lb]++;
+            }
+          }
+          if (bec == BARREL)  nlinksBAR++; 
+          if (bec == ENDCAP_A)nlinksECp++;
+          if (bec == ENDCAP_C)nlinksECm++;
+          nlinks++;
+        }
+        if (nlinks >0){
+          m_occ_lb[m_current_lb] /= nlinks;
+          m_occTrigger_lb[m_current_lb] /= nlinks;
+          m_hitocc_lb[m_current_lb] /= nlinks;
+          m_hitoccTrigger_lb[m_current_lb] /= nlinks;
+        }
+        if (nlinksBAR >0){
+          m_occBAR_lb[m_current_lb] /= nlinksBAR;
+          m_occTriggerBAR_lb[m_current_lb] /= nlinksBAR;
+          m_hitoccBAR_lb[m_current_lb] /= nlinksBAR;
+          m_hitoccTriggerBAR_lb[m_current_lb] /= nlinksBAR;
+        }
+        if (nlinksECp >0){
+          m_occECp_lb[m_current_lb] /= nlinksECp;
+          m_occTriggerECp_lb[m_current_lb] /= nlinksECp;
+          m_hitoccECp_lb[m_current_lb] /= nlinksECp;
+          m_hitoccTriggerECp_lb[m_current_lb] /= nlinksECp;
+        }
+        if (nlinksECm >0){
+          m_occECm_lb[m_current_lb] /= nlinksECm;
+          m_occTriggerECm_lb[m_current_lb] /= nlinksECm;
+          m_hitoccECm_lb[m_current_lb] /= nlinksECm;
+          m_hitoccTriggerECm_lb[m_current_lb] /= nlinksECm;
+        }
       }
 
       m_BARNO_vsLB->Reset();
@@ -2266,92 +2257,92 @@ SCTHitsNoiseMonTool::checkNoiseMaps(bool final) {
       m_NoisyModulesWithHOTrigger10000_vsLB->Reset();
       //
       for (int bin = 1; bin <= SCT_Monitoring::NBINS_LBs; bin++) {
-	if (m_occBAR_lb[bin] != 0) {
-	  m_BARNO_vsLB->Fill(bin, m_occBAR_lb[bin]);
-	}
-	if (m_occECm_lb[bin] != 0) {
-	  m_ECmNO_vsLB->Fill(bin, m_occECm_lb[bin]);
-	}
-	if (m_occECp_lb[bin] != 0) {
-	  m_ECpNO_vsLB->Fill(bin, m_occECp_lb[bin]);
-	}
-	if (m_occ_lb[bin] != 0) {
-	  m_SCTNO_vsLB->Fill(bin, m_occ_lb[bin]);
-	}
-	if (m_noisyM100[bin] != 0) {
-	  m_NoisyModules100_vsLB->Fill(bin, m_noisyM100[bin]);
-	}
-	if (m_noisyM1000[bin] != 0) {
-	  m_NoisyModules1000_vsLB->Fill(bin, m_noisyM1000[bin]);
-	}
-	if (m_noisyM10000[bin] != 0) {
-	  m_NoisyModules10000_vsLB->Fill(bin, m_noisyM10000[bin]);
-	}
-	if (m_occTriggerBAR_lb[bin] != 0) {
-	  m_BARNOTrigger_vsLB->Fill(bin, m_occTriggerBAR_lb[bin]);
-	}
-	if (m_occTriggerECm_lb[bin] != 0) {
-	  m_ECmNOTrigger_vsLB->Fill(bin, m_occTriggerECm_lb[bin]);
-	}
-	if (m_occTriggerECp_lb[bin] != 0) {
-	  m_ECpNOTrigger_vsLB->Fill(bin, m_occTriggerECp_lb[bin]);
-	}
-	if (m_occTrigger_lb[bin] != 0) {
-	  m_SCTNOTrigger_vsLB->Fill(bin, m_occTrigger_lb[bin]);
-	}
-	if (m_noisyMTrigger100[bin] != 0) {
-	  m_NoisyModulesTrigger100_vsLB->Fill(bin, m_noisyMTrigger100[bin]);
-	}
-	if (m_noisyMTrigger1000[bin] != 0) {
-	  m_NoisyModulesTrigger1000_vsLB->Fill(bin, m_noisyMTrigger1000[bin]);
-	}
-	if (m_noisyMTrigger10000[bin] != 0) {
-	  m_NoisyModulesTrigger10000_vsLB->Fill(bin, m_noisyMTrigger10000[bin]);
-	}
+        if (m_occBAR_lb[bin] != 0) {
+          m_BARNO_vsLB->Fill(bin, m_occBAR_lb[bin]);
+        }
+        if (m_occECm_lb[bin] != 0) {
+          m_ECmNO_vsLB->Fill(bin, m_occECm_lb[bin]);
+        }
+        if (m_occECp_lb[bin] != 0) {
+          m_ECpNO_vsLB->Fill(bin, m_occECp_lb[bin]);
+        }
+        if (m_occ_lb[bin] != 0) {
+          m_SCTNO_vsLB->Fill(bin, m_occ_lb[bin]);
+        }
+        if (m_noisyM100[bin] != 0) {
+          m_NoisyModules100_vsLB->Fill(bin, m_noisyM100[bin]);
+        }
+        if (m_noisyM1000[bin] != 0) {
+          m_NoisyModules1000_vsLB->Fill(bin, m_noisyM1000[bin]);
+        }
+        if (m_noisyM10000[bin] != 0) {
+          m_NoisyModules10000_vsLB->Fill(bin, m_noisyM10000[bin]);
+        }
+        if (m_occTriggerBAR_lb[bin] != 0) {
+          m_BARNOTrigger_vsLB->Fill(bin, m_occTriggerBAR_lb[bin]);
+        }
+        if (m_occTriggerECm_lb[bin] != 0) {
+          m_ECmNOTrigger_vsLB->Fill(bin, m_occTriggerECm_lb[bin]);
+        }
+        if (m_occTriggerECp_lb[bin] != 0) {
+          m_ECpNOTrigger_vsLB->Fill(bin, m_occTriggerECp_lb[bin]);
+        }
+        if (m_occTrigger_lb[bin] != 0) {
+          m_SCTNOTrigger_vsLB->Fill(bin, m_occTrigger_lb[bin]);
+        }
+        if (m_noisyMTrigger100[bin] != 0) {
+          m_NoisyModulesTrigger100_vsLB->Fill(bin, m_noisyMTrigger100[bin]);
+        }
+        if (m_noisyMTrigger1000[bin] != 0) {
+          m_NoisyModulesTrigger1000_vsLB->Fill(bin, m_noisyMTrigger1000[bin]);
+        }
+        if (m_noisyMTrigger10000[bin] != 0) {
+          m_NoisyModulesTrigger10000_vsLB->Fill(bin, m_noisyMTrigger10000[bin]);
+        }
       }
       for (int bin = 1; bin <= SCT_Monitoring::NBINS_LBs; bin++) {
-	if (m_hitoccBAR_lb[bin] != 0) {
-	  m_BARHO_vsLB->Fill(bin, m_hitoccBAR_lb[bin]);
-	}
-	if (m_hitoccECm_lb[bin] != 0) {
-	  m_ECmHO_vsLB->Fill(bin, m_hitoccECm_lb[bin]);
-	}
-	if (m_hitoccECp_lb[bin] != 0) {
-	  m_ECpHO_vsLB->Fill(bin, m_hitoccECp_lb[bin]);
-	}
-	if (m_hitocc_lb[bin] != 0) {
-	  m_SCTHO_vsLB->Fill(bin, m_hitocc_lb[bin]);
-	}
-	if (m_noisyMWithHO100[bin] != 0) {
-	  m_NoisyModulesWithHO100_vsLB->Fill(bin, m_noisyMWithHO100[bin]);
-	}
-	if (m_noisyMWithHO1000[bin] != 0) {
-	  m_NoisyModulesWithHO1000_vsLB->Fill(bin, m_noisyMWithHO1000[bin]);
-	}
-	if (m_noisyMWithHO10000[bin] != 0) {
-	  m_NoisyModulesWithHO10000_vsLB->Fill(bin, m_noisyMWithHO10000[bin]);
-	}
-	if (m_hitoccTriggerBAR_lb[bin] != 0) {
-	  m_BARHOTrigger_vsLB->Fill(bin, m_hitoccTriggerBAR_lb[bin]);
-	}
-	if (m_hitoccTriggerECm_lb[bin] != 0) {
-	  m_ECmHOTrigger_vsLB->Fill(bin, m_hitoccTriggerECm_lb[bin]);
-	}
-	if (m_hitoccTriggerECp_lb[bin] != 0) {
-	  m_ECpHOTrigger_vsLB->Fill(bin, m_hitoccTriggerECp_lb[bin]);
-	}
-	if (m_hitoccTrigger_lb[bin] != 0) {
-	  m_SCTHOTrigger_vsLB->Fill(bin, m_hitoccTrigger_lb[bin]);
-	}
-	if (m_noisyMWithHOTrigger100[bin] != 0) {
-	  m_NoisyModulesWithHOTrigger100_vsLB->Fill(bin, m_noisyMWithHOTrigger100[bin]);
-	}
-	if (m_noisyMWithHOTrigger1000[bin] != 0) {
-	  m_NoisyModulesWithHOTrigger1000_vsLB->Fill(bin, m_noisyMWithHOTrigger1000[bin]);
-	}
-	if (m_noisyMWithHOTrigger10000[bin] != 0) {
-	  m_NoisyModulesWithHOTrigger10000_vsLB->Fill(bin, m_noisyMWithHOTrigger10000[bin]);
-	}
+        if (m_hitoccBAR_lb[bin] != 0) {
+          m_BARHO_vsLB->Fill(bin, m_hitoccBAR_lb[bin]);
+        }
+        if (m_hitoccECm_lb[bin] != 0) {
+          m_ECmHO_vsLB->Fill(bin, m_hitoccECm_lb[bin]);
+        }
+        if (m_hitoccECp_lb[bin] != 0) {
+          m_ECpHO_vsLB->Fill(bin, m_hitoccECp_lb[bin]);
+        }
+        if (m_hitocc_lb[bin] != 0) {
+          m_SCTHO_vsLB->Fill(bin, m_hitocc_lb[bin]);
+        }
+        if (m_noisyMWithHO100[bin] != 0) {
+          m_NoisyModulesWithHO100_vsLB->Fill(bin, m_noisyMWithHO100[bin]);
+        }
+        if (m_noisyMWithHO1000[bin] != 0) {
+          m_NoisyModulesWithHO1000_vsLB->Fill(bin, m_noisyMWithHO1000[bin]);
+        }
+        if (m_noisyMWithHO10000[bin] != 0) {
+          m_NoisyModulesWithHO10000_vsLB->Fill(bin, m_noisyMWithHO10000[bin]);
+        }
+        if (m_hitoccTriggerBAR_lb[bin] != 0) {
+          m_BARHOTrigger_vsLB->Fill(bin, m_hitoccTriggerBAR_lb[bin]);
+        }
+        if (m_hitoccTriggerECm_lb[bin] != 0) {
+          m_ECmHOTrigger_vsLB->Fill(bin, m_hitoccTriggerECm_lb[bin]);
+        }
+        if (m_hitoccTriggerECp_lb[bin] != 0) {
+          m_ECpHOTrigger_vsLB->Fill(bin, m_hitoccTriggerECp_lb[bin]);
+        }
+        if (m_hitoccTrigger_lb[bin] != 0) {
+          m_SCTHOTrigger_vsLB->Fill(bin, m_hitoccTrigger_lb[bin]);
+        }
+        if (m_noisyMWithHOTrigger100[bin] != 0) {
+          m_NoisyModulesWithHOTrigger100_vsLB->Fill(bin, m_noisyMWithHOTrigger100[bin]);
+        }
+        if (m_noisyMWithHOTrigger1000[bin] != 0) {
+          m_NoisyModulesWithHOTrigger1000_vsLB->Fill(bin, m_noisyMWithHOTrigger1000[bin]);
+        }
+        if (m_noisyMWithHOTrigger10000[bin] != 0) {
+          m_NoisyModulesWithHOTrigger10000_vsLB->Fill(bin, m_noisyMWithHOTrigger10000[bin]);
+        }
       }
     }
   }
@@ -2622,9 +2613,7 @@ SCTHitsNoiseMonTool::resetVecH1(VecH1_t hists) {
 // ====================================================================================================
 StatusCode
 SCTHitsNoiseMonTool::bookNoiseDistributions() {
-  // SCTHitsNoiseMonTool::bookNoiseDistributions(bool isNewRun){
 
-  //  if(isNewRun){
   if (newRunFlag()) {
     MonGroup NoiseDistributions(this, "SCT/GENERAL/noise", ManagedMonitorToolBase::run, ATTRIB_UNMANAGED);
     const Int_t bins = 8000;
@@ -2967,7 +2956,7 @@ SCTHitsNoiseMonTool::bookSPvsEventNumber() {
     m_nSP->GetYaxis()->SetTitle("Num of Spacepoints");
     size_t nSP_buf_size;
     nSP_buf_size = m_evtsbins * sizeof(int);
-    m_nSP_buf = (int *) malloc(nSP_buf_size);
+    m_nSP_buf = (int*) malloc(nSP_buf_size);
     m_nSP_pos = 0;
 
     m_nHits = th1Factory("sct_av_hits_vs_en", "Number of Average Hits vs Event Number", BarrelSPHist, 1, m_evtsbins + 1,
@@ -2976,7 +2965,7 @@ SCTHitsNoiseMonTool::bookSPvsEventNumber() {
     m_nHits->GetYaxis()->SetTitle("Num of Average Hits");
     size_t nHits_buf_size;
     nHits_buf_size = m_evtsbins * sizeof(int);
-    m_nHits_buf = (int *) malloc(nHits_buf_size);
+    m_nHits_buf = (int*) malloc(nHits_buf_size);
     m_nHits_pos = 0;
 
     m_nmaxHits = th1Factory("sct_max_hits_vs_en", "Max Number of Hits vs Event Number", BarrelSPHist, 1, m_evtsbins + 1,
@@ -2985,10 +2974,10 @@ SCTHitsNoiseMonTool::bookSPvsEventNumber() {
     m_nmaxHits->GetYaxis()->SetTitle("Num of Max Hits");
     size_t nmaxHits_buf_size;
     nmaxHits_buf_size = m_evtsbins * sizeof(int);
-    m_nmaxHits_buf = (int *) malloc(nmaxHits_buf_size);
+    m_nmaxHits_buf = (int*) malloc(nmaxHits_buf_size);
     size_t nmaxModule_buf_size;
     nmaxModule_buf_size = m_evtsbins * sizeof(Identifier);
-    m_nmaxModule_buf = (Identifier *) malloc(nmaxModule_buf_size);
+    m_nmaxModule_buf = (Identifier*) malloc(nmaxModule_buf_size);
 
     m_nminHits = th1Factory("sct_min_hits_vs_en", "Min Number of Hits vs Event Number", BarrelSPHist, 1, m_evtsbins + 1,
                             m_evtsbins);
@@ -2996,10 +2985,10 @@ SCTHitsNoiseMonTool::bookSPvsEventNumber() {
     m_nminHits->GetYaxis()->SetTitle("Num of Min Hits");
     size_t nminHits_buf_size;
     nminHits_buf_size = m_evtsbins * sizeof(int);
-    m_nminHits_buf = (int *) malloc(nminHits_buf_size);
+    m_nminHits_buf = (int*) malloc(nminHits_buf_size);
     size_t nminModule_buf_size;
     nminModule_buf_size = m_evtsbins * sizeof(Identifier);
-    m_nminModule_buf = (Identifier *) malloc(nminModule_buf_size);
+    m_nminModule_buf = (Identifier*) malloc(nminModule_buf_size);
   }
   return StatusCode::SUCCESS;
 }
@@ -3022,7 +3011,7 @@ SCTHitsNoiseMonTool::makeSPvsEventNumber() {
   SpacePointContainer::const_iterator it = SCT_spcontainer->begin();
   SpacePointContainer::const_iterator endit = SCT_spcontainer->end();
   for (; it != endit; ++it) {
-    const SpacePointCollection *colNext = &(**it);
+    const SpacePointCollection* colNext = &(**it);
     if (!colNext) {
       continue;
     }
@@ -3077,7 +3066,7 @@ SCTHitsNoiseMonTool::makeSPvsEventNumber() {
 }
 
 std::string
-SCTHitsNoiseMonTool::positionString(const Identifier &plane) const {
+SCTHitsNoiseMonTool::positionString(const Identifier& plane) const {
   ostringstream position_txt;
 
   position_txt << m_pSCTHelper->barrel_ec(plane) << "_" << m_pSCTHelper->layer_disk(plane) << "_" <<
@@ -3110,31 +3099,31 @@ SCTHitsNoiseMonTool::makeVectorOfTrackRDOIdentifiers() {
   }
   // assemble list of rdo ids associated with tracks
   for (int i = 0; i < (int) tracks->size(); i++) {
-    const Trk::Track *track = (*tracks)[i];
+    const Trk::Track* track = (*tracks)[i];
     if (track == 0) {
       ATH_MSG_WARNING("no pointer to track!!!");
       break;
     }
     // Get pointer to track state on surfaces
-    const DataVector<const Trk::TrackStateOnSurface> *trackStates = track->trackStateOnSurfaces();
+    const DataVector<const Trk::TrackStateOnSurface>* trackStates = track->trackStateOnSurfaces();
     if (trackStates == 0) {
       ATH_MSG_WARNING("for current track is TrackStateOnSurfaces == Null, no data will be written for this track");
     }else {// Loop over all track states on surfaces
       for (DataVector<const Trk::TrackStateOnSurface>::const_iterator it = trackStates->begin();
            it != trackStates->end(); it++) {
         // Get pointer to RIO of right type
-        const InDet::SiClusterOnTrack *clus =
-          dynamic_cast<const InDet::SiClusterOnTrack *>((*it)->measurementOnTrack());
+        const InDet::SiClusterOnTrack* clus =
+          dynamic_cast<const InDet::SiClusterOnTrack*>((*it)->measurementOnTrack());
         if (clus) {
           // Get Pointer to prepRawDataObject
-          const InDet::SiCluster *RawDataClus = dynamic_cast<const InDet::SiCluster *>(clus->prepRawData());
+          const InDet::SiCluster* RawDataClus = dynamic_cast<const InDet::SiCluster*>(clus->prepRawData());
           if (RawDataClus == 0) {
             ATH_MSG_WARNING("SiCluster WITHOUT prepRawData!!!!");
             break;
           }
           // if Cluster is in SCT ...
           if (RawDataClus->detectorElement()->isSCT()) {
-            const std::vector<Identifier> &rdoList = RawDataClus->rdoList();
+            const std::vector<Identifier>& rdoList = RawDataClus->rdoList();
             m_RDOsOnTracks.insert(m_RDOsOnTracks.end(), rdoList.begin(), rdoList.end());
           }
         }
@@ -3160,10 +3149,10 @@ SCTHitsNoiseMonTool::bookGeneralTrackHits(const unsigned int systemIndex) {
   const unsigned int limits[] = {
     N_DISKSx2, N_BARRELSx2, N_DISKSx2
   };
-  VecH2_t *histoVec[] = {
+  VecH2_t* histoVec[] = {
     &m_ptrackhitsHistoVectorECm, &m_ptrackhitsHistoVector, &m_ptrackhitsHistoVectorECp
   };
-  VecH2_t *histoVecRecent[] = {
+  VecH2_t* histoVecRecent[] = {
     &m_ptrackhitsHistoVectorRecentECm, &m_ptrackhitsHistoVectorRecent, &m_ptrackhitsHistoVectorRecentECp
   };
   string stem = m_stream + "/" + paths[systemIndex] + "mapsOfHitsOnTracks";
@@ -3175,13 +3164,13 @@ SCTHitsNoiseMonTool::bookGeneralTrackHits(const unsigned int systemIndex) {
     for (unsigned int i(0); i != limits[systemIndex]; ++i) {
       LayerSideFormatter layerSide(i, systemIndex);
       const string streamhitmap = "mapsOfHitsOnTracks" + abbreviations[systemIndex] + streamDelimiter +
-	"trackhitsmap_" + layerSide.name();
+        "trackhitsmap_" + layerSide.name();
       const string streamhitmaprecent = "mapsOfHitsOnTracksRecent" + abbreviations[systemIndex] + streamDelimiter +
-	"trackhitsmap_" + layerSide.name();
+        "trackhitsmap_" + layerSide.name();
       std::string histoName = stem + streamhitmap;
       std::string histotitle = "SCT hits on tracks for " + names[systemIndex] + " " + layerSide.title();
       std::string histotitlerecent = "SCT hits on tracks from recent events for " + names[systemIndex] + " " +
-	layerSide.title();
+        layerSide.title();
       h2Factory(streamhitmap, histotitle, bec, tracksMon, *(histoVec[systemIndex]));
       if (m_environment == AthenaMonManager::online) {
         h2Factory(streamhitmaprecent, histotitlerecent, bec, tracksMon, *(histoVecRecent[systemIndex]));
@@ -3200,15 +3189,15 @@ SCTHitsNoiseMonTool::bookGeneralTrackTimeHistos(const unsigned int systemIndex)
     const unsigned int limits[N_REGIONS] = {
       N_DISKS, N_BARRELS, N_DISKS
     };
-    std::vector<H1_t> *tbinHistoVectorArray[] = {
+    std::vector<H1_t>* tbinHistoVectorArray[] = {
       &m_tbinHistoVectorECm, &m_tbinHistoVector, &m_tbinHistoVectorECp
     };
-    std::vector<H1_t> *tbinHistoVectorArrayRecent[] = {
+    std::vector<H1_t>* tbinHistoVectorArrayRecent[] = {
       &m_tbinHistoVectorRecentECm, &m_tbinHistoVectorRecent, &m_tbinHistoVectorRecentECp
     };
     //
-    std::vector<H1_t> &tbinHistoVector = *(tbinHistoVectorArray[systemIndex]);
-    std::vector<H1_t> &tbinHistoVectorRecent = *(tbinHistoVectorArrayRecent[systemIndex]);
+    std::vector<H1_t>& tbinHistoVector = *(tbinHistoVectorArray[systemIndex]);
+    std::vector<H1_t>& tbinHistoVectorRecent = *(tbinHistoVectorArrayRecent[systemIndex]);
     tbinHistoVector.clear();
     tbinHistoVectorRecent.clear();
     MonGroup timeGroup(this, path[systemIndex], run, ATTRIB_UNMANAGED);
@@ -3308,7 +3297,7 @@ SCTHitsNoiseMonTool::bookGeneralTrackTimeHistos(const unsigned int systemIndex)
       const string streamlayer(std::to_string(i));
       const string streamhitmap = "TrackTimeBin" + abbreviations[systemIndex] + streamDelimiter + streamlayer;
       const string streamhitmaprecent = "TrackTimeBinRecent" + abbreviations[systemIndex] + streamDelimiter +
-	streamlayer;
+        streamlayer;
       histoName = stem + streamhitmap;
       histoNameRecent = stem + streamhitmaprecent;
       histoTitle = "RDO Track TimeBin: layer " + streamlayer;
@@ -3336,8 +3325,8 @@ SCTHitsNoiseMonTool::bookGeneralTrackTimeHistos(const unsigned int systemIndex)
 }
 
 SCTHitsNoiseMonTool::H2_t
-SCTHitsNoiseMonTool::h2Factory(const std::string &name, const std::string &title, const SCT_Monitoring::Bec bec,
-                               MonGroup &registry, VecH2_t &storageVector) {
+SCTHitsNoiseMonTool::h2Factory(const std::string& name, const std::string& title, const SCT_Monitoring::Bec bec,
+                               MonGroup& registry, VecH2_t& storageVector) {
   int firstEta(FIRST_ETA_BIN), lastEta(LAST_ETA_BIN), firstPhi(FIRST_PHI_BIN), lastPhi(LAST_PHI_BIN), nEta(N_ETA_BINS),
     nPhi(N_PHI_BINS);
 
@@ -3350,7 +3339,7 @@ SCTHitsNoiseMonTool::h2Factory(const std::string &name, const std::string &title
     nPhi = N_PHI_BINS_EC;
   }
   H2_t tmp = TH2F_LW::create(TString(name), TString(
-					     title), nEta, firstEta - 0.5, lastEta + 0.5, nPhi, firstPhi - 0.5, lastPhi + 0.5);
+                                             title), nEta, firstEta - 0.5, lastEta + 0.5, nPhi, firstPhi - 0.5, lastPhi + 0.5);
   tmp->SetXTitle("Index in the direction of #eta");
   tmp->SetYTitle("Index in the direction of #phi");
   bool success(registry.regHist(tmp).isSuccess());
@@ -3358,11 +3347,11 @@ SCTHitsNoiseMonTool::h2Factory(const std::string &name, const std::string &title
     ATH_MSG_WARNING("Cannot book SCT histogram: " << name);
   }
   storageVector.push_back(tmp);
-  return success ? tmp : NULL;
+  return success ? tmp : nullptr;
 }
 
 SCTHitsNoiseMonTool::H2I_t
-SCTHitsNoiseMonTool::h2IFactory(const std::string &name, const std::string &title, MonGroup &registry, int nbinx,
+SCTHitsNoiseMonTool::h2IFactory(const std::string& name, const std::string& title, MonGroup& registry, int nbinx,
                                 float xlo, float xhi, int nbiny, float ylo, float yhi) {
   H2I_t tmp = TH2I_LW::create(TString(name), TString(title), nbinx, xlo, xhi, nbiny, ylo, yhi);
 
@@ -3372,11 +3361,11 @@ SCTHitsNoiseMonTool::h2IFactory(const std::string &name, const std::string &titl
   if (not success) {
     ATH_MSG_WARNING("Cannot book SCT histogram: " << name);
   }
-  return success ? tmp : NULL;
+  return success ? tmp : nullptr;
 }
 
 SCTHitsNoiseMonTool::Prof2_t
-SCTHitsNoiseMonTool::prof2DFactory(const std::string &name, const std::string &title, MonGroup &registry, int nbinx,
+SCTHitsNoiseMonTool::prof2DFactory(const std::string& name, const std::string& title, MonGroup& registry, int nbinx,
                                    float xlo, float xhi, int nbiny, float ylo, float yhi) {
   Prof2_t tmp = new TProfile2D(TString(name), TString(title), nbinx, xlo - 0.5, xhi + 0.5, nbiny, ylo - 0.5, yhi + 0.5);
 
@@ -3386,11 +3375,11 @@ SCTHitsNoiseMonTool::prof2DFactory(const std::string &name, const std::string &t
   if (not success) {
     ATH_MSG_WARNING("Cannot book SCT histogram: " << name);
   }
-  return success ? tmp : NULL;
+  return success ? tmp : nullptr;
 }
 
 SCTHitsNoiseMonTool::Prof_t
-SCTHitsNoiseMonTool::profFactory(const std::string &name, const std::string &title, MonGroup &registry, int nbin,
+SCTHitsNoiseMonTool::profFactory(const std::string& name, const std::string& title, MonGroup& registry, int nbin,
                                  float lo, float hi) {
   Prof_t tmp = TProfile_LW::create(TString(name), TString(title), nbin, lo, hi);
 
@@ -3400,11 +3389,11 @@ SCTHitsNoiseMonTool::profFactory(const std::string &name, const std::string &tit
   if (not success) {
     ATH_MSG_WARNING("Cannot book SCT histogram: " << name);
   }
-  return success ? tmp : NULL;
+  return success ? tmp : nullptr;
 }
 
 SCTHitsNoiseMonTool::Prof_t
-SCTHitsNoiseMonTool::profFactory(const std::string &name, const std::string &title, MonGroup &registry) {
+SCTHitsNoiseMonTool::profFactory(const std::string& name, const std::string& title, MonGroup& registry) {
   Prof_t tmp = TProfile_LW::create(TString(name), TString(title), 3, 0, 3);
 
   tmp->SetYTitle("Fraction of 01X");
@@ -3415,12 +3404,12 @@ SCTHitsNoiseMonTool::profFactory(const std::string &name, const std::string &tit
   if (not success) {
     ATH_MSG_WARNING("Cannot book SCT histogram: " << name);
   }
-  return success ? tmp : NULL;
+  return success ? tmp : nullptr;
 }
 
 SCTHitsNoiseMonTool::Prof2_t
-SCTHitsNoiseMonTool::prof2Factory(const std::string &name, const std::string &title, const SCT_Monitoring::Bec bec,
-                                  MonGroup &registry, VecProf2_t &storageVector) {
+SCTHitsNoiseMonTool::prof2Factory(const std::string& name, const std::string& title, const SCT_Monitoring::Bec bec,
+                                  MonGroup& registry, VecProf2_t& storageVector) {
   int firstEta(FIRST_ETA_BIN), lastEta(LAST_ETA_BIN), firstPhi(FIRST_PHI_BIN), lastPhi(LAST_PHI_BIN), nEta(N_ETA_BINS),
     nPhi(N_PHI_BINS);
 
@@ -3433,7 +3422,7 @@ SCTHitsNoiseMonTool::prof2Factory(const std::string &name, const std::string &ti
     nPhi = N_PHI_BINS_EC;
   }
   Prof2_t tmp = new TProfile2D(TString(name), TString(
-							     title), nEta, firstEta - 0.5, lastEta + 0.5, nPhi, firstPhi - 0.5, lastPhi + 0.5);
+                                                             title), nEta, firstEta - 0.5, lastEta + 0.5, nPhi, firstPhi - 0.5, lastPhi + 0.5);
   tmp->SetXTitle("Index in the direction of #eta");
   tmp->SetYTitle("Index in the direction of #phi");
   bool success(registry.regHist(tmp).isSuccess());
@@ -3441,11 +3430,11 @@ SCTHitsNoiseMonTool::prof2Factory(const std::string &name, const std::string &ti
     ATH_MSG_WARNING("Cannot book SCT histogram: " << name);
   }
   storageVector.push_back(tmp);
-  return success ? tmp : NULL;
+  return success ? tmp : nullptr;
 }
 
 SCTHitsNoiseMonTool::H1_t
-SCTHitsNoiseMonTool::h1Factory(const std::string &name, const std::string &title, MonGroup &registry, const float lo,
+SCTHitsNoiseMonTool::h1Factory(const std::string& name, const std::string& title, MonGroup& registry, const float lo,
                                const float hi, const unsigned int nbins) {
   H1_t tmp = TH1F_LW::create(TString(name), TString(title), nbins, lo, hi);
   bool success(registry.regHist(tmp).isSuccess());
@@ -3453,12 +3442,12 @@ SCTHitsNoiseMonTool::h1Factory(const std::string &name, const std::string &title
   if (not success) {
     ATH_MSG_WARNING("Cannot book SCT histogram: " << name);
   }
-  return success ? tmp : NULL;
+  return success ? tmp : nullptr;
 }
 
 SCTHitsNoiseMonTool::H1_t
-SCTHitsNoiseMonTool::h1Factory(const std::string &name, const std::string &title, MonGroup &registry,
-                               VecH1_t &storageVector, const float lo, const float hi, const unsigned int nbins) {
+SCTHitsNoiseMonTool::h1Factory(const std::string& name, const std::string& title, MonGroup& registry,
+                               VecH1_t& storageVector, const float lo, const float hi, const unsigned int nbins) {
   H1_t tmp = TH1F_LW::create(TString(name), TString(title), nbins, lo, hi);
   bool success(registry.regHist(tmp).isSuccess());
 
@@ -3466,24 +3455,24 @@ SCTHitsNoiseMonTool::h1Factory(const std::string &name, const std::string &title
     ATH_MSG_WARNING("Cannot book SCT histogram: " << name);
   }
   storageVector.push_back(tmp);
-  return success ? tmp : NULL;
+  return success ? tmp : nullptr;
 }
 
 TH1F*
-SCTHitsNoiseMonTool::th1Factory(const std::string &name, const std::string &title, MonGroup &registry, const float lo,
-				const float hi, const unsigned int nbins) {
+SCTHitsNoiseMonTool::th1Factory(const std::string& name, const std::string& title, MonGroup& registry, const float lo,
+                                const float hi, const unsigned int nbins) {
   TH1F* tmp = new TH1F(TString(name), TString(title), nbins, lo, hi);
   bool success(registry.regHist(tmp).isSuccess());
 
   if (not success) {
     ATH_MSG_WARNING("Cannot book SCT histogram: " << name);
   }
-  return success ? tmp : NULL;
+  return success ? tmp : nullptr;
 }
 
 TH1F*
-SCTHitsNoiseMonTool::th1Factory(const std::string &name, const std::string &title, MonGroup &registry,
-                               std::vector<TH1F*> &storageVector, const float lo, const float hi, const unsigned int nbins) {
+SCTHitsNoiseMonTool::th1Factory(const std::string& name, const std::string& title, MonGroup& registry,
+                               std::vector<TH1F*>& storageVector, const float lo, const float hi, const unsigned int nbins) {
   TH1F* tmp = new TH1F(TString(name), TString(title), nbins, lo, hi);
   bool success(registry.regHist(tmp).isSuccess());
 
@@ -3491,5 +3480,5 @@ SCTHitsNoiseMonTool::th1Factory(const std::string &name, const std::string &titl
     ATH_MSG_WARNING("Cannot book SCT histogram: " << name);
   }
   storageVector.push_back(tmp);
-  return success ? tmp : NULL;
+  return success ? tmp : nullptr;
 }
diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTLorentzMonTool.cxx b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTLorentzMonTool.cxx
index cf4ccd067287e18fc9734eb3ebfef3e874b2b289..f01a5b140c3f598d2444e7fe83ef19ea1785052f 100644
--- a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTLorentzMonTool.cxx
+++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTLorentzMonTool.cxx
@@ -9,28 +9,29 @@
  *    Modified by Yuta
  */
 #include "SCT_Monitoring/SCTLorentzMonTool.h"
+
 #include "SCT_NameFormatter.h"
-#include <cmath>
-#include <type_traits>
 
-#include "GaudiKernel/StatusCode.h"
-#include "GaudiKernel/IToolSvc.h"
+#include "AthContainers/DataVector.h"
+#include "Identifier/Identifier.h"
+#include "InDetIdentifier/SCT_ID.h"
+#include "InDetPrepRawData/SiCluster.h"
+#include "InDetRIO_OnTrack/SiClusterOnTrack.h"
 #include "StoreGate/ReadCondHandle.h"
 #include "StoreGate/ReadHandle.h"
+#include "TrkParameters/TrackParameters.h"
+#include "TrkTrackSummary/TrackSummary.h" // for sct residuals
+
+#include "GaudiKernel/StatusCode.h"
+#include "GaudiKernel/IToolSvc.h"
 
 #include "TH1F.h"
 #include "TH2F.h"
 #include "TProfile2D.h"
 #include "TF1.h"
-#include "AthContainers/DataVector.h"
-#include "Identifier/Identifier.h"
-#include "InDetIdentifier/SCT_ID.h"
-#include "InDetRIO_OnTrack/SiClusterOnTrack.h"
-#include "InDetPrepRawData/SiCluster.h"
-#include "TrkParameters/TrackParameters.h"
 
-// for sct residuals
-#include "TrkTrackSummary/TrackSummary.h"
+#include <cmath>
+#include <type_traits>
 
 using namespace std;
 using namespace Rec;
@@ -43,8 +44,8 @@ using namespace SCT_Monitoring;
  *  of the filepath for histograms etc
  */
 // ====================================================================================================
-SCTLorentzMonTool::SCTLorentzMonTool(const string &type, const string &name,
-                                     const IInterface *parent) : SCTMotherTrigMonTool(type, name, parent),
+SCTLorentzMonTool::SCTLorentzMonTool(const string& type, const string& name,
+                                     const IInterface* parent) : SCTMotherTrigMonTool(type, name, parent),
   m_trackToVertexTool("Reco::TrackToVertex", this), // for TrackToVertexTool
   m_phiVsNstrips{},
   m_phiVsNstrips_100{},
@@ -164,20 +165,20 @@ SCTLorentzMonTool::fillHistograms() {
 
   for (; trkitr != trkend; ++trkitr) {
     // Get track
-    const Trk::Track *track = (*trkitr);
+    const Trk::Track* track = (*trkitr);
     if (not track) {
       ATH_MSG_ERROR("no pointer to track!!!");
       continue;
     }
 
     // Get pointer to track state on surfaces
-    const DataVector<const Trk::TrackStateOnSurface> *trackStates = track->trackStateOnSurfaces();
+    const DataVector<const Trk::TrackStateOnSurface>* trackStates = track->trackStateOnSurfaces();
     if (not trackStates) {
       ATH_MSG_WARNING("for current track, TrackStateOnSurfaces == Null, no data will be written for this track");
       continue;
     }
 
-    const Trk::TrackSummary *summary = track->trackSummary();
+    const Trk::TrackSummary* summary = track->trackSummary();
     if (not summary) {
       ATH_MSG_WARNING(" null trackSummary");
       continue;
@@ -186,10 +187,10 @@ SCTLorentzMonTool::fillHistograms() {
     DataVector<const Trk::TrackStateOnSurface>::const_iterator endit = trackStates->end();
     for (DataVector<const Trk::TrackStateOnSurface>::const_iterator it = trackStates->begin(); it != endit; ++it) {
       if ((*it)->type(Trk::TrackStateOnSurface::Measurement)) {
-        const InDet::SiClusterOnTrack *clus =
-          dynamic_cast<const InDet::SiClusterOnTrack *>((*it)->measurementOnTrack());
+        const InDet::SiClusterOnTrack* clus =
+          dynamic_cast<const InDet::SiClusterOnTrack*>((*it)->measurementOnTrack());
         if (clus) { // Is it a SiCluster? If yes...
-          const InDet::SiCluster *RawDataClus = dynamic_cast<const InDet::SiCluster *>(clus->prepRawData());
+          const InDet::SiCluster* RawDataClus = dynamic_cast<const InDet::SiCluster*>(clus->prepRawData());
           if (not RawDataClus) {
             continue; // Continue if dynamic_cast returns null
           }
@@ -213,15 +214,15 @@ SCTLorentzMonTool::fillHistograms() {
               }
             }
             // find cluster size
-            const std::vector<Identifier> &rdoList = RawDataClus->rdoList();
+            const std::vector<Identifier>& rdoList = RawDataClus->rdoList();
             int nStrip = rdoList.size();
-            const Trk::TrackParameters *trkp = dynamic_cast<const Trk::TrackParameters *>((*it)->trackParameters());
+            const Trk::TrackParameters* trkp = dynamic_cast<const Trk::TrackParameters*>((*it)->trackParameters());
             if (not trkp) {
               ATH_MSG_WARNING(" Null pointer to MeasuredTrackParameters");
               continue;
             }
 
-            const Trk::Perigee *perigee = track->perigeeParameters();
+            const Trk::Perigee* perigee = track->perigeeParameters();
 
             if (perigee) {
               // Get angle to wafer surface
@@ -274,8 +275,8 @@ SCTLorentzMonTool::fillHistograms() {
             }// end if mtrkp
             //            delete perigee;perigee = 0;
           } // end if SCT..
-        } // end if(clus)
-      } // if((*it)->type(Trk::TrackStateOnSurface::Measurement)){
+        } // end if (clus)
+      } // if ((*it)->type(Trk::TrackStateOnSurface::Measurement)){
     }// end of loop on TrackStatesonSurface (they can be SiClusters, TRTHits,..)
   } // end of loop on tracks
 
@@ -372,9 +373,9 @@ SCTLorentzMonTool::bookLorentzHistos() {
   return StatusCode::SUCCESS;
 }
 
-TProfile *
-SCTLorentzMonTool::pFactory(const std::string &name, const std::string &title, int nbinsx, float xlow, float xhigh,
-                            MonGroup &registry, int &iflag) {
+TProfile*
+SCTLorentzMonTool::pFactory(const std::string& name, const std::string& title, int nbinsx, float xlow, float xhigh,
+                            MonGroup& registry, int& iflag) {
   Prof_t tmp = new TProfile(TString(name), TString(title), nbinsx, xlow, xhigh);
   bool success(registry.regHist(tmp).isSuccess());
 
@@ -389,8 +390,8 @@ SCTLorentzMonTool::pFactory(const std::string &name, const std::string &title, i
 }
 
 bool
-SCTLorentzMonTool::h1Factory(const std::string &name, const std::string &title, const float extent, MonGroup &registry,
-                             VecH1_t &storageVector) {
+SCTLorentzMonTool::h1Factory(const std::string& name, const std::string& title, const float extent, MonGroup& registry,
+                             VecH1_t& storageVector) {
   const unsigned int nbins(100);
   const float lo(-extent), hi(extent);
   H1_t tmp = new TH1F(TString(name), TString(title), nbins, lo, hi);
@@ -404,9 +405,9 @@ SCTLorentzMonTool::h1Factory(const std::string &name, const std::string &title,
 }
 
 int
-SCTLorentzMonTool::findAnglesToWaferSurface(const float (&vec)[3], const float &sinAlpha, const Identifier &id,
+SCTLorentzMonTool::findAnglesToWaferSurface(const float (&vec)[3], const float& sinAlpha, const Identifier& id,
                                             const InDetDD::SiDetectorElementCollection* elements,
-                                            float &theta, float &phi) {
+                                            float& theta, float& phi) {
   int iflag(-1);
 
   phi = 90.;
@@ -414,7 +415,7 @@ SCTLorentzMonTool::findAnglesToWaferSurface(const float (&vec)[3], const float &
 
   const Identifier waferId = m_pSCTHelper->wafer_id(id);
   const IdentifierHash waferHash = m_pSCTHelper->wafer_hash(waferId);
-  const InDetDD::SiDetectorElement *element = elements->getDetectorElement(waferHash);
+  const InDetDD::SiDetectorElement* element = elements->getDetectorElement(waferHash);
   if (!element) {
     ATH_MSG_ERROR("findAnglesToWaferSurface:  failed to find detector element for id=" <<
                   m_pSCTHelper->show_to_string(id));
diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTMotherTrigMonTool.cxx b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTMotherTrigMonTool.cxx
index b935037b7828667be53b6f783bef387ac235f7a3..b882276e2f16630e38f25ce2b335c7a66dc9890b 100644
--- a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTMotherTrigMonTool.cxx
+++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTMotherTrigMonTool.cxx
@@ -10,16 +10,17 @@
 // Local
 #include "SCT_Monitoring/SCTMotherTrigMonTool.h"
 // Framework
-#include "GaudiKernel/IInterface.h"
-#include "GaudiKernel/StatusCode.h"
 #include "StoreGate/ReadHandle.h"
 #include "TrigDecisionInterface/ITrigDecisionTool.h"
 
+#include "GaudiKernel/IInterface.h"
+#include "GaudiKernel/StatusCode.h"
+
 const std::string SCTMotherTrigMonTool::m_triggerNames[] = {
   "RNDM", "BPTX", "L1CAL", "TGC", "RPC", "MBTS", "COSM", "Calib"
 };
 
-SCTMotherTrigMonTool::SCTMotherTrigMonTool(const std::string &type, const std::string &name, const IInterface *parent)
+SCTMotherTrigMonTool::SCTMotherTrigMonTool(const std::string& type, const std::string& name, const IInterface* parent)
   : ManagedMonitorToolBase(type, name, parent),
   m_doTrigger(true),
   m_isStream(false),
@@ -65,14 +66,14 @@ SCTMotherTrigMonTool::hasTriggerFired(const unsigned int trigger) const {
 }
 
 bool
-SCTMotherTrigMonTool::isCalibrationNoise(const std::string &L1_Item) {
+SCTMotherTrigMonTool::isCalibrationNoise(const std::string& L1_Item) {
   ATH_MSG_DEBUG("Trigger " << L1_Item << " = " << m_trigDecTool->isPassed(L1_Item));
 
   return m_trigDecTool->isPassed(L1_Item);
 }
 
 bool
-SCTMotherTrigMonTool::isStream(const std::string &StreamName) {
+SCTMotherTrigMonTool::isStream(const std::string& StreamName) {
   SG::ReadHandle<xAOD::EventInfo> evtInfo(m_eventInfoKey);
   if (evtInfo.isValid()) {
     m_isStream = false;
diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTRatioNoiseMonTool.cxx b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTRatioNoiseMonTool.cxx
index 778dc20c4bc13cd22a811df912cdb5edc55835a6..3674db6db4c86000466816a4eb4ebd85b9007377 100644
--- a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTRatioNoiseMonTool.cxx
+++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTRatioNoiseMonTool.cxx
@@ -8,37 +8,34 @@
  *
  */
 #include "SCT_Monitoring/SCTRatioNoiseMonTool.h"
-#include "SCT_NameFormatter.h"
-#include <cmath>
 
-#include "GaudiKernel/IToolSvc.h"
+#include "SCT_NameFormatter.h"
 
-#include "TH1F.h"
-#include "TH2F.h"
-#include "TProfile2D.h"
-#include "TF1.h"
 #include "AthContainers/DataVector.h"
+#include "AthenaKernel/errorcheck.h"
 #include "Identifier/Identifier.h"
+#include "InDetConditionsSummaryService/InDetHierarchy.h"
 #include "InDetIdentifier/SCT_ID.h"
 #include "InDetRawData/SCT3_RawData.h"
-#include "AthenaKernel/errorcheck.h"
-#include "SCT_Monitoring/SCT_ClusterStruct.h"
+#include "InDetRawData/InDetRawDataContainer.h"
+#include "InDetRawData/InDetRawDataCLASS_DEF.h"
+#include "InDetIdentifier/SCT_ID.h"
+#include "LWHists/TH1F_LW.h"
+#include "LWHists/TH2F_LW.h"
+#include "StoreGate/ReadHandle.h"
+
 #include "GaudiKernel/ITHistSvc.h"
+#include "GaudiKernel/IToolSvc.h"
 
-// conditions stuff
-#include "InDetConditionsSummaryService/InDetHierarchy.h"
-#include "TMath.h"
+#include "TF1.h"
 #include "TH1F.h"
+#include "TH2F.h"
 #include "TH2I.h"
-#include "LWHists/TH1F_LW.h"
-#include "LWHists/TH2F_LW.h"
+#include "TMath.h"
 #include "TProfile2D.h"
-#include "InDetRawData/SCT3_RawData.h"
-#include "InDetRawData/InDetRawDataContainer.h"
-#include "InDetRawData/InDetRawDataCLASS_DEF.h"
-#include "Identifier/Identifier.h"
-#include "InDetIdentifier/SCT_ID.h"
-#include "StoreGate/ReadHandle.h"
+#include "TProfile2D.h"
+
+#include <cmath>
 
 //
 using namespace std;
@@ -90,8 +87,8 @@ namespace { // use anonymous namespace to restrict scope to this file, equivalen
  *  numbers to be used, and the timebin.
  */
 // ====================================================================================================
-SCTRatioNoiseMonTool::SCTRatioNoiseMonTool(const string &type,
-                                           const string &name,
+SCTRatioNoiseMonTool::SCTRatioNoiseMonTool(const string& type,
+                                           const string& name,
                                            const IInterface *parent) :
   SCTMotherTrigMonTool(type, name, parent),
   m_eventID(0),
@@ -241,7 +238,7 @@ SCTRatioNoiseMonTool::SCTRatioNoiseMonTool(const string &type,
   declareProperty("NOTrigger", m_NOTrigger = "L1_RD0_EMPTY");
   declareProperty("IgnoreRDOCutOnline", m_ignore_RDO_cut_online);
 
-  for (auto &i:m_goodModules) {
+  for (auto& i:m_goodModules) {
     i = true;
   }
 }
@@ -373,11 +370,11 @@ SCTRatioNoiseMonTool::fillHistograms() {
   if (isSelectedTrigger == true) {
     for (; col_it != lastCol; ++col_it) {
       m_correct_TimeBin = false;
-      const InDetRawDataCollection<SCTRawDataType> *SCT_Collection(*col_it);
+      const InDetRawDataCollection<SCTRawDataType>* SCT_Collection(*col_it);
       if (!SCT_Collection) {
         continue; // select only SCT RDOs
       }
-      const InDetRawDataCollection<SCT_RDORawData> *rd(*col_it);
+      const InDetRawDataCollection<SCT_RDORawData>* rd(*col_it);
 
       Identifier SCT_Identifier = SCT_Collection->identify();
       int thisBec = m_pSCTHelper->barrel_ec(SCT_Identifier);
@@ -399,7 +396,7 @@ SCTRatioNoiseMonTool::fillHistograms() {
       DataVector<SCTRawDataType>::const_iterator p_rdo_end = SCT_Collection->end();
       for (DataVector<SCTRawDataType>::const_iterator p_rdo = SCT_Collection->begin(); p_rdo != p_rdo_end; ++p_rdo) {
         count_SCT_RDO++;
-        const SCT3_RawData *rdo3 = dynamic_cast<const SCT3_RawData *>(*p_rdo);
+        const SCT3_RawData* rdo3 = dynamic_cast<const SCT3_RawData *>(*p_rdo);
         if (rdo3 != 0) {
           m_tbin = (rdo3)->getTimeBin();
         }
@@ -424,7 +421,7 @@ SCTRatioNoiseMonTool::fillHistograms() {
     // ignores the RDO cut online since the empty events are pre-filtered there
     if (count_SCT_RDO < 1E6 || (m_ignore_RDO_cut_online && m_environment == AthenaMonManager::online)) {
       m_num_RDO->Fill(count_SCT_RDO);
-      if(m_current_lb<=SCT_Monitoring::NBINS_LBs) m_noisyM[m_current_lb] = 0;
+      if (m_current_lb<=SCT_Monitoring::NBINS_LBs) m_noisyM[m_current_lb] = 0;
       for (int j = 0; j < n_mod[GENERAL_INDEX]; j++) {
         m_noSidesHit = false;
         m_oneSideHit = false;
@@ -506,7 +503,7 @@ SCTRatioNoiseMonTool::fillHistograms() {
         }
         // --------------------------------------
         if (calculateNoiseOccupancyUsingRatioMethod(m_nOneSide_lb[j], m_nNoSides_lb[j]) * 1E5 > 100.) {
-          if(m_current_lb<=SCT_Monitoring::NBINS_LBs) m_noisyM[m_current_lb] += 1;
+          if (m_current_lb<=SCT_Monitoring::NBINS_LBs) m_noisyM[m_current_lb] += 1;
         }
       }
 
@@ -912,14 +909,14 @@ SCTRatioNoiseMonTool::bookRatioNoiseHistos() {
     const unsigned int limits[] = {
       N_DISKS, N_BARRELS, N_DISKS
     };
-    VecProf2_t *storageVectors[] = {
+    VecProf2_t* storageVectors[] = {
       &m_pnoiseoccupancymapHistoVectorECC, &m_pnoiseoccupancymapHistoVectorBAR, &m_pnoiseoccupancymapHistoVectorECA
     };
-    VecProf2_t *storageVectorsSide0[] = {
+    VecProf2_t* storageVectorsSide0[] = {
       &m_pnoiseoccupancymapHistoVectorECCSide0, &m_pnoiseoccupancymapHistoVectorBARSide0,
       &m_pnoiseoccupancymapHistoVectorECASide0
     };
-    VecProf2_t *storageVectorsSide1[] = {
+    VecProf2_t* storageVectorsSide1[] = {
       &m_pnoiseoccupancymapHistoVectorECCSide1, &m_pnoiseoccupancymapHistoVectorBARSide1,
       &m_pnoiseoccupancymapHistoVectorECASide1
     };
@@ -1081,7 +1078,7 @@ SCTRatioNoiseMonTool::bookRatioNoiseHistos() {
 }
 
 SCTRatioNoiseMonTool::Prof_t
-SCTRatioNoiseMonTool::pFactory(const std::string &name, const std::string &title, MonGroup &registry, const float lo,
+SCTRatioNoiseMonTool::pFactory(const std::string& name, const std::string& title, MonGroup& registry, const float lo,
                                const float hi, const unsigned int nbins) {
   Prof_t tmp = new TProfile(TString(name), TString(title), nbins, lo, hi);
   bool success(registry.regHist(tmp).isSuccess());
@@ -1089,11 +1086,11 @@ SCTRatioNoiseMonTool::pFactory(const std::string &name, const std::string &title
   if (not success) {
     ATH_MSG_WARNING("Cannot book SCT histogram: " << name);
   }
-  return success ? tmp : NULL;
+  return success ? tmp : nullptr;
 }
 
 SCTRatioNoiseMonTool::H1_t
-SCTRatioNoiseMonTool::h1Factory(const std::string &name, const std::string &title, MonGroup &registry, const float lo,
+SCTRatioNoiseMonTool::h1Factory(const std::string& name, const std::string& title, MonGroup& registry, const float lo,
                                 const float hi, const unsigned int nbins) {
   H1_t tmp = TH1F_LW::create(TString(name), TString(title), nbins, lo, hi);
   bool success(registry.regHist(tmp).isSuccess());
@@ -1101,11 +1098,11 @@ SCTRatioNoiseMonTool::h1Factory(const std::string &name, const std::string &titl
   if (not success) {
     ATH_MSG_WARNING("Cannot book SCT histogram: " << name);
   }
-  return success ? tmp : NULL;
+  return success ? tmp : nullptr;
 }
 
 SCTRatioNoiseMonTool::H2_t
-SCTRatioNoiseMonTool::h2Factory(const std::string &name, const std::string &title, MonGroup &registry, const float lo_x,
+SCTRatioNoiseMonTool::h2Factory(const std::string& name, const std::string& title, MonGroup& registry, const float lo_x,
                                 const float hi_x, const unsigned int nbins_x, const float lo_y, const float hi_y,
                                 const unsigned int nbins_y) {
   H2_t tmp = TH2F_LW::create(TString(name), TString(title), nbins_x, lo_x, hi_x, nbins_y, lo_y, hi_y);
@@ -1114,12 +1111,12 @@ SCTRatioNoiseMonTool::h2Factory(const std::string &name, const std::string &titl
   if (not success) {
     ATH_MSG_WARNING("Cannot book SCT histogram: " << name);
   }
-  return success ? tmp : NULL;
+  return success ? tmp : nullptr;
 }
 
 SCTRatioNoiseMonTool::H1_t
-SCTRatioNoiseMonTool::h1Factory(const std::string &name, const std::string &title, MonGroup &registry,
-                                VecH1_t &storageVector, const float lo, const float hi, const unsigned int nbins) {
+SCTRatioNoiseMonTool::h1Factory(const std::string& name, const std::string& title, MonGroup& registry,
+                                VecH1_t& storageVector, const float lo, const float hi, const unsigned int nbins) {
   H1_t tmp = TH1F_LW::create(TString(name), TString(title), nbins, lo, hi);
   bool success(registry.regHist(tmp).isSuccess());
 
@@ -1127,12 +1124,12 @@ SCTRatioNoiseMonTool::h1Factory(const std::string &name, const std::string &titl
     ATH_MSG_WARNING("Cannot book SCT histogram: " << name);
   }
   storageVector.push_back(tmp);
-  return success ? tmp : NULL;
+  return success ? tmp : nullptr;
 }
 
 SCTRatioNoiseMonTool::Prof2_t
-SCTRatioNoiseMonTool::prof2Factory(const std::string &name, const std::string &title, const unsigned int &bec,
-                                   MonGroup &registry, VecProf2_t &storageVector) {
+SCTRatioNoiseMonTool::prof2Factory(const std::string& name, const std::string& title, const unsigned int& bec,
+                                   MonGroup& registry, VecProf2_t& storageVector) {
   int firstEta(FIRST_ETA_BIN), lastEta(LAST_ETA_BIN), firstPhi(FIRST_PHI_BIN), lastPhi(LAST_PHI_BIN), nEta(N_ETA_BINS),
   nPhi(N_PHI_BINS);
 
@@ -1153,7 +1150,7 @@ SCTRatioNoiseMonTool::prof2Factory(const std::string &name, const std::string &t
     ATH_MSG_WARNING("Cannot book SCT histogram: " << name);
   }
   storageVector.push_back(tmp);
-  return success ? tmp : NULL;
+  return success ? tmp : nullptr;
 }
 
 float
diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTSummaryMonTool.cxx b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTSummaryMonTool.cxx
index 00d41c61cb319113f2abb0bd4333d11c499f4937..50cb2358d17681a7c9e477b88aac5b286cc39973 100644
--- a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTSummaryMonTool.cxx
+++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTSummaryMonTool.cxx
@@ -19,8 +19,8 @@
  *  numbers to be used, and the timebin.
  */
 // ====================================================================================================
-SCTSummaryMonTool::SCTSummaryMonTool(const std::string &type, const std::string &name,
-                                     const IInterface *parent) : SCTMotherTrigMonTool(type, name, parent) {
+SCTSummaryMonTool::SCTSummaryMonTool(const std::string& type, const std::string& name,
+                                     const IInterface* parent) : SCTMotherTrigMonTool(type, name, parent) {
   m_numberOfEvents = 0;
 }
 
diff --git a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTTracksMonTool.cxx b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTTracksMonTool.cxx
index 69914f5e1c3e0a1955e49dd4ca8eef351f4400d8..af5c55d06ec04e8bcbca46ca852d951a5c3af998 100644
--- a/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTTracksMonTool.cxx
+++ b/InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTTracksMonTool.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
 */
 
 /**    @file SCTTracksMonTool.cxx
@@ -8,29 +8,29 @@
  *    Also uses code from InDet::SCT_ResidualPullCalculator
  */
 #include "SCT_Monitoring/SCTTracksMonTool.h"
+
 #include "SCT_NameFormatter.h"
-#include <cmath>
-#include "AthenaKernel/errorcheck.h"
-#include "GaudiKernel/StatusCode.h"
-#include "GaudiKernel/IToolSvc.h"
 
-#include "TH1F.h"
-#include "TH2F.h"
-#include "TProfile2D.h"
-#include "TF1.h"
 #include "AthContainers/DataVector.h"
+#include "AthenaKernel/errorcheck.h"
 #include "Identifier/Identifier.h"
 #include "InDetIdentifier/SCT_ID.h"
-#include "InDetRIO_OnTrack/SiClusterOnTrack.h"
 #include "InDetPrepRawData/SiCluster.h"
+#include "InDetRIO_OnTrack/SiClusterOnTrack.h"
+#include "StoreGate/ReadHandle.h"
 #include "TrkParameters/TrackParameters.h"
 #include "TrkTrackSummary/TrackSummary.h"
 
-// for sct residuals
-// for GetKalmanUpdator
+#include "GaudiKernel/IToolSvc.h"
 #include "GaudiKernel/ListItem.h"
+#include "GaudiKernel/StatusCode.h"
 
-#include "StoreGate/ReadHandle.h"
+#include "TF1.h"
+#include "TH1F.h"
+#include "TH2F.h"
+#include "TProfile2D.h"
+
+#include <cmath>
 
 using namespace std;
 using namespace SCT_Monitoring;
@@ -65,9 +65,9 @@ namespace {
  *  numbers to be used, and the timebin.
  */
 // ====================================================================================================
-SCTTracksMonTool::SCTTracksMonTool(const string &type,
-                                   const string &name,
-                                   const IInterface *parent)
+SCTTracksMonTool::SCTTracksMonTool(const string& type,
+                                   const string& name,
+                                   const IInterface* parent)
   : SCTMotherTrigMonTool(type, name, parent),
   m_nTracks(nullptr),
   m_trackTrigger(nullptr),
@@ -288,14 +288,14 @@ SCTTracksMonTool::fillHistograms() {
   ATH_MSG_DEBUG("Begin loop over " << tracks->size() << " tracks");
   for (TrackCollection::const_iterator trkitr(tracks->begin()); trkitr != trkend; ++trkitr) {
     int local_scthits = 0;
-    const Trk::Track *track = (*trkitr);
+    const Trk::Track* track = (*trkitr);
     if (not track) {
       ATH_MSG_ERROR("No pointer to track");
       break;
     }
     int scthits_on_trk(0);     // Breaks out of loop if track has less than 3 sct hits
-    const Trk::TrackSummary *trkSum(track->trackSummary());
-    if (trkSum != NULL) {
+    const Trk::TrackSummary* trkSum(track->trackSummary());
+    if (trkSum) {
       scthits_on_trk = trkSum->get(Trk::numberOfSCTHits);
     } else {
       ATH_MSG_WARNING("TrackSummary not found not using track!");
@@ -336,13 +336,13 @@ SCTTracksMonTool::fillHistograms() {
       false, false, false
     }; // Define bools to check whether the track has barrel, EA/C hits
     // Get pointer to track state on surfaces
-    const DataVector<const Trk::TrackStateOnSurface> *trackStates(track->trackStateOnSurfaces());
+    const DataVector<const Trk::TrackStateOnSurface>* trackStates(track->trackStateOnSurfaces());
     if (not trackStates) {
       ATH_MSG_ERROR("for current track, TrackStateOnSurfaces == Null, no data will be written for this track");
       break;
     }
-    VecProf2_t *residualsHistogramArray[3];
-    VecProf2_t *pullsHistogramArray[3];
+    VecProf2_t* residualsHistogramArray[3];
+    VecProf2_t* pullsHistogramArray[3];
     Prof2_t residualsHistogram(0);
     Prof2_t pullsHistogram(0);
     if (m_environment != AthenaMonManager::online) {
@@ -354,11 +354,11 @@ SCTTracksMonTool::fillHistograms() {
       pullsHistogramArray[2] = &m_psctpullsHistoVectorECp;
     }
 
-    VecH1_t *residualsSummaryHistogramArray[3] = {
+    VecH1_t* residualsSummaryHistogramArray[3] = {
       &m_psctresiduals_summaryHistoVectorECm,
       &m_psctresiduals_summaryHistoVector, &m_psctresiduals_summaryHistoVectorECp
     };
-    VecH1_t *pullsSummaryHistogramArray[3] = {
+    VecH1_t* pullsSummaryHistogramArray[3] = {
       &m_psctpulls_summaryHistoVectorECm,
       &m_psctpulls_summaryHistoVector, &m_psctpulls_summaryHistoVectorECp
     };
@@ -367,9 +367,9 @@ SCTTracksMonTool::fillHistograms() {
     DataVector<const Trk::TrackStateOnSurface>::const_iterator endit(trackStates->end());
     for (DataVector<const Trk::TrackStateOnSurface>::const_iterator it(trackStates->begin()); it != endit; ++it) {
       if ((*it)->type(Trk::TrackStateOnSurface::Measurement)) {
-        const InDet::SiClusterOnTrack *clus(dynamic_cast<const InDet::SiClusterOnTrack *>((*it)->measurementOnTrack()));
+        const InDet::SiClusterOnTrack* clus(dynamic_cast<const InDet::SiClusterOnTrack*>((*it)->measurementOnTrack()));
         if (clus) { // Is it a SiCluster? If yes...
-          const InDet::SiCluster *RawDataClus(dynamic_cast<const InDet::SiCluster *>(clus->prepRawData()));
+          const InDet::SiCluster* RawDataClus(dynamic_cast<const InDet::SiCluster*>(clus->prepRawData()));
           if (not RawDataClus) {
             continue; // Continue if dynamic_cast returns null
           }
@@ -379,19 +379,19 @@ SCTTracksMonTool::fillHistograms() {
             const int phi(m_pSCTHelper->phi_module(sct_id));
             const int bec(m_pSCTHelper->barrel_ec(sct_id));
             const int layer(m_pSCTHelper->layer_disk(sct_id));
-            const int element(2 * layer + m_pSCTHelper->side(sct_id));
+            const int element(2*  layer + m_pSCTHelper->side(sct_id));
             const int subsystemIndex(bec2Index(bec));
             const bool doThisDetector(doThisSubsystem[subsystemIndex]);
             hasHits[subsystemIndex] = true;
-            const Trk::TrackParameters *trkParameters(0);
-            const Trk::RIO_OnTrack *rio(dynamic_cast<const Trk::RIO_OnTrack *>((*it)->measurementOnTrack()));
+            const Trk::TrackParameters* trkParameters(0);
+            const Trk::RIO_OnTrack* rio(dynamic_cast<const Trk::RIO_OnTrack*>((*it)->measurementOnTrack()));
             bool updateSucceeds(true);
             if (rio) {
 #ifndef NDEBUG
               ATH_MSG_DEBUG("if rio");
 #endif
               if (m_doUnbiasedCalc) {
-                const Trk::TrackParameters *trkParam((*it)->trackParameters());
+                const Trk::TrackParameters* trkParam((*it)->trackParameters());
                 if (trkParam) {
                   trkParameters = m_updator->removeFromState(*trkParam, rio->localParameters(), rio->localCovariance());
                   updateSucceeds = (trkParameters != 0);
@@ -410,7 +410,7 @@ SCTTracksMonTool::fillHistograms() {
               ATH_MSG_DEBUG("Cluster Position Phi= " << clus->localParameters()[Trk::locX]);
 #endif
               if (!m_residualPullCalculator.empty()) {
-                const Trk::ResidualPull *residualPull(m_residualPullCalculator->residualPull(rio, trkParameters,
+                const Trk::ResidualPull* residualPull(m_residualPullCalculator->residualPull(rio, trkParameters,
                                                                                              m_doUnbiasedCalc ? Trk::ResidualPull::Unbiased : Trk::ResidualPull::Biased));
                 if (!residualPull) {
                   ATH_MSG_WARNING("Residual Pull Calculator did not succeed!");
@@ -460,25 +460,25 @@ SCTTracksMonTool::fillHistograms() {
             } else { // no measured local parameters, pull won't be calculated
               ATH_MSG_WARNING("No measured local parameters, pull won't be calculated");
               // sroe: trkParameters is null at this point, by definition, so the following code is dead
-              // const Trk::AtaPlane * trackAtPlane(dynamic_cast<const Trk::AtaPlane*> (trkParameters));
+              // const Trk::AtaPlane*  trackAtPlane(dynamic_cast<const Trk::AtaPlane*> (trkParameters));
               /**
                  if (trackAtPlane) {
                                 //    const CLHEP::HepVector LocalTrackParameters(trackAtPlane->parameters());
                                 const AmgVector(5) LocalTrackParameters(trackAtPlane->parameters());
-                                if(clus->localParameters().parameterKey() == ONE_D_LOCATION){
+                                if (clus->localParameters().parameterKey() == ONE_D_LOCATION){
                                     float local_residual(LocalTrackParameters[Trk::locX] -
                                        clus->localParameters()[Trk::locX]);
                                     if (doThisDetector){
                                         residualsSummaryHistogram =
                                            (*residualsSummaryHistogramArray[subsystemIndex])[element];
-                                        if(m_environment != AthenaMonManager::online){
+                                        if (m_environment != AthenaMonManager::online){
                                             residualsHistogram = (*residualsHistogramArray[subsystemIndex])[element];
                                             if (residualsHistogram) residualsHistogram->Fill(eta, phi, local_residual);
                                         }
                                         if (residualsSummaryHistogram) residualsSummaryHistogram->Fill(local_residual,
                                            1.);
-                                        if(bec == 0) m_totalBarrelResidual->Fill(local_residual, 1.);
-                                        else if(bec > 0) m_totalEndCapAResidual->Fill(local_residual, 1.);
+                                        if (bec == 0) m_totalBarrelResidual->Fill(local_residual, 1.);
+                                        else if (bec > 0) m_totalEndCapAResidual->Fill(local_residual, 1.);
                                         else m_totalEndCapCResidual->Fill(local_residual, 1.);
                                     }
                                 } else {
@@ -493,7 +493,7 @@ SCTTracksMonTool::fillHistograms() {
                + (LocalTrackParameters[Trk::locY] - clus->localParameters()[Trk::locY]) * sinAlpha);
                                         residualsSummaryHistogram = (bec == BARREL) ? 0 :
                                          +(*residualsSummaryHistogramArray[subsystemIndex])[element];
-                                        if(m_environment != AthenaMonManager::online){
+                                        if (m_environment != AthenaMonManager::online){
                                             residualsHistogram = (bec == BARREL) ? 0 :
                                              +(*residualsHistogramArray[subsystemIndex])[layer];//!!! this is 'layer' in
                                              +the original code, others are elements
@@ -501,8 +501,8 @@ SCTTracksMonTool::fillHistograms() {
                                         }
                                         if (residualsSummaryHistogram) residualsSummaryHistogram->Fill(local_residual,
                                          +1.);
-                                        if(bec == 0) m_totalBarrelResidual->Fill(local_residual, 1.);
-                                        else if(bec > 0) m_totalEndCapAResidual->Fill(local_residual, 1.);
+                                        if (bec == 0) m_totalBarrelResidual->Fill(local_residual, 1.);
+                                        else if (bec > 0) m_totalEndCapAResidual->Fill(local_residual, 1.);
                                         else m_totalEndCapCResidual->Fill(local_residual, 1.);
                                     }
                                 }
@@ -518,8 +518,8 @@ SCTTracksMonTool::fillHistograms() {
               }
             }
           } // end if SCT..
-        } // end if(clus)
-      } // if((*it)->type(Trk::TrackStateOnSurface::Measurement))
+        } // end if (clus)
+      } // if ((*it)->type(Trk::TrackStateOnSurface::Measurement))
     }// end of loop on TrackStatesonSurface (they can be SiClusters, TRTHits,..)
     m_trk_ncluHisto->Fill(local_scthits, 1.);
     // We now know whether this particular track had hits in the barrel or endcaps- update the profile histogram
@@ -616,16 +616,16 @@ SCTTracksMonTool::checkHists(bool /*fromFinalize*/) {
 
 
   if (m_environment != AthenaMonManager::online) {
-    const VecProf2_t *residuals[3] = {
+    const VecProf2_t* residuals[3] = {
       &m_psctresidualsHistoVectorECm, &m_psctresidualsHistoVector, &m_psctresidualsHistoVectorECp
     };
-    const VecProf2_t *pulls[3] = {
+    const VecProf2_t* pulls[3] = {
       &m_psctpullsHistoVectorECm, &m_psctpullsHistoVector, &m_psctpullsHistoVectorECp
     };
-    const VecH2_t *pullsRms[3] = {
+    const VecH2_t* pullsRms[3] = {
       &m_psctpullsRMSHistoVectorECm, &m_psctpullsRMSHistoVector, &m_psctpullsRMSHistoVectorECp
     };
-    const VecH2_t *residualsRms[3] = {
+    const VecH2_t* residualsRms[3] = {
       &m_psctresidualsRMSHistoVectorECm, &m_psctresidualsRMSHistoVector, &m_psctresidualsRMSHistoVectorECp
     };
 
@@ -687,7 +687,7 @@ SCTTracksMonTool::checkHists(bool /*fromFinalize*/) {
    //====================================================================================================
    StatusCode SCTTracksMonTool::GetKalmanUpdator(){
    // use kalman updator to get unbiased states
-   IAlgTool * algTool;
+   IAlgTool*  algTool;
    ListItem ltool("Trk::KalmanUpdator/TrkKalmanUpdator");
    CHECK(toolSvc()->retrieveTool(ltool.type(), ltool.name(), algTool));
    m_updator = dynamic_cast<Trk::IUpdator*>(algTool);
@@ -705,7 +705,7 @@ float
 SCTTracksMonTool::calculatePull(const float residual, const float trkErr, const float hitErr) {
   float ErrorSum(pow(trkErr * trkErr + hitErr * hitErr, 0.5));
 
-  if (ErrorSum > 1.0e-20) { // if(ErrorSum != 0) //as floats are rarely exactly zero
+  if (ErrorSum > 1.0e-20) { // as floats are rarely exactly zero
     return residual / ErrorSum;
   } else {
     ATH_MSG_DEBUG("Error on Track and Cluster are 0. Returning Pull value 0.");
@@ -818,7 +818,7 @@ SCTTracksMonTool::bookGeneralHistos() {
       m_nTracks->GetYaxis()->SetTitle("Num of Tracks");
       size_t nTracks_buf_size;
       nTracks_buf_size = m_evtsbins * sizeof(int);
-      m_nTracks_buf = (int *) malloc(nTracks_buf_size);
+      m_nTracks_buf = (int*) malloc(nTracks_buf_size);
       m_nTracks_pos = 0;
       CHECK(Tracks.regHist(m_nTracks));
     }
@@ -853,10 +853,10 @@ SCTTracksMonTool::bookTrackHistos(const SCT_Monitoring::Bec becVal) {
   };
   const unsigned int systemIndex(bec2Index(becVal));
 
-  VecH1_t *residualsSummaryArray[] = {
+  VecH1_t* residualsSummaryArray[] = {
     &m_psctresiduals_summaryHistoVectorECm, &m_psctresiduals_summaryHistoVector, &m_psctresiduals_summaryHistoVectorECp
   };
-  VecH1_t *pullsSummaryArray[] = {
+  VecH1_t* pullsSummaryArray[] = {
     &m_psctpulls_summaryHistoVectorECm, &m_psctpulls_summaryHistoVector, &m_psctpulls_summaryHistoVectorECp
   };
 
@@ -867,7 +867,8 @@ SCTTracksMonTool::bookTrackHistos(const SCT_Monitoring::Bec becVal) {
   const string localPathResi(localPathsResi[systemIndex]);
   const string localPathPull(localPathsPull[systemIndex]);
   const unsigned int limit(limits[systemIndex]);
-  VecH1_t *p_residualsSummary(residualsSummaryArray[systemIndex]), *p_pullsSummary(pullsSummaryArray[systemIndex]);
+  VecH1_t* p_residualsSummary(residualsSummaryArray[systemIndex]);
+  VecH1_t* p_pullsSummary(pullsSummaryArray[systemIndex]);
 
   MonGroup endCapTracks(this, m_path + localPath, run, ATTRIB_UNMANAGED);
   MonGroup endCapTracksResi(this, m_path + localPathResi, run, ATTRIB_UNMANAGED);
@@ -890,24 +891,24 @@ SCTTracksMonTool::bookTrackHistos(const SCT_Monitoring::Bec becVal) {
 
 
   if (m_environment != AthenaMonManager::online) {
-    VecProf2_t *residualsArray[] = {
+    VecProf2_t* residualsArray[] = {
       &m_psctresidualsHistoVectorECm, &m_psctresidualsHistoVector, &m_psctresidualsHistoVectorECp
     };
-    VecH2_t *residualsRmsArray[] = {
+    VecH2_t* residualsRmsArray[] = {
       &m_psctresidualsRMSHistoVectorECm, &m_psctresidualsRMSHistoVector, &m_psctresidualsRMSHistoVectorECp
     };
 
-    VecProf2_t *pullsArray[] = {
+    VecProf2_t* pullsArray[] = {
       &m_psctpullsHistoVectorECm, &m_psctpullsHistoVector, &m_psctpullsHistoVectorECp
     };
-    VecH2_t *pullsRmsArray[] = {
+    VecH2_t* pullsRmsArray[] = {
       &m_psctpullsRMSHistoVectorECm, &m_psctpullsRMSHistoVector, &m_psctpullsRMSHistoVectorECp
     };
 
-    VecProf2_t *p_residuals(residualsArray[systemIndex]);
-    VecProf2_t *p_pulls(pullsArray[systemIndex]);
-    VecH2_t *p_residualsRms(residualsRmsArray[systemIndex]);
-    VecH2_t *p_pullsRms(pullsRmsArray[systemIndex]);
+    VecProf2_t* p_residuals(residualsArray[systemIndex]);
+    VecProf2_t* p_pulls(pullsArray[systemIndex]);
+    VecH2_t* p_residualsRms(residualsRmsArray[systemIndex]);
+    VecH2_t* p_pullsRms(pullsRmsArray[systemIndex]);
 
     p_residuals->clear();
     p_pulls->clear();
@@ -943,8 +944,8 @@ SCTTracksMonTool::bookTrackHistos(const SCT_Monitoring::Bec becVal) {
 }
 
 StatusCode
-SCTTracksMonTool::h2Factory(const std::string &name, const std::string &title,
-                            const SCT_Monitoring::Bec bec, MonGroup &registry, VecH2_t &storageVector) {
+SCTTracksMonTool::h2Factory(const std::string& name, const std::string& title,
+                            const SCT_Monitoring::Bec bec, MonGroup& registry, VecH2_t& storageVector) {
   int firstEta(FIRST_ETA_BIN), lastEta(LAST_ETA_BIN), firstPhi(FIRST_PHI_BIN), lastPhi(LAST_PHI_BIN), nEta(N_ETA_BINS),
   nPhi(N_PHI_BINS);
 
@@ -964,8 +965,8 @@ SCTTracksMonTool::h2Factory(const std::string &name, const std::string &title,
 }
 
 StatusCode
-SCTTracksMonTool::p2Factory(const std::string &name, const std::string &title,
-                            const SCT_Monitoring::Bec bec, MonGroup &registry, VecProf2_t &storageVector) {
+SCTTracksMonTool::p2Factory(const std::string& name, const std::string& title,
+                            const SCT_Monitoring::Bec bec, MonGroup& registry, VecProf2_t& storageVector) {
   int firstEta(FIRST_ETA_BIN), lastEta(LAST_ETA_BIN), firstPhi(FIRST_PHI_BIN), lastPhi(LAST_PHI_BIN), nEta(N_ETA_BINS),
   nPhi(N_PHI_BINS);
 
@@ -985,8 +986,8 @@ SCTTracksMonTool::p2Factory(const std::string &name, const std::string &title,
 }
 
 StatusCode
-SCTTracksMonTool::h1Factory(const std::string &name, const std::string &title, const float extent, MonGroup &registry,
-                            VecH1_t &storageVector) {
+SCTTracksMonTool::h1Factory(const std::string& name, const std::string& title, const float extent, MonGroup& registry,
+                            VecH1_t& storageVector) {
   const unsigned int nbins(100);
   const float lo(-extent), hi(extent);
   H1_t tmp = new TH1F(TString(name), TString(title), nbins, lo, hi);
diff --git a/InnerDetector/InDetRawAlgs/InDetOverlay/CMakeLists.txt b/InnerDetector/InDetRawAlgs/InDetOverlay/CMakeLists.txt
index 1a7443086f9a8989f0f13d0306d3a18785ce6f42..f1a3579953ffe0ee50761ab52c6cf70bfc78240c 100644
--- a/InnerDetector/InDetRawAlgs/InDetOverlay/CMakeLists.txt
+++ b/InnerDetector/InDetRawAlgs/InDetOverlay/CMakeLists.txt
@@ -32,7 +32,7 @@ set( _jobOPath "${_jobOPath}:$ENV{JOBOPTSEARCHPATH}" )
 
 # Unit Tests
 atlas_add_test( PixelOverlay_test
-                SOURCES src/PixelOverlay.cxx test/PixelOverlay_test.cxx
+                SOURCES test/PixelOverlay_test.cxx src/PixelOverlay.cxx
                 INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} ${GTEST_INCLUDE_DIRS}
                 LINK_LIBRARIES ${CLHEP_LIBRARIES} AthenaBaseComps IDC_OverlayBase GaudiKernel InDetRawData StoreGateLib SGtests GeneratorObjects InDetIdentifier InDetSimData TrkTrack ${GTEST_LIBRARIES}
                 EXTRA_PATTERNS "[0-9]+ ms")
diff --git a/LArCalorimeter/LArElecCalib/LArElecCalib/ATLAS_CHECK_THREAD_SAFETY b/LArCalorimeter/LArElecCalib/LArElecCalib/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 0000000000000000000000000000000000000000..347bf36b9d2912d97f3b83526279dfb6d71b583a
--- /dev/null
+++ b/LArCalorimeter/LArElecCalib/LArElecCalib/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+LArCalorimeter/LArElecCalib
diff --git a/LArCalorimeter/LArG4/LArG4SD/python/LArG4SDToolConfig.py b/LArCalorimeter/LArG4/LArG4SD/python/LArG4SDToolConfig.py
index 125467b1d6c1456d49cf899198edd6ecb2a5c5cd..361aa1600d42a025b9dc3a10d892e6b360612d83 100644
--- a/LArCalorimeter/LArG4/LArG4SD/python/LArG4SDToolConfig.py
+++ b/LArCalorimeter/LArG4/LArG4SD/python/LArG4SDToolConfig.py
@@ -6,6 +6,9 @@ from ISF_Algorithms.collection_merger_helpersNew import CollectionMergerCfg
 from LArG4SD.LArG4SDConf import LArG4__EMBSDTool
 from LArG4SD.LArG4SDConf import LArG4__EMECSDTool
 from LArG4SD.LArG4SDConf import LArG4__FCALSDTool
+from LArG4SD.LArG4SDConf import LArG4__HECSDTool
+from LArG4SD.LArG4SDConf import LArG4__MiniFCALSDTool
+from LArG4SD.LArG4SDConf import LArG4__DeadSDTool
 
 def getLArActiveSensitiveDetector(name="LArActiveSensitiveDetector", **kwargs):
     ## Main configuration
@@ -32,7 +35,7 @@ def getLArActiveSensitiveDetector(name="LArActiveSensitiveDetector", **kwargs):
     kwargs.setdefault("OutputCollectionNames", ["LArCalibrationHitActive"])
     return CfgMgr.LArG4__ActiveSDTool(name, **kwargs)
 
-def getLArDeadSensitiveDetector(name="LArDeadSensitiveDetector", **kwargs):
+def LArDeadSensitiveDetectorToolCfg(ConfigFlags, name="LArDeadSensitiveDetector", **kwargs):
     ## Main configuration
     kwargs.setdefault("BarrelCryVolumes",   ["LArMgr::LAr::Barrel::Cryostat::InnerWall::Vis",
                                              "LArMgr::LAr::Barrel::Cryostat::Sector::*",
@@ -113,16 +116,14 @@ def getLArDeadSensitiveDetector(name="LArDeadSensitiveDetector", **kwargs):
                                              "LArMgr::LAr::HEC::Module::Depth::FirstAbsorber",
                                              "LArMgr::LAr::HEC::Module::Depth::FirstAbsorber::TieRod"])
     # Running PID calibration hits?
-    from G4AtlasApps.SimFlags import simFlags
-    kwargs.setdefault("ParticleID",simFlags.ParticleID())
-    kwargs.setdefault("doEscapedEnergy",simFlags.CalibrationRun.get_Value()!='DeadLAr')
+    kwargs.setdefault("ParticleID", ConfigFlags.Sim.ParticleID)
+    kwargs.setdefault("doEscapedEnergy",ConfigFlags.Sim.CalibrationRun  !='DeadLAr')
     # No effect currently
-    outputCollectionName = "LArCalibrationHitDeadMaterial"
-    from G4AtlasApps.SimFlags import simFlags
-    if simFlags.CalibrationRun.get_Value() in ['LAr', 'LAr+Tile']:
+    outputCollectionName = "LArCalibrationHitDeadMaterial"  
+    if ConfigFlags.Sim.CalibrationRun in ['LAr', 'LAr+Tile']:
         outputCollectionName = "LArCalibrationHitDeadMaterial_DEAD"
     kwargs.setdefault("HitCollectionName", outputCollectionName)
-    return CfgMgr.LArG4__DeadSDTool(name, **kwargs)
+    return LArG4__DeadSDTool(name, **kwargs)
 
 def LArEMBSensitiveDetectorCfg(ConfigFlags,name="LArEMBSensitiveDetector", **kwargs):
 
@@ -197,20 +198,25 @@ def LArFCALSensitiveDetectorCfg(ConfigFlags, name="LArFCALSensitiveDetector", **
     result.merge(acc)
     return result, LArG4__FCALSDTool(name, **kwargs)
 
-def getLArHECSensitiveDetector(name="LArHECSensitiveDetector", **kwargs):
+def LArHECSensitiveDetectorCfg(ConfigFlags, name="LArHECSensitiveDetector", **kwargs):
+    result = ComponentAccumulator()
     bare_collection_name = "LArHitHEC"
     mergeable_collection_suffix = "_G4"
     merger_input_property = "LArHECHits"
-    hits_collection_name = generate_mergeable_collection_name(bare_collection_name,
+    acc, hits_collection_name = CollectionMergerCfg(ConfigFlags, bare_collection_name,
                                                               mergeable_collection_suffix,
                                                               merger_input_property)
+
+
+    kwargs.setdefault("WheelVolumes",["LArMgr::LAr::HEC::Module::Depth::Slice"])
     #kwargs.setdefault("SliceVolumes",["LAr::HEC::Module::Depth::Slice"])
     #kwargs.setdefault("LocalVolumes",["LAr::HEC::Module::Depth::Slice::Local"])
-    kwargs.setdefault("WheelVolumes",["LArMgr::LAr::HEC::Module::Depth::Slice"])
     #  You might think this should go here, but we don't think so!  LAr::HEC::Module::Depth::Slice::Wheel"])
     # No effect currently
     kwargs.setdefault("OutputCollectionNames", [hits_collection_name])
-    return CfgMgr.LArG4__HECSDTool(name, **kwargs)
+
+    result.merge(acc)
+    return result, LArG4__HECSDTool(name, **kwargs)
 
 def getLArInactiveSensitiveDetector(name="LArInactiveSensitiveDetector", **kwargs):
     ## Main configuration
@@ -273,11 +279,12 @@ def getLArInactiveSensitiveDetector(name="LArInactiveSensitiveDetector", **kwarg
     kwargs.setdefault("OutputCollectionNames", ["LArCalibrationHitInactive"])
     return CfgMgr.LArG4__InactiveSDTool(name, **kwargs)
 
-def getLArMiniFCALSensitiveDetector(name="LArMiniFCALSensitiveDetector", **kwargs):
+def LArMiniFCALSensitiveDetectorToolCfg(ConfigFlags, name="LArMiniFCALSensitiveDetector", **kwargs):
     kwargs.setdefault("MiniVolumes",["LArMgr::MiniFCAL::Wafer"])
     # No effect currently
     kwargs.setdefault("OutputCollectionNames", ["LArHitMiniFCAL"])
-    return CfgMgr.LArG4__MiniFCALSDTool(name, **kwargs)
+
+    return LArG4__MiniFCALSDTool(name, **kwargs)
 
 def getCalibrationDefaultCalculator(name="CalibrationDefaultCalculator", **kwargs):
     return CfgMgr.LArG4__CalibrationDefaultCalculator(name, **kwargs)
diff --git a/LArCalorimeter/LArG4/LArG4SD/test/LArG4SDToolConfig_test.py b/LArCalorimeter/LArG4/LArG4SD/test/LArG4SDToolConfig_test.py
index 389a87e86016132f56e11a1248fa40e1cb1f48e9..c5f3a7f3ceb437a3fbfff88459fda8b72268d6ab 100755
--- a/LArCalorimeter/LArG4/LArG4SD/test/LArG4SDToolConfig_test.py
+++ b/LArCalorimeter/LArG4/LArG4SD/test/LArG4SDToolConfig_test.py
@@ -37,8 +37,10 @@ if __name__ == '__main__':
   from LArG4SD.LArG4SDToolConfig import LArEMBSensitiveDetectorCfg
   from LArG4SD.LArG4SDToolConfig import LArEMECSensitiveDetectorCfg
   from LArG4SD.LArG4SDToolConfig import LArFCALSensitiveDetectorCfg
+  from LArG4SD.LArG4SDToolConfig import LArHECSensitiveDetectorCfg
+  from LArG4SD.LArG4SDToolConfig import LArMiniFCALSensitiveDetectorToolCfg
+  from LArG4SD.LArG4SDToolConfig import LArDeadSensitiveDetectorToolCfg
 
-  #TODO CHECK IF THESE ARE ALL PUBLIC TOOLS!
   acc1, tool1 = LArEMBSensitiveDetectorCfg(ConfigFlags)
   acc1.addPublicTool(tool1)
   cfg.merge(acc1)
@@ -52,6 +54,17 @@ if __name__ == '__main__':
   acc3.addPublicTool(tool3)
   cfg.merge(acc3)
   
+  acc4, tool4 = LArHECSensitiveDetectorCfg(ConfigFlags)
+  acc4.addPublicTool(tool4)
+  cfg.merge(acc4)
+
+  toolMiniFCAL = LArMiniFCALSensitiveDetectorToolCfg(ConfigFlags)
+  cfg.addPublicTool(toolMiniFCAL)
+
+  toolDeadSensitiveDetector = LArDeadSensitiveDetectorToolCfg(ConfigFlags)
+  cfg.addPublicTool(toolDeadSensitiveDetector)
+  
+
 
   cfg.printConfig(withDetails=True, summariseProps = True)
   ConfigFlags.dump()
diff --git a/MuonSpectrometer/Amdcsimrec/AmdcStand/src/getindfromamdc.F90 b/MuonSpectrometer/Amdcsimrec/AmdcStand/src/getindfromamdc.F90
index 772cf6129a5c037eb90b1de8d2ac1cc483a2c74c..1eed1cd65f9a644cfce08bba3589be9db05fcd3c 100644
--- a/MuonSpectrometer/Amdcsimrec/AmdcStand/src/getindfromamdc.F90
+++ b/MuonSpectrometer/Amdcsimrec/AmdcStand/src/getindfromamdc.F90
@@ -308,7 +308,7 @@
 !
     NberOfMDTMultilayers = 0
 !
-    IF( Jff <= 0 )   	 RETURN
+    IF( Jff <= 0 )        RETURN
     Car3(1:1)=TypChar1(1)
     Car3(2:2)=TypChar1(2)
     Car3(3:3)=TypChar1(3)
diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTrackSummaryHelperTool/src/MuonTrackSummaryHelperTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTrackSummaryHelperTool/src/MuonTrackSummaryHelperTool.cxx
index d6823fcb0b06e0b0b9c475a1c80c08fd145645ef..b1cbb362a25e0f55624a39ac3bc9b9176c49e9d0 100755
--- a/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTrackSummaryHelperTool/src/MuonTrackSummaryHelperTool.cxx
+++ b/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTrackSummaryHelperTool/src/MuonTrackSummaryHelperTool.cxx
@@ -298,9 +298,7 @@ void Muon::MuonTrackSummaryHelperTool::searchForHoles (
   }
   // 
   if (!m_trackingGeometry) {   
-    StoreGateSvc* detStore = 0;
-    StatusCode sc = service( "DetectorStore", detStore );
-    sc = detStore->retrieve(m_trackingGeometry, m_trackingGeometryName);
+    StatusCode sc = detStore()->retrieve(m_trackingGeometry, m_trackingGeometryName);
     if (sc.isFailure()) {
       msg (MSG::FATAL)<<"Could not find geometry "<< m_trackingGeometryName<<". Exiting."
 		      << endmsg;
diff --git a/MuonSpectrometer/MuonTruthAlgs/src/MuonPRD_MultiTruthMaker.cxx b/MuonSpectrometer/MuonTruthAlgs/src/MuonPRD_MultiTruthMaker.cxx
index 883cf72c5c7ee31be1839e40212b84ca425c3dea..d57d9d05870681e437e800fec1099f39d354038c 100755
--- a/MuonSpectrometer/MuonTruthAlgs/src/MuonPRD_MultiTruthMaker.cxx
+++ b/MuonSpectrometer/MuonTruthAlgs/src/MuonPRD_MultiTruthMaker.cxx
@@ -163,57 +163,52 @@ void MuonPRD_MultiTruthMaker::addPRDRange (SG::WriteHandle<PRD_MultiTruthCollect
 //================================================================
 template <class SIMDATACOLLECTION>
 void MuonPRD_MultiTruthMaker::addPrepRawDatum(SG::WriteHandle<PRD_MultiTruthCollection> prdTruth,
-					      const Trk::PrepRawData* prd,
-					      SG::ReadHandle<SIMDATACOLLECTION> simDataMap
-    )
+                                              const Trk::PrepRawData* prd,
+                                              SG::ReadHandle<SIMDATACOLLECTION> simDataMap
+                                              )
 {
-    ATH_MSG_VERBOSE( "addPrepRawDatum(): new PRD "<<prd<<", id="<<prd->identify()<<", number of RDOs: " << prd->rdoList().size() );
+  ATH_MSG_VERBOSE( "addPrepRawDatum(): new PRD "<<prd<<", id="<<prd->identify()<<", number of RDOs: " << prd->rdoList().size() );
 
-    bool gotSDO = false;
-    bool gotValidParticle = false;
+  bool gotSDO = false;
+  bool gotValidParticle = false;
 
   // loop over RDOs
-    std::vector<Identifier>::const_iterator nextRDO = prd->rdoList().begin();
-    std::vector<Identifier>::const_iterator lastRDO = prd->rdoList().end();   
-    for (; nextRDO!=lastRDO; ++nextRDO) {
-        typename SIMDATACOLLECTION::const_iterator iter(simDataMap->find(*nextRDO));
+  for (const auto& nextRDO : prd->rdoList()) {
+    typename SIMDATACOLLECTION::const_iterator iter(simDataMap->find(nextRDO));
 
-        if(iter != simDataMap->end() )  {
-            gotSDO = true;
+    if(iter != simDataMap->end() )  {
+      gotSDO = true;
       // Got an SDO.  Try to associate the PRD to MC particles we have info about.
-            typedef typename SIMDATACOLLECTION::mapped_type SIMDATA;
-            const SIMDATA& sdo = iter->second; 
-            const std::vector<   typename SIMDATA::Deposit >& deposits = sdo.getdeposits();
-            typename std::vector< typename SIMDATA::Deposit >::const_iterator nextdeposit = deposits.begin();
-            typename std::vector< typename SIMDATA::Deposit >::const_iterator lastdeposit = deposits.end();
-            for( ; nextdeposit!=lastdeposit; ++nextdeposit) {
-                const HepMcParticleLink& particleLink = nextdeposit->first;
-
-                ATH_MSG_VERBOSE("addPrepRawDatum(): Barcode " << particleLink.barcode()<< " evt " << particleLink.eventIndex() );
-
-                if (particleLink.isValid()) {
-                    gotValidParticle = true;
-      // Associate the particle to the PRD. But don't add duplicates.
-      // Note: it may be more efficient to filter out duplicates among particles for the current PRD, then check-and-add the reduced set to the large multimap.
-      // But may be not for the typically small RDO/PRD ratio.
-                    typedef PRD_MultiTruthCollection::iterator truthiter;
-                    std::pair<truthiter, truthiter> r = prdTruth->equal_range(prd->identify());
-		    if(r.second == std::find_if(r.first, r.second, 
-                          [ particleLink ](const PRD_MultiTruthCollection::value_type &prd_to_truth) {
-                             return prd_to_truth.second == particleLink;
-                          } )) {
-                        prdTruth->insert(std::make_pair(prd->identify(), particleLink));
-                    }
-                }
-            }
+      typedef typename SIMDATACOLLECTION::mapped_type SIMDATA;
+      const SIMDATA& sdo = iter->second;
+      const std::vector<   typename SIMDATA::Deposit >& deposits = sdo.getdeposits();
+      if (deposits.empty()) { continue; }
+      for (const auto& [particleLink, mcData] : deposits) {
+        ATH_MSG_VERBOSE("addPrepRawDatum(): particleLink.isValid() " << particleLink.isValid() );
+        ATH_MSG_VERBOSE("addPrepRawDatum(): Barcode " << particleLink.barcode()<< " evt " << particleLink.eventIndex() );
+        if (particleLink.isValid()) {
+          gotValidParticle = true;
+          // Associate the particle to the PRD. But don't add duplicates.
+          // Note: it may be more efficient to filter out duplicates among particles for the current PRD, then check-and-add the reduced set to the large multimap.
+          // But may be not for the typically small RDO/PRD ratio.
+          typedef PRD_MultiTruthCollection::iterator truthiter;
+          std::pair<truthiter, truthiter> r = prdTruth->equal_range(prd->identify());
+          if(r.second == std::find_if(r.first, r.second,
+                                      [ particleLink ](const PRD_MultiTruthCollection::value_type &prd_to_truth) {
+                                        return prd_to_truth.second == particleLink;
+                                      } )) {
+            prdTruth->insert(std::make_pair(prd->identify(), particleLink));
+          }
         }
+      }
     }
+  }
 
-    if(gotSDO && !gotValidParticle) {
+  if(gotSDO && !gotValidParticle) {
     // Looked at all the deposits from all the SDOs, but did not find any valid particle link.
     //prdTruth->insert(std::make_pair(prd, particleLinkUnknown));
-        ATH_MSG_DEBUG("addPrepRawDatum(): got SDO but no particles");
-    }
+    ATH_MSG_DEBUG("addPrepRawDatum(): got SDO but no particles");
+  }
 }
 
 //================================================================
diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_LoadTools.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_LoadTools.py
index e8474eaf60060e3b631bd42635913fb9418880e7..039fbe5d20833ecbc070233c681536590a8a5101 100644
--- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_LoadTools.py
+++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_LoadTools.py
@@ -130,10 +130,9 @@ def Initiate(ConfInstance=None):
     # -------------- Calibration Broker --------------
     from AthenaCommon.AppMgr import ToolSvc
     from AthenaCommon.Resilience import treatException,protectedInclude
-    if ConfInstance._name == "":
-      print ConfInstance.BTagTag()+' - No calibration broker setup - The condition algorithm is used'
-    elif ConfInstance._name == "Trig":
-      print ConfInstance.BTagTag()+' - No calibration broker setup - The condition algorithm is used'
+    if ConfInstance._name == "" or ConfInstance._name == "Trig":
+      # No calibration broker setup - The condition algorithm is used
+      pass
     elif ConfInstance._name == "AODFix":
       protectedInclude("BTagging/BTagCalibBroker_AODFix_jobOptions.py")
       BTagCalibrationBrokerTool = ConfInstance.getTool("BTagCalibrationBrokerTool")
diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibration/src/JetTagCalibCondAlg.cxx b/PhysicsAnalysis/JetTagging/JetTagCalibration/src/JetTagCalibCondAlg.cxx
index 06d140171aa687c341e86c84adffa0bcdccada66..02aef493682ea77bfa25f39bf882c60d834f2c93 100644
--- a/PhysicsAnalysis/JetTagging/JetTagCalibration/src/JetTagCalibCondAlg.cxx
+++ b/PhysicsAnalysis/JetTagging/JetTagCalibration/src/JetTagCalibCondAlg.cxx
@@ -737,9 +737,11 @@ namespace Analysis {
   }
 
   StatusCode JetTagCalibCondAlg::getTObject(const std::string& histname, TFile * pfile, TObject*& hist) const {
-     // now read the histogram into memory
+     // now read the histogram into memor
      ATH_MSG_DEBUG("Getting object "+histname+" from file");
-     pfile->GetObject(histname.c_str(),hist);
+     std::unique_ptr<TObject> hist_raw(pfile->Get(histname.c_str()));
+     hist = dynamic_cast<TObject *>(hist_raw.get());
+     hist_raw.release();
      if (hist==nullptr) {
        ATH_MSG_DEBUG("#BTAG# Could not load TObject " << histname);
        return StatusCode::FAILURE;
diff --git a/PhysicsAnalysis/JetTagging/JetTagCalibration/src/JetTagCalibCondData.cxx b/PhysicsAnalysis/JetTagging/JetTagCalibration/src/JetTagCalibCondData.cxx
index ac5ad67f92e280dfd153a1d87976dd5440dbaa55..4dc531a2f034f5225cc60894dcecb8c7b895312f 100644
--- a/PhysicsAnalysis/JetTagging/JetTagCalibration/src/JetTagCalibCondData.cxx
+++ b/PhysicsAnalysis/JetTagging/JetTagCalibration/src/JetTagCalibCondData.cxx
@@ -61,11 +61,11 @@ void JetTagCalibCondData::addHisto(const unsigned int indexTagger, const std::st
 
 void JetTagCalibCondData::addDL1NN(const std::string&tagger, const std::string& channel, const lwt::JSONConfig& obj) {
   MsgStream log(Athena::getMessageSvc(), "JetTagCalibCondData");
-  log << MSG::WARNING << "#BTAG# JSONConfig in cond data with " << obj.layers.size() << " layers" << endmsg;
-  log << MSG::WARNING << "#BTAG# JSONConfig in cond data for tagger " << tagger << endmsg;
-  log << MSG::WARNING << "#BTAG# JSONConfig in cond data for channel " << channel << endmsg;
+  log << MSG::DEBUG << "#BTAG# JSONConfig in cond data with " << obj.layers.size() << " layers" << endmsg;
+  log << MSG::DEBUG << "#BTAG# JSONConfig in cond data for tagger " << tagger << endmsg;
+  log << MSG::DEBUG << "#BTAG# JSONConfig in cond data for channel " << channel << endmsg;
   m_DL1_NNConfig[tagger].insert(std::make_pair(channel, obj));
-  log << MSG::WARNING << "#BTAG# m_DL1_NNConfig size " << m_DL1_NNConfig.size();
+  log << MSG::DEBUG << "#BTAG# m_DL1_NNConfig size " << m_DL1_NNConfig.size() << endmsg;
 }
 
 void JetTagCalibCondData::addChannelAlias(const std::string& channel, const std::string& alias) {
diff --git a/Projects/Athena/package_filters.txt b/Projects/Athena/package_filters.txt
index 404fd74062304a143c5c9ce22c890a2e432ce38f..2c431ffaabe675392dcbe21e3af287dd3cff3724 100644
--- a/Projects/Athena/package_filters.txt
+++ b/Projects/Athena/package_filters.txt
@@ -57,12 +57,6 @@
 
 # obsolete packages to be removed in a second step
 - Tracking/TrkTools/TrkSegmentConverter
-- Trigger/TrigAlgorithms/TrigEFLongLivedParticles
-
-# obsolete JPsi monitoring packages that may be removed in the future 
-- Trigger/TrigTools/TrigJPsiTools
-- Trigger/TrigMonitoring/TrigIDJpsiMonitoring
-- Trigger/TrigAnalysis/TrigEffJpsiTools
 
 # Huge D3PD librarys not really useful any more
 - PhysicsAnalysis/D3PDMaker/InDetD3PDMaker
diff --git a/Reconstruction/egamma/egammaAlgs/src/egammaSuperClusterBuilder.cxx b/Reconstruction/egamma/egammaAlgs/src/egammaSuperClusterBuilder.cxx
index 4de501fad70c8458a080c4c4058503aa648acdef..26fa71bec72e74517ffcbed60f4048ca6652e49b 100644
--- a/Reconstruction/egamma/egammaAlgs/src/egammaSuperClusterBuilder.cxx
+++ b/Reconstruction/egamma/egammaAlgs/src/egammaSuperClusterBuilder.cxx
@@ -19,9 +19,10 @@
 #include "xAODTracking/TrackParticle.h"
 //
 #include "FourMomUtils/P4Helpers.h"
-
+#include "CaloGeoHelpers/proxim.h"
 
 #include <vector>
+#include <cmath>
 
 namespace {
   /**
@@ -152,7 +153,7 @@ StatusCode egammaSuperClusterBuilder::initialize() {
   return StatusCode::SUCCESS;
 }
 
-bool egammaSuperClusterBuilder::MatchesInWindow(const xAOD::CaloCluster *ref,
+bool egammaSuperClusterBuilder::matchesInWindow(const xAOD::CaloCluster *ref,
 						const xAOD::CaloCluster *clus) const
 {
   //First the case where we are both endcap and barrel, i.e in the crack
@@ -183,8 +184,9 @@ bool egammaSuperClusterBuilder::MatchesInWindow(const xAOD::CaloCluster *ref,
   }
 }
 
-xAOD::CaloCluster* egammaSuperClusterBuilder::CreateNewCluster(const std::vector<const xAOD::CaloCluster*>& clusters,
-							       xAOD::EgammaParameters::EgammaType egType)
+std::unique_ptr<xAOD::CaloCluster>
+egammaSuperClusterBuilder::createNewCluster(const std::vector<const xAOD::CaloCluster*>& clusters,
+					    xAOD::EgammaParameters::EgammaType egType)
 {
   const auto acSize = clusters.size();
   if (acSize == 0) {
@@ -199,39 +201,55 @@ xAOD::CaloCluster* egammaSuperClusterBuilder::CreateNewCluster(const std::vector
   }
   newCluster->setClusterSize(xAOD::CaloCluster::SuperCluster);
 
+
+  // Let's try to find the eta and phi of the hottest cell in L2.
+  // This will be used as the center for restricting the cluster size.
+  // In the future can refine (or add sanity checks) to the selection
+
+  float etaRef = clusters[0]->eta(); // these are just default values, overwritten by findCentralPosition
+  float phiRef = clusters[0]->phi();
+  bool isBarrel = xAOD::EgammaHelpers::isBarrel(clusters[0]);
+  
+  bool foundHotCell = findCentralPosition(etaRef, phiRef, isBarrel, clusters);
+
+  float eta0 = etaRef;
+  float phi0 = phiRef;
+
+  if (foundHotCell) {
+    //Get the hotest in raw co-ordinates
+    const CaloDetDescrManager* mgr = CaloDetDescrManager::instance();
+    if (!mgr) {
+      ATH_MSG_ERROR("Couldn't create instance of CaloDetDescrManager this should never happen");
+      return nullptr;
+    }
+    CaloCell_ID::CaloSample xsample = (isBarrel) ? CaloCell_ID::EMB2 :CaloCell_ID::EME2;
+    const CaloDetDescrElement* dde = mgr->get_element(xsample, etaRef, phiRef);
+    if (dde) {
+      eta0 = dde->eta_raw();
+      phi0 = dde->phi_raw();
+    } else {
+      ATH_MSG_WARNING("Couldn't get CaloDetDescrElement from mgr for eta = " << etaRef << ", phi = " << phiRef);
+    }
+  } else {
+    ATH_MSG_DEBUG("Did not find the hot cell; probably a cluster that will be filtered out later");
+  }
+  //Set the eta0/phi0 based on the references, but in raw coordinates
+  newCluster->setEta0(eta0);
+  newCluster->setPhi0(phi0);
+  ATH_MSG_DEBUG("========== Reference Position  ==== ");
+  ATH_MSG_DEBUG("Reference eta : "<<newCluster->eta0());
+  ATH_MSG_DEBUG("Reference phi : "<<newCluster->phi0());
+
   //Need a vector of element Links to the constituent Cluster
   std::vector< ElementLink< xAOD::CaloClusterContainer > > constituentLinks;
   static const SG::AuxElement::Accessor < ElementLink < xAOD::CaloClusterContainer > > sisterCluster("SisterCluster");
   //
-  //Start with the seed 
-  //Add the EM cells of the seed cluster
-  if (AddEMCellsToCluster(newCluster.get(),clusters[0]).isFailure()) {
-    ATH_MSG_DEBUG("There was problem adding the cells to cluster");
-    return nullptr;
-  }  
-  //Set the element Link to the relevant constitent
-  if (sisterCluster.isAvailable(*clusters[0])) {
-    constituentLinks.push_back(sisterCluster(*clusters[0]));
-  } else{
-    ATH_MSG_WARNING("No sister Link available");
-  }
-  
-  // calculate the seed cluster kinematics.
-  CaloClusterKineHelper::calculateKine(newCluster.get(), true, true);
-  //
-  //Set the eta0/phi0 based on the eta/phi of the seed 
-  newCluster->setEta0(newCluster->eta());
-  newCluster->setPhi0(newCluster->phi());
-  ATH_MSG_DEBUG("========== Seed  ==== ");
-  ATH_MSG_DEBUG("Seed eta : "<<newCluster->eta0());
-  ATH_MSG_DEBUG("Seed phi : "<<newCluster->phi0());
 
-  //
-  // Now continue with the remaining clusters
-  for (size_t i = 1; i < acSize; i++) {
+  // Now add the clusters (other than L1 and PS)
+  for (size_t i = 0; i < acSize; i++) {
     //Add te EM cells of the accumulated to the cluster
-    if (AddEMCellsToCluster(newCluster.get(),clusters[i]).isFailure()) {
-      ATH_MSG_WARNING("There was problem adding the topocluster cells to the the cluster");
+    if (addEMCellsToCluster(newCluster.get(),clusters[i], etaRef, phiRef, isBarrel).isFailure()) {
+      ATH_MSG_DEBUG("There was problem adding the topocluster cells to the the cluster; potentially no L2 or L3 cells in cluster");
       return nullptr;
     }
     //
@@ -242,6 +260,23 @@ xAOD::CaloCluster* egammaSuperClusterBuilder::CreateNewCluster(const std::vector
       ATH_MSG_WARNING("No sister Link available");
     }
   }
+
+  // Now calculate the cluster size; use that for restricting the L1 cells
+  double phiSizePlus = 0;
+  double phiSizeMinus = 0;
+
+  findPhiSize(phiSizePlus, phiSizeMinus, phiRef, newCluster.get());
+
+  // now add L1 cells
+  for (size_t i = 0; i < acSize; i++) {
+    //Add te EM cells of the accumulated to the cluster
+    if (addL0L1EMCellsToCluster(newCluster.get(),clusters[i], etaRef, phiRef, isBarrel, phiSizePlus, phiSizeMinus).isFailure()) {
+      ATH_MSG_WARNING("There was problem adding the topocluster PS and L1 cells to the the cluster");
+      // Could potentially downgrade this to a debug. Getting rid of malformed clusters is the right thing to do.
+      return nullptr;
+    }
+  }
+
   //
   //Set the link from the super cluster to the constituents (accumulated) clusters used. 
   static const SG::AuxElement::Accessor < std::vector< ElementLink< xAOD::CaloClusterContainer > > > caloClusterLinks("constituentClusterLinks");
@@ -263,23 +298,25 @@ xAOD::CaloCluster* egammaSuperClusterBuilder::CreateNewCluster(const std::vector
   }
 
   // Apply SW-style summation of TileGap3 cells (if necessary).
-  if (AddTileGap3CellsinWindow(newCluster.get()).isFailure()) {
+  if (addTileGap3CellsinWindow(newCluster.get()).isFailure()) {
     ATH_MSG_ERROR("Problem with the input cluster when running AddTileGap3CellsinWindow?");
     return nullptr;
   }
   CaloClusterKineHelper::calculateKine(newCluster.get(), true, true);
 
   // Apply correction  calibration
-  if (CalibrateCluster(newCluster.get(), egType).isFailure()) {
+  if (calibrateCluster(newCluster.get(), egType).isFailure()) {
     ATH_MSG_WARNING("There was problem calibrating the object");
     return nullptr;
   }
   // return the new cluster
-  return newCluster.release();  
+  return newCluster;  
 }
 
-StatusCode egammaSuperClusterBuilder::AddEMCellsToCluster(xAOD::CaloCluster *newCluster,
-							  const xAOD::CaloCluster *ref) const {
+StatusCode egammaSuperClusterBuilder::addEMCellsToCluster(xAOD::CaloCluster *newCluster,
+							  const xAOD::CaloCluster *ref,
+							  double etaRef, double phiRef, bool isBarrel) const
+{
   if (!newCluster || !ref) {
     ATH_MSG_ERROR("Invalid input in AddEMCellsToCluster");
     return StatusCode::FAILURE;
@@ -294,64 +331,134 @@ StatusCode egammaSuperClusterBuilder::AddEMCellsToCluster(xAOD::CaloCluster *new
     const CaloCell* cell = *cell_itr; 
     if (!cell){
       continue;
-    }    
+    }
+
+    // lets remove from consideration if outside the range
+    if (isBarrel) { // if the center is in the barrel
+      if (fabs(etaRef - cell->eta()) > m_addCellsWindowEtaBarrel){
+	continue;
+      }
+      if (fabs(P4Helpers::deltaPhi(phiRef, cell->phi())) > m_addCellsWindowPhiBarrel){
+	continue;
+      }
+    } else { // if the center is in the endcap
+      if (fabs(etaRef - cell->eta()) > m_addCellsWindowEtaEndcap){
+	continue;
+      }
+      if (fabs(P4Helpers::deltaPhi(phiRef, cell->phi())) > m_addCellsWindowPhiEndcap){
+	continue;
+      }
+    }
+    
     const CaloDetDescrElement *dde = cell->caloDDE();
     if(!dde){
       continue;
     }
-    //First add all TileGap3 (consider only E4 cell).
-    if (CaloCell_ID::TileGap3 == dde->getSampling()) {
-      if( fabs(cell->eta()) >1.4 && fabs(cell->eta()) < 1.6 ) {
+
+    auto sampling = dde->getSampling();
+
+    // I think we will leave this for AddTileGap3CellsinWindow
+    // //First add all TileGap3 (consider only E4 cell).
+    // if (CaloCell_ID::TileGap3 == sampling) {
+    //   if( fabs(cell->eta()) >1.4 && fabs(cell->eta()) < 1.6 ) {
+    // 	newCluster->addCell(cell_itr.index(), cell_itr.weight());
+    //   }
+    //   continue;  
+    //   //If it is TileGap we are done here
+    //   //either added or not , next cell please
+    // }
+
+    // skip if sampling is L1 or presample, since that is a separate step
+    if (CaloCell_ID::EMB1 == sampling || CaloCell_ID::EME1 == sampling ||
+	CaloCell_ID::PreSamplerB == sampling || CaloCell_ID::PreSamplerE == sampling) {
+      continue;
+    }
+
+    
+    //For the cells we have not skipped either because TileGap, bounds, or L1
+    if (dde->getSubCalo() == CaloCell_ID::LAREM) {
+      //Avoid summing inner wheel Endcap cells 
+      if(! (dde->is_lar_em_endcap_inner()) ){
 	newCluster->addCell(cell_itr.index(), cell_itr.weight());
       }
-      continue;  
-      //If it is TileGap we are done here
-      //either added or not , next cell please
     }
-    //First the case where we are both endcap and barrel, i.e in the crack
-    if (ref->hasSampling(CaloSampling::EMB2) && ref->hasSampling(CaloSampling::EME2)) {
-      //Here we want to allow them either because they around the barrel center 
-      //or because they are around the endcap center , so skip only if it fails both 
-      if ( (fabs(ref->etaSample(CaloSampling::EMB2)-cell->eta()) > m_addCellsWindowEtaBarrel)&&
-	   (fabs(ref->etaSample(CaloSampling::EME2)-cell->eta()) > m_addCellsWindowEtaEndcap) ){
-	continue;
-      }
-      if ((fabs(P4Helpers::deltaPhi(ref->phiSample(CaloSampling::EMB2),cell->phi())) > m_addCellsWindowPhiBarrel)&&
-	  (fabs(P4Helpers::deltaPhi(ref->phiSample(CaloSampling::EME2),cell->phi())) > m_addCellsWindowPhiEndcap) ){
-	continue;
-      }
+  }//Loop over cells
+  if (newCluster->size()==0){
+    return StatusCode::FAILURE;
+  }
+  return StatusCode::SUCCESS;
+}
+
+
+StatusCode egammaSuperClusterBuilder::addL0L1EMCellsToCluster(xAOD::CaloCluster *newCluster,
+							      const xAOD::CaloCluster *ref,
+							      double etaRef, double phiRef, bool isBarrel,
+							      double phiSizePlus, double phiSizeMinus) const
+{
+  if (!newCluster || !ref) {
+    ATH_MSG_ERROR("Invalid input in addL0L1EMCellsToCluster");
+    return StatusCode::FAILURE;
+  }
+
+  ATH_MSG_DEBUG("phiRef = " << phiRef << ", phiSizePlus = " << phiSizePlus << ", phiSizeMinus = " << phiSizeMinus);
+
+  double phiPlus = phiRef + phiSizePlus + 0.001;
+  double phiMinus = phiRef - phiSizeMinus - 0.001;
+
+  ATH_MSG_DEBUG("phi range = " << phiMinus << " to " << phiPlus);
+
+  //
+  xAOD::CaloCluster::const_cell_iterator cell_itr = ref->begin();
+  xAOD::CaloCluster::const_cell_iterator cell_end = ref->end();
+  //Loop over cells
+  for (; cell_itr != cell_end; ++cell_itr) { 
+ 
+    //sanity check on the cell
+    const CaloCell* cell = *cell_itr; 
+    if (!cell){
+      continue;
     }
-    else if (xAOD::EgammaHelpers::isBarrel(ref)) {//else if it is barrel
-      if (fabs(ref->eta()-cell->eta()) > m_addCellsWindowEtaBarrel){
+
+    // lets remove from consideration if outside the range
+    if (isBarrel) { // if the center is in the barrel
+      if (fabs(etaRef - cell->eta()) > m_addCellsWindowEtaBarrel){
 	continue;
       }
-      if (fabs(P4Helpers::deltaPhi(ref->phi(),cell->phi())) > m_addCellsWindowPhiBarrel){
+      if (fabs(P4Helpers::deltaPhi(phiRef, cell->phi())) > m_addCellsWindowPhiBarrel){
 	continue;
       }
-    } else { //here must be endcap only
-      if (fabs(ref->eta()-cell->eta()) > m_addCellsWindowEtaEndcap){
+    } else { // if the center is in the endcap
+      if (fabs(etaRef - cell->eta()) > m_addCellsWindowEtaEndcap){
 	continue;
       }
-      if (fabs(P4Helpers::deltaPhi(ref->phi(),cell->phi())) > m_addCellsWindowPhiEndcap){
+      if (fabs(P4Helpers::deltaPhi(phiRef, cell->phi())) > m_addCellsWindowPhiEndcap){
 	continue;
       }
     }
-    //For the cells we have not skipped either because TileGap or because out of bounds
-    if (dde->getSubCalo() == CaloCell_ID::LAREM) {
-      //Avoid summing inner wheel Endcap cells 
-      if(! (dde->is_lar_em_endcap_inner()) ){
+    
+    const CaloDetDescrElement *dde = cell->caloDDE();
+    if(!dde){
+      continue;
+    }
+
+    auto sampling = dde->getSampling();
+
+    // only deal with L1 or PS
+    if (CaloCell_ID::EMB1 == sampling || CaloCell_ID::EME1 == sampling ||
+	CaloCell_ID::PreSamplerB == sampling || CaloCell_ID::PreSamplerE == sampling) {
+      double cell_phi = proxim(cell->phi(), phiRef);
+      bool inRange = cell_phi > phiMinus && cell_phi < phiPlus;
+      ATH_MSG_DEBUG("Found PS or L1 cell with phi = " << cell_phi << "; inRange = " << inRange);
+      if (inRange) {
 	newCluster->addCell(cell_itr.index(), cell_itr.weight());
       }
     }
-  }//Loop over cells
-  if (newCluster->size()==0){
-    return StatusCode::FAILURE;
   }
   return StatusCode::SUCCESS;
 }
 
 
-StatusCode egammaSuperClusterBuilder::CalibrateCluster(xAOD::CaloCluster* newCluster,
+StatusCode egammaSuperClusterBuilder::calibrateCluster(xAOD::CaloCluster* newCluster,
 						       const xAOD::EgammaParameters::EgammaType egType) {
 
   ATH_MSG_DEBUG("========== Initial ==== ");
@@ -503,17 +610,19 @@ StatusCode egammaSuperClusterBuilder::makeCorrection1(xAOD::CaloCluster* cluster
   return StatusCode::SUCCESS;
 }
 
-StatusCode egammaSuperClusterBuilder::AddTileGap3CellsinWindow(xAOD::CaloCluster *myCluster) const{
+StatusCode egammaSuperClusterBuilder::addTileGap3CellsinWindow(xAOD::CaloCluster *myCluster) const{
   ATH_MSG_DEBUG("Add Remaining cells in window");
     if (!myCluster) {
-      ATH_MSG_ERROR("Invalid input in AddRemainingCellsToCluster");
+      ATH_MSG_ERROR("Invalid input in addRemainingCellsToCluster");
       return StatusCode::FAILURE;
     }
 
-    //DO NOT RUN IF THERE ARE ALREADY ADDED
-    if (myCluster->hasSampling(CaloSampling::TileGap3)) {
-      return StatusCode::SUCCESS;
-    }
+    // This should never be the case now, since I commented it out
+    // //DO NOT RUN IF THERE ARE ALREADY ADDED
+    // if (myCluster->hasSampling(CaloSampling::TileGap3)) {
+    //   return StatusCode::SUCCESS;
+    // }
+    
     static const double searchWindowEta = 0.2;
     static const double searchWindowPhi = 2*M_PI/64.0 + M_PI/64 ; // ~ 0.15 rad
     std::vector<const CaloCell*> cells;
@@ -521,7 +630,7 @@ StatusCode egammaSuperClusterBuilder::AddTileGap3CellsinWindow(xAOD::CaloCluster
     const CaloCellContainer* inputcells=myCluster->getCellLinks()->getCellContainer();
 
     if (!inputcells) {
-      ATH_MSG_ERROR("No cell container in AddRemainingCellsToCluster?");
+      ATH_MSG_ERROR("No cell container in addRemainingCellsToCluster?");
       return StatusCode::FAILURE;      
     }
 
@@ -545,3 +654,89 @@ StatusCode egammaSuperClusterBuilder::AddTileGap3CellsinWindow(xAOD::CaloCluster
     }   
   return StatusCode::SUCCESS;
 }
+
+bool egammaSuperClusterBuilder::findCentralPosition(float& eta, float& phi, bool& isBar,
+						    const std::vector<const xAOD::CaloCluster*>& clusters) const
+{
+
+  // local variables for finding the maximum
+  float etaRef = 999.;
+  float phiRef = 999.;
+  bool isBarrel = true;
+  float emax = -999*Gaudi::Units::GeV;
+
+  for (auto cluster : clusters) {
+    if (cluster->hasSampling(CaloSampling::EMB2)) {
+      float thisEmax = cluster->energy_max(CaloSampling::EMB2);
+      if (thisEmax > emax) {
+	emax = thisEmax;
+	isBarrel = true;
+	etaRef = cluster->etamax(CaloSampling::EMB2);
+	phiRef = cluster->phimax(CaloSampling::EMB2);
+      }
+    }
+    if (cluster->hasSampling(CaloSampling::EME2)) {
+      float thisEmax = cluster->energy_max(CaloSampling::EME2);
+      if (thisEmax > emax) {
+	emax = thisEmax;
+	isBarrel = false;
+	etaRef = cluster->etamax(CaloSampling::EME2);
+	phiRef = cluster->phimax(CaloSampling::EME2);
+      }
+    }
+  }
+  if (emax > 0) {
+    eta = etaRef;
+    phi = phiRef;
+    isBar = isBarrel;
+    return true;
+  } else {
+    return false;
+  }
+}
+
+void egammaSuperClusterBuilder::findPhiSize(double& phiSizePlus, double& phiSizeMinus,
+					    float phiRef,
+					    const xAOD::CaloCluster* cluster) const
+{
+  
+  auto cell_itr = cluster->cell_cbegin();
+  auto cell_end = cluster->cell_cend();   
+  
+  for (; cell_itr != cell_end; ++cell_itr) { 
+    const CaloCell* cell = *cell_itr; 
+    if (!cell){
+      continue;
+    }    
+    
+    const CaloDetDescrElement *dde = cell->caloDDE();
+    if(!dde){
+      continue;
+    }
+
+    if (CaloCell_ID::EMB2 == dde->getSampling() || CaloCell_ID::EME2 == dde->getSampling()) {
+      double cell_phi = proxim(cell->phi(), phiRef);
+      if (cell_phi > phiRef) {
+	auto diff = cell_phi - phiRef;
+	if (diff > phiSizePlus) {
+	  phiSizePlus = diff;
+	}
+      } else {
+	auto diff = phiRef - cell_phi;
+	if (diff > phiSizeMinus) {
+	  phiSizeMinus = diff;
+	}
+      }
+    }
+  }
+  // some safety checks
+  if (phiSizePlus > 1.0) {
+    ATH_MSG_WARNING("phiSizePlus is large: " << phiSizePlus << ", capping at 1.0");
+    phiSizePlus = 1.0;
+  }
+  if (phiSizeMinus > 1.0) {
+    ATH_MSG_WARNING("phiSizeMinus is large: " << phiSizeMinus << ", capping at 1.0");
+    phiSizeMinus = 1.0;
+  }
+  
+}
diff --git a/Reconstruction/egamma/egammaAlgs/src/egammaSuperClusterBuilder.h b/Reconstruction/egamma/egammaAlgs/src/egammaSuperClusterBuilder.h
index 2fc404678df32df87fdc6383c55ddc6626960072..b0915532627e4ab8cd9057974040b096b8587d7d 100644
--- a/Reconstruction/egamma/egammaAlgs/src/egammaSuperClusterBuilder.h
+++ b/Reconstruction/egamma/egammaAlgs/src/egammaSuperClusterBuilder.h
@@ -20,6 +20,8 @@
 #include "egammaInterfaces/IegammaSwTool.h"
 #include "egammaInterfaces/IegammaMVASvc.h"
 
+#include <memory>
+
 /** Base class for electronSuperClusterBuilder and photonSuperClusterBuilder.
  *  The inheritance should be private. This class should never be instantiated
  *  by itself, and hence has no interface class
@@ -34,13 +36,13 @@ protected:
   StatusCode initialize() override;
 
   /** Is clus in window center around ref? */
-  bool MatchesInWindow(const xAOD::CaloCluster *ref,
+  bool matchesInWindow(const xAOD::CaloCluster *ref,
 		       const xAOD::CaloCluster *clus) const;
 
   /** Creates a new supercluster out of the input cluster */
   // not const because it calls CalibrateCluster
-  xAOD::CaloCluster* CreateNewCluster(const std::vector<const xAOD::CaloCluster*>& clusters,
-				      xAOD::EgammaParameters::EgammaType egType);
+  std::unique_ptr<xAOD::CaloCluster> createNewCluster(const std::vector<const xAOD::CaloCluster*>& clusters,
+						      xAOD::EgammaParameters::EgammaType egType);
 
   // some constants to use
   static constexpr float s_cellEtaSize = 0.025;
@@ -59,12 +61,35 @@ protected:
   //
 private:
 
-  /** Add the EM cells from reference cluster to self */
-  StatusCode AddEMCellsToCluster(xAOD::CaloCluster* newCluster,
-				 const xAOD::CaloCluster* ref) const;
+  /** Find the reference position (eta, phi) relative to which cells are restricted.
+      The return value is whether it succeeded in finding a positive energy max value. 
+      (If rv = false, the output variables are passed as arguments are not updated.) 
+  */
+  bool findCentralPosition(float& eta, float& phi, bool& isBarrel,
+			   const std::vector<const xAOD::CaloCluster*>& clusters) const;
+
+  /** Find the reference position (eta, phi) relative to which cells are restricted.
+      The return value is whether it succeeded in finding a positive energy max value. 
+      (If rv = false, the output variables are passed as arguments are not updated.) 
+  */
+  void findPhiSize(double& phiSizePlus, double& phiSizeMinus, float phi,
+		   const xAOD::CaloCluster* cluster) const;
 
+  
+  /** Add the EM cells from reference cluster to self; eta and phi are the ones to use for limiting size. 
+      This excludes L1 (which is done as a separate step) */
+  StatusCode addEMCellsToCluster(xAOD::CaloCluster* newCluster,
+				 const xAOD::CaloCluster* ref,
+				 double eta, double phi, bool isBarrel) const;
+
+  /** Add the preshower and L1 EM cells from reference cluster to self */
+  StatusCode addL0L1EMCellsToCluster(xAOD::CaloCluster* newCluster,
+				     const xAOD::CaloCluster* ref,
+				     double eta, double phi, bool isBarrel,
+				     double phiSizePlus, double phiSizeMinus) const;
+  
   /** function to calibrate the new clusters energy */
-  StatusCode CalibrateCluster(xAOD::CaloCluster* newCluster,
+  StatusCode calibrateCluster(xAOD::CaloCluster* newCluster,
 			      const xAOD::EgammaParameters::EgammaType egType) ;
   // not const because it calls fillPositionsInCalo
 
@@ -79,7 +104,7 @@ private:
 			     const CaloSampling::CaloSample sample) const ;
   
   /** functions to add all tile Gap 3 cells in a window*/
-  StatusCode AddTileGap3CellsinWindow(xAOD::CaloCluster *myCluster) const;
+  StatusCode addTileGap3CellsinWindow(xAOD::CaloCluster *myCluster) const;
 
   // these are calculated window values for the windows in which cells of topoclusters are edded
   float m_addCellsWindowEtaBarrel; //!< half of addCells window size, converted to units of eta
diff --git a/Reconstruction/egamma/egammaAlgs/src/electronSuperClusterBuilder.cxx b/Reconstruction/egamma/egammaAlgs/src/electronSuperClusterBuilder.cxx
index 6c852165c2e3bdad8baa556e15a362f931f57532..9f2356a698a2d50a5939de578cb338fbc2d6efb6 100644
--- a/Reconstruction/egamma/egammaAlgs/src/electronSuperClusterBuilder.cxx
+++ b/Reconstruction/egamma/egammaAlgs/src/electronSuperClusterBuilder.cxx
@@ -31,7 +31,6 @@ electronSuperClusterBuilder::electronSuperClusterBuilder(const std::string& name
 							 ISvcLocator* pSvcLocator):
   egammaSuperClusterBuilder(name, pSvcLocator),
   m_nWindowClusters(0),
-  m_nExtraClusters(0),
   m_nSameTrackClusters(0),
   m_nSimpleBremSearchClusters(0)
 {
@@ -141,7 +140,6 @@ StatusCode electronSuperClusterBuilder::execute(){
     //
     //Counters to keep tracks why we added the clusters
     m_nWindowClusters=0;
-    m_nExtraClusters=0;
     m_nSameTrackClusters=0;
     m_nSimpleBremSearchClusters=0;
     //
@@ -162,7 +160,7 @@ StatusCode electronSuperClusterBuilder::execute(){
     //Find Secondary Clusters
     ATH_MSG_DEBUG("Find secondary clusters");
     const std::vector<std::size_t>  secondaryIndices = 
-      SearchForSecondaryClusters(i, egammaRecs.cptr(), isUsed);
+      searchForSecondaryClusters(i, egammaRecs.cptr(), isUsed);
     //
     //Append possible accumulated  clusters.
     ATH_MSG_DEBUG("Add secondary clusters");
@@ -174,7 +172,7 @@ StatusCode electronSuperClusterBuilder::execute(){
     ATH_MSG_DEBUG("Total clusters " << accumulatedClusters.size());
     //
     //Take the full list of cluster , now stored in the secondaries and add their cells together
-    xAOD::CaloCluster *newClus = CreateNewCluster(accumulatedClusters,xAOD::EgammaParameters::electron);
+    std::unique_ptr<xAOD::CaloCluster> newClus = createNewCluster(accumulatedClusters,xAOD::EgammaParameters::electron);
     //
     if (!newClus) {
       ATH_MSG_DEBUG("Creating a new cluster failed - skipping it");
@@ -183,24 +181,26 @@ StatusCode electronSuperClusterBuilder::execute(){
       continue;
     }
     //
-    ATH_MSG_DEBUG("extra clusters: " << m_nExtraClusters);
-    ATH_MSG_DEBUG("extra clusters: " << m_nWindowClusters);
+    ATH_MSG_DEBUG("window clusters: " << m_nWindowClusters);
     ATH_MSG_DEBUG("Same Track clusters: " << m_nSameTrackClusters);
     ATH_MSG_DEBUG("Simple Brem Search clusters:  " << m_nSimpleBremSearchClusters);
     //
     //////////////////////////////////////////////////////////////////
     //Push back the new cluster into the output container.
-    outputClusterContainer->push_back(newClus);
-    ElementLink< xAOD::CaloClusterContainer > clusterLink(newClus, *outputClusterContainer);
+    outputClusterContainer->push_back(std::move(newClus));
+    ElementLink< xAOD::CaloClusterContainer > clusterLink(*outputClusterContainer, outputClusterContainer->size() - 1);
     std::vector< ElementLink<xAOD::CaloClusterContainer> > elClusters {clusterLink};
     //
     ////////////////////////////////////////////////////////////////////
     //Make egammaRec object, and push it back into output container.
-    egammaRec *newEgRec = new egammaRec(*egRec);
+    auto newEgRec = std::make_unique<egammaRec>(*egRec);
     if (newEgRec) {
       newEgRec->setCaloClusters  (elClusters);
-      newEgammaRecs->push_back(newEgRec);
+      newEgammaRecs->push_back(std::move(newEgRec));
       ATH_MSG_DEBUG("Made new egammaRec object");
+    } else {
+      ATH_MSG_FATAL("Couldn't make an egammaRec object");
+      return StatusCode::FAILURE;
     }
   } //End loop on egammaRecs
  
@@ -217,7 +217,7 @@ StatusCode electronSuperClusterBuilder::execute(){
   return StatusCode::SUCCESS;
 }
 
-const std::vector<std::size_t> electronSuperClusterBuilder::SearchForSecondaryClusters(const std::size_t electronIndex,
+const std::vector<std::size_t> electronSuperClusterBuilder::searchForSecondaryClusters(const std::size_t electronIndex,
 										       const EgammaRecContainer* egammaRecs,
 										       std::vector<bool>& isUsed){
   std::vector<std::size_t>  secondaryClusters;
@@ -248,49 +248,47 @@ const std::vector<std::size_t> electronSuperClusterBuilder::SearchForSecondaryCl
     const xAOD::CaloCluster *clus = egRec->caloCluster();
 
     //Now the actual checks
+    bool addCluster = false;
+
     //Check if clusters are nearby enough to form the "topo-seeded window.'
-    bool matchesInWindow(MatchesInWindow(seedCluster,clus));
-    if (matchesInWindow){
+    if (matchesInWindow(seedCluster,clus)) {
       ATH_MSG_DEBUG("Cluster  with Et : " << clus->et()<< " matched in window");
       ++ m_nWindowClusters;
-    }    
+      addCluster = true;
+    }   
 
+    
     //Satellite brem cluster search for clusters
     //outside the 3x5 window.
-    bool passesSimpleBremSearch(false);
-    bool matchSameTrack        (false);
-
     float seedSecdEta(fabs(seedCluster->eta() - clus->eta()));
     float seedSecdPhi(fabs(P4Helpers::deltaPhi(seedCluster->phi(), clus->phi())));
 
-    if (!matchesInWindow 
+    if (!addCluster   
 	&& seedSecdEta<m_maxDelEta 
-	&& seedSecdPhi<m_maxDelPhi) {      
-      matchSameTrack = MatchSameTrack(seedEgammaRec,egRec);      
-
-      if(matchSameTrack) {
+	&& seedSecdPhi<m_maxDelPhi) {
+      if (matchSameTrack(seedEgammaRec,egRec)) {
 	++m_nSameTrackClusters;
-	++m_nExtraClusters;
+	addCluster = true;
       } else if (doBremSatellite){
 	  
 	static const SG::AuxElement::Accessor<float> pgExtrapEta ("perigeeExtrapEta");
 	static const SG::AuxElement::Accessor<float> pgExtrapPhi ("perigeeExtrapPhi");
 	float perigeeExtrapEta (pgExtrapEta(*seedEgammaRec->trackParticle()));
 	float perigeeExtrapPhi (pgExtrapPhi(*seedEgammaRec->trackParticle()));
-	if (perigeeExtrapEta>-999. && perigeeExtrapPhi>-999.)
-	  passesSimpleBremSearch = PassesSimpleBremSearch(seedCluster,
-	      					    clus,
-	      					    perigeeExtrapEta,
-	      					    perigeeExtrapPhi);
-	if (passesSimpleBremSearch) {
-	  ++m_nSimpleBremSearchClusters;
-	  ++m_nExtraClusters;
+	if (perigeeExtrapEta>-999. && perigeeExtrapPhi>-999.) {
+	  if (passesSimpleBremSearch(seedCluster,
+				     clus,
+				     perigeeExtrapEta,
+				     perigeeExtrapPhi)) {
+	    ++m_nSimpleBremSearchClusters;
+	    addCluster = true;
+	  }
 	}
       }
     }
     
     //Add it to the list of secondary clusters if it matches.
-    if (matchesInWindow || passesSimpleBremSearch || matchSameTrack) {
+    if (addCluster) {
       secondaryClusters.push_back(i); 
       isUsed.at(i)=1;
     }
@@ -300,7 +298,7 @@ const std::vector<std::size_t> electronSuperClusterBuilder::SearchForSecondaryCl
   return secondaryClusters;
 }
 
-bool electronSuperClusterBuilder::MatchSameTrack(const egammaRec *seed,
+bool electronSuperClusterBuilder::matchSameTrack(const egammaRec *seed,
 						 const egammaRec *sec) const{
   bool matchesSameTrack(false);
   if (seed && sec) {
@@ -322,7 +320,7 @@ bool electronSuperClusterBuilder::MatchSameTrack(const egammaRec *seed,
   return matchesSameTrack;
 }
 
-bool electronSuperClusterBuilder::PassesSimpleBremSearch(const xAOD::CaloCluster *seed,
+bool electronSuperClusterBuilder::passesSimpleBremSearch(const xAOD::CaloCluster *seed,
 							 const xAOD::CaloCluster *sec,
 							 float perigeeExtrapEta,
 							 float perigeeExtrapPhi) const
diff --git a/Reconstruction/egamma/egammaAlgs/src/electronSuperClusterBuilder.h b/Reconstruction/egamma/egammaAlgs/src/electronSuperClusterBuilder.h
index d9d27def290fd0c828edc59d6469159718d41b5f..3b1fbc0a0e55f827899b6bc6c966cea820166509 100644
--- a/Reconstruction/egamma/egammaAlgs/src/electronSuperClusterBuilder.h
+++ b/Reconstruction/egamma/egammaAlgs/src/electronSuperClusterBuilder.h
@@ -32,14 +32,14 @@ class electronSuperClusterBuilder : public egammaSuperClusterBuilder {
 
  private:
 
-  bool MatchSameTrack(const egammaRec *seed,
+  bool matchSameTrack(const egammaRec *seed,
 		      const egammaRec *sec) const;
 
-  const std::vector<std::size_t> SearchForSecondaryClusters(const size_t i,
+  const std::vector<std::size_t> searchForSecondaryClusters(const size_t i,
 							    const EgammaRecContainer*,
 							    std::vector<bool>& isUsed);
   
-  bool PassesSimpleBremSearch(const xAOD::CaloCluster *seed,
+  bool passesSimpleBremSearch(const xAOD::CaloCluster *seed,
 			      const xAOD::CaloCluster *sec,
 			      float perigeeExtrapEta,
 			      float perigeeExtrapPhi) const;
@@ -74,7 +74,6 @@ class electronSuperClusterBuilder : public egammaSuperClusterBuilder {
   //Keep track of # of 3x5 and brem point
   //clusters added to seed clusters.
   int m_nWindowClusters;
-  int m_nExtraClusters;
   int m_nSameTrackClusters;
   int m_nSimpleBremSearchClusters;
 
diff --git a/Reconstruction/egamma/egammaAlgs/src/photonSuperClusterBuilder.cxx b/Reconstruction/egamma/egammaAlgs/src/photonSuperClusterBuilder.cxx
index a8ba4662020df8b81784a0ae3914b74e0df7293e..59b01bce62d7fceb9b2d08a70bb1412bb6fedc5f 100644
--- a/Reconstruction/egamma/egammaAlgs/src/photonSuperClusterBuilder.cxx
+++ b/Reconstruction/egamma/egammaAlgs/src/photonSuperClusterBuilder.cxx
@@ -120,7 +120,7 @@ StatusCode photonSuperClusterBuilder::execute(){
     int nExtraClusters = 0;
 
     const std::vector<std::size_t> secondaryClusters = 
-      SearchForSecondaryClusters(i, egammaRecs.cptr(), isUsed, nWindowClusters, nExtraClusters);
+      searchForSecondaryClusters(i, egammaRecs.cptr(), isUsed, nWindowClusters, nExtraClusters);
 
     for (auto secClus : secondaryClusters) {
       const auto secRec = egammaRecs->at(secClus);
@@ -138,7 +138,7 @@ StatusCode photonSuperClusterBuilder::execute(){
       xAOD::EgammaParameters::convertedPhoton :
       xAOD::EgammaParameters::unconvertedPhoton;
 
-    xAOD::CaloCluster* newCluster = CreateNewCluster(accumulatedClusters, egType);
+    std::unique_ptr<xAOD::CaloCluster> newCluster = createNewCluster(accumulatedClusters, egType);
 
     if (!newCluster) {
       ATH_MSG_DEBUG("Creating a new cluster failed");
@@ -147,24 +147,28 @@ StatusCode photonSuperClusterBuilder::execute(){
       continue;
     }
 
+    ATH_MSG_DEBUG("window clusters: " << nWindowClusters);
+    ATH_MSG_DEBUG("extra clusters: " << nExtraClusters);
+     
     //push back the new photon super cluster 
-    outputClusterContainer->push_back(newCluster);
-
-    ///////////////////////////////////////////////////////
-    //Now create the new eg Rec 
-    egammaRec *newEgRec = new egammaRec(*egRec);
+    outputClusterContainer->push_back(std::move(newCluster));
 
     //Add the cluster link to the super cluster
-    ElementLink< xAOD::CaloClusterContainer > clusterLink(newCluster, *outputClusterContainer);
+    ElementLink< xAOD::CaloClusterContainer > clusterLink(*outputClusterContainer, outputClusterContainer->size() - 1);
     std::vector< ElementLink<xAOD::CaloClusterContainer> > phCluster {clusterLink};
-    newEgRec->setCaloClusters(phCluster);
-
-    // will rerun conversion finding, so conversion vertices are not copied
-
-    //push it back
-    newEgammaRecs->push_back(newEgRec);
 
-    ATH_MSG_DEBUG("Finished making photon egammaRec object");
+    ///////////////////////////////////////////////////////
+    //Now create the new eg Rec 
+    auto newEgRec = std::make_unique<egammaRec>(*egRec);
+    if (newEgRec) {
+      newEgRec->setCaloClusters(phCluster);
+      //push it back
+      newEgammaRecs->push_back(std::move(newEgRec));
+      ATH_MSG_DEBUG("Finished making photon egammaRec object");
+    } else {
+      ATH_MSG_FATAL("Couldn't make an egammaRec object");
+      return StatusCode::FAILURE;
+    }
   } //End loop on egammaRecs
 
   //Redo conversion matching given the super cluster
@@ -181,7 +185,7 @@ StatusCode photonSuperClusterBuilder::execute(){
 }
 
 std::vector<std::size_t> 
-photonSuperClusterBuilder::SearchForSecondaryClusters(std::size_t photonInd,
+photonSuperClusterBuilder::searchForSecondaryClusters(std::size_t photonInd,
 						      const EgammaRecContainer *egammaRecs,
 						      std::vector<bool>& isUsed,
 						      int& nWindowClusters,
@@ -243,20 +247,17 @@ photonSuperClusterBuilder::SearchForSecondaryClusters(std::size_t photonInd,
     // Now perform a number of tests to see if the cluster should be added
     bool addCluster = false;
     if (m_addClustersInWindow && 
-	MatchesInWindow(seedCaloClus, caloClus)) {
+	matchesInWindow(seedCaloClus, caloClus)) {
       ATH_MSG_DEBUG("Cluster  with Et : " << caloClus->et()<< " matched in window");
       nWindowClusters++;
       addCluster = true;
-    } 
-
-    // should do "else if" if we want nWindowCluster and nExtraCluster to not both increment
-    if (m_addClustersMatchingVtx && 
-	MatchesVtx(seedVertices, seedVertexType, egRec)) {
+    } else if (m_addClustersMatchingVtx && 
+	matchesVtx(seedVertices, seedVertexType, egRec)) {
       ATH_MSG_DEBUG("conversion vertices match");
       addCluster = true;
       nExtraClusters++;
     } else if (m_addClustersMatchingVtxTracks &&
-	       MatchesVtxTrack(seedVertexTracks, egRec)) {
+	       matchesVtxTrack(seedVertexTracks, egRec)) {
       ATH_MSG_DEBUG("conversion track match");
       addCluster = true;
       nExtraClusters++;
@@ -272,7 +273,7 @@ photonSuperClusterBuilder::SearchForSecondaryClusters(std::size_t photonInd,
 }
 
 
-bool photonSuperClusterBuilder::MatchesVtx(const std::vector<const xAOD::Vertex*>& seedVertices,
+bool photonSuperClusterBuilder::matchesVtx(const std::vector<const xAOD::Vertex*>& seedVertices,
 					   const std::vector<xAOD::EgammaParameters::ConversionType>& seedVertexType,
 					   const egammaRec *egRec) const
 {
@@ -297,7 +298,7 @@ bool photonSuperClusterBuilder::MatchesVtx(const std::vector<const xAOD::Vertex*
   return false;
 }
 
-bool photonSuperClusterBuilder::MatchesVtxTrack(const std::vector<const xAOD::TrackParticle*>& seedVertexTracks,
+bool photonSuperClusterBuilder::matchesVtxTrack(const std::vector<const xAOD::TrackParticle*>& seedVertexTracks,
 						const egammaRec *egRec) const
 {
   auto numTestTracks = egRec->getNumberOfTrackParticles();
diff --git a/Reconstruction/egamma/egammaAlgs/src/photonSuperClusterBuilder.h b/Reconstruction/egamma/egammaAlgs/src/photonSuperClusterBuilder.h
index 653ec26f32340acf46fcf194ea544f10d96139e2..05926673279dd28356ab7c3b8395a5e5f118f2b5 100644
--- a/Reconstruction/egamma/egammaAlgs/src/photonSuperClusterBuilder.h
+++ b/Reconstruction/egamma/egammaAlgs/src/photonSuperClusterBuilder.h
@@ -32,19 +32,19 @@ class photonSuperClusterBuilder : public egammaSuperClusterBuilder {
 
   /** Return extra clusters that can be added to make supercluster */
   std::vector<std::size_t> 
-    SearchForSecondaryClusters(std::size_t photonInd,
+    searchForSecondaryClusters(std::size_t photonInd,
 			       const EgammaRecContainer *egammaRecs,
 			       std::vector<bool>& isUsed,
 			       int& nWindowClusters,
 			       int& nExtraClusters) const;
 
   /** Does the cluster share conversion vertex? */
-  bool MatchesVtx(const std::vector<const xAOD::Vertex*>& seedVertices,
+  bool matchesVtx(const std::vector<const xAOD::Vertex*>& seedVertices,
 		  const std::vector<xAOD::EgammaParameters::ConversionType>& seedVertexType,
 		  const egammaRec *egRec) const;
 
   /** Does the cluster match a conversion vertex track with the seed? */
-  bool MatchesVtxTrack(const std::vector<const xAOD::TrackParticle*>& seedVertexTracks,
+  bool matchesVtxTrack(const std::vector<const xAOD::TrackParticle*>& seedVertexTracks,
 		  const egammaRec *egRec) const;
 
   /////////////////////////////////////////////////////////////////////
diff --git a/Simulation/G4Atlas/G4AtlasApps/python/SimConfigFlags.py b/Simulation/G4Atlas/G4AtlasApps/python/SimConfigFlags.py
index c0dfdfa04e29758d7fa684c47963462364ef301d..f909c266ead5a50782f5edc92b3bcdc81dc4fbbe 100644
--- a/Simulation/G4Atlas/G4AtlasApps/python/SimConfigFlags.py
+++ b/Simulation/G4Atlas/G4AtlasApps/python/SimConfigFlags.py
@@ -8,5 +8,8 @@ def createSimConfigFlags():
 
     scf.addFlag("Sim.ISF.Run",False)
     scf.addFlag("Sim.ISF.HITSMergingRequired", True)
+    scf.addFlag('Sim.ParticleID',False)
+    scf.addFlag("Sim.CalibrationRun", "DeadLAr") # 'LAr', 'Tile', 'LAr+Tile', 'DeadLAr'
+
 
     return scf
diff --git a/Trigger/TrigAlgorithms/TrigDetCalib/TrigDetCalib/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigAlgorithms/TrigDetCalib/TrigDetCalib/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 0000000000000000000000000000000000000000..eaa981fd24ffdb72b37ad6fffe61ec2ed4e26a91
--- /dev/null
+++ b/Trigger/TrigAlgorithms/TrigDetCalib/TrigDetCalib/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Trigger/TrigAlgorithms/TrigDetCalib
diff --git a/Trigger/TrigAlgorithms/TrigDetCalib/src/TrigROBSelector.cxx b/Trigger/TrigAlgorithms/TrigDetCalib/src/TrigROBSelector.cxx
index c9416a25df240f91eab3ae000e59812e39f0d145..4e88ea3b06c51c159455fe6f0c570786410766d1 100644
--- a/Trigger/TrigAlgorithms/TrigDetCalib/src/TrigROBSelector.cxx
+++ b/Trigger/TrigAlgorithms/TrigDetCalib/src/TrigROBSelector.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 "GaudiKernel/MsgStream.h"
@@ -159,12 +159,8 @@ HLT::ErrorCode TrigROBSelector::fillPEBInfo(PartialEventBuildingInfo& pebInfo,
     if (nRobs) (*nRobs).push_back(detectorROBs.size());
     
     TH1I*& robHist = m_robHists[*detector];
-    static bool warnedAlready = false; 
     if (!robHist) {
-      if (!warnedAlready) {
-        ATH_MSG_DEBUG("Monitoring of detector " << *detector << " not implemented yet.");
-        warnedAlready = true;
-      }
+      ATH_MSG_DEBUG("Monitoring of detector " << *detector << " not implemented yet.");
       continue;
     }
 
diff --git a/Trigger/TrigAlgorithms/TrigEFLongLivedParticles/CMakeLists.txt b/Trigger/TrigAlgorithms/TrigEFLongLivedParticles/CMakeLists.txt
deleted file mode 100644
index 9f0ec41710e9e72e361c623394032208972e6ee0..0000000000000000000000000000000000000000
--- a/Trigger/TrigAlgorithms/TrigEFLongLivedParticles/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-################################################################################
-# Package: TrigEFLongLivedParticles
-################################################################################
-
-# Declare the package name:
-atlas_subdir( TrigEFLongLivedParticles )
-
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Reconstruction/Jet/JetEvent
-                          Trigger/TrigEvent/TrigCaloEvent
-                          Trigger/TrigEvent/TrigSteeringEvent
-                          Trigger/TrigSteer/TrigInterfaces
-                          PRIVATE
-                          Calorimeter/CaloEvent
-                          Control/AthenaKernel
-                          Event/FourMomUtils
-                          Event/xAOD/xAODJet
-                          GaudiKernel
-                          Trigger/TrigEvent/TrigParticle
-                          Trigger/TrigTools/TrigTimeAlgs )
-
-# Component(s) in the package:
-atlas_add_library( TrigEFLongLivedParticlesLib
-                   src/*.cxx
-                   PUBLIC_HEADERS TrigEFLongLivedParticles
-                   LINK_LIBRARIES JetEvent TrigCaloEvent TrigSteeringEvent TrigInterfacesLib TrigTimeAlgsLib
-                   PRIVATE_LINK_LIBRARIES CaloEvent AthenaKernel FourMomUtils xAODJet GaudiKernel TrigParticle )
-
-atlas_add_component( TrigEFLongLivedParticles
-                     src/components/*.cxx
-                     LINK_LIBRARIES JetEvent TrigCaloEvent TrigSteeringEvent TrigInterfacesLib CaloEvent AthenaKernel FourMomUtils xAODJet GaudiKernel TrigParticle TrigTimeAlgsLib TrigEFLongLivedParticlesLib )
-
-# Install files from the package:
-atlas_install_python_modules( python/*.py )
-atlas_install_joboptions( share/*.py )
-
diff --git a/Trigger/TrigAlgorithms/TrigEFLongLivedParticles/TrigEFLongLivedParticles/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigAlgorithms/TrigEFLongLivedParticles/TrigEFLongLivedParticles/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 0000000000000000000000000000000000000000..b8e1cbf00d0304be5ae227d2431a1d15ca6c419f
--- /dev/null
+++ b/Trigger/TrigAlgorithms/TrigEFLongLivedParticles/TrigEFLongLivedParticles/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Trigger/TrigAlgorithms/TrigEFLongLivedParticles
diff --git a/Trigger/TrigAlgorithms/TrigEFLongLivedParticles/TrigEFLongLivedParticles/TrigLoFRemoval.h b/Trigger/TrigAlgorithms/TrigEFLongLivedParticles/TrigEFLongLivedParticles/TrigLoFRemoval.h
deleted file mode 100755
index 825acdeb5d9d80638dcdddf65ab7d4ef6ae16f13..0000000000000000000000000000000000000000
--- a/Trigger/TrigAlgorithms/TrigEFLongLivedParticles/TrigEFLongLivedParticles/TrigLoFRemoval.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-/********************************************************************
- *
- * NAME:     TrigLoFRemoval.h
- * PACKAGE:  Trigger/TrigAlgorithms/TrigEFLongLivedParticles
- *
- * AUTHOR:   A. Policicchio
- *********************************************************************/
-#ifndef TRIGLOFREMOVAL_TRIGLOFREMOVAL_H
-#define TRIGLOFREMOVAL_TRIGLOFREMOVAL_H
-
-#include "TrigInterfaces/FexAlgo.h"
-#include "JetEvent/JetCollection.h"
-
-class JetAlgToolBase;
-class TrigTimer;
-
-class TrigLoFRemoval : public HLT::FexAlgo {
-
- public:
-
-  TrigLoFRemoval(const std::string& name, ISvcLocator* pSvcLocator);
-  ~TrigLoFRemoval();
-
-  HLT::ErrorCode hltInitialize();
-  HLT::ErrorCode hltFinalize();
-  HLT::ErrorCode hltExecute(const HLT::TriggerElement* inputTE, HLT::TriggerElement* outputTE);
-
- private:
-
-
-
-  /////////////////////////////////////////////////////////////////////////////
-  /// Properties
-  /////////////////////////////////////////////////////////////////////////////
-
-
-  // Monitoring
-  double m_et;
-  double m_njet;
-  double m_eta;
-  double m_phi;
-  float m_CellContainerSize;
-
-
-public:
-
- 
-};
-#endif
diff --git a/Trigger/TrigAlgorithms/TrigEFLongLivedParticles/doc/packagedoc.h b/Trigger/TrigAlgorithms/TrigEFLongLivedParticles/doc/packagedoc.h
deleted file mode 100644
index 0e273e13b0f63c397e64d1e5c691d7b717cd6f88..0000000000000000000000000000000000000000
--- a/Trigger/TrigAlgorithms/TrigEFLongLivedParticles/doc/packagedoc.h
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-/**
-
-@page TrigEFLongLivedParticles_page 
-@author Antonio Policicchio
-
-@section TrigEFLongLivedParticles_TrigEFLongLivedParticlesOverview Overview
-This package contains EF Fex algorithm for Long-Lived 
-neutral particle triggers: TrigLoFRemoval.
-The TrigLoFRemoval is accessing the EF jet collection and the cal cell container.
-It saves the cells associated in PHI with the leading jets for LoF removal in the HYPO
-algorithm TrigLongLivedParticlesHypo/LoFRemovalHypo.h 
-
-
-
-*/
diff --git a/Trigger/TrigAlgorithms/TrigEFLongLivedParticles/python/TrigEFLongLivedParticlesConfig.py b/Trigger/TrigAlgorithms/TrigEFLongLivedParticles/python/TrigEFLongLivedParticlesConfig.py
deleted file mode 100755
index 79cf9cce69c0c7389a39e611dd08513d32cc149a..0000000000000000000000000000000000000000
--- a/Trigger/TrigAlgorithms/TrigEFLongLivedParticles/python/TrigEFLongLivedParticlesConfig.py
+++ /dev/null
@@ -1,24 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-from TrigEFLongLivedParticles.TrigEFLongLivedParticlesConf import TrigLoFRemoval
-from AthenaCommon.Constants import INFO,DEBUG
-from AthenaCommon.SystemOfUnits import GeV
-
-
-class TrigLoFRemovalConfig(TrigLoFRemoval):
-   __slots__ = []
-   def __init__ (self, name="TrigLoFRemovalConfig"):
-        super(TrigLoFRemovalConfig, self).__init__(name)
-
-        from TrigEFLongLivedParticles.TrigEFLongLivedParticlesMonitoring import TrigLoFRemovalValidationMonitoring, TrigLoFRemovalOnlineMonitoring, TrigLoFRemovalCosmicMonitoring
-        validation = TrigLoFRemovalValidationMonitoring()
-        online     = TrigLoFRemovalOnlineMonitoring()
-        cosmic     = TrigLoFRemovalCosmicMonitoring()
-
-
-        from TrigTimeMonitor.TrigTimeHistToolConfig import TrigTimeHistToolConfig
-        time = TrigTimeHistToolConfig("TrigLoFRemoval_Time")
-
-        self.AthenaMonTools = [ validation, online, time, cosmic]
-
-        self.OutputLevel=INFO
diff --git a/Trigger/TrigAlgorithms/TrigEFLongLivedParticles/python/TrigEFLongLivedParticlesMonitoring.py b/Trigger/TrigAlgorithms/TrigEFLongLivedParticles/python/TrigEFLongLivedParticlesMonitoring.py
deleted file mode 100755
index 900ba288a362212b290da0dd02e8f5c302b7e505..0000000000000000000000000000000000000000
--- a/Trigger/TrigAlgorithms/TrigEFLongLivedParticles/python/TrigEFLongLivedParticlesMonitoring.py
+++ /dev/null
@@ -1,66 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-
-#Definitions of the monitoring classes
-
-
-
-from TrigMonitorBase.TrigGenericMonitoringToolConfig import defineHistogram, TrigGenericMonitoringToolConfig
-
-
-class TrigLoFRemovalValidationMonitoring(TrigGenericMonitoringToolConfig):
-    def __init__ (self, name="TrigLoFRemoval_Validation"):
-        super(TrigLoFRemovalValidationMonitoring, self).__init__(name)
-
-        self.defineTarget("Validation")
-# this target contains all the histograms necessary for validation
-       
-        self.Histograms =  [ defineHistogram('Et', type='TH1F', title="TrigLoFRemoval Fex Et; E_{T} [MeV]; entries", xbins=30, xmin=0., xmax=600000.) ]
-        self.Histograms += [ defineHistogram('Eta, Et', type='TH2F', title="TrigLoFRemoval FEX Et vs. Eta;#eta;E_{T} [MeV]", xbins=10, xmin=-5., xmax=5., ybins=50, ymin=0, ymax=600000.) ]
-        self.Histograms += [ defineHistogram('Phi, Et', type='TH2F', title="TrigLoFRemoval FEX Et vs. Phi;#phi(rad);E_{T} [MeV]", xbins=32, xmin=-3.2, xmax=3.2, ybins=50, ymin=0, ymax=600000.) ]
-        self.Histograms += [ defineHistogram('NJet', type='TH1F', title="TrigLoFRemoval FEX NJet; Number of jets; nevents", xbins=21, xmin=-0.5, xmax=20.5) ]
-        self.Histograms += [ defineHistogram('Eta', type='TH1F', title="TrigLoFRemoval FEX Eta;Eta; nevents", xbins=10, xmin=-5., xmax=5.) ]
-        self.Histograms += [ defineHistogram('Phi', type='TH1F', title="TrigLoFRemoval FEX Phi;Phi; nevents", xbins=32, xmin=-3.2, xmax=3.2) ]
-        self.Histograms += [ defineHistogram('Eta, Phi', type='TH2F', title="TrigLoFRemoval FEX Phi vs. Eta;#eta;#phi(rad)", xbins=10, xmin=-5., xmax=5., ybins=32, ymin=-3.2, ymax=3.2) ]
-        self.Histograms += [ defineHistogram('CellContainerSize', type='TH1F', title="TrigLoFRemoval FEX CellContainerSize;CellContainerSize; nevents", xbins=100, xmin=0.0, xmax=100.0) ]
-
-
-class TrigLoFRemovalOnlineMonitoring(TrigGenericMonitoringToolConfig):
-    def __init__ (self, name="TrigLoFRemoval_Online"):
-        """ defines hisograms for online """
-        super(TrigLoFRemovalOnlineMonitoring, self).__init__(name)
-
-        self.defineTarget("Online")
-# this target contains the list of monitoring histograms to be made online
-
-        self.Histograms =  [ defineHistogram('Et', type='TH1F', title="EF Jet Transverse Energy; Et[MeV]; nevents", xbins=30, xmin=0., xmax=600000.) ]
-        self.Histograms += [ defineHistogram('Eta, Et', type='TH2F', title="EF Jet Transverse Energy vs. Pseudorapidity;#eta;E_{T} [MeV]", 
-          xbins=10, xmin=-5., xmax=5., ybins=50, ymin=0, ymax=600000.) ]
-        self.Histograms += [ defineHistogram('Phi, Et', type='TH2F', title="EF Jet Transverse Energy vs. Azimuth;#phi(rad);E_{T} [MeV]", 
-          xbins=32, xmin=-3.2, xmax=3.2, ybins=50, ymin=0, ymax=600000.) ]
-        self.Histograms += [ defineHistogram('NJet', type='TH1F', title="EF Jet Multiplicity per RoI; Number of jets; nevents", 
-          xbins=21, xmin=-0.5, xmax=20.5) ]
-        self.Histograms += [ defineHistogram('Eta', type='TH1F', title="EF Jet Pseudorapidity ;#eta; nevents", 
-          xbins=10, xmin=-5., xmax=5.) ]
-        self.Histograms += [ defineHistogram('Phi', type='TH1F', title="EF Jet Azimuth;#phi(rad); nevents", xbins=32, xmin=-3.2, xmax=3.2) ]
-        self.Histograms += [ defineHistogram('Eta, Phi', type='TH2F', title="EF Jet Azimuth vs. Pseudorapidity;#eta;#phi(rad)", 
-          xbins=10, xmin=-5., xmax=5., ybins=32, ymin=-3.2, ymax=3.2) ]
-        self.Histograms += [ defineHistogram('CellContainerSize', type='TH1F', title="TrigLoFRemoval FEX CellContainerSize;CellContainerSize; nevents", xbins=100, xmin=0.0, xmax=100.0) ]
-       
-        
-class TrigLoFRemovalCosmicMonitoring(TrigGenericMonitoringToolConfig):
-    def __init__ (self, name="TrigLoFRemoval_Cosmic"):
-        """ defines hisograms for cosmics"""
-        super(TrigLoFRemovalCosmicMonitoring, self).__init__(name)
-
-        self.defineTarget("Cosmic")
-# this target contains the same list of histograms as for "Online", but the axis range for plots of Et and etc. are smaller 
-
-        self.Histograms =  [ defineHistogram('Et', type='TH1F', title="TrigLoFRemoval Fex Et; Et [MeV]; nevents", xbins=30, xmin=0., xmax=300000.) ]
-        self.Histograms += [ defineHistogram('Eta, Et', type='TH2F', title="TrigLoFRemoval FEX Et vs. Eta;#eta;E_{T} [MeV]", xbins=10, xmin=-5., xmax=5., ybins=30, ymin=0, ymax=300000.) ]
-        self.Histograms += [ defineHistogram('Phi, Et', type='TH2F', title="TrigLoFRemoval FEX Et vs. Phi;#phi(rad);E_{T} [MeV]", xbins=32, xmin=-3.2, xmax=3.2, ybins=30, ymin=0, ymax=300000.) ]
-        self.Histograms += [ defineHistogram('NJet', type='TH1F', title="TrigLoFRemoval FEX NJet; Number of jets; nevents", xbins=21, xmin=-0.5, xmax=20.5) ]
-        self.Histograms += [ defineHistogram('Eta', type='TH1F', title="TrigLoFRemoval FEX Eta;Eta; nevents", xbins=10, xmin=-5., xmax=5.) ]
-        self.Histograms += [ defineHistogram('Phi', type='TH1F', title="TrigLoFRemoval FEX Phi;Phi; nevents", xbins=32, xmin=-3.2, xmax=3.2) ]
-        self.Histograms += [ defineHistogram('Eta, Phi', type='TH2F', title="TrigLoFRemoval FEX Phi vs. Eta;#eta;#phi(rad)", xbins=10, xmin=-5., xmax=5., ybins=32, ymin=-3.2, ymax=3.2) ]
-        self.Histograms += [ defineHistogram('CellContainerSize', type='TH1F', title="TrigLoFRemoval FEX CellContainerSize;CellContainerSize; nevents", xbins=100, xmin=0.0, xmax=100.0) ]
diff --git a/Trigger/TrigAlgorithms/TrigEFLongLivedParticles/share/TrigLoFRemovalJobOption.py b/Trigger/TrigAlgorithms/TrigEFLongLivedParticles/share/TrigLoFRemovalJobOption.py
deleted file mode 100644
index 3d10788e2d9d6d1fea16174cd814a14ebc13cdbb..0000000000000000000000000000000000000000
--- a/Trigger/TrigAlgorithms/TrigEFLongLivedParticles/share/TrigLoFRemovalJobOption.py
+++ /dev/null
@@ -1,14 +0,0 @@
-#----------------------------------------------------
-#  TrigLoFRemoval options
-#----------------------------------------------------
-# Timing service libs.
-theApp.Dlls += [ "TrigTimeAlgs" ]
-theApp.ExtSvc += [ "TrigTimeSvc" ]
-
-# Algorithm
-theApp.Dlls += [ "TrigLoFRemoval" ]
-
-
-# Timer service conf.
-TrigTimerSvc = Service ( "TrigTimerSvc" )
-TrigTimerSvc.OutputLevel = 3
diff --git a/Trigger/TrigAlgorithms/TrigEFLongLivedParticles/share/TriggerConfig_TrigLoFRemoval.py b/Trigger/TrigAlgorithms/TrigEFLongLivedParticles/share/TriggerConfig_TrigLoFRemoval.py
deleted file mode 100644
index 973167cd8407cbe048fb567192d3b1d3b13dfe34..0000000000000000000000000000000000000000
--- a/Trigger/TrigAlgorithms/TrigEFLongLivedParticles/share/TriggerConfig_TrigLoFRemoval.py
+++ /dev/null
@@ -1,20 +0,0 @@
-include.block("TrigEFLongLivedParticles/TriggerConfig_TrigLoFRemoval.py")
-
-class TriggerConfig_TrigLoFRemoval:
-    
-    def __init__(self, level, type = None, threshold = None, isIsolated = None):
-
-        if type == "jet":
-           self.__instname__ = "TrigLoFRemoval_Jet_"
-           self.__sequence__ = "TrigLoFRemoval/TrigLoFRemoval/Jet"
-
-        self.__instname__ += level
-
-    def instanceName(self):
-        return self.__instname__
-
-    def classAndInstanceName(self):
-        return [ self.__sequence__ ]
-
-include( "TrigEFLongLivedParticles/TrigLoFRemovalJobOptions.py" )
-include.block( "TrigEFLongLivedParticles/TrigLoFRemovalJobOptions.py" )
diff --git a/Trigger/TrigAlgorithms/TrigEFLongLivedParticles/share/jobOfragment_TrigLoFRemoval.py b/Trigger/TrigAlgorithms/TrigEFLongLivedParticles/share/jobOfragment_TrigLoFRemoval.py
deleted file mode 100644
index 54aee5fa63865d49a77458d705c18da8f2f1dba7..0000000000000000000000000000000000000000
--- a/Trigger/TrigAlgorithms/TrigEFLongLivedParticles/share/jobOfragment_TrigLoFRemoval.py
+++ /dev/null
@@ -1,13 +0,0 @@
-#----------------------------------------------------
-# MuCluster options
-#----------------------------------------------------
-# Timing service libs.
-theApp.Dlls += [ "TrigTimeAlgs" ]
-theApp.ExtSvc += [ "TrigTimeSvc" ]
-
-# Algorithm
-theApp.Dlls += [ "TrigiMuCluster" ]
-
-# Timer service conf.
-TrigTimerSvc = Service ( "TrigTimerSvc" )
-TrigTimerSvc.OutputLevel = 3
diff --git a/Trigger/TrigAlgorithms/TrigEFLongLivedParticles/src/TrigLoFRemoval.cxx b/Trigger/TrigAlgorithms/TrigEFLongLivedParticles/src/TrigLoFRemoval.cxx
deleted file mode 100755
index 8df28e806089ff61eb63a29c116c9bf2ba2252ad..0000000000000000000000000000000000000000
--- a/Trigger/TrigAlgorithms/TrigEFLongLivedParticles/src/TrigLoFRemoval.cxx
+++ /dev/null
@@ -1,249 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// ********************************************************************
-//
-// NAME:     TrigLoFRemoval.cxx
-// PACKAGE:  Trigger/TrigAlgorithms/TrigEFLongLivedParticles
-//
-// AUTHOR:   A. Policicchio
-//           This is an Hlt algorithm that retrieves EF jets and calo cells
-//           for the LoF removal 
-//
-// ********************************************************************
-//
-#include <sstream>
-//
-#include "GaudiKernel/MsgStream.h"
-#include "GaudiKernel/IToolSvc.h"
-#include "GaudiKernel/StatusCode.h"
-#include "GaudiKernel/ListItem.h"
-
-#include "xAODJet/JetContainer.h"
-#include "xAODJet/Jet.h"
-
-#include "TrigEFLongLivedParticles/TrigLoFRemoval.h"
-
-#include "CaloEvent/CaloCellContainer.h"
-#include "CaloEvent/CaloCell.h"
-
-#include "FourMomUtils/P4DescendingSorters.h"
-
-#include "TrigSteeringEvent/PhiHelper.h"
-#include "TrigTimeAlgs/TrigTimer.h"
-#include "AthContainers/ConstDataVector.h"
-#include "AthenaKernel/Timeout.h"
-
-#define PI 3.14159265
-
-
-class ISvcLocator;
-
-
-//** ----------------------------------------------------------------------------------------------------------------- **//
-
-
-struct DescendingEt:std::binary_function<const xAOD::Jet*, const xAOD::Jet*, bool> {
-  bool operator()(const xAOD::Jet* l, const xAOD::Jet* r)  const {
-    return l->p4().Et() > r->p4().Et();
-  }
-};
-
-
-//** ----------------------------------------------------------------------------------------------------------------- **//
-
-
-TrigLoFRemoval::TrigLoFRemoval(const std::string& name, ISvcLocator* pSvcLocator):
-    HLT::FexAlgo(name, pSvcLocator) {
-
-  // Monitored variables...
-  declareMonitoredVariable("Et", m_et);
-  declareMonitoredVariable("NJet", m_njet);
-  declareMonitoredVariable("Eta", m_eta);
-  declareMonitoredVariable("Phi", m_phi);
-  declareMonitoredVariable("CellContainerSize", m_CellContainerSize);
-  
-}
-
-
-//** ----------------------------------------------------------------------------------------------------------------- **//
-
-
-TrigLoFRemoval::~TrigLoFRemoval() {}
-
-
-//** ----------------------------------------------------------------------------------------------------------------- **//
-
-
-HLT::ErrorCode TrigLoFRemoval::hltInitialize() {
-
-  msg() << MSG::INFO << "in initialize()" << endmsg;
-
-  return HLT::OK;
-}
-
-//** ----------------------------------------------------------------------------------------------------------------- **//
-
-
-HLT::ErrorCode TrigLoFRemoval::hltFinalize() {
-
-  msg() << MSG::INFO << "in finalize()" << endmsg;
-
-  return HLT::OK;
-}
-
-
-//** ----------------------------------------------------------------------------------------------------------------- **//
-
-
-HLT::ErrorCode TrigLoFRemoval::hltExecute(const HLT::TriggerElement* inputTE, HLT::TriggerElement* outputTE) {
-
-  if (msgLvl() <= MSG::DEBUG)
-    msg() << MSG::DEBUG << "in execute()" << endmsg;
-  
-  // Monitoring, we set-up default :
-  m_et = -99000.;
-  m_njet = 0.0;
-  m_eta = -99.;
-  m_phi = -99.;
-
-  // Some debug output:
-  if (msgLvl() <= MSG::DEBUG) {
-    msg() << MSG::DEBUG << "outputTE->getId(): " << outputTE->getId() << endmsg;
-    msg() << MSG::DEBUG << "inputTE->getId(): " << inputTE->getId() << endmsg;
-  }
-
-  const xAOD::JetContainer* vectorOfJets = 0;
-  HLT::ErrorCode status = getFeature(outputTE, vectorOfJets);
-
-  if(status != HLT::OK) {
-    msg() << MSG::ERROR << "Failed to get the xAOD jet container" << endmsg;
-    return HLT::ERROR;
-  } else if (msgLvl() <= MSG::DEBUG)
-    msg() << MSG::DEBUG << "Got the xAOD jet container" << endmsg;
-  
-  if(vectorOfJets->size() == 0) {
-    if (msgLvl() <= MSG::DEBUG)
-      msg() << MSG::DEBUG << "The xAOD jet container is empty" << endmsg;
-    return HLT::OK;
-  } else {
-    if (msgLvl() <= MSG::DEBUG)
-      msg() << MSG::DEBUG << vectorOfJets->size() << " jets are found" << endmsg;
-  }
-
-  std::vector<const xAOD::Jet*> theJets(vectorOfJets->begin(), vectorOfJets->end());
-
-  std::sort (theJets.begin(), theJets.end(), DescendingEt());
- 
-  double etLjet = 0;
-  double etaLjet = 0;
-  double phiLjet = 0;
-  int count = 0;
-
-  for (const xAOD::Jet* aJet : theJets) {
-    count++;
-    if(msgLvl() <= MSG::DEBUG) 
-      msg() << MSG::DEBUG << "Jet Et: " << aJet->p4().Et() << endmsg;
-    if(count==1) {
-      etLjet = aJet->p4().Et();
-      etaLjet = aJet->eta();
-      phiLjet = aJet->phi();
-    }
-  }
-  
-  if(msgLvl() <= MSG::DEBUG) {
-    msg() << MSG::DEBUG << " Highest Et Jet Et= "   << etLjet << endmsg;
-    msg() << MSG::DEBUG << " Highest Et Jet eta = " << etaLjet << endmsg;
-    msg() << MSG::DEBUG << " Highest Et Jet phi = " << phiLjet << endmsg;
-  }
-
-  // monitoring
-  m_et = etLjet;
-  m_eta = etaLjet;
-  m_phi = phiLjet;
-  m_njet = (float)theJets.size();
-
-
-  // We retrieve the CellContainer from the Trigger Element...
-  std::vector<const CaloCellContainer*> vectorOfCellContainers;
-
-  if(getFeatures(outputTE, vectorOfCellContainers, "") != HLT::OK) {
-    msg() << MSG::WARNING << "Failed to get TrigCells" << endmsg;   
-    return HLT::OK;
-  }
- 
-  if(msgLvl() <= MSG::DEBUG) msg() << MSG::DEBUG << "Got vector with " << vectorOfCellContainers.size() << " CellContainers" << endmsg;
- 
-  // if no containers were found, just leave the vector empty and leave
-  if ( vectorOfCellContainers.size() < 1) {
-    msg() << MSG::ERROR << "No cells to analyse, leaving!" << endmsg;
-    return HLT::OK;
-  }
-
-  // get last ccontainer to be put in vector (should also be the only one)
-  const CaloCellContainer* theCellCont = vectorOfCellContainers.back();
-
-  if(msgLvl() <= MSG::DEBUG) {
-    msg() << MSG::DEBUG << " Retrieved a Cell Container of Size= " << theCellCont->size() << endmsg;
-  }
-
-  ConstDataVector<CaloCellContainer>* theCellContLoF =
-    new ConstDataVector<CaloCellContainer>(SG::VIEW_ELEMENTS);
-  for(CaloCellContainer::const_iterator iter = theCellCont->begin(); iter != theCellCont->end(); ++iter){
-    //LoF cell selection:
-    //-tile
-    //-provenance
-    //-energy
-    if((*iter)->caloDDE()->is_tile() && (*iter)->energy() > 240.0){
-      //-dPhi
-      //-dR
-      float d_phi = HLT::wrapPhi((*iter)->phi() - phiLjet);
-      float d_eta = (*iter)->eta() - etaLjet;
-
-      if(fabs(d_phi) < 0.2 && sqrt(d_eta*d_eta + d_phi*d_phi) > 0.3){
-        //-early
-        float t = (*iter)->time();
-        if(t < -2.0){
-          //-halo time
-          float x = (*iter)->x();
-          float y = (*iter)->y();
-          float z = (*iter)->z();
-          float c = 299.792458;//mm per ns
-          float r = sqrt(x*x + y*y);
-          if((fabs(t - (z-sqrt(z*z + r*r))/c) < 5.0) || (fabs(t - (-z-sqrt(z*z + r*r))/c) < 5.0)){
-            theCellContLoF->push_back((*iter));
-          }
-        }
-      }
-    }
-  }
-
-  //now save the cell container
-  std::string persKey = "TrigCaloCellLoF";
-  std::string cellCollKey;
-  HLT::ErrorCode sc = getUniqueKey( theCellContLoF->asDataVector(), cellCollKey, persKey );
-  if (sc != HLT::OK) {
-    msg() << MSG::DEBUG << "Could not retrieve the cell collection key" << endmsg;
-    return sc;
-  }     
-  if ( store()->record(theCellContLoF, cellCollKey).isFailure() ) {
-    msg() << MSG::ERROR << "Could not record a cell container with key " << cellCollKey << endmsg;
-  }
-
-  sc = reAttachFeature(outputTE, theCellContLoF, cellCollKey, persKey );
-  if (sc != HLT::OK) {
-    msg() << MSG::WARNING << "Could not record a cell container with key " << cellCollKey << " " << name() << endmsg;
-  } else {
-    if (msgLvl() <= MSG::DEBUG)
-      msg() << MSG::DEBUG << "Recorded the cell container " << endmsg;
-  }
-  if (msgLvl() <= MSG::DEBUG)
-    msg() << MSG::DEBUG << "Produced a Cell Container of Size= " << theCellContLoF->size() << endmsg;
-
-  //monitoring
-  m_CellContainerSize = (float)theCellContLoF->size();
-
-  return HLT::OK;
-
-}
diff --git a/Trigger/TrigAlgorithms/TrigEFLongLivedParticles/src/components/TrigEFLongLivedParticles_entries.cxx b/Trigger/TrigAlgorithms/TrigEFLongLivedParticles/src/components/TrigEFLongLivedParticles_entries.cxx
deleted file mode 100644
index 020c3dae9c09aa857fd6749dc65f4fa7c217aa7b..0000000000000000000000000000000000000000
--- a/Trigger/TrigAlgorithms/TrigEFLongLivedParticles/src/components/TrigEFLongLivedParticles_entries.cxx
+++ /dev/null
@@ -1,5 +0,0 @@
-#include "TrigEFLongLivedParticles/TrigLoFRemoval.h"
-
-
-DECLARE_COMPONENT( TrigLoFRemoval )
-
diff --git a/Trigger/TrigAlgorithms/TrigEgammaRec/TrigEgammaRec/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigAlgorithms/TrigEgammaRec/TrigEgammaRec/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 0000000000000000000000000000000000000000..4f866eade019d749ea7b60727d8ba2416a4e130c
--- /dev/null
+++ b/Trigger/TrigAlgorithms/TrigEgammaRec/TrigEgammaRec/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Trigger/TrigAlgorithms/TrigEgammaRec
diff --git a/Trigger/TrigAlgorithms/TrigEgammaRec/src/TrigEgammaRec.cxx b/Trigger/TrigAlgorithms/TrigEgammaRec/src/TrigEgammaRec.cxx
index 8b95163cef42217d4667e2e1e546c1264740c7e8..902b40a328283b8ed750ff219f94602f37c8bcbc 100755
--- a/Trigger/TrigAlgorithms/TrigEgammaRec/src/TrigEgammaRec.cxx
+++ b/Trigger/TrigAlgorithms/TrigEgammaRec/src/TrigEgammaRec.cxx
@@ -996,7 +996,7 @@ HLT::ErrorCode TrigEgammaRec::hltExecute( const HLT::TriggerElement* inputTE,
             for (unsigned int i = 0 ; i < egRec->getNumberOfClusters(); ++i){
                 const xAOD::CaloCluster *clus = egRec->caloCluster(i);
                 // Also check the original (non-calibrated cluster)
-                static SG::AuxElement::Accessor<ElementLink<xAOD::CaloClusterContainer> > orig ("originalCaloCluster");
+                static const SG::AuxElement::Accessor<ElementLink<xAOD::CaloClusterContainer> > orig ("originalCaloCluster");
                 if (!orig.isAvailable(*clus) || !orig(*clus).isValid()){
                     ATH_MSG_DEBUG("Problem with original cluster link");
                 }
@@ -1076,7 +1076,7 @@ HLT::ErrorCode TrigEgammaRec::hltExecute( const HLT::TriggerElement* inputTE,
             std::vector< ElementLink< xAOD::CaloClusterContainer > > ph_clusterLinks;
             for (unsigned int i = 0 ; i < egRec->getNumberOfClusters(); ++i){
                 const xAOD::CaloCluster *clus = egRec->caloCluster(i);
-                static SG::AuxElement::Accessor<ElementLink<xAOD::CaloClusterContainer> > orig ("originalCaloCluster");
+                static const SG::AuxElement::Accessor<ElementLink<xAOD::CaloClusterContainer> > orig ("originalCaloCluster");
                 if (!orig.isAvailable(*clus) || !orig(*clus).isValid()){
                     ATH_MSG_DEBUG("Problem with original cluster link");
                 }
diff --git a/Trigger/TrigAlgorithms/TrigFastTrackFinder/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigAlgorithms/TrigFastTrackFinder/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 0000000000000000000000000000000000000000..e485a0efffacbf0bafcd382a170caeda9154dc3b
--- /dev/null
+++ b/Trigger/TrigAlgorithms/TrigFastTrackFinder/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Trigger/TrigAlgorithms/TrigFastTrackFinder
diff --git a/Trigger/TrigAlgorithms/TrigGenericAlgs/TrigGenericAlgs/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigAlgorithms/TrigGenericAlgs/TrigGenericAlgs/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 0000000000000000000000000000000000000000..203f89a60d0b74867a7cf45f8000e68a543c1457
--- /dev/null
+++ b/Trigger/TrigAlgorithms/TrigGenericAlgs/TrigGenericAlgs/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Trigger/TrigAlgorithms/TrigGenericAlgs
diff --git a/Trigger/TrigAlgorithms/TrigGenericAlgs/src/AcceptWhenInputMissing.cxx b/Trigger/TrigAlgorithms/TrigGenericAlgs/src/AcceptWhenInputMissing.cxx
index 42de1884e05bb37892ae013e0b27d277137a0f86..c7fe5c843c5b830bebb585d7e3e325984a771bbc 100644
--- a/Trigger/TrigAlgorithms/TrigGenericAlgs/src/AcceptWhenInputMissing.cxx
+++ b/Trigger/TrigAlgorithms/TrigGenericAlgs/src/AcceptWhenInputMissing.cxx
@@ -1,12 +1,10 @@
 /*
-  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 "TrigGenericAlgs/AcceptWhenInputMissing.h"
 #include "boost/foreach.hpp"
 
-std::vector<HLT::TriggerElement*> fake_seed;
-
 AcceptWhenInputMissing::AcceptWhenInputMissing(const std::string& name, ISvcLocator* pSvcLocator) 
   : HLT::AllTEAlgo(name, pSvcLocator) {
 }
@@ -24,7 +22,9 @@ HLT::ErrorCode AcceptWhenInputMissing::hltExecute(std::vector<std::vector<HLT::T
       msg() << MSG::DEBUG << "Not creating output because " <<  count << " input TEs present" << endmsg;    
   } else {
     if ( msgLvl() <= MSG::DEBUG )
-      msg() << MSG::DEBUG << "Creating output TE" << endmsg;      
+      msg() << MSG::DEBUG << "Creating output TE" << endmsg;
+
+    std::vector<HLT::TriggerElement*> fake_seed;
     HLT::TriggerElement* te = config()->getNavigation()->addNode(fake_seed, output);
     te->setActiveState(true);
   }
diff --git a/Trigger/TrigAlgorithms/TrigHLTJetHemisphereRec/TrigHLTJetHemisphereRec/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigAlgorithms/TrigHLTJetHemisphereRec/TrigHLTJetHemisphereRec/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 0000000000000000000000000000000000000000..2e2d0a29eadbc7e874fea536cb72318bc84c80a9
--- /dev/null
+++ b/Trigger/TrigAlgorithms/TrigHLTJetHemisphereRec/TrigHLTJetHemisphereRec/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Trigger/TrigAlgorithms/TrigHLTJetHemisphereRec
diff --git a/Trigger/TrigAlgorithms/TrigHLTJetRec/CMakeLists.txt b/Trigger/TrigAlgorithms/TrigHLTJetRec/CMakeLists.txt
index ec07e72ecc6437029c8ec9b59e02660fcae8b858..5470790b5d6c8db682f8be40c46a269d9386afe0 100644
--- a/Trigger/TrigAlgorithms/TrigHLTJetRec/CMakeLists.txt
+++ b/Trigger/TrigAlgorithms/TrigHLTJetRec/CMakeLists.txt
@@ -24,6 +24,7 @@ atlas_depends_on_subdirs( PUBLIC
                           Trigger/TrigEvent/TrigSteeringEvent
                           Trigger/TrigSteer/TrigInterfaces
                           PRIVATE
+                          Control/CxxUtils
                           Calorimeter/CaloEvent
                           Event/xAOD/xAODEventShape
                           Reconstruction/EventShapes/EventShapeTools
diff --git a/Trigger/TrigAlgorithms/TrigHLTJetRec/TrigHLTJetRec/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigAlgorithms/TrigHLTJetRec/TrigHLTJetRec/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 0000000000000000000000000000000000000000..f3fa35f18be08b0bcc30b9b9c8426d208911f57a
--- /dev/null
+++ b/Trigger/TrigAlgorithms/TrigHLTJetRec/TrigHLTJetRec/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Trigger/TrigAlgorithms/TrigHLTJetRec
diff --git a/Trigger/TrigAlgorithms/TrigHLTJetRec/TrigHLTJetRec/TrigHLTPSvsFSDiagnostics.h b/Trigger/TrigAlgorithms/TrigHLTJetRec/TrigHLTJetRec/TrigHLTPSvsFSDiagnostics.h
index d24d1a7e9fa284f1b1a11201715fa71904a641c1..761c235e1f6124890b7492a5f43ca996322f8909 100644
--- a/Trigger/TrigAlgorithms/TrigHLTJetRec/TrigHLTJetRec/TrigHLTPSvsFSDiagnostics.h
+++ b/Trigger/TrigAlgorithms/TrigHLTJetRec/TrigHLTJetRec/TrigHLTPSvsFSDiagnostics.h
@@ -11,6 +11,8 @@
 #include "TrigSteeringEvent/TrigRoiDescriptor.h"
 #include "xAODJet/JetContainer.h"
 
+#include "CxxUtils/checker_macros.h"
+ATLAS_NO_CHECK_FILE_THREAD_SAFETY;  // legacy trigger code
 
 class TH1D;
 class TH2D;
diff --git a/Trigger/TrigAlgorithms/TrigHLTJetRec/src/TrigHLTPSvsFSDiagnostics.cxx b/Trigger/TrigAlgorithms/TrigHLTJetRec/src/TrigHLTPSvsFSDiagnostics.cxx
index a2cadc2376c6ff39ad183760bb26fa97e7a6771f..52c4a865a401c81fce4592ba0552c0d22163c499 100644
--- a/Trigger/TrigAlgorithms/TrigHLTJetRec/src/TrigHLTPSvsFSDiagnostics.cxx
+++ b/Trigger/TrigAlgorithms/TrigHLTJetRec/src/TrigHLTPSvsFSDiagnostics.cxx
@@ -22,6 +22,7 @@
 #include <cmath>
 #include "TrigSteeringEvent/PhiHelper.h"
 
+ATLAS_NO_CHECK_FILE_THREAD_SAFETY;  // legacy trigger code
 
 TrigHLTPSvsFSDiagnostics::TrigHLTPSvsFSDiagnostics(const std::string& name, ISvcLocator* pSvcLocator):
 HLT::HypoAlgo(name, pSvcLocator) {
diff --git a/Trigger/TrigAlgorithms/TrigL2LongLivedParticles/TrigL2LongLivedParticles/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigAlgorithms/TrigL2LongLivedParticles/TrigL2LongLivedParticles/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 0000000000000000000000000000000000000000..19d05402785413953afef25f9d3b41c4fcb73c77
--- /dev/null
+++ b/Trigger/TrigAlgorithms/TrigL2LongLivedParticles/TrigL2LongLivedParticles/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Trigger/TrigAlgorithms/TrigL2LongLivedParticles
diff --git a/Trigger/TrigAlgorithms/TrigL2SiTrackFinder/TrigL2SiTrackFinder/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigAlgorithms/TrigL2SiTrackFinder/TrigL2SiTrackFinder/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 0000000000000000000000000000000000000000..4b0632a32dfa03d4bcf4419526310dbaf1b4c5d0
--- /dev/null
+++ b/Trigger/TrigAlgorithms/TrigL2SiTrackFinder/TrigL2SiTrackFinder/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Trigger/TrigAlgorithms/TrigL2SiTrackFinder
diff --git a/Trigger/TrigAlgorithms/TrigL2TRTSegFinder/TrigL2TRTSegFinder/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigAlgorithms/TrigL2TRTSegFinder/TrigL2TRTSegFinder/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 0000000000000000000000000000000000000000..2b6fed6cf715c9262c06d4b1fa373038ae709ed4
--- /dev/null
+++ b/Trigger/TrigAlgorithms/TrigL2TRTSegFinder/TrigL2TRTSegFinder/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Trigger/TrigAlgorithms/TrigL2TRTSegFinder
diff --git a/Trigger/TrigAlgorithms/TrigMinBias/TrigMinBias/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigAlgorithms/TrigMinBias/TrigMinBias/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 0000000000000000000000000000000000000000..90cf7858f1bd88931cd4b6d2af02ccc5dc29e7b6
--- /dev/null
+++ b/Trigger/TrigAlgorithms/TrigMinBias/TrigMinBias/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Trigger/TrigAlgorithms/TrigMinBias
diff --git a/Trigger/TrigAlgorithms/TrigPartialEventBuilding/TrigPartialEventBuilding/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigAlgorithms/TrigPartialEventBuilding/TrigPartialEventBuilding/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 0000000000000000000000000000000000000000..5c7de71a6cbf797ff40a9a8432c14e216d9a3d4f
--- /dev/null
+++ b/Trigger/TrigAlgorithms/TrigPartialEventBuilding/TrigPartialEventBuilding/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Trigger/TrigAlgorithms/TrigPartialEventBuilding
diff --git a/Trigger/TrigAlgorithms/TrigSecVtxFinder/CMakeLists.txt b/Trigger/TrigAlgorithms/TrigSecVtxFinder/CMakeLists.txt
index e3cf6dafa61b44ebd37448b040665f86690a2f32..86d57d14bcfbc0bc1910c3a0d08587ab1aca52f1 100644
--- a/Trigger/TrigAlgorithms/TrigSecVtxFinder/CMakeLists.txt
+++ b/Trigger/TrigAlgorithms/TrigSecVtxFinder/CMakeLists.txt
@@ -14,6 +14,7 @@ atlas_depends_on_subdirs( PUBLIC
                           Trigger/TrigTools/TrigTrackJetFinderTool
                           InnerDetector/InDetConditions/BeamSpotConditionsData
                           PRIVATE
+                          Control/CxxUtils
                           DetectorDescription/GeoPrimitives
                           Trigger/TrigEvent/TrigInDetEvent
                           Trigger/TrigEvent/TrigSteeringEvent )
diff --git a/Trigger/TrigAlgorithms/TrigSecVtxFinder/TrigSecVtxFinder/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigAlgorithms/TrigSecVtxFinder/TrigSecVtxFinder/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 0000000000000000000000000000000000000000..51a8ff02b2bd3df37695b10092d62eb2dbfcfcd0
--- /dev/null
+++ b/Trigger/TrigAlgorithms/TrigSecVtxFinder/TrigSecVtxFinder/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Trigger/TrigAlgorithms/TrigSecVtxFinder
diff --git a/Trigger/TrigAlgorithms/TrigSecVtxFinder/TrigSecVtxFinder/TrigSecVtxFinder.h b/Trigger/TrigAlgorithms/TrigSecVtxFinder/TrigSecVtxFinder/TrigSecVtxFinder.h
index 1eb73718464e8286b94e964b1b0af6e19ab7f02f..ddcbc45947fd9052a5b0f9ee28a3528ce43c1485 100755
--- a/Trigger/TrigAlgorithms/TrigSecVtxFinder/TrigSecVtxFinder/TrigSecVtxFinder.h
+++ b/Trigger/TrigAlgorithms/TrigSecVtxFinder/TrigSecVtxFinder/TrigSecVtxFinder.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
 */
 
 // ************************************************
@@ -23,6 +23,9 @@
 #include "TrigInDetVxInJetTool/ITrigInDetVxInJetTool.h"
 #include "BeamSpotConditionsData/BeamSpotData.h"
 
+#include "CxxUtils/checker_macros.h"
+ATLAS_NO_CHECK_FILE_THREAD_SAFETY;  // legacy trigger code
+
 namespace CLHEP {
   class HepLorentzVector;
 }
diff --git a/Trigger/TrigAlgorithms/TrigSecVtxFinder/src/TrigSecVtxFinder.cxx b/Trigger/TrigAlgorithms/TrigSecVtxFinder/src/TrigSecVtxFinder.cxx
index a411f5f2b53f0e51b0521044751ba509c65a56a7..46f1046692fc10109fbb69d9191f8b2dc8d924ee 100644
--- a/Trigger/TrigAlgorithms/TrigSecVtxFinder/src/TrigSecVtxFinder.cxx
+++ b/Trigger/TrigAlgorithms/TrigSecVtxFinder/src/TrigSecVtxFinder.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 "TrigSecVtxFinder/TrigSecVtxFinder.h"
@@ -14,6 +14,8 @@
 
 #include <sstream>
 
+ATLAS_NO_CHECK_FILE_THREAD_SAFETY;  // legacy trigger code
+
 TrigSecVtxFinder::TrigSecVtxFinder(const std::string &name, ISvcLocator *pSvcLocator):
   HLT::FexAlgo(name, pSvcLocator),
   m_algo(6),
diff --git a/Trigger/TrigAlgorithms/TrigT2BeamSpot/TrigT2BeamSpot/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigAlgorithms/TrigT2BeamSpot/TrigT2BeamSpot/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 0000000000000000000000000000000000000000..a4209cd81c140c530270d0e82a6dd524a83a38e2
--- /dev/null
+++ b/Trigger/TrigAlgorithms/TrigT2BeamSpot/TrigT2BeamSpot/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Trigger/TrigAlgorithms/TrigT2BeamSpot
diff --git a/Trigger/TrigAlgorithms/TrigT2BeamSpot/src/T2Track.h b/Trigger/TrigAlgorithms/TrigT2BeamSpot/src/T2Track.h
index 476ffb45c581a91580b93ea1eca170b9b6474813..0a90bf5fcf187977a0392eb4bfe76a5870c3e255 100644
--- a/Trigger/TrigAlgorithms/TrigT2BeamSpot/src/T2Track.h
+++ b/Trigger/TrigAlgorithms/TrigT2BeamSpot/src/T2Track.h
@@ -1,10 +1,9 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 /**********************************************************************************
  *
- * @version: $Id: T2Track.h 793162 2017-01-20 03:48:25Z ssnyder $
  *
  * @project: HLT, PESA algorithms
  * @package: TrigT2BeamSpot
@@ -146,7 +145,7 @@ namespace PESA {
     double m_D0err;
     double m_NDF;
     double m_Qual;
-    mutable double m_Chi2Prob;
+    mutable std::atomic<double> m_Chi2Prob;
     int    m_SiHits;
     int    m_PIXHits;
     int    m_SCTHits;
diff --git a/Trigger/TrigAlgorithms/TrigT2BeamSpot/src/T2Vertex.h b/Trigger/TrigAlgorithms/TrigT2BeamSpot/src/T2Vertex.h
index 98e820a03f741bb2f57a281c92325868c8de8577..00cf90b19fe9bf6d4b02313096799094b239269a 100644
--- a/Trigger/TrigAlgorithms/TrigT2BeamSpot/src/T2Vertex.h
+++ b/Trigger/TrigAlgorithms/TrigT2BeamSpot/src/T2Vertex.h
@@ -1,10 +1,9 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 /**********************************************************************************
  *
- * @version: $Id: T2Vertex.h 702277 2015-10-22 10:33:51Z smh $
  *
  * @project: HLT, PESA algorithms
  * @package: TrigT2BeamSpot
@@ -192,12 +191,12 @@ namespace PESA
 
   private:
     // Data members
-    mutable double   m_SumPt   ;
-    mutable double   m_SumPt2  ;
+    double   m_SumPt   ;
+    double   m_SumPt2  ;
     double   m_Mass    ;
     double   m_NDF     ;
     double   m_Qual    ;
-    mutable double   m_Chi2Prob;
+    mutable std::atomic<double>   m_Chi2Prob;
     double   m_XZoom   ;
     double   m_YZoom   ;
     double   m_ZZoom   ;
diff --git a/Trigger/TrigAlgorithms/TrigT2HistoPrmVtx/TrigT2HistoPrmVtx/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigAlgorithms/TrigT2HistoPrmVtx/TrigT2HistoPrmVtx/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 0000000000000000000000000000000000000000..c07a233412a18ac833e7219044644c8f6aa25d6f
--- /dev/null
+++ b/Trigger/TrigAlgorithms/TrigT2HistoPrmVtx/TrigT2HistoPrmVtx/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Trigger/TrigAlgorithms/TrigT2HistoPrmVtx
diff --git a/Trigger/TrigAlgorithms/TrigT2IDTau/TrigT2IDTau/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigAlgorithms/TrigT2IDTau/TrigT2IDTau/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 0000000000000000000000000000000000000000..8c4fafadafcc39d54468a5ff6cf410d754830145
--- /dev/null
+++ b/Trigger/TrigAlgorithms/TrigT2IDTau/TrigT2IDTau/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Trigger/TrigAlgorithms/TrigT2IDTau
diff --git a/Trigger/TrigAlgorithms/TrigT2MinBias/TrigT2MinBias/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigAlgorithms/TrigT2MinBias/TrigT2MinBias/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 0000000000000000000000000000000000000000..0e4b7dcfa063cf7eb64698f78299f3bea2022efc
--- /dev/null
+++ b/Trigger/TrigAlgorithms/TrigT2MinBias/TrigT2MinBias/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Trigger/TrigAlgorithms/TrigT2MinBias
diff --git a/Trigger/TrigAlgorithms/TrigT2Tau/CMakeLists.txt b/Trigger/TrigAlgorithms/TrigT2Tau/CMakeLists.txt
index d0da2c2ef5e8d08bb0754d44e3ccdbb67aa3b919..52e74468abcd7f078e44f5560fca5b4e87616731 100644
--- a/Trigger/TrigAlgorithms/TrigT2Tau/CMakeLists.txt
+++ b/Trigger/TrigAlgorithms/TrigT2Tau/CMakeLists.txt
@@ -15,6 +15,7 @@ atlas_depends_on_subdirs( PUBLIC
                           Trigger/TrigEvent/TrigSteeringEvent
                           Trigger/TrigSteer/TrigInterfaces
                           PRIVATE
+                          Control/CxxUtils
                           Event/FourMom )
 
 # Component(s) in the package:
diff --git a/Trigger/TrigAlgorithms/TrigT2Tau/TrigT2Tau/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigAlgorithms/TrigT2Tau/TrigT2Tau/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 0000000000000000000000000000000000000000..fc278ed8f08521893f04155c273dee75ad517c06
--- /dev/null
+++ b/Trigger/TrigAlgorithms/TrigT2Tau/TrigT2Tau/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Trigger/TrigAlgorithms/TrigT2Tau
diff --git a/Trigger/TrigAlgorithms/TrigT2Tau/TrigT2Tau/T2TauFinal.h b/Trigger/TrigAlgorithms/TrigT2Tau/TrigT2Tau/T2TauFinal.h
index 6c34c8273846eea9796be57b33fc07edfb2077c6..f084ec30e73db1323a30487151209802eb69c4ec 100755
--- a/Trigger/TrigAlgorithms/TrigT2Tau/TrigT2Tau/T2TauFinal.h
+++ b/Trigger/TrigAlgorithms/TrigT2Tau/TrigT2Tau/T2TauFinal.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
 */
 
 // ********************************************************************
@@ -19,6 +19,9 @@
 #include "TrigInterfaces/FexAlgo.h"
 #include "GaudiKernel/ToolHandle.h"
 
+#include "CxxUtils/checker_macros.h"
+ATLAS_NO_CHECK_FILE_THREAD_SAFETY;  // legacy trigger code
+
 namespace HLT {
   class TriggerElement;
 }
diff --git a/Trigger/TrigAlgorithms/TrigT2Tau/src/T2TauFinal.cxx b/Trigger/TrigAlgorithms/TrigT2Tau/src/T2TauFinal.cxx
index 57ac9d00180af8bf978bf34f81ff9b74ecc88231..b2041af63224eee1b2708bdff6055d1095141675 100755
--- a/Trigger/TrigAlgorithms/TrigT2Tau/src/T2TauFinal.cxx
+++ b/Trigger/TrigAlgorithms/TrigT2Tau/src/T2TauFinal.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
 */
 
 // ********************************************************************
@@ -30,6 +30,8 @@
 #include "TrigParticle/TrigTau.h"
 #include "TrigParticle/TrigTauContainer.h"
 
+ATLAS_NO_CHECK_FILE_THREAD_SAFETY;  // legacy trigger code
+
 class ISvcLocator;
 
 T2TauFinal::T2TauFinal(const std::string & name, ISvcLocator* pSvcLocator):
diff --git a/Trigger/TrigAlgorithms/TrigTRTHighTHitCounter/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigAlgorithms/TrigTRTHighTHitCounter/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 0000000000000000000000000000000000000000..eb284e97a744c73074ad6777476adaad606adcce
--- /dev/null
+++ b/Trigger/TrigAlgorithms/TrigTRTHighTHitCounter/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Trigger/TrigAlgorithms/TrigTRTHighTHitCounter
diff --git a/Trigger/TrigAlgorithms/TrigTauDiscriminant/CMakeLists.txt b/Trigger/TrigAlgorithms/TrigTauDiscriminant/CMakeLists.txt
index 1b5ee90bbff0876009a071d37b020881cf794500..5fdce736f38df26d9b6e405dde59081a9e4447f5 100644
--- a/Trigger/TrigAlgorithms/TrigTauDiscriminant/CMakeLists.txt
+++ b/Trigger/TrigAlgorithms/TrigTauDiscriminant/CMakeLists.txt
@@ -12,6 +12,7 @@ atlas_depends_on_subdirs( PUBLIC
                           Trigger/TrigSteer/TrigInterfaces
                           Trigger/TrigTools/TrigTimeAlgs
                           PRIVATE
+                          Control/CxxUtils
                           Event/xAOD/xAODTau
                           Trigger/TrigEvent/TrigParticle
                           Trigger/TrigEvent/TrigSteeringEvent
diff --git a/Trigger/TrigAlgorithms/TrigTauDiscriminant/TrigTauDiscriminant/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigAlgorithms/TrigTauDiscriminant/TrigTauDiscriminant/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 0000000000000000000000000000000000000000..f4ac6f82b23f2a1e0a33296c803374787c44f4a8
--- /dev/null
+++ b/Trigger/TrigAlgorithms/TrigTauDiscriminant/TrigTauDiscriminant/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Trigger/TrigAlgorithms/TrigTauDiscriminant
diff --git a/Trigger/TrigAlgorithms/TrigTauDiscriminant/TrigTauDiscriminant/TrigTauDiscriBuilder.h b/Trigger/TrigAlgorithms/TrigTauDiscriminant/TrigTauDiscriminant/TrigTauDiscriBuilder.h
index 8341cf6f5e54b8ef4925a3977310aa4c5a65fc4d..601c158c7a5b6e8329df5512f69620f3c65c4a8e 100755
--- a/Trigger/TrigAlgorithms/TrigTauDiscriminant/TrigTauDiscriminant/TrigTauDiscriBuilder.h
+++ b/Trigger/TrigAlgorithms/TrigTauDiscriminant/TrigTauDiscriminant/TrigTauDiscriBuilder.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
 */
 
 //
@@ -23,6 +23,9 @@
 #include "tauRecTools/ITauToolBase.h"
 #include <vector>
 
+#include "CxxUtils/checker_macros.h"
+ATLAS_NO_CHECK_FILE_THREAD_SAFETY;  // legacy trigger code
+
 namespace HLT {
   class TriggerElement;
 }
diff --git a/Trigger/TrigAlgorithms/TrigTauDiscriminant/src/TrigTauDiscriBuilder.cxx b/Trigger/TrigAlgorithms/TrigTauDiscriminant/src/TrigTauDiscriBuilder.cxx
index 16242b137cff4cb8b87d168d5117d91d92d5234e..9255ea28a1652d27e9028d8eedf5d809701e7209 100644
--- a/Trigger/TrigAlgorithms/TrigTauDiscriminant/src/TrigTauDiscriBuilder.cxx
+++ b/Trigger/TrigAlgorithms/TrigTauDiscriminant/src/TrigTauDiscriBuilder.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
 */
 
 /********************************************************************
@@ -21,6 +21,8 @@
 #include "TrigTauDiscriminant/TrigTauDiscriBuilder.h"
 #include "tauRecTools/ITauToolBase.h"
 
+ATLAS_NO_CHECK_FILE_THREAD_SAFETY;  // legacy trigger code
+
 using namespace std;
 
 /////////////////////////////////////////////////////////////////
diff --git a/Trigger/TrigAlgorithms/TrigTauRec/TrigTauRec/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigAlgorithms/TrigTauRec/TrigTauRec/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 0000000000000000000000000000000000000000..1bdff0706463bba668ed92901e333f640976dcad
--- /dev/null
+++ b/Trigger/TrigAlgorithms/TrigTauRec/TrigTauRec/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Trigger/TrigAlgorithms/TrigTauRec
diff --git a/Trigger/TrigAlgorithms/TrigTileMuId/TrigTileMuId/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigAlgorithms/TrigTileMuId/TrigTileMuId/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 0000000000000000000000000000000000000000..1674bed49456bf783a4e254741e9cd0278e3494b
--- /dev/null
+++ b/Trigger/TrigAlgorithms/TrigTileMuId/TrigTileMuId/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Trigger/TrigAlgorithms/TrigTileMuId
diff --git a/Trigger/TrigAlgorithms/TrigmuComb/CMakeLists.txt b/Trigger/TrigAlgorithms/TrigmuComb/CMakeLists.txt
index 3e72c8c215d48443a9a413ec605ceafc15ec65d9..ac70437532a1ca143f2e31f288879a2e133076ba 100644
--- a/Trigger/TrigAlgorithms/TrigmuComb/CMakeLists.txt
+++ b/Trigger/TrigAlgorithms/TrigmuComb/CMakeLists.txt
@@ -19,6 +19,7 @@ atlas_depends_on_subdirs( PUBLIC
                           Trigger/TrigTools/TrigTimeAlgs
                           PRIVATE
                           Control/AthenaKernel
+                          Control/CxxUtils
                           Control/StoreGate
                           Tools/PathResolver
                           Trigger/TrigConfiguration/TrigConfHLTData
diff --git a/Trigger/TrigAlgorithms/TrigmuComb/TrigmuComb/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigAlgorithms/TrigmuComb/TrigmuComb/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 0000000000000000000000000000000000000000..243a5a252619ad7dadf54d68124fa6008c56d03c
--- /dev/null
+++ b/Trigger/TrigAlgorithms/TrigmuComb/TrigmuComb/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Trigger/TrigAlgorithms/TrigmuComb
diff --git a/Trigger/TrigAlgorithms/TrigmuComb/TrigmuComb/muComb.h b/Trigger/TrigAlgorithms/TrigmuComb/TrigmuComb/muComb.h
index f71330bcd9fc40331a54e5a75bfbb42c4d3e710b..2dd7d3f9c4dab2102ff4ab6ba16b79b52f1ec8a2 100755
--- a/Trigger/TrigAlgorithms/TrigmuComb/TrigmuComb/muComb.h
+++ b/Trigger/TrigAlgorithms/TrigmuComb/TrigmuComb/muComb.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
 */
 
 // ********************************************************************
@@ -28,6 +28,9 @@
 #include "xAODTrigMuon/L2CombinedMuonContainer.h"
 #include "xAODTracking/TrackParticle.h"
 
+#include "CxxUtils/checker_macros.h"
+ATLAS_NO_CHECK_FILE_THREAD_SAFETY;  // legacy trigger code
+
 /** Main LVL2 Algorithm. Sided by a xAOD::L2StandaloneMuon, match the muon spectrometer track with an ID track, and produces a xAOD::L2CombinedMuon. */
 class muComb : public HLT::FexAlgo
 {
diff --git a/Trigger/TrigAlgorithms/TrigmuComb/src/muComb.cxx b/Trigger/TrigAlgorithms/TrigmuComb/src/muComb.cxx
index ad325e3c4640b073a3c0e05d2687fa25c496b933..c74f43027c95402d2d6e07016fe0b7b3aa5e5f67 100755
--- a/Trigger/TrigAlgorithms/TrigmuComb/src/muComb.cxx
+++ b/Trigger/TrigAlgorithms/TrigmuComb/src/muComb.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
 */
 
 // ********************************************************************
@@ -37,6 +37,8 @@
 
 #include "CLHEP/Units/SystemOfUnits.h"
 
+ATLAS_NO_CHECK_FILE_THREAD_SAFETY;  // legacy trigger code
+
 muComb::muComb(const std::string& name, ISvcLocator* pSvcLocator):
    HLT::FexAlgo(name, pSvcLocator),
    m_pStoreGate(NULL),
diff --git a/Trigger/TrigAlgorithms/TrigmuIso/CMakeLists.txt b/Trigger/TrigAlgorithms/TrigmuIso/CMakeLists.txt
index b763a53b58020594f5095a40488cf610c396000e..af28f049685328011846f74ff997a1ec4d1d84ef 100644
--- a/Trigger/TrigAlgorithms/TrigmuIso/CMakeLists.txt
+++ b/Trigger/TrigAlgorithms/TrigmuIso/CMakeLists.txt
@@ -17,6 +17,7 @@ atlas_depends_on_subdirs( PUBLIC
                           Trigger/TrigTools/TrigTimeAlgs
                           PRIVATE
                           Control/AthenaKernel
+                          Control/CxxUtils
                           Event/xAOD/xAODEventInfo
                           Event/xAOD/xAODTracking
                           Trigger/TrigConfiguration/TrigConfHLTData
diff --git a/Trigger/TrigAlgorithms/TrigmuIso/TrigmuIso/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigAlgorithms/TrigmuIso/TrigmuIso/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 0000000000000000000000000000000000000000..e9af1816887b3a090cf9bc63b8e76dfbbae11420
--- /dev/null
+++ b/Trigger/TrigAlgorithms/TrigmuIso/TrigmuIso/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Trigger/TrigAlgorithms/TrigmuIso
diff --git a/Trigger/TrigAlgorithms/TrigmuIso/TrigmuIso/muIso.h b/Trigger/TrigAlgorithms/TrigmuIso/TrigmuIso/muIso.h
index 15a540c93395cc6cc5925c12881624fe37a460ea..0eb5872df1e13ada2f2c42dca9094d0914b31e2c 100755
--- a/Trigger/TrigAlgorithms/TrigmuIso/TrigmuIso/muIso.h
+++ b/Trigger/TrigAlgorithms/TrigmuIso/TrigmuIso/muIso.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
 */
 
 // ********************************************************************
@@ -33,6 +33,9 @@
 #include "StoreGate/WriteHandleKey.h"  
 #include "AthenaMonitoring/GenericMonitoringTool.h"  
 
+#include "CxxUtils/checker_macros.h"
+ATLAS_NO_CHECK_FILE_THREAD_SAFETY;  // legacy trigger code
+
 class StoreGateSvc;
 class TrigTimer;
 
diff --git a/Trigger/TrigAlgorithms/TrigmuIso/src/muIso.cxx b/Trigger/TrigAlgorithms/TrigmuIso/src/muIso.cxx
index 0f016dd4a42a8dae5e07791f28288837eff78598..7f6c04968d60db89c49d914cac37a1c9475d7244 100644
--- a/Trigger/TrigAlgorithms/TrigmuIso/src/muIso.cxx
+++ b/Trigger/TrigAlgorithms/TrigmuIso/src/muIso.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
 */
 
 // ********************************************************************
@@ -45,6 +45,8 @@
 #include "AthenaBaseComps/AthMsgStreamMacros.h"
 #include "AthenaMonitoring/Monitored.h"
 
+ATLAS_NO_CHECK_FILE_THREAD_SAFETY;  // legacy trigger code
+
 class ISvcLocator;
 
 muIso::muIso(const std::string & name, ISvcLocator* pSvcLocator):
diff --git a/Trigger/TrigAlgorithms/TrigmuRoI/TrigmuRoI/ATLAS_CHECK_THREAD_SAFETY b/Trigger/TrigAlgorithms/TrigmuRoI/TrigmuRoI/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 0000000000000000000000000000000000000000..aa1f4a975ff93915cc450f0ab5c46c15028a0142
--- /dev/null
+++ b/Trigger/TrigAlgorithms/TrigmuRoI/TrigmuRoI/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Trigger/TrigAlgorithms/TrigmuRoI
diff --git a/Trigger/TrigAnalysis/TrigEffJpsiTools/CMakeLists.txt b/Trigger/TrigAnalysis/TrigEffJpsiTools/CMakeLists.txt
deleted file mode 100644
index ccb3504e9ad21ff25ce3e6030aecfc9eda1578d6..0000000000000000000000000000000000000000
--- a/Trigger/TrigAnalysis/TrigEffJpsiTools/CMakeLists.txt
+++ /dev/null
@@ -1,56 +0,0 @@
-################################################################################
-# Package: TrigEffJpsiTools
-################################################################################
-
-# Declare the package name:
-atlas_subdir( TrigEffJpsiTools )
-
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          DetectorDescription/GeoPrimitives
-                          GaudiKernel
-                          PRIVATE
-                          Control/AthenaBaseComps
-                          Control/AthenaKernel
-                          Control/StoreGate
-                          Event/EventInfo
-                          Event/EventKernel
-                          MuonSpectrometer/MuonCablings/RPCcablingInterface
-                          MuonSpectrometer/MuonDetDescr/MuonReadoutGeometry
-                          MuonSpectrometer/MuonIdHelpers
-                          PhysicsAnalysis/AnalysisTrigger/AnalysisTriggerEvent
-                          Reconstruction/MuonIdentification/muonEvent
-                          Reconstruction/Particle
-                          Tracking/TrkDetDescr/TrkSurfaces
-                          Tracking/TrkEvent/TrkEventUtils
-                          Tracking/TrkEvent/TrkParameters
-                          Tracking/TrkEvent/TrkRIO_OnTrack
-                          Tracking/TrkEvent/TrkTrack
-                          Tracking/TrkExtrapolation/TrkExInterfaces
-                          Trigger/TrigAnalysis/TrigDecisionTool
-                          Trigger/TrigAnalysis/TrigInDetAnalysis
-                          Trigger/TrigAnalysis/TrigInDetAnalysisUtils
-                          Trigger/TrigConfiguration/TrigConfL1Data
-                          Trigger/TrigEvent/TrigMuonEvent
-                          Trigger/TrigEvent/TrigParticle
-                          Trigger/TrigEvent/TrigSteeringEvent
-                          Trigger/TrigT1/TrigT1Interfaces
-                          Trigger/TrigT1/TrigT1RPCRecRoiSvc
-                          Trigger/TrigT1/TrigT1Result
-                          Trigger/TrigT1/TrigT1TGCRecRoiSvc )
-
-# External dependencies:
-find_package( Eigen )
-find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread MathMore Minuit Minuit2 Matrix Physics HistPainter Rint )
-
-# Component(s) in the package:
-atlas_add_component( TrigEffJpsiTools
-                     src/*.cxx
-                     src/components/*.cxx
-                     INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${ROOT_LIBRARIES} ${EIGEN_LIBRARIES} GeoPrimitives GaudiKernel AthenaBaseComps AthenaKernel StoreGateLib SGtests EventInfo EventKernel RPCcablingInterfaceLib MuonReadoutGeometry MuonIdHelpersLib AnalysisTriggerEvent muonEvent Particle TrkSurfaces TrkEventUtils TrkParameters TrkRIO_OnTrack TrkTrack TrkExInterfaces TrigDecisionToolLib TrigInDetAnalysis TrigInDetAnalysisUtils TrigConfL1Data TrigMuonEvent TrigParticle TrigSteeringEvent TrigT1Interfaces TrigT1RPCRecRoiSvcLib TrigT1Result TrigT1TGCRecRoiSvcLib )
-
-# Install files from the package:
-atlas_install_headers( TrigEffJpsiTools )
-atlas_install_joboptions( share/*.py )
-
diff --git a/Trigger/TrigAnalysis/TrigEffJpsiTools/TrigEffJpsiTools/ITrigEffJpsiTools.h b/Trigger/TrigAnalysis/TrigEffJpsiTools/TrigEffJpsiTools/ITrigEffJpsiTools.h
deleted file mode 100644
index e6df12cf98a246ae81a7f22bed02d2bb5a4ddb33..0000000000000000000000000000000000000000
--- a/Trigger/TrigAnalysis/TrigEffJpsiTools/TrigEffJpsiTools/ITrigEffJpsiTools.h
+++ /dev/null
@@ -1,312 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef ITRIGEFFJPSITOOLS_H
-#define ITRIGEFFJPSITOOLS_H
-/**
- * @author    Hironori Kiyamura
- * @author    Takashi Matsushita
- * @date      $Date: 2013-11-11 01:34:19 +0100 (Mon, 11 Nov 2013) $
- * @version   $Revision: 569614 $
- */
-
-/** @todo */
-/** @warnings */
-
-
-/*--------------------------------------------------------------------*
- * headers
- *--------------------------------------------------------------------*/
-#include "GaudiKernel/IAlgTool.h"
-#include "GeoPrimitives/GeoPrimitives.h"
-
-class INavigable4Momentum;
-namespace Rec { class TrackParticle; }
-namespace Trk { class Track; }
-namespace Trk { class RIO_OnTrack; }
-namespace Trk { class TrackStateOnSurface; }
-
-static const InterfaceID IID_ITrigEffJpsiTools("ITrigEffJpsiTools", 1, 0);
-
-
-/*--------------------------------------------------------------------*
- * classes
- *--------------------------------------------------------------------*/
-class ITrigEffJpsiTools : virtual public IAlgTool
-{
- public:
-    enum TrackType { COMBINED=0, SPECTROMETER=1, EXTRAPOLATED=2, IDONLY=3, UNDEFINED=99 };
-    enum TargetDetector { UNDEF, TGC, RPC };
-    struct TrigObject {
-      std::vector<std::string>  names;
-      double                    eta;
-      double                    phi;
-      double                    pt;
-      int                       q;
-      int64_t                   id;
-      int64_t                   parentId;
-      int64_t                   grandparentId;
-      std::vector<int64_t>      daughterIds;
-      std::vector<int>          combIds;
-      std::vector<int>          efObjIds;
-      int                       type; // combined, spectrometer, extrapolated track
-    };
-    typedef std::map<int64_t,  TrigObject> TrigObjectMap;
-    typedef std::pair<int64_t, TrigObject> TrigObjectPair;
-
-    static const InterfaceID& interfaceID() { return IID_ITrigEffJpsiTools; };
-
-    /** checks if track has passed given trigger chain
-     *
-     * @param track[in] Rec::TrackParticle to be tested
-     * @param chainName[in] name of trigger chain
-     * @return true if the given track has passed the trigger chain
-     */
-    virtual bool isTriggeredMuonEF(const Rec::TrackParticle* track,
-                                   const std::string& chainName) const = 0;
-
-    /** checks if track has passed given trigger chain
-     *
-     * @param track[in] Rec::TrackParticle to be tested
-     * @param chainName[in] name of trigger chain
-     * @return true if the given track has passed the trigger chain
-     */
-    virtual bool isTriggeredMuonL2(const Rec::TrackParticle* track,
-                                   const std::string& chainName) const = 0;
-
-    /** checks if track has passed given trigger chain
-     *
-     * @param track[in] Rec::TrackParticle to be tested
-     * @param chainName[in] name of trigger chain
-     * @return true if the given track has passed the trigger chain
-     */
-    virtual bool isTriggeredMuonL1(const Rec::TrackParticle* track,
-                                   const std::string& chainName) const = 0;
-
-    /** checks if track has matching muon RoI with the given threshold or not
-     *
-     * @param track[in] Rec::TrackParticle to be tested
-     * @param thresholdNumber[in] logic number of the muon level1 threshold to be passed
-     * @return true if the given track has corresponding muon RoI, false otherwise
-     */
-    virtual bool isTriggeredMuon(const Rec::TrackParticle* track,
-                                 int thresholdNumber) const = 0;
-
-    /** checks if a track pair is a J/psi candidate or not
-     *
-     * @param track1[in] Rec::TrackParticle to be tested
-     * @param track2[in] Rec::TrackParticle to be tested
-     * @return true if the given track pair is a J/psi candidate, false otherwise
-     */
-    virtual bool isJPsiCandidate(const Rec::TrackParticle* track1,
-                                 const Rec::TrackParticle* track2) const = 0;
-
-    /** checks if a 4-vector pair is a Jpsi candidate or not
-     *
-     * @param mom1[in] INavigable4Momentum to be tested
-     * @param mom2[in] INavigable4Momentum to be tested
-     */
-    virtual bool isJPsiCandidate(const INavigable4Momentum* mom1,
-                                 const INavigable4Momentum* mom2) const = 0;
-
-    /** searches level1 muon RoI associating with the given track
-     *
-     * @param track[in] Rec::TrackParticle to be tested
-     * @param barrel[out] returns true if the track passes barrel pivot plane
-     * @param endcap[out] returns true if the track passes endcap pivot plane
-     * @param eta[out] if not null, returns extrapolated position and error in eta (if the track passes both barrel/endcap pivot planes without matching roi, barrel information is stored)
-     * @param phi[out] if not null, returns extrapolated position and error in phi (if the track passes both barrel/endcap pivot planes without matching roi, barrel information is stored)
-     * @return index to muon_type (std::vector<Muon_ROI>), -1 when there is no association
-     */
-    virtual int getMatchedRoI(const Rec::TrackParticle* track,
-                              bool* barrel = 0,
-                              bool* endcap = 0,
-                              Amg::Vector2D* eta = 0,
-                              Amg::Vector2D* phi = 0) const = 0;
-
-    /** calculates size of the givin RoI
-     *
-     * @param roiWord[in] roiWord to be examined
-     * @param etaSize[out] roiSize in eta
-     * @param phiSize[out] roiSize in phi
-     * @return StatusCode
-     */
-    virtual StatusCode getRoiSize(const unsigned int roiWord,
-                                  double* etaSize,
-                                  double* phiSize) const = 0;
-
-    /** get array of reconstruction input objects (rio) on track
-     *
-     * @param track[in] reference track
-     * @param rots[in] array of rio on the reference track
-     * @param pivotOnly[in] if true, get rio on pivot plane only
-     * @return StatusCode
-     */
-    virtual StatusCode getRioOnTriggerChamber(const Trk::Track* track,
-                                              std::vector<const Trk::RIO_OnTrack*>& rots,
-                                              bool pivotOnly=true) const = 0;
-
-    /** extrapolate an input track to given rio
-     *
-     * @param track[in] track to be extrapolated
-     * @param rot[in] target rio
-     * @param eta[out]  eta and its error of extrapolated position
-     * @param phi[out]  phi and its error of extrapolated position
-     * @param ptpz[out] pt and pz of the extrapolated track
-     * @param getTsos[in] set true when you need tsos output
-     * @param tsos[out] array of TrackStateOnSurface along extrapolation
-     * @return true for successful extrapolation, false otherwise
-     */
-    virtual bool extrapolateToRio(const Rec::TrackParticle* track,
-                                  const Trk::RIO_OnTrack* rot,
-                                  Amg::Vector2D* eta,
-                                  Amg::Vector2D* phi,
-                                  Amg::Vector2D* ptpz,
-                                  bool getTsos,
-                                  const std::vector<const Trk::TrackStateOnSurface*>* &tsos) const = 0;
-
-    /** extrapolate an input track to given point
-     *
-     * @param track[in] track to be extrapolated
-     * @param pos[in] target position
-     * @param detector[in] target detector
-     * @param eta[out] eta and its error of extrapolated position
-     * @param phi[out] phi and its error of extrapolated position
-     * @param mom[out] momentum of the extrapolated track
-     * @return true for successful extrapolation, false otherwise
-     */
-    virtual bool extrapolateToPoint(const Rec::TrackParticle* track,
-                                    const Amg::Vector3D* pos,
-                                    const int detector,
-                                    Amg::Vector2D* eta,
-                                    Amg::Vector2D* phi,
-                                    Amg::Vector3D* mom) const = 0;
-
-    /** get all trigger objects of a given chain and its parents
-     *
-     * @param chain[in] name of the trigger chain
-     * @param muonsEF[out] pointer to the TrigObjectMap to be filled by EF trigger objects
-     * @param muonsL2[out] pointer to the TrigObjectMap to be filled by L2 trigger objects
-     * @param muonsL1[out] pointer to the TrigObjectMap to be filled by EF trigger objects
-     * @return true for successful retrival, false otherwise
-     */
-    virtual bool getTriggerObjects(const std::string& chain,
-                                   TrigObjectMap* muonsEF = NULL,
-                                   TrigObjectMap* muonsL2 = NULL,
-                                   TrigObjectMap* muonsL1 = NULL) const = 0;
-
-    /** get L1 trigger objects of a given chain
-     *
-     * @param chain[in] name of the trigger chain
-     * @param muonsL1[out] pointer to the TrigObjectMap to be filled by EF trigger objects
-     * @return true for successful retrival, false otherwise
-     */
-    virtual bool getL1TriggerObjects(const std::string& chain,
-                                     TrigObjectMap* muonsL1 = NULL) const = 0;
-
-    /** get L2 trigger objects of a given chain and its parents
-     *
-     * @param chain[in] name of the trigger chain
-     * @param muonsL2[out] pointer to the TrigObjectMap to be filled by L2 trigger objects
-     * @param muonsL1[out] pointer to the TrigObjectMap to be filled by EF trigger objects
-     * @return true for successful retrival, false otherwise
-     */
-    virtual bool getL2TriggerObjects(const std::string& chain,
-                                     TrigObjectMap* muonsL2 = NULL,
-                                     TrigObjectMap* muonsL1 = NULL) const = 0;
-
-    /** get EF trigger objects of a given chain and its parents
-     *
-     * @param chain[in] name of the trigger chain
-     * @param muonsEF[out] pointer to the TrigObjectMap to be filled by EF trigger objects
-     * @param muonsL2[out] pointer to the TrigObjectMap to be filled by L2 trigger objects
-     * @param muonsL1[out] pointer to the TrigObjectMap to be filled by EF trigger objects
-     * @return true for successful retrival, false otherwise
-     */
-    virtual bool getEFTriggerObjects(const std::string& chain,
-                                     TrigObjectMap* muonsEF = NULL,
-                                     TrigObjectMap* muonsL2 = NULL,
-                                     TrigObjectMap* muonsL1 = NULL) const = 0;
-
-    /** get EF trigger objects of a given chain and its parents
-     *
-     * @param chain[in] name of the trigger chain
-     * @param muonsEF[out] pointer to the TrigObjectMap to be filled by EF trigger objects
-     * @param muonsL2[out] pointer to the TrigObjectMap to be filled by L2 trigger objects
-     * @param muonsL1[out] pointer to the TrigObjectMap to be filled by EF trigger objects
-     * @return true for successful retrival, false otherwise
-     */
-    virtual bool getEFAllTriggerObjects(const std::string& chain,
-                                     TrigObjectMap* muonsEF = NULL,
-                                     TrigObjectMap* muonsL2 = NULL,
-                                     TrigObjectMap* muonsL1 = NULL) const = 0;
-
-    /** get EF trigger objects of a given chain and its parents
-     *
-     * @param chain[in] name of the trigger chain
-     * @param muonsEF[out] pointer to the TrigObjectMap to be filled by EF trigger objects
-     * @param muonsL2[out] pointer to the TrigObjectMap to be filled by L2 trigger objects
-     * @param muonsL1[out] pointer to the TrigObjectMap to be filled by EF trigger objects
-     * @return true for successful retrival, false otherwise
-     */
-    virtual bool getEFIDTriggerObjects(const std::string& chain,
-				       TrigObjectMap* muonsEF = NULL,
-				       TrigObjectMap* muonsL2 = NULL,
-				       TrigObjectMap* muonsL1 = NULL) const = 0;
-
-    virtual bool getEFMSTriggerObjects(const std::string& chain,
-				       TrigObjectMap* muonsEF = NULL,
-				       TrigObjectMap* muonsL2 = NULL,
-				       TrigObjectMap* muonsL1 = NULL) const = 0;
-
-
-    /** get BPhysics L2 trigger objects of a given chain and its parents
-     *
-     * @param chain[in] name of the trigger chain
-     * @param muonsL2[out] pointer to the TrigObjectMap to be filled by L2 trigger objects
-     * @param muonsL1[out] pointer to the TrigObjectMap to be filled by EF trigger objects
-     * @return true for successful retrival, false otherwise
-     */
-    virtual bool getBPhysL2TriggerObjects(const std::string& chain,
-                                          TrigObjectMap* muonsL2 = NULL,
-                                          TrigObjectMap* muonsL1 = NULL) const = 0;
-
-    /** get BPhysics EF trigger objects of a given chain and its parents
-     *
-     * @param chain[in] name of the trigger chain
-     * @param muonsEF[out] pointer to the TrigObjectMap to be filled by EF trigger objects
-     * @param muonsL2[out] pointer to the TrigObjectMap to be filled by L2 trigger objects
-     * @param muonsL1[out] pointer to the TrigObjectMap to be filled by EF trigger objects
-     * @return true for successful retrival, false otherwise
-     */
-    virtual bool getBPhysEFTriggerObjects(const std::string& chain,
-                                          TrigObjectMap* muonsEF = NULL,
-                                          TrigObjectMap* muonsL2 = NULL,
-                                          TrigObjectMap* muonsL1 = NULL) const = 0;
-
-    /** get bunch crossing ID difference between 7-bit bcid and the event
-     *
-     * @param roiBcid[in] 7-bit bcid of muon RoI
-     */
-    virtual int muctpiBcidDiff(const int roiBcid) const = 0;
-
-    /** get bunch crossing ID difference between given roi and the event
-     *
-     * @param roiWord[in] roiWord
-     */
-    virtual int getMuonRoiBcidDiff(const uint32_t roiWord) const = 0;
-
-
-    /** checks if the event is triggered by EF_mu0_missingRoi or L1_2MU0 with TGC only trigger
-     *
-     * @param roiWord[in] roiWord
-     */
-    virtual bool isOffTimeTgcTrigger() const = 0;
-
-    /** emulates EF_mu4_MSOnly trigger with EF_mu0_outOfTime1
-     *
-     */
-    virtual bool EF_mu4_MSOnly_from_EF_mu0_outOfTime1() const = 0;
-};
-#endif
diff --git a/Trigger/TrigAnalysis/TrigEffJpsiTools/share/configureServices.py b/Trigger/TrigAnalysis/TrigEffJpsiTools/share/configureServices.py
deleted file mode 100644
index 0c3e300a110349b5bd598ec08d7a4ce2b8ebfb06..0000000000000000000000000000000000000000
--- a/Trigger/TrigAnalysis/TrigEffJpsiTools/share/configureServices.py
+++ /dev/null
@@ -1,23 +0,0 @@
-###
-### extrapolator
-###
-include("TrkDetDescrSvc/AtlasTrackingGeometrySvc.py")
-from TrkExTools.AtlasExtrapolator import AtlasExtrapolator
-theAtlasExtrapolator = AtlasExtrapolator()
-ToolSvc += theAtlasExtrapolator
-
-
-###
-### TrigEffJpsiTools
-###
-from TrigEffJpsiTools.TrigEffJpsiToolsConf import TrigEffJpsiTools
-theTrigEffJpsiTools = TrigEffJpsiTools("TrigEffJpsiTools")
-
-# barrel and endcap enlarged.
-# not to lose curly tracks escaping through barrel/end-cap transition regions
-theTrigEffJpsiTools.EndcapPivotPlaneMaximumRadius = 20000.
-theTrigEffJpsiTools.BarrelPivotPlaneHalfLength = 16000.
-
-ToolSvc += theTrigEffJpsiTools
-
-# eof
diff --git a/Trigger/TrigAnalysis/TrigEffJpsiTools/src/MuonRoiWithExtendedBunches.cxx b/Trigger/TrigAnalysis/TrigEffJpsiTools/src/MuonRoiWithExtendedBunches.cxx
deleted file mode 100644
index 6bcb652315066afbfbf10324b23515f5ae4904db..0000000000000000000000000000000000000000
--- a/Trigger/TrigAnalysis/TrigEffJpsiTools/src/MuonRoiWithExtendedBunches.cxx
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-/**
- * @date      $Date: 2010-09-30 22:13:27 +0200 (Thu, 30 Sep 2010) $
- * @version   $Revision: 324593 $
- */
-
-/** @todo */
-/** @warning */
-
-/*--------------------------------------------------------------------*
- * headers
- *--------------------------------------------------------------------*/
-#include "AthenaKernel/errorcheck.h"
-#include "StoreGate/StoreGate.h"
-
-#include "EventInfo/EventInfo.h"
-#include "EventInfo/EventID.h"
-
-#include "TrigT1Result/MuCTPI_RDO.h"
-#include "TrigT1Result/MuCTPIResult.h"
-#include "TrigT1Result/MuCTPIRoI.h"
-#include "TrigT1Result/MuCTPI_DataWord_Decoder.h"
-#include "TrigT1Result/MuCTPI_MultiplicityWord_Decoder.h"
-#include "TrigT1Result/RoIBResult.h"
-
-#include "TrigT1Interfaces/RecMuonRoI.h"
-#include "TrigT1Interfaces/RecMuonRoiSvc.h"
-
-#include "TrigConfL1Data/TriggerThreshold.h"
-
-#include "AnalysisTriggerEvent/LVL1_ROI.h"
-
-#include "MuonRoiWithExtendedBunches.h"
-
-
-namespace MuComm {
-
-/*--------------------------------------------------------------------*
- * constructor & destructor
- *--------------------------------------------------------------------*/
-MuonRoiWithExtendedBunches::MuonRoiWithExtendedBunches(const std::string& name,
-                                                       ISvcLocator* pSvcLocator)
-  : AthAlgorithm(name, pSvcLocator),
-    m_muctpiInput("MUCTPI_RDO"),  // StoreGate key for MuCTPI_RDO
-    m_roibInput("RoIBResult"),  // StoreGate key for ROIB::RoIBResult
-    m_extendedMuonRoi("ExtendedMuonRoi"), // StoreGate key for LVL1_ROI with extneded BCs
-    m_allowedBcArray(), // a list of bunch-offset wrt to the current BCID
-    m_allowedBcSet(),
-    m_l1PtNames(),  // a list of level1 muon trigger item names
-    m_l1PtValues(), // a list of level1 muon trigger item pt values in MeV
-    m_recRpcRoiSvc(LVL1::ID_RecRpcRoiSvc, name),
-    m_recTgcRoiSvc(LVL1::ID_RecTgcRoiSvc, name)
-{
-    declareProperty("MuCTPIInput", m_muctpiInput);
-    declareProperty("RoIBInput", m_roibInput);
-    declareProperty("Lvl1_RoiName", m_extendedMuonRoi);
-    declareProperty("AllowedBCs", m_allowedBcArray);
-    declareProperty("L1PtNames", m_l1PtNames);
-    declareProperty("L1PtValues", m_l1PtValues);
-}
-
-
-/*--------------------------------------------------------------------*
- * public methods
- *--------------------------------------------------------------------*/
-StatusCode
-MuonRoiWithExtendedBunches::initialize()
-{
-  if ((m_l1PtNames.size() != NUM_THRESHOLDS) or
-      (m_l1PtValues.size() != NUM_THRESHOLDS)) {
-    ATH_MSG_ERROR("MuonRoiWithExtendedBunches::initialize(): "
-                  "setup failure: L1PtNames or L1PtValues"
-                  << m_l1PtNames << " : " << m_l1PtValues);
-    return StatusCode::FAILURE;
-  }
-
-  m_allowedBcSet.clear();
-  for (size_t ii = 0; ii < m_allowedBcArray.size(); ii++) {
-    m_allowedBcSet.insert(m_allowedBcArray.at(ii));
-    ATH_MSG_INFO("MuonRoiWithExtendedBunches::initialize(): "
-                 "adding bc diff = " << m_allowedBcArray.at(ii));
-  }
-
-  // Get the RPC RecRoI service
-  CHECK(m_recRpcRoiSvc.retrieve());
-  ATH_MSG_VERBOSE(LVL1::ID_RecRpcRoiSvc << " retrieved");
-
-  // Get the TGC RecRoI service
-  CHECK(m_recTgcRoiSvc.retrieve());
-  ATH_MSG_VERBOSE(LVL1::ID_RecTgcRoiSvc << " retrieved");
-
-  return StatusCode::SUCCESS;
-}
-
-
-StatusCode
-MuonRoiWithExtendedBunches::execute()
-{
-  ATH_MSG_DEBUG("MuonRoiWithExtendedBunches::execute()");
-
-  ROIB::RoIBResult* roibResult = getExtendedRoIBResult();
-  if (roibResult == 0) {
-    ATH_MSG_FATAL("MuonRoiWithExtendedBunches: getExtendedRoiBResult() ");
-    return StatusCode::FAILURE;
-  }
-
-  LVL1_ROI* rois = new LVL1_ROI();
-  CHECK(evtStore()->record(rois, m_extendedMuonRoi));
-  ATH_MSG_VERBOSE("recorded LVL1_ROI with key " << m_extendedMuonRoi);
-
-  std::vector<TrigConf::TriggerThreshold*> dummy;
-  const std::vector<ROIB::MuCTPIRoI>& muctpiRois = roibResult->muCTPIResult().roIVec();
-  std::vector<ROIB::MuCTPIRoI>::const_iterator cit = muctpiRois.begin();
-  std::vector<ROIB::MuCTPIRoI>::const_iterator end = muctpiRois.end();
-  ATH_MSG_VERBOSE("found " << muctpiRois.size() << " muctpiRois");
-  for (; cit != end; cit++) {
-    int thresholdNumber = cit->pt();
-    if (thresholdNumber < 1 or thresholdNumber > 6) {
-      ATH_MSG_FATAL("MuonRoiWithExtendedBunches: execute: "
-                    "unexpected threshold number: " << thresholdNumber);
-      return StatusCode::FAILURE;
-    }
-
-    uint32_t roiWord = cit->roIWord();
-    LVL1::RecMuonRoI recRoi(roiWord,
-                            m_recRpcRoiSvc.operator->(),
-                            m_recTgcRoiSvc.operator->(),
-                            &dummy);
-
-    Muon_ROI roi(roiWord, recRoi.eta(), recRoi.phi(),
-                 m_l1PtNames.at(thresholdNumber-1),
-                 m_l1PtValues.at(thresholdNumber-1));
-
-    rois->addMuonROI(roi);
-  }
-  ATH_MSG_VERBOSE("found " << rois->getMuonROIs().size() << " muon rois");
-
-  CHECK(evtStore()->setConst(rois));
-  ATH_MSG_VERBOSE("set const for LVL1_ROI with key " << m_extendedMuonRoi);
-
-  delete roibResult;
-
-  return StatusCode::SUCCESS;
-}
-
-
-/*--------------------------------------------------------------------*
- * private methods
- *--------------------------------------------------------------------*/
-ROIB::RoIBResult*
-MuonRoiWithExtendedBunches::getExtendedRoIBResult()
-{
-  ATH_MSG_DEBUG("MuonRoiWithExtendedBunches::getExtendedRoIBResult()");
-
-  const EventInfo* eventInfo = 0;
-  if (StoreGate::pointer()->retrieve(eventInfo).isFailure()) {
-    ATH_MSG_WARNING("MuonRoiWithExtendedBunches: couldn't retrieve EventInfo");
-    return 0;
-  }
-  const EventID* eventId = eventInfo->event_ID();
-  const unsigned int eventBcid = eventId->bunch_crossing_id();
-
-  // Create the RoI vector from the RDO data:
-  const MuCTPI_RDO* muctpi_rdo = 0;
-  if (evtStore()->retrieve(muctpi_rdo, m_muctpiInput).isFailure()) {
-    ATH_MSG_WARNING("MuonRoiWithExtendedBunches: couldn't retrieve "
-                    << m_muctpiInput);
-    return 0;
-  }
-  ATH_MSG_VERBOSE("Retrieved the MuCTPI_RDO object with key: "
-                  << m_muctpiInput );
-
-  ATH_MSG_VERBOSE("Now creating the RoIs in extended bunches...");
-  std::vector<ROIB::MuCTPIRoI> roi_vector;
-  MuCTPI_MultiplicityWord_Decoder mwDecoder(muctpi_rdo->candidateMultiplicity());
-  uint32_t currentBcid = mwDecoder.getBCID();
-  if (currentBcid != (eventBcid & 0x7)) {
-    ATH_MSG_WARNING("MuonRoiWithExtendedBunches: BCID mis-match: " << eventBcid << ":" << currentBcid
-                    << " at " << eventId->run_number() << " " << eventId->event_number() << " "
-                    << eventId->lumi_block() << " " << eventId->time_stamp() << " " << eventId->time_stamp_ns_offset());
-    currentBcid = (eventBcid & 0x7);
-  }
-
-  // Loop over all "data words" and select the ones in streatched time window
-  ATH_MSG_VERBOSE("found " << muctpi_rdo->dataWord().size() << " muctpi_rdo dataWords");
-
-  std::vector<uint32_t>::const_iterator cit = muctpi_rdo->dataWord().begin();
-  std::vector<uint32_t>::const_iterator end = muctpi_rdo->dataWord().end();
-  for(; cit != end; ++cit) {
-    MuCTPI_DataWord_Decoder dwDecoder(*cit);
-
-    uint32_t bcid = dwDecoder.getBCID();
-    int bcDiff = bcid - currentBcid;
-    switch (eventBcid) {
-      case 0: // cannot distinguish 3563 and 3, 3562 and 2, 3561 and 1
-        if (bcid == 3) {
-          bcDiff = -1;
-        } else if (bcid == 2) {
-          bcDiff = -2;
-        } else if (bcid == 1) {
-          bcDiff = -3;
-        }
-        break;
-
-      case 1: // cannot distinguish 3563 and 3, 3562 and 2
-        if (bcid == 3) {
-          bcDiff = -2;
-        } else if (bcid == 2) {
-          bcDiff = -3;
-        }
-        break;
-
-      case 2: // cannot distinguish 3563 and 3
-        if (bcid == 3) {
-          bcDiff = -3;
-        }
-        break;
-
-      default:
-        break;
-    }
-
-    if (abs(bcDiff) > 4) {
-      bcDiff = (8 - abs(bcDiff)) * ((bcDiff < 0) ? 1 : -1);
-    }
-
-    ATH_MSG_DEBUG(std::dec << bcid << " : " << currentBcid);
-    ATH_MSG_DEBUG("bcid diff = " << std::dec << bcDiff <<
-                  " loc = " << dwDecoder.getSectorLocation());
-
-    if (dwDecoder.getSectorLocation() == MuCTPI_RDO::BARREL) {  // BARREL
-      ATH_MSG_VERBOSE("bcid diff in BARREL");
-    } else {  // ENDCAP
-      ATH_MSG_VERBOSE("bcid diff in ENDCAP");
-    }
-    if (m_allowedBcSet.find(bcDiff) == m_allowedBcSet.end()) continue;
-
-    ATH_MSG_DEBUG("accepted");
-    roi_vector.push_back(ROIB::MuCTPIRoI(RDOtoRoI(*cit)));
-    ATH_MSG_VERBOSE( "  - Processed data word: 0x" << std::hex << std::setw(8)
-                          << std::setfill('0') << *cit );
-  }
-
-
-  // Create the new MuCTPI result:
-  const ROIB::RoIBResult* roibResult = 0;
-  if (evtStore()->retrieve(roibResult, m_roibInput).isFailure()) {
-    ATH_MSG_WARNING("MuonRoiWithExtendedBunches: couldn't retrieve "
-                    << m_roibInput);
-    return 0;
-  }
-  ATH_MSG_VERBOSE("Retrieved the old RoIBResult object with key:"
-                  << m_roibInput);
-
-  ROIB::MuCTPIResult newResult(roibResult->muCTPIResult().header(),
-                               roibResult->muCTPIResult().trailer(),
-                               roi_vector);
-
-  // Create the new RoIBResult object:
-  return new ROIB::RoIBResult(newResult,
-                              roibResult->cTPResult(),
-                              roibResult->jetEnergyResult(),
-                              roibResult->eMTauResult());
-}
-
-
-/**
- * @param data_word Data word from the MuCTPI_RDO object
- * @returns The RoI word created from the data word
- */
-uint32_t
-MuonRoiWithExtendedBunches::RDOtoRoI(uint32_t data_word)
-{
-  // MuCTPI_RDO to MuCTPIRoI
-  // ref: Fig 3.6 and Fig 3.8 in https://edms.cern.ch/file/248757/1/mirod.pdf
-  return (((data_word & 0x8000000) >> 4) | ((data_word & 0x3fe0000) >> 3) |
-          (data_word & 0x3fff));
-}
-
-
-} // namespace MuComm
diff --git a/Trigger/TrigAnalysis/TrigEffJpsiTools/src/MuonRoiWithExtendedBunches.h b/Trigger/TrigAnalysis/TrigEffJpsiTools/src/MuonRoiWithExtendedBunches.h
deleted file mode 100644
index bc048635a0c833bddeb461a2dfcc925213477e43..0000000000000000000000000000000000000000
--- a/Trigger/TrigAnalysis/TrigEffJpsiTools/src/MuonRoiWithExtendedBunches.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef MuonRoiWithExtendedBunches_h
-#define MuonRoiWithExtendedBunches_h
-/**
- * @author  Takashi Matsushita
- * @date    $Date: 2010-06-17 12:11:12 +0200 (Thu, 17 Jun 2010) $
- * @version $Revision: 305782 $
- *
- * This algorithm reconstructs Muon_ROI with extended bunches
- * for RPC commissioning period.
- * Based on MuCTPI_RDOToRoIBResult.h
- */
-
-/*--------------------------------------------------------------------*
- * headers
- *--------------------------------------------------------------------*/
-#include "AthenaBaseComps/AthAlgorithm.h"
-#include "GaudiKernel/ServiceHandle.h"
-#include "TrigT1Interfaces/RecMuonRoiSvc.h"
-
-namespace ROIB { class RoIBResult; }
-
-namespace MuComm {
-enum {
-  NUM_THRESHOLDS = 6
-};
-
-/*--------------------------------------------------------------------*
- * classes
- *--------------------------------------------------------------------*/
-class MuonRoiWithExtendedBunches : public AthAlgorithm {
-
-  public:
-    MuonRoiWithExtendedBunches(const std::string& name,
-                              ISvcLocator* pSvcLocator);
-    virtual StatusCode initialize();
-    virtual StatusCode execute();
-
-  private:
-    ROIB::RoIBResult* getExtendedRoIBResult();
-    static uint32_t RDOtoRoI(uint32_t data_word);
-
-    std::string m_muctpiInput;
-    std::string m_roibInput;
-    std::string m_extendedMuonRoi;
-
-    std::vector<int> m_allowedBcArray;
-    std::set<int> m_allowedBcSet;
-    std::vector<std::string> m_l1PtNames;
-    std::vector<double> m_l1PtValues;
-
-    ServiceHandle<LVL1::RecMuonRoiSvc> m_recRpcRoiSvc;
-    ServiceHandle<LVL1::RecMuonRoiSvc> m_recTgcRoiSvc;
-
-}; // class MuonRoiWithExtendedBunches
-
-} // namespace MuComm
-
-
-#endif // MuonRoiWithExtendedBunches_h
diff --git a/Trigger/TrigAnalysis/TrigEffJpsiTools/src/TrigEffJpsiTools.cxx b/Trigger/TrigAnalysis/TrigEffJpsiTools/src/TrigEffJpsiTools.cxx
deleted file mode 100644
index 0d4c16cb5fa5c60ff3cab89e56dd7677b99cc94e..0000000000000000000000000000000000000000
--- a/Trigger/TrigAnalysis/TrigEffJpsiTools/src/TrigEffJpsiTools.cxx
+++ /dev/null
@@ -1,3376 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-/**
- * @date      $Date: 2016-02-10 18:13:46 +0100 (Wed, 10 Feb 2016) $
- * @version   $Revision: 723173 $
- */
-
-/** @todo */
-/** @warning */
-
-/*--------------------------------------------------------------------*
- * headers
- *--------------------------------------------------------------------*/
-#include "EventKernel/INavigable4Momentum.h"
-#include "Particle/TrackParticle.h"
-#include "TrkExInterfaces/IExtrapolator.h"
-#include "TrkTrack/Track.h"
-#include "TrkRIO_OnTrack/RIO_OnTrack.h"
-#include "TrkTrack/TrackStateOnSurface.h"
-#include "TrigT1TGCRecRoiSvc/TGCRecRoiSvc.h"
-#include "TrigT1RPCRecRoiSvc/RPCRecRoiSvc.h"
-#include "MuonIdHelpers/MuonIdHelperTool.h"
-#include "RPCcablingInterface/IRPCcablingServerSvc.h"
-
-#include "TrkSurfaces/DiscSurface.h"
-#include "TrkSurfaces/CylinderSurface.h"
-#include "TrkEventUtils/RoT_Extractor.h"
-#include "MuonReadoutGeometry/MuonDetectorManager.h"
-
-#include "AnalysisTriggerEvent/Muon_ROI.h"
-#include "TrigDecisionTool/ChainGroup.h"
-#include "TrigDecisionTool/Combination.h"
-#include "TrigDecisionTool/FeatureContainer.h"
-#include "TrigDecisionTool/Feature.h"
-#include "TrigMuonEvent/MuonFeature.h"
-#include "TrigMuonEvent/CombinedMuonFeature.h"
-#include "TrigMuonEvent/CombinedMuonFeatureContainer.h"
-#include "TrigMuonEvent/MuonFeatureContainer.h"
-#include "TrigMuonEvent/TrigMuonEF.h"
-#include "TrigMuonEvent/TrigMuonEFInfo.h"
-#include "TrigMuonEvent/TrigMuonEFInfoContainer.h"
-#include "TrigMuonEvent/TrigMuonEFInfoTrack.h"
-#include "TrigMuonEvent/TrigMuonEFInfoTrackContainer.h"
-#include "TrigMuonEvent/TrigMuonEFCbTrack.h"
-#include "TrigInDetAnalysis/TIDARoiDescriptor.h"
-#include "TrigInDetAnalysisUtils/TIDARoiDescriptorBuilder.h"
-#include "TrigSteeringEvent/TrigPassBits.h"
-#include "TrigSteeringEvent/TrigPassBitsCollection.h"
-#include "TrigSteeringEvent/TrigRoiDescriptor.h"
-
-#include "TrigParticle/TrigL2BphysContainer.h"
-#include "TrigParticle/TrigL2Bphys.h"
-#include "TrigParticle/TrigEFBphysContainer.h"
-#include "TrigParticle/TrigEFBphys.h"
-
-#include "EventInfo/EventInfo.h"
-#include "EventInfo/EventID.h"
-
-#include "TrigT1Result/MuCTPI_RDO.h"
-#include "TrigT1Result/MuCTPI_DataWord_Decoder.h"
-#include "TrigT1Result/MuCTPI_MultiplicityWord_Decoder.h"
-
-#include "muonEvent/Muon.h"
-#include "muonEvent/MuonContainer.h"
-
-//#include "AnalysisTools/IAnalysisTools.h"
-#include "TLorentzVector.h"
-
-#include <limits>
-#include <cmath>
-
-#include "src/TrigEffJpsiTools.h"
-
-/*--------------------------------------------------------------------*
- * constructor & destructor
- *--------------------------------------------------------------------*/
-TrigEffJpsiTools::TrigEffJpsiTools(const std::string& type,
-                                   const std::string& name,
-                                   const IInterface* parent)
-  : AthAlgTool(type, name, parent),
-    m_rpcRoiService("LVL1RPC::RPCRecRoiSvc", name),
-    m_tgcRoiService("LVL1TGC::TGCRecRoiSvc", name),
-    m_muonIdHelper("Muon::MuonIdHelperTool/MuonIdHelperTool"),
-    m_extrapolator("Trk::Extrapolator/AtlasExtrapolator"),
-    m_trigDecisionTool("Trig::TrigDecisionTool/TrigDecisionTool"),
-    m_Lvl1RoiName("LVL1_ROI"), // container name for level1 RoI
-    m_endcapPivotPlaneZ(15525.), // z position of pivot plane in endcap region
-    m_endcapPivotPlaneMinimumRadius(0.), // minimum radius of pivot plane in endcap region
-    m_endcapPivotPlaneMaximumRadius(11977.), // maximum radius of pivot plane in endcap region
-    m_barrelPivotPlaneRadius(7500.), // radius of pivot plane in barrel region
-    m_barrelPivotPlaneHalfLength(9500.), // half length of pivot plane in barrel region
-    m_invariantMassUpperLimit(3300.), // upper limit on invariant mass of di-muon system
-    m_invariantMassLowerLimit(2880.), // lower limit on invariant mass of di-muon system
-    m_trackPtCut(0.), // minimum pt of track
-    m_trackEtaCut(5.), // maximum eta of track
-    m_roiSizeBarrel(0.071), // half-diagonal lengh of barrel RoI in eta-phi plane
-    m_roiSizeEndcap(0.019), // half-diagonal lengh of endcap RoI in eta-phi plane
-    m_roiSizeForward(0.034), // half-diagonal lengh of forward RoI in eta-phi plane
-    m_endcapForwardBoundary(1.95), // boundary of forward and endcap chambers in eta
-    m_searchRangeTolerance(3.), // coefficient for extrapolation error to calculate search range
-    m_searchRangeOffset(0.), // offset to calculate search range
-    m_appendL1IfExists(true),
-    m_appendL2IfExists(true),
-    m_appendEFIfExists(true),
-    m_useManualHypoCuts(false),
-    p_rpcCablingSvc(0),
-    m_cacheEndcap(),
-    m_cacheBarrel(),
-    m_MUON_MASS(105.658367) // MeV/c  ref - PL B667, 1 (2008) (pdg.lbl.gov)
-{
-  declareInterface<ITrigEffJpsiTools>(this);
-
-  declareProperty("RPCRecRoiSvc", m_rpcRoiService);
-  declareProperty("TGCRecRoiSvc", m_tgcRoiService);
-  declareProperty("MuonIdHelperTool", m_muonIdHelper);
-  declareProperty("Extrapolator", m_extrapolator);
-  declareProperty("TrigDecisionTool", m_trigDecisionTool);
-
-  declareProperty("Lvl1_RoiName", m_Lvl1RoiName);
-  declareProperty("EndcapPivotPlaneZ", m_endcapPivotPlaneZ);
-  declareProperty("EndcapPivotPlaneMinimumRadius", m_endcapPivotPlaneMinimumRadius);
-  declareProperty("EndcapPivotPlaneMaximumRadius", m_endcapPivotPlaneMaximumRadius);
-  declareProperty("BarrelPivotPlaneRadius", m_barrelPivotPlaneRadius);
-  declareProperty("BarrelPivotPlaneHalfLength", m_barrelPivotPlaneHalfLength);
-  declareProperty("InvariantMassUpperLimit", m_invariantMassUpperLimit);
-  declareProperty("InvariantMassLowerLimit", m_invariantMassLowerLimit);
-  declareProperty("MuonPtCut", m_trackPtCut);
-  declareProperty("MuonEtaCut", m_trackEtaCut);
-  declareProperty("roiSizeBarrel", m_roiSizeBarrel);
-  declareProperty("roiSizeEndcap", m_roiSizeEndcap);
-  declareProperty("roiSizeForward", m_roiSizeForward);
-  declareProperty("endcapForwardBoundary", m_endcapForwardBoundary);
-  declareProperty("searchRangeTolerance", m_searchRangeTolerance);
-  declareProperty("searchRangeOffset", m_searchRangeOffset);
-  declareProperty("appendL1IfExists", m_appendL1IfExists);
-  declareProperty("appendL2IfExists", m_appendL2IfExists);
-  declareProperty("appendEFIfExists", m_appendEFIfExists);
-  declareProperty("useManualHypoCuts", m_useManualHypoCuts);
-
-}
-
-
-TrigEffJpsiTools::~TrigEffJpsiTools()
-{
-}
-
-
-
-/*--------------------------------------------------------------------*
- * public methods
- *--------------------------------------------------------------------*/
-StatusCode
-TrigEffJpsiTools::initialize()
-{
-  ATH_MSG_DEBUG("initialize()");
-
-  if (AthAlgTool::initialize().isFailure()) return StatusCode::FAILURE;
-
-
-  // extrapolator
-  if (m_extrapolator.retrieve().isFailure()) {
-    ATH_MSG_FATAL("Failed to retrieve tool: " << m_extrapolator);
-    return StatusCode::FAILURE;
-  }
-  ATH_MSG_INFO("Retrieved tool: " << m_extrapolator);
-
-
-  // trigger decision tool
-  if (m_trigDecisionTool.retrieve().isFailure()) {
-    ATH_MSG_FATAL("Failed to retrieve tool: " << m_trigDecisionTool);
-    return StatusCode::FAILURE;
-  }
-  ATH_MSG_INFO("Retrieved tool: " << m_trigDecisionTool);
-
-
-  // muon id helper tool
-  if (m_muonIdHelper.retrieve().isFailure()) {
-    ATH_MSG_FATAL("Failed to retrieve tool: " << m_muonIdHelper);
-    return StatusCode::FAILURE;
-  }
-  ATH_MSG_INFO("Retrieved tool: " << m_muonIdHelper);
-
-
-  // muon id helpers
-  const MuonGM::MuonDetectorManager* muonDetectorManager;
-  if (detStore()->retrieve(muonDetectorManager).isFailure() or
-      !muonDetectorManager) {
-    ATH_MSG_FATAL("Failed to retrieve MuonDetectorManager");
-    return StatusCode::FAILURE;
-  }
-  ATH_MSG_INFO("Muon id helper ready");
-
-
-  // rpc cabling server service
-  const IRPCcablingServerSvc* rpcCablingServer = 0;
-  if (service("RPCcablingServerSvc", rpcCablingServer, 1).isFailure() or
-      !rpcCablingServer) {
-    ATH_MSG_FATAL("Failed to retrieve the RPCcablingServerSvc");
-    return StatusCode::FAILURE;
-  }
-  ATH_MSG_INFO("RPCCablingServerSvc ready");
- 
-
-  // rpc cabling service
-  if (rpcCablingServer->giveCabling(p_rpcCablingSvc).isFailure() or
-      !p_rpcCablingSvc) {
-    ATH_MSG_FATAL("Failed to get the IRPCcablingSvc");
-    return StatusCode::FAILURE;
-  }
-  ATH_MSG_INFO("IRPCcablingSvc ready");
-
-
-  // rpc rec roi service
-  if (m_rpcRoiService.retrieve().isFailure()) {
-    ATH_MSG_FATAL("Failed to retrieve " << m_rpcRoiService);
-    return StatusCode::FAILURE;
-  }
-  ATH_MSG_INFO("Retrieved service: " << m_rpcRoiService);
-
-
-  // tgc rec roi service
-  if (m_tgcRoiService.retrieve().isFailure()) {
-    ATH_MSG_FATAL("Failed to retrieve " << m_tgcRoiService);
-    return StatusCode::FAILURE;
-  }
-  ATH_MSG_INFO("Retrieved service: " << m_tgcRoiService);
-
-  m_cacheEndcap.evtNo = 0;
-  m_cacheEndcap.runNo = 0;
-  m_cacheEndcap.tp.clear();
-
-  m_cacheBarrel.evtNo = 0;
-  m_cacheBarrel.runNo = 0;
-  m_cacheBarrel.tp.clear();
-
-  Btrig_L2_initCuts();
-  Btrig_EF_initCuts();
-
-
-  ATH_MSG_DEBUG("initialize() successful");
-
-  return StatusCode::SUCCESS;
-}
-
-
-
-StatusCode
-TrigEffJpsiTools::finalize()
-{
-  ATH_MSG_DEBUG("finalize()");
-  if (AthAlgTool::finalize().isFailure()) return StatusCode::FAILURE;
-
-  return StatusCode::SUCCESS;
-}
-
-
-
-bool
-TrigEffJpsiTools::isTriggeredMuonEF(const Rec::TrackParticle* track,
-                                    const std::string& chainName) const
-{
-  if (not isConfigured(chainName, "EF")) return false;
-
-  const Trig::ChainGroup* cg = m_trigDecisionTool->getChainGroup(chainName);
-  if (not (m_trigDecisionTool->isPassedBits(cg) &
-           TrigDefs::EF_passedRaw)) {
-    ATH_MSG_DEBUG("isTriggeredMuonEF:EF_passedRaw: no " << chainName);
-    return false;
-  } 
-  ATH_MSG_DEBUG("isTriggeredMuonEF:EF_passedRaw: yes " << chainName);
-
-  return isTriggeredMuonHLT(track, chainName, cg);
-}
-
-
-bool
-TrigEffJpsiTools::isTriggeredMuonL2(const Rec::TrackParticle* track,
-                                    const std::string& chainName) const
-{
-  if (not isConfigured(chainName, "L2")) return false;
-
-  const Trig::ChainGroup* cg = m_trigDecisionTool->getChainGroup(chainName);
-  if (not (m_trigDecisionTool->isPassedBits(cg) &
-           TrigDefs::L2_passedRaw)) {
-    ATH_MSG_DEBUG("isTriggeredMuonEF:L2_passedRaw: no " << chainName);
-    return false;
-  } 
-  ATH_MSG_DEBUG("isTriggeredMuonEF:L2_passedRaw: yes " << chainName);
-
-  return isTriggeredMuonHLT(track, chainName, cg);
-}
-
-
-
-bool
-TrigEffJpsiTools::isTriggeredMuonL1(const Rec::TrackParticle* track,
-                                    const std::string& chainName) const
-{
-  if (not isConfigured(chainName, "L1")) return false;
-
-  const int ptRequired = getL1PtThreshold(chainName);
-  if (ptRequired < 0) {
-    ATH_MSG_WARNING("isTriggeredMuonL1: problem on chainName '" << chainName << "'");
-    return false;
-  }
-
-  const Trig::ChainGroup *cg = m_trigDecisionTool->getChainGroup("L1_MU[0-9]+");
-  const std::vector<std::string> l1muonName = cg->getListOfTriggers();
-  bool passed = false;
-  for (size_t ii = 0; ii < l1muonName.size(); ii++) {
-    int pt = getL1PtThreshold(l1muonName.at(ii));
-    if (pt < ptRequired) continue;
-    if (m_trigDecisionTool->isPassedBits(l1muonName.at(ii)) &
-        TrigDefs::L1_isPassedBeforePrescale) {
-      ATH_MSG_DEBUG("isTriggeredMuonL1:L1_isPassedBeforePrescale: yes " << l1muonName.at(ii));
-      passed = true;
-      break;
-    } else {
-      ATH_MSG_DEBUG("isTriggeredMuonL1:L1_isPassedBeforePrescale: no " << l1muonName.at(ii));
-    }
-  }
-
-  if (not passed) return false;
-
-
-  struct Match match;
-  if (not getMatchedRoI(track, match)) {
-    ATH_MSG_DEBUG("isTriggeredMuonL1:getMatchedRoI: no " << chainName);
-    return false;
-  }
-
-  bool rc = (match.roiThrValue >= ptRequired);
-  ATH_MSG_DEBUG("Pt passed: " << match.roiThrValue <<
-                " >= Pt required: " << ptRequired <<
-                " = " << rc);
-  return rc;
-}
-
-
-
-bool
-TrigEffJpsiTools::isTriggeredMuon(const Rec::TrackParticle* track,
-                                  int thresholdNumber) const
-{
-  ATH_MSG_DEBUG("isTriggeredMuon()");
-
-  if (!track) {
-    ATH_MSG_WARNING("isTriggeredMuon: track pointer is null");
-    return false;
-  }
-
-  if ((thresholdNumber < 1) or (thresholdNumber > 6)) {
-    ATH_MSG_WARNING("isTriggeredMuon: logical threshold number out of range: " <<
-                    thresholdNumber);
-    return false;
-  }
-
-  const LVL1_ROI* lvl1Roi = 0;
-  if (evtStore()->retrieve(lvl1Roi, m_Lvl1RoiName).isFailure() or !lvl1Roi) {
-    ATH_MSG_WARNING("Failed to retrieve: " << m_Lvl1RoiName);
-    return false;
-  }
-
-  LVL1_ROI::muons_type muonRoIs = lvl1Roi->getMuonROIs();
-
-  bool rc = isTriggeredOnEndcap(track, muonRoIs, thresholdNumber) or
-    isTriggeredOnBarrel(track, muonRoIs, thresholdNumber);
-  return rc;
-}
-
-
-
-bool
-TrigEffJpsiTools::isJPsiCandidate(const Rec::TrackParticle* track1,
-                                  const Rec::TrackParticle* track2) const
-{
-  ATH_MSG_DEBUG("isJPsiCandidate()");
-
-  if (!track1 or !track2) {
-    ATH_MSG_WARNING("isTriggeredMuon: track pointer is null");
-    return false;
-  }
-
-  if (track1->charge()*track2->charge() > 0.) {
-    ATH_MSG_DEBUG("reject: same charge combination");
-    return false;
-  }
-  ATH_MSG_DEBUG("accept: opposite charge combination");
-
-  if (!isSeparated(track1, track2)) {
-    ATH_MSG_DEBUG("reject: two tracks too close");
-    return false;
-  }
-  ATH_MSG_DEBUG("accept: tracks well separated");
-
-  TLorentzVector tvec1, tvec2;
-  tvec1.SetPtEtaPhiM(track1->pt(), track1->eta(), track1->phi(), m_MUON_MASS);
-  tvec2.SetPtEtaPhiM(track2->pt(), track2->eta(), track2->phi(), m_MUON_MASS);
-  double invariantMass = (tvec1 + tvec2).M();
-
-  if ((invariantMass < m_invariantMassLowerLimit) or
-      (invariantMass > m_invariantMassUpperLimit)) {
-    ATH_MSG_DEBUG("reject: invariant mass: " << invariantMass);
-    return false;
-  }
-  ATH_MSG_DEBUG("accept: invariant mass: " << invariantMass);
-
-  return true;
-}
-
-
-bool
-TrigEffJpsiTools::isJPsiCandidate(const INavigable4Momentum* mom1,
-                                  const INavigable4Momentum* mom2) const
-{
-  ATH_MSG_DEBUG("isJPsiCandidate");
-
-  if (!mom1 or !mom2) {
-    ATH_MSG_WARNING("isTriggeredMuon: momentum pointer is null");
-    return false;
-  }
-
-  // invariant mass calculation
-  TLorentzVector tvec1, tvec2;
-  tvec1.SetPtEtaPhiM(mom1->pt(), mom1->eta(), mom1->phi(), m_MUON_MASS);
-  tvec2.SetPtEtaPhiM(mom2->pt(), mom2->eta(), mom2->phi(), m_MUON_MASS);
-  double invariantMass = (tvec1 + tvec2).M();
-
-  if ((invariantMass < m_invariantMassLowerLimit) or
-      (invariantMass > m_invariantMassUpperLimit)) {
-    ATH_MSG_DEBUG("reject: invariant mass: " << invariantMass);
-    return false;
-  }
-  ATH_MSG_DEBUG("accept: invariant mass: " << invariantMass);
-
-  return true;
-}
-
-
-
-int
-TrigEffJpsiTools::getMatchedRoI(const Rec::TrackParticle* track,
-                                bool* barrel,
-                                bool* endcap,
-                                Amg::Vector2D* eta,
-                                Amg::Vector2D* phi) const
-{
-  ATH_MSG_DEBUG("getMatchedRoI()");
-
-  struct Match match;
-  match.etaExTrk = eta;
-  match.phiExTrk = phi;
-  getMatchedRoI(track, match);
-  if (barrel) *barrel = match.barrel;
-  if (endcap) *endcap = match.endcap;
-  return match.roiIndex; 
-}
-
-
-
-bool
-TrigEffJpsiTools::extrapolateToRio(const Rec::TrackParticle* track,
-                                   const Trk::RIO_OnTrack* rot,
-                                   Amg::Vector2D* eta,
-                                   Amg::Vector2D* phi,
-                                   Amg::Vector2D* ptpz,
-                                   bool getTsos,
-                                   const std::vector<const Trk::TrackStateOnSurface*>* &tsos) const
-
-{
-  if (!track) {
-    ATH_MSG_WARNING("extrapolateToRio: track pointer is null");
-    return false;
-  }
-
-  if (!rot) {
-    ATH_MSG_WARNING("extrapolateToRio: rot pointer is null");
-    return false;
-  }
-
-  if (!eta) {
-    ATH_MSG_WARNING("extrapolateToRio: eta pointer is null");
-    return false;
-  }
-
-  if (!phi) {
-    ATH_MSG_WARNING("extrapolateToRio: phi pointer is null");
-    return false;
-  }
-
-  if (!ptpz) {
-    ATH_MSG_WARNING("extrapolateToRio: ptpz pointer is null");
-    return false;
-  }
-
-  const Identifier id = rot->identify();
-  if (not m_muonIdHelper->isMuon(id)) return false;
-  if (not m_muonIdHelper->isTrigger(id)) return false;
-
-  const bool useCache = false;
-  const Trk::TrackParameters* point = 0;
-  Amg::Vector2D dEtaPhi;
-  if (m_muonIdHelper->isTgc(id)) {
-    const Trk::AtaDisc* p = extrapolateToEndcap(track, rot->globalPosition().z(), useCache);
-    if (!p) return false;
-    getExtrapolationErrorOnEndcap(p, &dEtaPhi);
-    point = p;
-
-  } else {
-    double x = rot->globalPosition().x();
-    double y = rot->globalPosition().y();
-    double pivotRadius = sqrt(x*x + y*y);
-    const Trk::AtaCylinder* p = extrapolateToBarrel(track, pivotRadius,
-                                                            useCache);
-    if (!p) return false;
-    getExtrapolationErrorOnBarrel(p, &dEtaPhi);
-    point = p;
-  }
-  (*eta)[Trk::locX] = point->position().eta();
-  (*eta)[Trk::locY] = dEtaPhi[Trk::locX];
-  (*phi)[Trk::locX] = point->position().phi();
-  (*phi)[Trk::locY] = dEtaPhi[Trk::locY];
-
-  (*ptpz)[Trk::locX] = point->momentum().perp();
-  (*ptpz)[Trk::locY] = point->momentum().z();
-  delete point;
-
-  if (not getTsos) return true;
-
-  if (m_muonIdHelper->isTgc(id)) {
-    tsos = extrapolateToEndcapM(track, rot->globalPosition().z());
-  } else {
-    double x = rot->globalPosition().x();
-    double y = rot->globalPosition().y();
-    double pivotRadius = sqrt(x*x + y*y);
-    tsos = extrapolateToBarrelM(track, pivotRadius);
-  }
-
-  return true;
-}
-
-
-
-bool
-TrigEffJpsiTools::extrapolateToPoint(const Rec::TrackParticle* track,
-                                     const Amg::Vector3D* pos,
-                                     const int detector,
-                                     Amg::Vector2D* eta,
-                                     Amg::Vector2D* phi,
-                                     Amg::Vector3D* mom) const
-
-{
-  if (!track) {
-    ATH_MSG_WARNING("extrapolateToPoint: track pointer is null");
-    return false;
-  }
-
-  if (!pos) {
-    ATH_MSG_WARNING("extrapolateToPoint: pos pointer is null");
-    return false;
-  }
-
-  if (!eta) {
-    ATH_MSG_WARNING("extrapolateToPoint: eta pointer is null");
-    return false;
-  }
-
-  if (!phi) {
-    ATH_MSG_WARNING("extrapolateToPoint: phi pointer is null");
-    return false;
-  }
-
-  if (!mom) {
-    ATH_MSG_WARNING("extrapolateToPoint: mom pointer is null");
-    return false;
-  }
-
-
-  const bool useCache = false;
-  const Trk::TrackParameters* point = 0;
-  Amg::Vector2D dEtaPhi;
-  if (detector == ITrigEffJpsiTools::TGC) {
-    const Trk::AtaDisc* p = extrapolateToEndcap(track, pos->z(), useCache);
-    if (!p) return false;
-    getExtrapolationErrorOnEndcap(p, &dEtaPhi);
-    point = p;
-
-  } else if (detector == ITrigEffJpsiTools::RPC) {
-    double x = pos->x();
-    double y = pos->y();
-    double pivotRadius = sqrt(x*x + y*y);
-    const Trk::AtaCylinder* p = extrapolateToBarrel(track, pivotRadius,
-                                                            useCache);
-    if (!p) return false;
-    getExtrapolationErrorOnBarrel(p, &dEtaPhi);
-    point = p;
-
-  } else {
-    ATH_MSG_WARNING("extrapolateToPoint: unknown target: " << detector);
-    return false;
-  }
-
-  (*eta)[Trk::locX] = point->position().eta();
-  (*eta)[Trk::locY] = dEtaPhi[Trk::locX];
-  (*phi)[Trk::locX] = point->position().phi();
-  (*phi)[Trk::locY] = dEtaPhi[Trk::locY];
-
-  (*mom)[Trk::locX] = point->momentum().x();
-  (*mom)[Trk::locY] = point->momentum().y();
-  (*mom)[Trk::locZ] = point->momentum().z();
-
-  delete point;
-
-  return true;
-}
-
-
-// Accessing Trigger Elements using advanced expert features
-// This functionality may disappear when TDT veriosn used is above 01-05-56
-std::vector<HLT::TriggerElement*>
-TrigEffJpsiTools::getExpertTEs(const std::string& chain) const
-{
-  Trig::ExpertMethods* expert = m_trigDecisionTool->ExperimentalAndExpertMethods();
-  expert->enable();
-  std::vector<HLT::TriggerElement*> tes;
-  expert->getNavigation()->getAllOfType(chain, tes, true); ///EF_mu4 is the TE name, see NavigatioNcore or lxr for docu on it
-
-  return tes;
-}
-
-
-bool
-TrigEffJpsiTools::getTriggerObjects(const std::string& chain,
-                                    TrigObjectMap* muonsEF,
-                                    TrigObjectMap* muonsL2,
-                                    TrigObjectMap* muonsL1) const
-{
-  std::string lvl = chain.substr(0,2);
-  if (lvl == "EF") return getEFTriggerObjects( chain, muonsEF, muonsL2, muonsL1);
-  if (lvl == "L2") return getL2TriggerObjects( chain, muonsL2, muonsL1);
-  if (lvl == "L1") return getL1TriggerObjects( chain, muonsL1);
-  return false;
-}
-
-
-
-bool
-TrigEffJpsiTools::getL1TriggerObjects(const std::string& chain,
-                                      TrigObjectMap* muonsL1) const
-{
-  ATH_MSG_DEBUG("TrigEffJpsiTools::getL1TriggerObjects() : " << chain);
-
-  const LVL1_ROI* lvl1Roi = 0;
-  if (evtStore()->retrieve(lvl1Roi, chain).isFailure() or !lvl1Roi) {
-    ATH_MSG_WARNING("Failed to retrieve: " << chain);
-    return false;
-  }
-
-  std::string keyPref = "L1_";
-
-  std::vector<Muon_ROI>::const_iterator it;
-  short iMuon=0;
-  for (it = lvl1Roi->getMuonROIs().begin(); it != lvl1Roi->getMuonROIs().end(); ++it, ++iMuon) {
-    ATH_MSG_DEBUG("L1 object # " << iMuon
-                  << "  &: " << &(*it)
-                  << "  pt: " << it->pt()
-                  << "  eta: " << it->eta()
-                  << "  phi: " << it->phi()
-                  << "  word: " << it->getROIWord()
-                  << "  Source: " << it->getSource()
-                  << "  Hemisphere: " << it->getHemisphere() );
-
-    if ( muonsL1 != NULL) {
-      TrigObject trigObjectL1;
-      int charge = -99;
-      switch (it->getCharge()) {
-      case Muon_ROI::Pos:
-	charge = 1;
-	break;
-      case Muon_ROI::Neg:
-	charge = -1;
-	break;
-      default:
-	charge = -99;
-      }
-      trigObjectL1.names.push_back( keyPref + it->getThrName() );
-      trigObjectL1.eta = it->eta();
-      trigObjectL1.phi = it->phi();
-      trigObjectL1.pt  = it->pt();
-      trigObjectL1.q   = charge;
-      trigObjectL1.id  = it->getROIWord();
-      trigObjectL1.parentId = -1;
-      trigObjectL1.grandparentId = -1;
-      //trigObjectL1.daughterIds.push_back(-1);
-      trigObjectL1.combIds.push_back(iMuon);
-      trigObjectL1.efObjIds.push_back(-1);
-      trigObjectL1.type = SPECTROMETER;
-      addTrigObject(trigObjectL1, muonsL1, m_appendL1IfExists);
-    }
-  }
-
-  //   Trig::FeatureContainer fc = m_trigDecisionTool->features(chain);
-  //   ATH_MSG_INFO("Features: # " << fc.get<TrigRoiDescriptor>().size() );
-  //   const std::vector<Trig::Combination>& combs = fc.getCombinations();
-  //   std::vector<Trig::Combination>::const_iterator combIt;
-  //   int iComb = 1;
-  //   for ( combIt = combs.begin(); combIt != combs.end(); ++combIt, ++iComb ) {
-  //     std::vector<Trig::Feature<TrigRoiDescriptor> > muons = fc.get<TrigRoiDescriptor>();
-  //     std::vector<Trig::Feature<TrigRoiDescriptor> >::const_iterator mit;
-  //     int iObj = 0;
-  //     for ( mit = muons.begin(); mit != muons.end(); ++mit, ++iObj) {
-  //       const TrigRoiDescriptor* mu = mit->cptr();
-  //       ATH_MSG_INFO("L1 combination # " << iComb << " object # " << iObj
-  //                    << "  &: " << mu
-  //                    //                   << "  pt: " << mu
-  //                    << "  eta: " << mu->eta() << ", " << mu->eta0()
-  //                    << "  phi: " << mu->phi() << ", " << mu->phi0()
-  //                    << "  word: " << mu->roiWord() );
-  //     }
-  //   }
-
-  return true;
-}
-
-
-bool
-TrigEffJpsiTools::getL2TriggerObjects(const std::string& chain,
-                                      TrigObjectMap* muonsL2,
-                                      TrigObjectMap* muonsL1) const
-{
-  ATH_MSG_DEBUG("TrigEffJpsiTools::getL2TriggerObjects() : " << chain);
-
-  //const Trig::ChainGroup* cg = m_trigDecisionTool->getChainGroup(chain);
-  // Getting the chain's features:
-  const Trig::FeatureContainer fc = m_trigDecisionTool->features(chain);
-
-  std::vector<Trig::Combination>::const_iterator it;
-  short iComb = 1;
-  short iMuon = 0;
-  for ( it = fc.getCombinations().begin(); it != fc.getCombinations().end(); ++it, ++iComb ) { // Loop over combinations
-    // TOOD: It is possible for L2 objects which did not pass L2 hypo (not active) to still go into the ntuple
-    // via getEFTriggerObjects EF parents. Find solution
-    const Trig::Combination& combination = *it;
-    if (not combination.active()) {
-      ATH_MSG_DEBUG("getEFTriggerObjects: combination " << combination << " is not active");
-      continue;
-    }
-    ATH_MSG_DEBUG("getEFTriggerObjects: combination " << combination << " is active");
-
-    std::vector<Trig::Feature<CombinedMuonFeature> > muons = combination.get<CombinedMuonFeature>(); // TODO: Use MuonFeature as well to retrieve non-combined
-    std::vector<Trig::Feature<CombinedMuonFeature> >::const_iterator mit;
-    int iObj = 0;
-    for ( mit = muons.begin(); mit != muons.end(); ++mit, ++iObj) {
-      const CombinedMuonFeature* muonL2 = mit->cptr();
-      Trig::Feature<Muon_ROI> muonL1Feature = m_trigDecisionTool->ancestor<Muon_ROI>(*mit);
-      const Muon_ROI* muonL1 = muonL1Feature.cptr();
-      if ( muonL2 != NULL ) {
-        ATH_MSG_DEBUG("L2 combination # " << iComb << " object # " << iObj
-                      << "  &:"    << (int64_t) muonL2
-                      << "  TE id: " << mit->te()->getId()
-                      << "  pt: "  << muonL2->pt()
-                      << "  eta: " << muonL2->eta()
-                      << "  phi: " << muonL2->phi());
-
-        if ( muonsL2 != NULL) {
-          TrigObject trigObjectL2;
-          trigObjectL2.names.push_back(chain);
-          trigObjectL2.eta = muonL2->eta();
-          trigObjectL2.phi = muonL2->phi();
-          trigObjectL2.pt  = muonL2->pt();
-          trigObjectL2.q   = muonL2->pt() > 0.0 ? 1 : -1;
-          trigObjectL2.id  = (int64_t) muonL2;
-          trigObjectL2.parentId = (muonL1 != NULL) ? muonL1->getROIWord() : -1;
-          trigObjectL2.grandparentId = -1;
-          //trigObjectL2.daughterIds.push_back(-1);
-          trigObjectL2.combIds.push_back(iComb);
-          trigObjectL2.efObjIds.push_back(-1);
-          trigObjectL2.type = COMBINED; // TODO: Add non-combined objects too
-          addTrigObject(trigObjectL2, muonsL2, m_appendL2IfExists);
-        }
-      } else ATH_MSG_WARNING("getL2TriggerObjects(): muonL2 is NULL");
-
-      if ( muonL1 != NULL ) {
-        ATH_MSG_DEBUG("     parent:  &:" << (int64_t) muonL1
-                      << "  pt: "   << muonL1->pt()
-                      << "  eta: "  << muonL1->eta()
-                      << "  phi: "  << muonL1->phi()
-                      << "  word: " << muonL1->getROIWord() );
-        if ( muonsL1 != NULL) {
-          TrigObject trigObjectL1;
-	  int charge = -99;
-	  switch (muonL1->getCharge()) {
-	  case Muon_ROI::Pos: charge = 1;  break;
-	  case Muon_ROI::Neg: charge = -1; break;
-	  default:
-	    charge = -99;
-	    ATH_MSG_DEBUG("muonL1 charge not defined " << muonL1->getCharge());
-	  }
-          trigObjectL1.names.push_back(chain);
-          trigObjectL1.eta = muonL1->eta();
-          trigObjectL1.phi = muonL1->phi();
-          trigObjectL1.pt  = muonL1->pt();
-          trigObjectL1.q   = charge;
-          trigObjectL1.id  = muonL1->getROIWord();
-          trigObjectL1.parentId = -1;
-          trigObjectL1.grandparentId = -1;
-          //trigObjectL1.daughterIds.push_back((int64_t) muonL2);
-          trigObjectL1.combIds.push_back(iComb);
-          trigObjectL1.efObjIds.push_back(-1);
-          trigObjectL1.type = SPECTROMETER;
-          addTrigObject(trigObjectL1, muonsL1, m_appendL1IfExists);
-        }
-      } else ATH_MSG_WARNING("getL2TriggerObjects(): muonL1 is NULL");
-      ++iMuon;
-    }
-  } // End loop over combinations
-
-  return true;
-}
-
-
-bool
-TrigEffJpsiTools::getEFTriggerObjects(const std::string& chain,
-                                      TrigObjectMap* muonsEF,
-                                      TrigObjectMap* muonsL2,
-                                      TrigObjectMap* muonsL1) const
-{
-  ATH_MSG_DEBUG("TrigEffJpsiTools::getEFTriggerObjects() : " << chain);
-
-  //const Trig::ChainGroup* cg = m_trigDecisionTool->getChainGroup(chain);
-  // Getting the chain's features:
-  const Trig::FeatureContainer fc = m_trigDecisionTool->features(chain);
-
-  std::vector<Trig::Combination>::const_iterator it;
-  short iComb = 1;
-  for ( it = fc.getCombinations().begin(); it != fc.getCombinations().end(); ++it, ++iComb ) { // Loop over combinations
-    const Trig::Combination& combination = *it;
-    if (not combination.active()) {
-      ATH_MSG_DEBUG("getEFTriggerObjects: combination " << combination << " is not active");
-      continue;
-    }
-    ATH_MSG_DEBUG("getEFTriggerObjects: combination " << combination << " is active");
-
-    std::vector<Trig::Feature<TrigMuonEFInfo> > muons = combination.get<TrigMuonEFInfo>();
-    std::vector<Trig::Feature<TrigMuonEFInfo> >::iterator mit;
-    short iObj = 0;
-    for ( mit = muons.begin(); mit != muons.end(); ++mit, ++iObj) { // Loop over objects
-      const TrigMuonEFInfo* muonEF = mit->cptr();
-      Trig::Feature<CombinedMuonFeature>  muonL2Feature       = m_trigDecisionTool->ancestor<CombinedMuonFeature>(*mit);
-      Trig::Feature<Muon_ROI>             muonL1Feature       = m_trigDecisionTool->ancestor<Muon_ROI>(*mit);
-      const CombinedMuonFeature*          muonL2              = muonL2Feature.cptr();
-      const Muon_ROI*                     muonL1              = muonL1Feature.cptr();
-      const TrigMuonEFInfoTrackContainer* muonEFInfoTrackCont = muonEF->TrackContainer();
-      TrigMuonEFInfoTrackContainer::const_iterator trit;
-
-      int iTrack    = 0;
-      int iCbTrack = 0;
-      for ( trit = muonEFInfoTrackCont->begin(); trit != muonEFInfoTrackCont->end(); ++trit, ++iTrack ) {
-        const TrigMuonEFTrack* muonEFTrack = NULL;
-        int                    trackType   = UNDEFINED;
-        if      ( (*trit)->hasCombinedTrack() )     { trackType = COMBINED;     muonEFTrack = (*trit)->CombinedTrack(); }
-        else if ( (*trit)->hasSpectrometerTrack() ) { trackType = SPECTROMETER; muonEFTrack = (*trit)->SpectrometerTrack(); }
-        else if ( (*trit)->hasExtrapolatedTrack() ) { trackType = EXTRAPOLATED; muonEFTrack = (*trit)->ExtrapolatedTrack(); }
-
-        if ( muonEFTrack != NULL ) {
-	  ATH_MSG_DEBUG("EF combination # " << iComb << " object # " << iObj << " CbTrack #" << iCbTrack
-			<< "  CbTrack&: " << (uint64_t) muonEFTrack
-			<< "  TrigMuonEFInfo&: "   << (int64_t) muonEF
-			<< "  pt: "  << muonEFTrack->pt()
-			<< "  eta: " << muonEFTrack->eta()
-			<< "  phi: " << muonEFTrack->phi()
-			<< "  type: " << trackType );
-
-	  TrigObject trigObjectEF;
-	  trigObjectEF.names.push_back(chain);
-	  trigObjectEF.eta = muonEFTrack->eta();
-	  trigObjectEF.phi = muonEFTrack->phi();
-	  trigObjectEF.pt  = muonEFTrack->pt();
-	  trigObjectEF.q   = muonEFTrack->Charge();
-	  trigObjectEF.id  = (int64_t) muonEFTrack;
-	  trigObjectEF.parentId = (int64_t) muonL2;
-	  trigObjectEF.grandparentId =  (muonL1 != NULL) ? muonL1->getROIWord() : -1;
-	  //trigObjectEF.daughterIds.push_back(-1);
-	  trigObjectEF.combIds.push_back(iComb);
-	  trigObjectEF.efObjIds.push_back(iTrack);
-	  trigObjectEF.type = trackType;
-	  addTrigObject(trigObjectEF, muonsEF, m_appendEFIfExists);
-	  ++iCbTrack; // TODO: Find a more proper name
-        }
-      } // End if muonEFTrack
-
-      if ( muonEFInfoTrackCont->size() > 0 && iCbTrack == 0 )
-        ATH_MSG_WARNING("getEFTriggerObjects(): Could not find a combined track");
-
-      if ( muonL2 != NULL ) {
-        ATH_MSG_DEBUG("   parent:  &: " << (int64_t) muonL2
-                      << "  pt: "  << muonL2->pt()
-                      << "  eta: " << muonL2->eta()
-                      << "  phi: " << muonL2->phi() );
-
-        if ( muonsL2 != NULL) {
-          TrigObject trigObjectL2;
-          trigObjectL2.names.push_back(chain);
-          trigObjectL2.eta = muonL2->eta();
-          trigObjectL2.phi = muonL2->phi();
-          trigObjectL2.pt  = muonL2->pt();
-          trigObjectL2.q   = muonL2->pt() > 0.0 ? 1 : -1;
-          trigObjectL2.id  = (int64_t) muonL2;
-          trigObjectL2.parentId = (muonL1 != NULL) ? muonL1->getROIWord() : -1;
-          trigObjectL2.grandparentId = -1;
-          //trigObjectL2.daughterIds.push_back((int64_t) muonEF);
-          trigObjectL2.combIds.push_back(iComb);
-          trigObjectL2.efObjIds.push_back(-1);
-          trigObjectL2.type = COMBINED;
-          addTrigObject(trigObjectL2, muonsL2, m_appendL2IfExists);
-        }
-      } else ATH_MSG_WARNING("getEFTriggerObjects(): muonL2 is NULL");
-
-      if ( muonL1 != NULL ) {
-        ATH_MSG_DEBUG("   grandparent:  &: " << (int64_t) muonL1
-                      << "  pt: "   << muonL1->pt()
-                      << "  eta: "  << muonL1->eta()
-                      << "  word: " << muonL1->getROIWord()
-                      << "  phi: "  << muonL1->phi() );
-        if ( muonsL1 != NULL) {
-          TrigObject trigObjectL1;
-	  int charge = -99;
-	  switch (muonL1->getCharge()) {
-	  case Muon_ROI::Pos: charge = 1;  break;
-	  case Muon_ROI::Neg: charge = -1; break;
-	  default:
-	    charge = -99;
-	    ATH_MSG_WARNING("muonL1 charge not defined " << muonL1->getCharge());
-	  }
-          trigObjectL1.names.push_back(chain);
-          trigObjectL1.eta = muonL1->eta();
-          trigObjectL1.phi = muonL1->phi();
-          trigObjectL1.pt  = muonL1->pt();
-          trigObjectL1.q   = charge;
-          trigObjectL1.id  = muonL1->getROIWord();
-          trigObjectL1.parentId = -1;
-          trigObjectL1.grandparentId = -1;
-          //trigObjectL1.daughterIds.push_back((int64_t) muonL2);
-          trigObjectL1.combIds.push_back(iComb);
-          trigObjectL1.efObjIds.push_back(-1);
-          trigObjectL1.type = SPECTROMETER;
-          addTrigObject(trigObjectL1, muonsL1, m_appendL1IfExists);
-        }
-      } else ATH_MSG_WARNING("getEFTriggerObjects(): muonL1 is NULL");
-    }
-  } // End loop over combinations
-
-  return true;
-}
-
-bool
-TrigEffJpsiTools::getEFAllTriggerObjects(const std::string& chain,
-					 TrigObjectMap* muonsEF,
-					 TrigObjectMap* /*muonsL2*/,
-					 TrigObjectMap* /*muonsL1*/) const
-{
-  ATH_MSG_DEBUG("TrigEffJpsiTools::getEFAllTriggerObjects() : " << chain);
-
-  const Trig::ChainGroup* cg = m_trigDecisionTool->getChainGroup(chain);
-  ATH_MSG_INFO( "The chain " << chain << "  is passing" << cg->isPassed() );
-
-  std::vector<HLT::TriggerElement*> tes = getExpertTEs(chain);
-
-  // now get features
-
-  BOOST_FOREACH( const HLT::TriggerElement* te, tes ) {
-    Trig::Feature<TrigMuonEFInfoContainer> FeatureCont = m_trigDecisionTool->ancestor<TrigMuonEFInfoContainer>(te);
-    const TrigMuonEFInfoContainer* TmuonsCont = FeatureCont.cptr();
-    ATH_MSG_INFO("Object container found !: " << FeatureCont.cptr() << " size " << TmuonsCont->size() );
-
-    TrigMuonEFInfoContainer::const_iterator MuonItr   = TmuonsCont->begin();
-    TrigMuonEFInfoContainer::const_iterator MuonItrE  = TmuonsCont->end();
-
-    for (int imu=0; MuonItr != MuonItrE; ++MuonItr, ++imu ) {
-      const TrigMuonEFInfo* muonInfo = (*MuonItr);
-      const TrigMuonEFInfoTrackContainer* muonEFInfoTrackCont = muonInfo->TrackContainer();
-      int iTrack    = 0;
-      TrigMuonEFInfoTrackContainer::const_iterator trit;
-      for ( trit = muonEFInfoTrackCont->begin(); trit != muonEFInfoTrackCont->end(); ++trit, ++iTrack ) {
-        const TrigMuonEFTrack* muonEFTrack = NULL;
-        int                    trackType   = UNDEFINED;
-        if      ( (*trit)->hasCombinedTrack() )     { trackType = COMBINED;     muonEFTrack = (*trit)->CombinedTrack(); }
-        else if ( (*trit)->hasSpectrometerTrack() ) { trackType = SPECTROMETER; muonEFTrack = (*trit)->SpectrometerTrack(); }
-        else if ( (*trit)->hasExtrapolatedTrack() ) { trackType = EXTRAPOLATED; muonEFTrack = (*trit)->ExtrapolatedTrack(); }
-
-        if ( muonEFTrack != NULL ) {
-	  ATH_MSG_DEBUG("EF container, track " << imu << "  " << iTrack 
-			<< "  CbTrack&: " << (uint64_t) muonEFTrack
-			<< "  TrigMuonEFInfo&: "   << (int64_t) muonInfo
-			<< "  pt: "  << muonEFTrack->pt()
-			<< "  eta: " << muonEFTrack->eta()
-			<< "  phi: " << muonEFTrack->phi()
-			<< "  type: " << trackType
-			<< "  combId: " << imu );
-
-	  // store ntuple info
-	  TrigObject trigObjectEF;
-	  trigObjectEF.names.push_back("EF_mu4_All");
-	  trigObjectEF.eta = muonEFTrack->eta();
-	  trigObjectEF.phi = muonEFTrack->phi();
-	  trigObjectEF.pt  = muonEFTrack->pt();
-	  trigObjectEF.q   = muonEFTrack->Charge();
-	  trigObjectEF.id  = (int64_t) muonEFTrack;
-	  trigObjectEF.parentId = -1; // (int64_t) muonL2;
-	  trigObjectEF.grandparentId =  -1; // (muonL1 != NULL) ? muonL1->getROIWord() : -1;
-	  //trigObjectEF.daughterIds.push_back(-1);
-	  trigObjectEF.combIds.push_back(-1);
-	  trigObjectEF.efObjIds.push_back(iTrack);
-	  trigObjectEF.type = trackType;
-	  addTrigObject(trigObjectEF, muonsEF, m_appendEFIfExists);
-	  //            ++iCbTrack; // TODO: Find a more proper name
-        }
-      } // End if muonEFTrack
-
-
-    } // end loop over muon conatiner
-
-
-  } // end loop over TEs
-
-
-  return true;
-}
-
-bool
-TrigEffJpsiTools::getEFIDTriggerObjects(const std::string& chain,
-					TrigObjectMap* muonsEF,
-					TrigObjectMap* /*muonsL2*/,
-					TrigObjectMap* /*muonsL1*/) const
-{
-  ATH_MSG_DEBUG("TrigEffJpsiTools::getEFIDTriggerObjects() : " << chain);
-  
-  const Trig::FeatureContainer fc = m_trigDecisionTool->features(chain);
-
-  ATH_MSG_DEBUG("getEFIDTriggerObjects: number of combination " << fc.getCombinations().size());
-
-  std::vector<Trig::Combination>::const_iterator it;
-  short iComb = 0;
-  for ( it = fc.getCombinations().begin(); it != fc.getCombinations().end(); ++it, ++iComb ) { // Loop over combinations
-    const Trig::Combination& combination = *it;
-    if (not combination.active()) {
-      ATH_MSG_DEBUG("getEFIDTriggerObjects: combination " << iComb << "  " << combination << " is not active");
-      continue;
-    }
-    ATH_MSG_DEBUG("getEFIDTriggerObjects: combination " << iComb << "  " <<  combination << " is active");
-
-    std::vector<Trig::Feature<Rec::TrackParticleContainer> > tracks = combination.get<Rec::TrackParticleContainer>("InDetTrigParticleCreation_Muon_EFID");
-    std::vector<Trig::Feature<Rec::TrackParticleContainer> >::iterator trit;
-
-    short iTrk = 0;
-    ATH_MSG_DEBUG("getEFIDTriggerObjects: number of track collections " << tracks.size());
-    for ( trit = tracks.begin(); trit != tracks.end(); ++trit, ++iTrk) { // Loop over objects
-      const Rec::TrackParticleContainer* trackEF = trit->cptr();
-
-      ATH_MSG_DEBUG("getEFIDTriggerObjects: number of tracks " << trackEF->size());
-      Rec::TrackParticleContainer::const_iterator trkIt    = trackEF->begin();
-      Rec::TrackParticleContainer::const_iterator lastTrkIt = trackEF->end();
-
-      for (int itrk=0 ; trkIt != lastTrkIt; itrk++, trkIt++) {
-	const Trk::Perigee* perigee = (*trkIt)->measuredPerigee();
-
-        double px = perigee->momentum()[Trk::px];
-        double py = perigee->momentum()[Trk::py];
-        double ptSquare=std::pow(px,2) + std::pow(py,2);
-        double pT = sqrt(ptSquare) * perigee->parameters()[Trk::qOverP]/fabs(perigee->parameters()[Trk::qOverP]);
-
-	ATH_MSG_DEBUG("getEFIDTriggerObjects: track " << itrk
-		      << "  pt: "  << pT
-		      << "  eta: " << perigee->eta()
-		      << "  phi: " << perigee->parameters()[Trk::phi]
-		      << "  type: " << IDONLY
-		      << "  combId: " << iComb );
-
-	// store ntuple info
-	TrigObject trigObjectEF;
-	trigObjectEF.names.push_back(chain);
-	trigObjectEF.eta = perigee->eta();
-	trigObjectEF.phi = perigee->parameters()[Trk::phi];
-	trigObjectEF.pt  = pT;
-	trigObjectEF.q   = perigee->parameters()[Trk::qOverP]/fabs(perigee->parameters()[Trk::qOverP]);
-	trigObjectEF.id  = (int64_t) (*trkIt);
-	trigObjectEF.parentId = -1;
-	trigObjectEF.grandparentId = -1;
-	// trigObjectEF.daughterIds.push_back(-1);
-	trigObjectEF.combIds.push_back(iComb);
-	trigObjectEF.efObjIds.push_back(iTrk);
-	trigObjectEF.type = IDONLY;
-	addTrigObject(trigObjectEF, muonsEF, m_appendEFIfExists);
-
-      } // end loop over tracks
-    } // end loop over track collections
-  } // end loopp over combinations
-
-
-  return true;
-}
-
-bool
-TrigEffJpsiTools::getEFMSTriggerObjects(const std::string& chain,
-					TrigObjectMap* muonsEF,
-					TrigObjectMap* /*muonsL2*/,
-					TrigObjectMap* /*muonsL1*/) const
-{
-  std::vector< const TrigMuonEFTrack* > muonExtrapolatedTracks;
-  ATH_MSG_DEBUG("TrigEffJpsiTools::getEFMSTriggerObjects() : " << chain);
-  const Trig::FeatureContainer fc = m_trigDecisionTool->features(chain);
-  ATH_MSG_DEBUG("getEFMSTriggerObjects: number of combination " << fc.getCombinations().size());
-
-  std::vector<Trig::Combination>::const_iterator it;
-  short iComb = 0;
-  for ( it = fc.getCombinations().begin(); it != fc.getCombinations().end(); ++it, ++iComb ) { // Loop over combinations
-    const Trig::Combination& combination = *it;
-    if (not combination.active()) {
-      ATH_MSG_DEBUG("getEFMSTriggerObjects: combination " << iComb << "  " << combination << " is not active");
-      continue;
-    }
-    ATH_MSG_DEBUG("getEFMSTriggerObjects: combination " << iComb << "  " <<  combination << " is active");
-
-    //from Peter    
-    std::vector< Trig::Feature<TrigRoiDescriptor> > initRois = combination.get<TrigRoiDescriptor>("initialRoI", TrigDefs::Physics); 
-    std::vector< Trig::Feature< TrigMuonEFInfoContainer > > muons = combination.get< TrigMuonEFInfoContainer >("MuonEFInfo", TrigDefs::Physics);
-
-    for( unsigned roiIt1 = 0; roiIt1 < muons.size(); roiIt1++ ){
-      Trig::Feature< TrigMuonEFInfoContainer > trackFeature1 = muons.at(roiIt1);
-      const TrigMuonEFInfoContainer* trigMuon1 = trackFeature1.cptr();
-      TrigMuonEFInfoContainer::const_iterator muonItr1  = trigMuon1->begin();
-      const TrigMuonEFInfo* muoninfo1 = (*muonItr1);
-
-      if( !initRois.empty() ){
-	const TrigRoiDescriptor* roid1 = initRois[roiIt1].cptr();
-	TIDARoiDescriptor roiInfo1 = TIDARoiDescriptorBuilder(*roid1);
-	if( muoninfo1->hasTrack() ){
-	  const TrigMuonEFInfoTrackContainer* tc1 = muoninfo1->TrackContainer();
-	  bool selected = false;
-	  for( TrigMuonEFInfoTrackContainer::const_iterator trackItr = tc1->begin(); trackItr != tc1->end(); trackItr++){
-	    const TrigMuonEFInfoTrack* muonInfo1 = (*trackItr);
-	    if( muonInfo1->hasExtrapolatedTrack() ){
-	      TrigMuonEFTrack* eTrack1 = muonInfo1->ExtrapolatedTrack();
-
-	      //              std::cout << "RoI " << muoninfo1->RoINum() << " extrapolated track " << *eTrack1 << std::endl;
-	      for( unsigned roiIt2 = 0; roiIt2 < muons.size(); roiIt2++ ){
-		if( roiIt1 != roiIt2 ){
-		  Trig::Feature< TrigMuonEFInfoContainer > trackFeature2 = muons.at(roiIt2);
-		  const TrigMuonEFInfoContainer* trigMuon2 = trackFeature2.cptr();
-		  TrigMuonEFInfoContainer::const_iterator muonItr2  = trigMuon2->begin();
-		  const TrigMuonEFInfo* muoninfo2 = (*muonItr2);
-		  if( !initRois.empty() ){
-		    const TrigRoiDescriptor* roid2 = initRois[roiIt2].cptr();
-		    TIDARoiDescriptor roiInfo2 = TIDARoiDescriptorBuilder(*roid2);
-
-		    if( muoninfo2->hasTrack() ){
-		      const TrigMuonEFInfoTrackContainer* tc2 = muoninfo2->TrackContainer();
-		      for( TrigMuonEFInfoTrackContainer::const_iterator trackItr = tc2->begin(); trackItr != tc2->end(); trackItr++){
-			const TrigMuonEFInfoTrack* muonInfo2 = (*trackItr);
-			if( muonInfo2->hasExtrapolatedTrack() ){
-			  TrigMuonEFTrack* eTrack2 = muonInfo2->ExtrapolatedTrack();
-			  //      std::cout << "RoI " << muoninfo2->RoINum() << " extrapolated track " << *eTrack2 << std::endl;
-			  double deta = getEtaDistance(eTrack1->eta(), eTrack2->eta());
-			  double dphi = getPhiDistance(eTrack1->phi(), eTrack2->phi());
-
-			  if( muoninfo1->RoINum() != muoninfo2->RoINum() && ((std::fabs(deta) < 0.08) && (std::fabs(dphi) < 0.08)) ){
-			    double deltarT1Roi1 = getEtaPhiDistance(eTrack1->eta(), roiInfo1.eta(), eTrack1->phi(), roiInfo1.phi() );
-			    double deltarT2Roi2 = getEtaPhiDistance(eTrack2->eta(), roiInfo2.eta(), eTrack2->phi(), roiInfo2.phi() );
-
-			    if( deltarT1Roi1 > deltarT2Roi2 ){
-			      eTrack1 = eTrack2;
-			      //  std::cout << "Switched!" << std::endl;
-			    }
-			  }//check duplcates - pick 1 closest to centre of its RoI
-			}
-		      }
-		    }
-		  }
-		}//roi1!=roi2
-	      }//start 2nd RoI loop
-
-	      for( std::vector<const TrigMuonEFTrack*>::const_iterator setIt = muonExtrapolatedTracks.begin(); setIt != muonExtrapolatedTracks.end(); ++setIt){
-		double deta = getEtaDistance( (*setIt)->eta(), eTrack1->eta() );
-		double dphi = getPhiDistance( (*setIt)->phi(), eTrack1->phi() );
-		if( (std::fabs(deta) < 0.08) && (std::fabs(dphi) < 0.08) ){
-		  selected = true;
-		}
-	      }
-	      if( !selected ){
-		muonExtrapolatedTracks.push_back(eTrack1);
-		// std::cout << "\nExtrapolatedTrack1 inserted." << *eTrack1 << "\n" << std::endl;
-	      }
-	    }//extrapolated track?
-	  }
-	}
-      }
-    }
-    // END PETER
-
-    int  MSsize = muonExtrapolatedTracks.size();
-    ATH_MSG_DEBUG("getEFMSTriggerObjects: number of MStracks " <<  MSsize );
-
-    for (int iMS=0 ; iMS < MSsize; iMS++) {
-      double px = (*muonExtrapolatedTracks.at(iMS)).px(); //perigee->momentum()[Trk::px];
-      double py = (*muonExtrapolatedTracks.at(iMS)).py(); //perigee->momentum()[Trk::py];
-      double ptSquare=std::pow(px,2) + std::pow(py,2);
-      double charge = (*muonExtrapolatedTracks.at(iMS)).Charge();
-      double pT = sqrt(ptSquare) * charge;
-      double eta = (*muonExtrapolatedTracks.at(iMS)).eta();
-      double phi = (*muonExtrapolatedTracks.at(iMS)).phi();
-
-      ATH_MSG_DEBUG("getEFMSTriggerObjects: track " << iMS << " Pt eta phi  " << pT  << " / " << eta << " / " <<   phi );
-      // store ntuple info
-      TrigObject trigObjectEF;
-      trigObjectEF.names.push_back(chain);
-      trigObjectEF.eta = eta;
-      trigObjectEF.phi = phi;
-      trigObjectEF.pt  = pT;
-      trigObjectEF.q   = charge;
-      trigObjectEF.id  = (int64_t) (muonExtrapolatedTracks.at(iMS));
-      trigObjectEF.parentId = -1;
-      trigObjectEF.grandparentId = -1;
-      //trigObjectEF.daughterIds.push_back(-1);
-      trigObjectEF.combIds.push_back(iComb);
-      trigObjectEF.efObjIds.push_back(iMS);
-      trigObjectEF.type = EXTRAPOLATED; //2999;
-      addTrigObject(trigObjectEF, muonsEF, m_appendEFIfExists);
-    } // end loop over tracks
-  }
-  return true;
-}
-
-
-bool
-TrigEffJpsiTools::getBPhysL2TriggerObjects(const std::string& chain,
-                                           TrigObjectMap* muonsL2,
-                                           TrigObjectMap* muonsL1) const
-{
-  ATH_MSG_DEBUG("TrigEffJpsiTools::getBPhysL2TriggerObjects() : " << chain);
-  int nTrig=-1;
-  bool muTrkJpsi = (chain.find("_mu") && chain.find("Trk")); // Checks if chain is a mu+Trk chain. Notice: Case sensitive!
-
-  for (unsigned int iTrig=0; iTrig < m_Btrig_L2_chain.size(); iTrig++) {
-    if (m_Btrig_L2_chain[iTrig] == chain) nTrig=iTrig;
-  }
-  if (m_useManualHypoCuts) {
-    if (nTrig<0) {
-      ATH_MSG_WARNING("getBPhysL2TriggerObjects: do not have HYPO cuts for chain " << chain);
-      return true;
-    }
-    ATH_MSG_DEBUG("getBPhysL2TriggerObjects: cuts for chain " << chain);
-    ATH_MSG_DEBUG("getBPhysL2TriggerObjects: mass : " << m_Btrig_L2_massMin[nTrig] << " - " << m_Btrig_L2_massMax[nTrig]);
-    ATH_MSG_DEBUG("getBPhysL2TriggerObjects: applyMassMax " << m_Btrig_L2_applyMassMax[nTrig]);
-    ATH_MSG_DEBUG("getBPhysL2TriggerObjects: checkOS " << m_Btrig_L2_checkOS[nTrig]);
-    ATH_MSG_DEBUG("getBPhysL2TriggerObjects: nHits " << m_Btrig_L2_nHits[nTrig]);
-    ATH_MSG_DEBUG("getBPhysL2TriggerObjects: chi2 " << m_Btrig_L2_chi2[nTrig]);
-  }
-
-
-  const Trig::FeatureContainer fc = m_trigDecisionTool->features(chain);
-  const std::vector<Trig::Combination>& combinations = fc.getCombinations();
-  ATH_MSG_DEBUG("getBPhysL2TriggerObjects: number of combinations: " << combinations.size());
-
-  std::vector<Trig::Combination>::const_iterator cit;
-  int iComb = 1;
-  for (cit = combinations.begin(); cit != combinations.end(); ++cit, ++iComb) { // Loop over combinations
-    const Trig::Combination& combination = *cit;
-    if (not combination.active()) {
-      ATH_MSG_DEBUG("getBPhysL2TriggerObjects: combination " << combination << " is not active");
-      continue;
-    }
-    ATH_MSG_DEBUG("getBPhysL2TriggerObjects: combination " << combination << " is active");
-
-
-    const std::vector<const HLT::TriggerElement*> tes = combination.tes();
-    std::vector<const HLT::TriggerElement*>::const_iterator tesIt;
-    int iTrigElement = 0;
-    ATH_MSG_DEBUG("Trigger elements: " << tes.size());
-    for (tesIt = tes.begin(); tesIt != tes.end(); ++tesIt, ++iTrigElement) {
-      ATH_MSG_DEBUG("Trigger element #" << iTrigElement << ": id = " << (*tesIt)->getId() << " activeState = " << (*tesIt)->getActiveState());
-    }
-
-    std::vector<Trig::Feature<TrigL2Bphys> > triggerFeatures = combination.get<TrigL2Bphys>();
-    std::vector<Trig::Feature<TrigL2Bphys> >::const_iterator tfIt;
-    int iObj = 0;
-    ATH_MSG_DEBUG("Trigger features: " << triggerFeatures.size());
-    for (tfIt = triggerFeatures.begin(); tfIt != triggerFeatures.end(); ++tfIt, ++iObj) { // Loop over trigger features
-      if(tfIt->te()) ATH_MSG_DEBUG("Trigger feature #" << iObj << ": id = " << tfIt->te()->getId() << " activeState = " << tfIt->te()->getActiveState());
-
-      Trig::Feature<TrigL2Bphys>  triggerFeature  = *tfIt;
-      const TrigL2Bphys*          trigObj         = triggerFeature.cptr();
-      Trig::Feature<Muon_ROI>     muonL1Feature   = m_trigDecisionTool->ancestor<Muon_ROI>(triggerFeature);
-      const Muon_ROI*             muonL1          = muonL1Feature.cptr();
-
-      const ElementLinkVector<TrigInDetTrackCollection> trackVector = trigObj->trackVector();
-      // check broken ElementLinks
-      if( !trackVector.at(0).isValid() || !trackVector.at(1).isValid() ) {
-        ATH_MSG_WARNING("Broken ElementLink. Chain = " << chain);
-        continue;
-      }
-      int nTracks = trackVector.size();
-      ATH_MSG_DEBUG("Number of tracks in vertex:  " << nTracks);
-      if (nTracks != 2) {
-        ATH_MSG_ERROR("Number of trigger tracks in J/psi vertex differs from 2");
-        continue;
-      }
-
-      const TrigInDetTrack* trigObjTracks[2] = { *(trackVector.at(0)), *(trackVector.at(1)) };
-      if ( trigObjTracks[0]->param() == NULL || trigObjTracks[1]->param() == NULL) {
-        ATH_MSG_ERROR("Some trigger tracks are without fitted parameters");
-        continue;
-      }
-
-      bool passedHypo = m_useManualHypoCuts ? selectL2TrigDiMuon(trigObj,
-								 trigObjTracks[0],
-								 trigObjTracks[1],
-								 m_Btrig_L2_checkOS[nTrig],
-								 m_Btrig_L2_massMin[nTrig],
-								 m_Btrig_L2_massMax[nTrig],
-								 m_Btrig_L2_applyMassMax[nTrig],
-								 m_Btrig_L2_nHits[nTrig],
-								 m_Btrig_L2_chi2[nTrig]) : true;
-
-      if (!passedHypo) {
-        ATH_MSG_DEBUG("This object failed hypo, will not store on ntuple");
-        continue;
-      }
-
-      // Get trigger object tracks
-      for (int iTrack = 0; iTrack < nTracks; ++iTrack) { // Loop over trigger object tracks
-        int64_t trkId = (int64_t) trigObjTracks[iTrack]; // TODO: Get a unique ID
-        const TrigInDetTrackFitPar* param = trigObjTracks[iTrack]->param();
-        ATH_MSG_DEBUG("BPhys L2 comb # " << iComb <<" object # " << iObj
-                      << "  &:"    << trkId
-                      << "  pt: "  << param->pT()
-                      << "  eta: " << param->eta()
-                      << "  phi: " << param->phi0()
-                      << "  passHypo: " << passedHypo);
-        if ( muonsL2 != NULL ) {
-	  TrackType trackType = COMBINED;
-	  if (muTrkJpsi) {
-	    trackType = (iTrack == 0) ? COMBINED : IDONLY;
-	  }
-          TrigObject trigObjectL2;
-          trigObjectL2.names.push_back(chain);
-          trigObjectL2.eta = param->eta();
-          trigObjectL2.phi = param->phi0();
-          trigObjectL2.pt  = param->pT();
-          trigObjectL2.q   = param->pT() > 0.0 ? 1 : -1 ;
-          trigObjectL2.id  = trkId;
-          trigObjectL2.parentId = (muonL1 != NULL) ? muonL1->getROIWord() : -1;
-          trigObjectL2.grandparentId = -1;
-          trigObjectL2.combIds.push_back(1000*iComb + iObj);
-          trigObjectL2.efObjIds.push_back(-1);
-          trigObjectL2.type = trackType;
-          addTrigObject(trigObjectL2, muonsL2, m_appendL2IfExists);
-        }
-      } // End loop over trigger object tracks
-
-      if ( muonL1 != NULL ) {
-        ATH_MSG_DEBUG("     parent:  &:" << (int64_t) muonL1
-                      << "  pt: "   << muonL1->pt()
-                      << "  eta: "  << muonL1->eta()
-                      << "  phi: "  << muonL1->phi()
-                      << "  word: " << muonL1->getROIWord() );
-        if ( muonsL1 != NULL) {
-          TrigObject trigObjectL1;
-	  int charge = -99;
-	  switch (muonL1->getCharge()) {
-	  case Muon_ROI::Pos: charge = 1;  break;
-	  case Muon_ROI::Neg: charge = -1; break;
-	  default:
-	    charge = -99;
-	    ATH_MSG_WARNING("muonL1 charge not defined " << muonL1->getCharge());
-	  }
-          trigObjectL1.names.push_back(chain);
-          trigObjectL1.eta = muonL1->eta();
-          trigObjectL1.phi = muonL1->phi();
-          trigObjectL1.pt  = muonL1->pt();
-          trigObjectL1.q   = charge;
-          trigObjectL1.id  = muonL1->getROIWord();
-          trigObjectL1.parentId = -1;
-          trigObjectL1.grandparentId = -1;
-          trigObjectL1.combIds.push_back(iObj);
-          trigObjectL1.efObjIds.push_back(-1);
-          trigObjectL1.type = SPECTROMETER;
-          addTrigObject(trigObjectL1, muonsL1, m_appendL1IfExists);
-        }
-      } else ATH_MSG_WARNING("getBPhysL2TriggerObjects(): muonL1 is NULL");
-    } // End loop over trigger features
-  } // End loop over combinations
-
-  return true;
-}
-
-bool
-TrigEffJpsiTools::getBPhysEFTriggerObjects(const std::string& chain,
-                                           TrigObjectMap* muonsEF,
-                                           TrigObjectMap* /*muonsL2*/,
-                                           TrigObjectMap* muonsL1) const
-{
-  // TOOD: Finish this
-  ATH_MSG_DEBUG("TrigEffJpsiTools::getBPhysEFTriggerObjects() : " << chain);
-  int nTrig      = -1;
-  bool muTrkJpsi = (chain.find("_mu") && chain.find("Trk")); // Checks if chain is a mu+Trk chain. Notice: Case sensitive!
-
-  for (unsigned int iTrig=0; iTrig < m_Btrig_EF_chain.size(); iTrig++) {
-    if (m_Btrig_EF_chain[iTrig] == chain) nTrig=iTrig;
-  }
-
-  if (m_useManualHypoCuts) {
-    if (nTrig<0) {
-      ATH_MSG_WARNING("getBPhysEFTriggerObjects: do not have HYPO cuts for chain " << chain);
-      return true;
-    }
-    ATH_MSG_DEBUG("getBPhysEFTriggerObjects: cuts for chain " << chain);
-    ATH_MSG_DEBUG("getBPhysEFTriggerObjects: mass : " << m_Btrig_EF_massMin[nTrig] << " -> " << m_Btrig_EF_massMax[nTrig]);
-    ATH_MSG_DEBUG("getBPhysEFTriggerObjects: applyMassMax " << m_Btrig_EF_applyMassMax[nTrig]);
-    ATH_MSG_DEBUG("getBPhysEFTriggerObjects: checkOS " << m_Btrig_EF_checkOS[nTrig]);
-    ATH_MSG_DEBUG("getBPhysEFTriggerObjects: chi2 " << m_Btrig_EF_chi2[nTrig]);
-  }
-
-  // Getting the chain's features:
-  const Trig::FeatureContainer fc = m_trigDecisionTool->features(chain/*, TrigDefs::alsoDeactivateTEs*/ );
-  const std::vector<Trig::Combination>& combinations = fc.getCombinations();
-  ATH_MSG_DEBUG("getBPhysEFTriggerObjects: number of combinations: " << combinations.size());
-
-  std::vector<Trig::Combination>::const_iterator cit;
-  int iComb = 1;
-  for (cit = combinations.begin(); cit != combinations.end(); ++cit, ++iComb) { // Loop over combinations
-    const Trig::Combination& combination = *cit;
-    if (not combination.active()) {
-      ATH_MSG_DEBUG("getBPhysEFTriggerObjects: combination " << combination << " is not active");
-      continue;
-    }
-    ATH_MSG_DEBUG("getBPhysEFTriggerObjects: combination " << combination << " is active");
-
-
-    const std::vector<const HLT::TriggerElement*> tes = combination.tes();
-    std::vector<const HLT::TriggerElement*>::const_iterator tesIt;
-    int iTrigElement = 0;
-    ATH_MSG_DEBUG("Trigger elements: " << tes.size());
-    for (tesIt = tes.begin(); tesIt != tes.end(); ++tesIt, ++iTrigElement) {
-      ATH_MSG_DEBUG("Trigger element #" << iTrigElement << ": id = " << (*tesIt)->getId() << " activeState = " << (*tesIt)->getActiveState());
-    }
-
-    std::vector<Trig::Feature<TrigEFBphys> > triggerFeatures = combination.get<TrigEFBphys>();
-    std::vector<Trig::Feature<TrigEFBphys> >::const_iterator tfIt;
-    int iObj = 0;
-    ATH_MSG_DEBUG("Trigger features: " << triggerFeatures.size());
-    for (tfIt = triggerFeatures.begin(); tfIt != triggerFeatures.end(); ++tfIt, ++iObj) { // Loop over trigger features
-      if(tfIt->te()) ATH_MSG_DEBUG("Trigger feature #" << iObj << ": id = " << tfIt->te()->getId() << " activeState = " << tfIt->te()->getActiveState());
-
-
-      Trig::Feature<TrigEFBphys> triggerFeature = *tfIt;
-      const TrigEFBphys*         trigObj        = triggerFeature.cptr();
-      Trig::Feature<Muon_ROI>    muonL1Feature  = m_trigDecisionTool->ancestor<Muon_ROI>(triggerFeature);
-      const Muon_ROI*            muonL1         = muonL1Feature.cptr();
-      if (muonL1 != NULL) ATH_MSG_DEBUG(" L1 muon feature: " <<  muonL1->getROIWord());
-      Trig::Feature<TrigL2Bphys> muonL2Feature  = m_trigDecisionTool->ancestor<TrigL2Bphys>(triggerFeature);
-      ATH_MSG_DEBUG(" L2 muon feature: " <<  (int64_t) muonL2Feature.te() );
-      const TrigL2Bphys* muonL2                 = muonL2Feature.cptr();
-
-      const ElementLinkVector<Rec::TrackParticleContainer> trackVector   = trigObj->trackVector();
-      // check broken ElementLinks
-      if( !trackVector.at(0).isValid() || !trackVector.at(1).isValid() ) {
-        ATH_MSG_WARNING("Broken ElementLink. Chain = " << chain);
-        continue;
-      }
-      int nTracks = trackVector.size();
-      ATH_MSG_DEBUG("Number of tracks in vertex:  " << nTracks);
-      if (nTracks != 2) {
-        ATH_MSG_ERROR("Number of trigger tracks in J/psi vertex differs from 2");
-        continue;
-      }
-
-      const Rec::TrackParticle* trigObjTracks[2] = { *(trackVector.at(0)),   *(trackVector.at(1)) };
-      const TrigInDetTrack*     l2Tracks[2]      = { NULL, NULL };
-      if (muonL2 != NULL) {
-	l2Tracks[0]   = *(muonL2->trackVector().at(0));
-	l2Tracks[1]   = *(muonL2->trackVector().at(1));
-      }
-      //      if ( trigObjTracks[0]->param() == NULL || trigObjTracks[1]->param() == NULL) {
-      //  ATH_MSG_ERROR("Some trigger tracks are without fitted parameters");
-      //  continue;
-      // }
-
-      // check HYPO cuts - need to make these explicitly now, in 2011 will be able to use TrigPassBits
-      ATH_MSG_DEBUG("B trigger mass ( " << chain << ") = " << trigObj->mass() );
-      bool passedHypo = m_useManualHypoCuts ? selectEFTrigDiMuon(trigObj,
-								 trigObjTracks[0],
-								 trigObjTracks[1],
-								 m_Btrig_EF_checkOS[nTrig],
-								 m_Btrig_EF_massMin[nTrig],
-								 m_Btrig_EF_massMax[nTrig],
-								 m_Btrig_EF_applyMassMax[nTrig],
-								 m_Btrig_EF_chi2[nTrig]) : true;
-
-      if (!passedHypo) {
-        ATH_MSG_DEBUG("This object failed hypo, will not store on ntuple");
-        continue;
-      }
-
-      // Get trigger object tracks
-      for (int iTrack = 0; iTrack < nTracks; ++iTrack) { // Loop over trigger object tracks
-        int64_t trkId    = (int64_t) trigObjTracks[iTrack]; // TODO: Get a unique ID
-	int64_t parentId = (int64_t) l2Tracks[iTrack];
-        ATH_MSG_DEBUG("BPhys EF comb # " << iComb <<" object # " << iObj
-                      << "  &:"          << trkId
-                      << "  pt: "        << trigObjTracks[iTrack]->pt()
-                      << "  eta: "       << trigObjTracks[iTrack]->eta()
-                      << "  phi: "       << trigObjTracks[iTrack]->phi()
-                      << "  passHypo: "  << passedHypo);
-        if ( muonsEF != NULL ) {
-	  TrackType trackType = COMBINED;
-	  if (muTrkJpsi) {
-	    trackType = (iTrack == 0) ? COMBINED : IDONLY;
-	  }
-
-          TrigObject trigObjectEF;
-          trigObjectEF.names.push_back(chain);
-          trigObjectEF.eta = trigObjTracks[iTrack]->eta();
-          trigObjectEF.phi = trigObjTracks[iTrack]->phi();
-
-	  int charge = trigObjTracks[iTrack]->measuredPerigee()->parameters()[Trk::qOverP] > 0 ? 1. : -1. ;
-          trigObjectEF.pt  = charge * trigObjTracks[iTrack]->pt();
-	  trigObjectEF.q   = charge;
-          trigObjectEF.id  = trkId;
-          trigObjectEF.parentId = parentId;
-//           trigObjectEF.parentId = (int64_t) muonL2;
-	  ATH_MSG_DEBUG("     parentId = " << trigObjectEF.parentId);
-          trigObjectEF.grandparentId = (muonL1 != NULL) ? muonL1->getROIWord() : -1;
-          //trigObjectEF.daughterIds.push_back(-1);
-          trigObjectEF.combIds.push_back(1000*iComb + iObj); // Multiply by 1000 to differentiate BPhys trigs from single-muon ones
-          trigObjectEF.efObjIds.push_back(iTrack);
-          trigObjectEF.type = trackType;
-          addTrigObject(trigObjectEF, muonsEF, m_appendEFIfExists);
-        }
-      } // End loop over trigger object tracks
-
-
-      // TODO:
-      // Need to add muonL2 acquisition step.
-      // Provenance is currently working only if the L2
-      // chain is specified in the BPhysL2 chains
-      if ( muonL1 != NULL ) {
-        ATH_MSG_DEBUG("     grandparent:  &:" << (int64_t) muonL1
-                      << "  pt: "   << muonL1->pt()
-                      << "  eta: "  << muonL1->eta()
-                      << "  phi: "  << muonL1->phi()
-                      << "  word: " << muonL1->getROIWord() );
-        if ( muonsL1 != NULL) {
-          TrigObject trigObjectL1;
-	  int charge = -99;
-	  switch (muonL1->getCharge()) {
-	  case Muon_ROI::Pos: charge = 1;  break;
-	  case Muon_ROI::Neg: charge = -1; break;
-	  default:
-	    charge = -99;
-	    ATH_MSG_WARNING("muonL1 charge not defined " << muonL1->getCharge());
-	  }
-          trigObjectL1.names.push_back(chain);
-          trigObjectL1.eta = muonL1->eta();
-          trigObjectL1.phi = muonL1->phi();
-          trigObjectL1.pt  = muonL1->pt();
-          trigObjectL1.q   = charge;
-          trigObjectL1.id  = muonL1->getROIWord();
-          trigObjectL1.parentId = -1;
-          trigObjectL1.grandparentId = -1;
-          //trigObjectL1.daughterIds.push_back((int64_t) muonL2);
-          trigObjectL1.combIds.push_back(iObj);
-          trigObjectL1.efObjIds.push_back(-1);
-          trigObjectL1.type = SPECTROMETER;
-          addTrigObject(trigObjectL1, muonsL1, m_appendL1IfExists);
-        }
-      } else ATH_MSG_WARNING("getBPhysEFTriggerObjects(): muonL1 is NULL");
-    } // End loop over trigger features
-  } // End loop over combinations
-
-  return true;
-}
-
-
-int
-TrigEffJpsiTools::muctpiBcidDiff(const int roiBcid) const
-{
-  const EventInfo* eventInfo = 0;
-  if (evtStore()->retrieve(eventInfo).isFailure()) {
-    ATH_MSG_WARNING("muctpiBcidDiff: couldn't retrieve EventInfo");
-    return 0;
-  }
-  const unsigned int eventBcid = eventInfo->event_ID()->bunch_crossing_id();
-
-  int diff = roiBcid - (eventBcid & 0x7);
-  switch (eventBcid) {
-  case 0: // cannot distinguish 3563 and 3, 3562 and 2, 3561 and 1
-    if (roiBcid == 3) {
-      diff = -1;
-    } else if (roiBcid == 2) {
-      diff = -2;
-    } else if (roiBcid == 1) {
-      diff = -3;
-    }
-    break;
-
-  case 1: // cannot distinguish 3563 and 3, 3562 and 2
-    if (roiBcid == 3) {
-      diff = -2;
-    } else if (roiBcid == 2) {
-      diff = -3;
-    }
-    break;
-
-  case 2: // cannot distinguish 3563 and 3
-    if (roiBcid == 3) {
-      diff = -3;
-    }
-    break;
-
-  default:
-    break;
-  }
-
-  if (abs(diff) > 4) {
-    diff = (8 - abs(diff)) * ((diff < 0) ? 1 : -1);
-  }
-
-  return diff;
-}
-
-
-int
-TrigEffJpsiTools::getMuonRoiBcidDiff(const uint32_t roiWord) const
-{
-  ATH_MSG_DEBUG("TrigEffJpsiTools::getMuonRoiBcidDiff()");
-
-  const EventInfo* eventInfo = 0;
-  if (evtStore()->retrieve(eventInfo).isFailure()) {
-    ATH_MSG_WARNING("getMuonRoiBcidDiff: couldn't retrieve EventInfo");
-    return 0;
-  }
-  const unsigned int eventBcid = eventInfo->event_ID()->bunch_crossing_id();
-
-  // Create the RoI vector from the RDO data:
-  const std::string key = "MUCTPI_RDO";
-  const MuCTPI_RDO* muctpi_rdo = 0;
-  if (evtStore()->retrieve(muctpi_rdo, key).isFailure()) {
-    ATH_MSG_WARNING("TrigEffJpsiTools::getMuonRoiBcidDiff: couldn't retrieve " << key);
-    return 0;
-  }
-  ATH_MSG_VERBOSE("Retrieved the MuCTPI_RDO object with key: "
-                  << key);
-
-  ATH_MSG_VERBOSE("Now creating the RoIs in extended bunches...");
-  MuCTPI_MultiplicityWord_Decoder mwDecoder(muctpi_rdo->candidateMultiplicity());
-  uint32_t currentBcid = mwDecoder.getBCID();
-  if (currentBcid != (eventBcid & 0x7)) {
-    ATH_MSG_WARNING("MuonRoiWithExtendedBunches: BCID mis-match: " << eventBcid << ":" << currentBcid);
-    return 0;
-  }
-
-  // Loop over all "data words" and calculate bunch crossing difference of the given roiWord
-  ATH_MSG_VERBOSE("found " << muctpi_rdo->dataWord().size() << " muctpi_rdo dataWords");
-
-  std::vector<uint32_t>::const_iterator cit = muctpi_rdo->dataWord().begin();
-  std::vector<uint32_t>::const_iterator end = muctpi_rdo->dataWord().end();
-  for(; cit != end; ++cit) {
-    if (roiWord != RDOtoRoI(*cit)) continue;
-
-    MuCTPI_DataWord_Decoder dwDecoder(*cit);
-    uint32_t bcid = dwDecoder.getBCID();
-    int bcDiff = muctpiBcidDiff(bcid);
-    ATH_MSG_DEBUG(std::dec << bcid << " : " << currentBcid << " diff = " << bcDiff);
-    return bcDiff;
-  }
-
-  ATH_MSG_WARNING("TrigEffJpsiTools::getMuonRoiBcidDiff: "
-                  "No corresponding RoI found: " << roiWord);
-  return 10000;
-}
-
-
-bool
-TrigEffJpsiTools::isOffTimeTgcTrigger() const
-{
-  ATH_MSG_DEBUG("TrigEffJpsiTools::isOffTimeTgcTrigger()");
-  
-  // apply for the run periods D2...D5 [158443, 159113]
-  const EventInfo* eventInfo;
-  StatusCode sc = evtStore()->retrieve(eventInfo);
-  if (sc.isFailure()) {
-    ATH_MSG_WARNING("failed to get EventInfo");
-    return false;
-  }
-  const EventID* eventId = eventInfo->event_ID();
-  int runNumber = eventId->run_number();
-  if (runNumber < 158443) return false;
-  if (runNumber > 159113) return false;
-
-
-  // check trigger configuration
-  const std::string EF_mu0_missingRoi = "EF_mu0_missingRoi";
-  if (not isConfigured(EF_mu0_missingRoi, "EF")) {
-    ATH_MSG_WARNING(EF_mu0_missingRoi << "not configured");
-    return false;
-  }
-
-  const std::string EF_mu0_rpcOnly = "EF_mu0_rpcOnly";
-  if (not isConfigured(EF_mu0_rpcOnly, "EF")) {
-    ATH_MSG_WARNING(EF_mu0_rpcOnly << "not configured");
-    return false;
-  }
-
-  const std::string EF_mu4_MSonly = "EF_mu4_MSonly";
-  if (not isConfigured(EF_mu4_MSonly, "EF")) {
-    ATH_MSG_WARNING(EF_mu4_MSonly << "not configured");
-    return false;
-  }
-
-  const std::string L1_2MU0 = "L1_2MU0";
-  if (not isConfigured(L1_2MU0, "L1")) {
-    ATH_MSG_WARNING(L1_2MU0 << "not configured");
-    return false;
-  }
-
-
-  // accept if event has triggers other than EF_mu0_missingRoi and l1_2mu0
-  bool ef_mu4_msonly = m_trigDecisionTool->isPassed(EF_mu4_MSonly);
-  bool ef_mu0_rpconly = m_trigDecisionTool->isPassed(EF_mu0_rpcOnly);
-  if (ef_mu4_msonly or ef_mu0_rpconly) return false;
-
-  bool ef_mu0_missingRoi = m_trigDecisionTool->isPassed(EF_mu0_missingRoi);
-  bool l1_2mu0 = m_trigDecisionTool->isPassed(L1_2MU0);
-  if ((not ef_mu0_missingRoi) and (not l1_2mu0)) return false;
-
-
-  // get level1 muon rois
-  const LVL1_ROI* lvl1Roi = 0;
-  if (evtStore()->retrieve(lvl1Roi, m_Lvl1RoiName).isFailure() or
-      !lvl1Roi) {
-    ATH_MSG_WARNING("Failed to retrieve " << m_Lvl1RoiName);
-    return false;
-  }  
-
-  bool tgcOffTime = false;
-
-  LVL1_ROI::muons_type muonRoIs = lvl1Roi->getMuonROIs();
-  typedef LVL1_ROI::muons_type::const_iterator iterator;
-  iterator cit = muonRoIs.begin();
-  iterator end = muonRoIs.end();
-
-  for (; cit != end; cit++) {
-    bool inTime = false;
-    int bcDiff = getMuonRoiBcidDiff(cit->getROIWord());
-    switch (bcDiff) {
-    case -2:
-    case -1:
-    case  0:
-      inTime = true;
-      break;
-
-    default:
-      break;
-    }
-
-    if (inTime and (cit->getSource() == Muon_ROI::Barrel)) return false;
-    if (inTime and (bcDiff < 0)) tgcOffTime = true;
-  }
-
-  return tgcOffTime;
-}
-
-
-bool
-TrigEffJpsiTools::EF_mu4_MSOnly_from_EF_mu0_outOfTime1() const
-{
-  const std::string L2_mu0_outOfTime1 = "L2_mu0_outOfTime1";
-
-  if (not m_trigDecisionTool->isPassed("EF_mu0_outOfTime1")) return false;
-  if (not m_trigDecisionTool->isPassed(L2_mu0_outOfTime1)) return false;
-
-  Trig::FeatureContainer fc = m_trigDecisionTool->features(L2_mu0_outOfTime1);
-  std::vector<Trig::Feature<MuonFeature> > l2muons = fc.get<MuonFeature>();
-  std::vector<Trig::Feature<MuonFeature> >::const_iterator cit;
-  for (cit = l2muons.begin(); cit != l2muons.end(); cit++) {
-    const MuonFeature* l2mf = cit->cptr();
-    if (EF_mu4_MSOnly_with_Muid(l2mf)) return true;
-  }
-
-  return false;
-}
-
-
-/*--------------------------------------------------------------------*
- * private methods
- *--------------------------------------------------------------------*/
-void
-TrigEffJpsiTools::getExtrapolationErrorOnEndcap(const Trk::AtaDisc* p,
-                                                Amg::Vector2D* dEtaPhi) const
-{
-  if (!p or !dEtaPhi) {
-    ATH_MSG_WARNING("getExtrapolationErrorOnEndcap: null input pointer");
-    return;
-  }
-
-  (*dEtaPhi)[Trk::locX] = getEtaErrFromRPhi(p);
-
-  (*dEtaPhi)[Trk::locY] = 9999.;
-  const AmgSymMatrix(5) *covMatrix = p->covariance();
-  if(covMatrix){
-    (*dEtaPhi)[Trk::locY] = sqrt((*covMatrix)(Trk::locPhi, Trk::locPhi));
-  }
-}
-
-
-void
-TrigEffJpsiTools::getExtrapolationErrorOnBarrel(const Trk::AtaCylinder* p,
-                                                Amg::Vector2D* dEtaPhi) const
-{
-  if (!p or !dEtaPhi) {
-    ATH_MSG_WARNING("getExtrapolationErrorOnBarrel: null input pointer");
-    return;
-  }
-
-  double radius = p->position().perp();
-  (*dEtaPhi)[Trk::locX] = getEtaErrFromRPhiZ(p);
-  (*dEtaPhi)[Trk::locY] = 9999.;
-  const AmgSymMatrix(5) *covMatrix = p->covariance();
-  if(covMatrix){
-    (*dEtaPhi)[Trk::locY] = sqrt((*covMatrix)(Trk::locRPhi, Trk::locRPhi))/radius;
-  }
-}
-
-
-// dR limit to match 
-double
-TrigEffJpsiTools::getSearchRangeOnEndcap(const Trk::AtaDisc* p) const
-{
-  if (!p) {
-    ATH_MSG_WARNING("getSearchRangeOnEndcap: null input pointer");
-    return false;
-  }
-
-  Amg::Vector2D dEtaPhi;
-  getExtrapolationErrorOnEndcap(p, &dEtaPhi);
-  double searchRange = m_searchRangeOffset + m_searchRangeTolerance *
-    sqrt(dEtaPhi.x()*dEtaPhi.x() + dEtaPhi.y()*dEtaPhi.y());
-
-  double eta = p->position().eta();
-  if (fabs(eta) > m_endcapForwardBoundary) {
-    searchRange += m_roiSizeForward;
-  } else {
-    searchRange += m_roiSizeEndcap;
-  }
-  return searchRange;
-}
-
-
-double
-TrigEffJpsiTools::getSearchRangeOnBarrel(const Trk::AtaCylinder* p) const
-{
-  if (!p) {
-    ATH_MSG_WARNING("getSearchRangeOnBarrel: null input pointer");
-    return false;
-  }
-
-  Amg::Vector2D dEtaPhi;
-  getExtrapolationErrorOnBarrel(p, &dEtaPhi);
-  double searchRange = m_searchRangeOffset + m_searchRangeTolerance *
-    sqrt(dEtaPhi.x()*dEtaPhi.x() + dEtaPhi.y()*dEtaPhi.y()) +
-    m_roiSizeBarrel;
-  return searchRange;
-}
-
-
-double TrigEffJpsiTools::getEtaPhiDistanceAtIp(const Rec::TrackParticle* track1,
-                                               const Rec::TrackParticle* track2) const
-{
-  if (!track1 or !track2) {
-    ATH_MSG_WARNING("getEtaPhiDistanceAtIp: null input pointer");
-    return -1.;
-  }
-
-  double eta[2] = {track1->eta(), track2->eta()};
-  double phi[2] = {track1->phi(), track2->phi()};
-  return getEtaPhiDistance(eta[0], eta[1], phi[0], phi[1]);
-}
-
-
-double
-TrigEffJpsiTools::getEtaPhiDistanceOnEndcap(const Trk::AtaDisc* p1,
-                                            const Trk::AtaDisc* p2) const
-{
-  if (!p1 or !p2) {
-    ATH_MSG_WARNING("getEtaPhiDistanceOnEndcap: null input pointer");
-    return -1.;
-  }
-
-  return getEtaPhiDistance(p1->position().eta(), p2->position().eta(),
-                           p1->position().phi(), p2->position().phi());
-}
-
-
-double
-TrigEffJpsiTools::getEtaPhiDistanceOnBarrel(const Trk::AtaCylinder* p1,
-                                            const Trk::AtaCylinder* p2) const
-{
-  if (!p1 or !p2) {
-    ATH_MSG_WARNING("getEtaPhiDistanceOnBarrel: null input pointer");
-    return -1.;
-  }
-
-  return getEtaPhiDistance(p1->position().eta(), p2->position().eta(),
-                           p1->position().phi(), p2->position().phi());
-}
-
-
-double
-TrigEffJpsiTools::getEtaPhiDistance(double eta1,
-                                    double eta2,
-                                    double phi1,
-                                    double phi2) const
-{
-  double deta = getEtaDistance(eta1, eta2);
-  double dphi = getPhiDistance(phi1, phi2);
-
-  double dr = sqrt(deta*deta + dphi*dphi);
-  return dr;
-}
-
-
-double
-TrigEffJpsiTools::getEtaDistance(double eta1,
-				 double eta2) const
-{
-  return fabs(eta1 - eta2);
-}
-
-
-double
-TrigEffJpsiTools::getPhiDistance(double phi1,
-				 double phi2) const
-{
-  double dphi = fabs(phi1 - phi2);
-
-  if (dphi > M_PI) dphi = 2.*M_PI - dphi;
-  return dphi;
-}
-
-
-bool
-TrigEffJpsiTools::isSeparated(const Rec::TrackParticle* track1,
-                              const Rec::TrackParticle* track2) const
-{
-  if (!track1 or !track2) {
-    ATH_MSG_WARNING("isSeparated: null input pointer");
-    return false;
-  }
-
-  return isSeparatedOnEndcap(track1, track2) and
-    isSeparatedOnBarrel(track1, track2);
-
-}
-
-bool
-TrigEffJpsiTools::isSeparatedOnEndcap(const Rec::TrackParticle* track1,
-                                      const Rec::TrackParticle* track2) const
-{
-  if (!track1 or !track2) {
-    ATH_MSG_WARNING("isSeparatedOnEndcap: null input pointer");
-    return false;
-  }
-
-  bool isSeparated = true;
-
-  double pivotZ1 = track1->eta() < 0. ? -m_endcapPivotPlaneZ : m_endcapPivotPlaneZ;
-  const Trk::AtaDisc* measurement1 = extrapolateToEndcap(track1, pivotZ1);
-  double pivotZ2 = track2->eta() < 0. ? -m_endcapPivotPlaneZ : m_endcapPivotPlaneZ;
-  const Trk::AtaDisc* measurement2 = extrapolateToEndcap(track2, pivotZ2);
-
-  if (measurement1 and measurement2) {
-    double searchRange = getSearchRangeOnEndcap(measurement1) +
-      getSearchRangeOnEndcap(measurement2);  
-    double dr = getEtaPhiDistanceOnEndcap(measurement1, measurement2);
-    if (dr < searchRange) isSeparated = false;
-  }
-
-  delete measurement1;
-  delete measurement2;
-
-  return isSeparated;
-}
-
-bool
-TrigEffJpsiTools::isSeparatedOnBarrel(const Rec::TrackParticle* track1,
-                                      const Rec::TrackParticle* track2) const
-{
-  if (!track1 or !track2) {
-    ATH_MSG_WARNING("isSeparatedOnBarrel: null input pointer");
-    return false;
-  }
-
-  bool isSeparated = true;
-
-  double pivotRadius = m_barrelPivotPlaneRadius;
-  const Trk::AtaCylinder* measurement1 = extrapolateToBarrel(track1, pivotRadius);
-  const Trk::AtaCylinder* measurement2 = extrapolateToBarrel(track2, pivotRadius);
-
-  if (measurement1 and measurement2) {
-    double searchRange = getSearchRangeOnBarrel(measurement1) +
-      getSearchRangeOnBarrel(measurement2);  
-    double dr = getEtaPhiDistanceOnBarrel(measurement1, measurement2);
-    if (dr < searchRange) isSeparated = false;
-  }
-
-  delete measurement1;
-  delete measurement2;
-
-  return isSeparated;
-}
-
-
-//--- convert local errors to global ---//
-// Disc to global
-double
-TrigEffJpsiTools::getEtaErrFromRPhi(const Trk::AtaDisc* p) const
-{
-  if (!p) {
-    ATH_MSG_WARNING("getEtaErrFromRPhi: null input pointer");
-    return -1;
-  }
-
-  double localR = p->localPosition().x();
-  double globalZ = p->position().z();
-  double dLocalR = 9999.;
-  const AmgSymMatrix(5) *covMatrix = p->covariance();
-  if(covMatrix){
-    dLocalR = sqrt((*covMatrix)(Trk::locR, Trk::locR));
-  }
-
-  double radius = sqrt(localR*localR + globalZ*globalZ);
-  double etaError = fabs(globalZ/localR/radius*dLocalR);  
-  return etaError;
-}
-
-
-// Cylinder to global
-double
-TrigEffJpsiTools::getEtaErrFromRPhiZ(const Trk::AtaCylinder* p) const
-{
-  if (!p) {
-    ATH_MSG_WARNING("getEtaErrFromRPhiZ: null input pointer");
-    return -1;
-  }
-
-  double localR = p->position().perp();
-  double localZ = p->localPosition().y();
-  double dLocalZ = 9999.;
-  const AmgSymMatrix(5) *covMatrix = p->covariance();
-  if(covMatrix){
-    dLocalZ = sqrt((*covMatrix)(Trk::locZ, Trk::locZ));
-  }
-
-  double radius = sqrt(localR*localR + localZ*localZ);
-  double etaError = fabs(1./radius*dLocalZ);
-  return etaError;
-}
-
-
-
-void
-TrigEffJpsiTools::validateCache(Cache& map) const
-{
-  const EventInfo* eventInfo = 0;
-  if (evtStore()->retrieve(eventInfo).isFailure() or !eventInfo) {
-    ATH_MSG_WARNING("validateCache: Failed to retrieve EventInfo");
-    return;
-  }
-
-  const EventID* eventId = eventInfo->event_ID();
-  if (!eventId) {
-    ATH_MSG_WARNING("validateCache: Failed to get EventID");
-    return;
-  }
-
-  if (((map.runNo == eventId->run_number()) and // new evt
-       (map.evtNo != eventId->event_number())) or
-      (map.runNo != eventId->run_number())) {   // new run
-    map.runNo = eventId->run_number();
-    map.evtNo = eventId->event_number();
-    ATH_MSG_DEBUG("validateCache: clear cache: " << map.runNo <<
-                  ", " << map.evtNo);
-    CacheMap::const_iterator cit;
-    for (cit = map.tp.begin(); cit != map.tp.end(); cit++) {
-      delete cit->second;
-    }
-    map.tp.clear();
-  }
-
-  return;
-}
-
-
-
-const Trk::AtaDisc*
-TrigEffJpsiTools::extrapolateToEndcap(const Rec::TrackParticle *track,
-                                      const double pivotZ,
-                                      const bool useCache) const
-{
-  if (!track) {
-    ATH_MSG_WARNING("extrapolateToEndcap: null input pointer");
-    return 0;
-  }
-
-  if (useCache) {
-    validateCache(m_cacheEndcap);
-    CacheMap::const_iterator cit;
-    cit = m_cacheEndcap.tp.find(track);
-    if (cit != m_cacheEndcap.tp.end()) {
-      // ATH_MSG_DEBUG("extrapolateToEndcap: use cache: " << track); // TODO: Removed as track dump segfaults in 17.3.1
-      if (cit->second)
-        return dynamic_cast<const Trk::AtaDisc*>(cit->second);
-      return 0;
-    }
-
-    m_cacheEndcap.tp.insert(CachePair(track, 0));
-  }
-  // ATH_MSG_DEBUG("extrapolateToEndcap: " << *track); // TODO: Removed as track dump segfaults in 17.3.1
-
-
-  const Trk::Perigee *perigee = track->measuredPerigee();
-  if (!perigee) {
-    ATH_MSG_WARNING("extrapolateToEndcap: null perigee");
-    return 0;
-  }
-
-  Amg::Vector3D endcapCentre(0., 0., pivotZ);
-  Amg::Transform3D* matrix = new Amg::Transform3D(Amg::RotationMatrix3D::Identity(), endcapCentre);
-
-  Trk::DiscSurface* disc = 
-    new Trk::DiscSurface(matrix,
-                         m_endcapPivotPlaneMinimumRadius,
-                         m_endcapPivotPlaneMaximumRadius);
-  if (!disc) {
-    ATH_MSG_WARNING("new Trk::DiscSurface failed."); 
-    delete matrix; 
-    matrix = 0; 
-    return 0;
-  }
-
-  bool boundaryCheck = true;
-  const Trk::Surface* surface = disc;
-  const Trk::TrackParameters* p = m_extrapolator->extrapolate(*perigee,
-							      *surface,
-							      Trk::alongMomentum,
-							      boundaryCheck,
-							      Trk::muon);
-  delete disc; 
-  disc = 0; 
-  surface = 0;
-  matrix = 0; 
-
-  if (useCache) m_cacheEndcap.tp[track] = p;
-  if (!p) return 0;
-  const Trk::AtaDisc *measurement = 
-    dynamic_cast<const Trk::AtaDisc*>(p);
-  return measurement;
-}
-
-
-const Trk::AtaCylinder*
-TrigEffJpsiTools::extrapolateToBarrel(const Rec::TrackParticle *track,
-                                      const double pivotRadius,
-                                      const bool useCache) const
-{
-  if (!track) {
-    ATH_MSG_WARNING("extrapolateToBarrel: null input pointer");
-    return 0;
-  }
-
-  if (useCache) {
-    validateCache(m_cacheBarrel);
-    CacheMap::const_iterator cit;
-    cit = m_cacheBarrel.tp.find(track);
-    if (cit != m_cacheBarrel.tp.end()) {
-      ATH_MSG_DEBUG("extrapolateToBarrel: use cache: " << track);
-      if (cit->second)
-        return dynamic_cast<const Trk::AtaCylinder*>(cit->second);
-      return 0;
-    }
-
-    m_cacheBarrel.tp.insert(CachePair(track, 0));
-  }
-  ATH_MSG_DEBUG("extrapolateToBarrel: " << *track);
-
-  const Trk::Perigee *perigee = track->measuredPerigee();
-  if (!perigee) {
-    ATH_MSG_WARNING("extrapolateToBarrel: null perigee");
-    return 0;
-  }
-
-  Amg::Vector3D barrelCentre(0., 0., 0.);
-  Amg::Transform3D* matrix = new Amg::Transform3D(Amg::RotationMatrix3D::Identity(), barrelCentre);
-
-  Trk::CylinderSurface* cylinder = 
-    new Trk::CylinderSurface(matrix,
-                             pivotRadius,
-                             m_barrelPivotPlaneHalfLength);
-  if (!cylinder) {
-    ATH_MSG_WARNING("new Trk::CylinderSurface failed.");
-    delete matrix;
-    matrix = 0;
-    return 0;
-  }
-
-  bool boundaryCheck = true;
-  const Trk::Surface* surface = cylinder;
-  const Trk::TrackParameters* p = m_extrapolator->extrapolate(*perigee,
-							      *surface,
-							      Trk::alongMomentum,
-							      boundaryCheck,
-							      Trk::muon);
-  delete cylinder;
-  cylinder = 0;
-  surface = 0;
-  matrix = 0;
-
-  if (useCache) m_cacheBarrel.tp[track] = p;
-  if (!p) return 0;
-  const Trk::AtaCylinder* measurement = 
-    dynamic_cast<const Trk::AtaCylinder*>(p);
-  return measurement; 
-}
-
-
-const std::vector<const Trk::TrackStateOnSurface*>*
-TrigEffJpsiTools::extrapolateToEndcapM(const Rec::TrackParticle *track,
-                                       const double pivotZ) const
-{
-  if (!track) {
-    ATH_MSG_WARNING("extrapolateToEndcapM: null input pointer");
-    return 0;
-  }
-
-  const Trk::Perigee *perigee = track->measuredPerigee();
-  if (!perigee) {
-    ATH_MSG_WARNING("extrapolateToEndcapM: null perigee");
-    return 0;
-  }
-
-  Amg::Vector3D endcapCentre(0., 0., pivotZ);
-  Amg::Transform3D* matrix = new Amg::Transform3D(Amg::RotationMatrix3D::Identity(), endcapCentre);
-
-  Trk::DiscSurface* disc = 
-    new Trk::DiscSurface(matrix,
-                         m_endcapPivotPlaneMinimumRadius,
-                         m_endcapPivotPlaneMaximumRadius);
-  if (!disc) {
-    ATH_MSG_WARNING("new Trk::DiscSurface failed.");
-    delete matrix;
-    matrix = 0;
-    return 0;
-  }
-
-  bool boundaryCheck = true;
-  const Trk::Surface* surface = disc;
-  const std::vector<const Trk::TrackStateOnSurface*>* p =
-    m_extrapolator->extrapolateM(*perigee, *surface, Trk::alongMomentum,
-                                 boundaryCheck, Trk::muon);
-  
-  delete disc;
-  disc = 0;
-  surface = 0;
-  matrix = 0; 
-
-  return p;
-}
-
-
-const std::vector<const Trk::TrackStateOnSurface*>*
-TrigEffJpsiTools::extrapolateToBarrelM(const Rec::TrackParticle *track,
-                                       const double pivotRadius) const
-{
-  if (!track) {
-    ATH_MSG_WARNING("extrapolateToBarrelM: null input pointer");
-    return 0;
-  }
-
-  const Trk::Perigee *perigee = track->measuredPerigee();
-  if (!perigee) {
-    ATH_MSG_WARNING("extrapolateToBarrelM: null perigee");
-    return 0;
-  }
-
-  Amg::Vector3D barrelCentre(0., 0., 0.);
-  Amg::Transform3D* matrix = new Amg::Transform3D(Amg::RotationMatrix3D::Identity(), barrelCentre);
-
-  Trk::CylinderSurface* cylinder;
-  cylinder = new Trk::CylinderSurface(matrix,
-                                      pivotRadius,
-                                      m_barrelPivotPlaneHalfLength);
-
-  if (!cylinder) {
-    ATH_MSG_WARNING("new Trk::CylinderSurface failed.");
-    delete matrix;
-    matrix = 0;
-    return 0;
-  }
-
-  bool boundaryCheck = true;
-  const Trk::Surface* surface = cylinder;
-  const std::vector<const Trk::TrackStateOnSurface*>* p = 
-    m_extrapolator->extrapolateM(*perigee, *surface, Trk::alongMomentum,
-                                 boundaryCheck, Trk::muon);
-  
-  delete cylinder;
-  cylinder = 0;
-  surface = 0;
-  matrix = 0; 
-
-  return p;
-}
-
-
-bool
-TrigEffJpsiTools::isTriggered(const struct Search& centre,
-                              const int thresholdNumber,
-                              const LVL1_ROI::muons_type& muonRoIs) const
-{
-  typedef LVL1_ROI::muons_type::const_iterator iterator;
-  iterator cit_end = muonRoIs.end();
-  for (iterator cit = muonRoIs.begin(); cit != cit_end; cit++) {
-    const Muon_ROI *roi = &(*cit);
-    if (roi->getThrNumber() < thresholdNumber) continue;
-
-    double eta = roi->eta(); 
-    double phi = roi->phi();
-    double dr = getEtaPhiDistance(centre.eta, eta, centre.phi, phi);
-    if (dr < centre.searchRange) return true;
-  }
-  return false;
-}
-
-
-bool
-TrigEffJpsiTools::isTriggeredOnEndcap(const Rec::TrackParticle* track,
-                                      LVL1_ROI::muons_type& muonRoIs,
-                                      int thresholdNumber) const
-{
-  if (!track) {
-    ATH_MSG_WARNING("isTriggeredOnEndcap: null input pointer");
-    return 0;
-  }
-
-  double pivotZ = track->eta() < 0. ? -m_endcapPivotPlaneZ : m_endcapPivotPlaneZ;
-  const Trk::AtaDisc* measurement = extrapolateToEndcap(track, pivotZ);
-  if (!measurement) {
-    ATH_MSG_DEBUG("Failed to extrapolate to endcap");
-    return false;
-  }
-
-  struct Search centre;
-  centre.eta = measurement->position().eta();
-  centre.phi = measurement->position().phi();
-  centre.searchRange = getSearchRangeOnEndcap(measurement);
-
-  return isTriggered(centre, thresholdNumber, muonRoIs);
-}
-
-
-bool
-TrigEffJpsiTools::isTriggeredOnBarrel(const Rec::TrackParticle* track,
-                                      LVL1_ROI::muons_type& muonRoIs,
-                                      int thresholdNumber) const
-{
-  if (!track) {
-    ATH_MSG_WARNING("isTriggeredOnBarrel: null input pointer");
-    return 0;
-  }
-
-  double pivotRadius = m_barrelPivotPlaneRadius;
-  const Trk::AtaCylinder* measurement = extrapolateToBarrel(track,
-							    pivotRadius);
-  if (!measurement) {
-    ATH_MSG_DEBUG("Failed to extrapolate to barrel");
-    return false;
-  }
-  struct Search centre;
-  centre.eta = measurement->position().eta();
-  centre.phi = measurement->position().phi();
-  centre.searchRange = getSearchRangeOnBarrel(measurement);
-
-  //delete measurement;
-  return isTriggered(centre, thresholdNumber, muonRoIs);
-}
-
-
-int
-TrigEffJpsiTools::getRoiRegion(int roiWord) const
-{
-  // ref: Muon_ROI::getSource() 
-  unsigned int word = (unsigned int) roiWord;
-  unsigned int sectorAddress = ((word >> 14) & 0xff);
-
-  if (sectorAddress & 0x80) { // endcap
-    return ENDCAP;
-
-  } else if (sectorAddress & 0x40) { // forward
-    return ENDCAP;
-
-  } else { // barrel
-    return BARREL;
-  }
-
-  return -1;
-}
-
-
-unsigned int
-TrigEffJpsiTools::getBitMaskValue(const unsigned int value,
-                                  const unsigned int mask) const
-{
-  // ref: RecMuonRoI::getBitMaskValue()
-  unsigned int maskcopy = mask;
-  unsigned int result = value & mask;
-
-  if (mask != 0) {
-    while ((maskcopy & 0x00000001) == 0) {
-      maskcopy = maskcopy >> 1;
-      result = result >> 1;
-    }
-  }
-  return result;
-}
-
-
-StatusCode
-TrigEffJpsiTools::getRoiSize(const unsigned int roiWord,
-                             double* etaSize,
-                             double* phiSize) const
-{
-  switch (getRoiRegion(roiWord)) {
-  case ENDCAP:
-    return getRoiSizeTgc(roiWord, etaSize, phiSize);
-
-  case BARREL:
-    return getRoiSizeRpc(roiWord, etaSize, phiSize);
-
-  default:
-    break;
-  }
-
-  return StatusCode::FAILURE;
-}
-
-
-StatusCode
-TrigEffJpsiTools::getRoiSizeTgc(const unsigned int roiWord,
-                                double* etaSize,
-                                double* phiSize) const
-{
-  if (!etaSize or !phiSize) {
-    ATH_MSG_FATAL("getRoiSizeTgc: null input pointer");
-    return StatusCode::FAILURE;
-  }
-
-  double etaMin, etaMax, phiMin, phiMax;
-  m_tgcRoiService->RoIsize(roiWord, etaMin, etaMax, phiMin, phiMax);
-
-  *etaSize = fabs(etaMax - etaMin);
-  *phiSize = fabs(phiMax - phiMin);
-
-  return StatusCode::SUCCESS;
-}
-
-
-StatusCode
-TrigEffJpsiTools::getRoiSizeRpc(const unsigned int roiWord,
-                                double* etaSize,
-                                double* phiSize) const
-{
-  if (!etaSize or !phiSize) {
-    ATH_MSG_FATAL("getRoiSizeRpc: null input pointer");
-    return StatusCode::FAILURE;
-  }
-
-  // ref: RPCRecRoiSvc::reconstruct()
-  *etaSize = *phiSize = -1.e30;
-  
-  double etaMin, etaMax, phiMin, phiMax;
-  m_rpcRoiService->RoIsize(roiWord, etaMin, etaMax, phiMin, phiMax);
-  
-  *etaSize = fabs(etaMax - etaMin);
-  *phiSize = fabs(phiMax - phiMin);
-  
-  return StatusCode::SUCCESS;
-}
-
-StatusCode
-TrigEffJpsiTools::getRioOnTriggerChamber(const Trk::Track* track,
-                                         std::vector<const Trk::RIO_OnTrack*>& rots,
-                                         bool pivotOnly) const
-{
-  if (!track) {
-    ATH_MSG_FATAL("getRioOnTriggerChamber: null input pointer");
-    return StatusCode::FAILURE;
-  }
-
-  const DataVector<const Trk::TrackStateOnSurface>* tsos;
-  tsos = track->trackStateOnSurfaces();
-
-  if (!tsos or tsos->empty()) return StatusCode::SUCCESS;
-
-  typedef DataVector<const Trk::TrackStateOnSurface>::const_iterator iterator;
-  iterator cit_end = tsos->end();
-  for (iterator cit = tsos->begin(); cit != cit_end; cit++) {
-    if (not (*cit)->type(Trk::TrackStateOnSurface::Measurement)) continue;
-
-    const Trk::MeasurementBase* measurement = (*cit)->measurementOnTrack();
-
-    const Trk::RIO_OnTrack* rot = 0;
-    Trk::RoT_Extractor::extract(rot, measurement);
-    if (!rot) continue;
-
-    const Identifier id = rot->identify();
-    if (not m_muonIdHelper->isMuon(id)) continue;
-    if (not m_muonIdHelper->isTrigger(id)) continue;
-
-    bool isTgc = m_muonIdHelper->isTgc(id);
-    bool isRpc = m_muonIdHelper->isRpc(id);
-
-    if (isTgc and isRpc) {
-      ATH_MSG_FATAL("rot belonging to both rpc and tgc()");
-      return StatusCode::FAILURE;
-    }
-
-    // ref; MuonChamberNameConverter.cxx - convertChamberName(...)
-    bool isPivot = false;
-    if (isRpc) {
-      const RpcIdHelper & rpcIdHelper = m_muonIdHelper->rpcIdHelper();
-      switch (rpcIdHelper.stationName(id)) {
-      case 2: // BML
-      case 3: // BMS
-      case 8: // BMF
-	if (rpcIdHelper.doubletR(id) == 2) { // RPC2
-	  isPivot = true;
-	}
-	break;
-
-      default:
-	isPivot = false;
-	break;
-      }
-    }
-      
-    if (isTgc) {
-      const TgcIdHelper & tgcIdHelper = m_muonIdHelper->tgcIdHelper();
-      switch (tgcIdHelper.stationName(id)) {
-      case 45: // T3F
-      case 46: // T3E
-	isPivot = true;
-	break;
-
-      default:
-	isPivot = false;
-	break;
-      }
-    }
-
-    if (pivotOnly) {
-      if (isPivot) {
-        rots.push_back(rot);
-      }
-    } else {
-      rots.push_back(rot);
-    }
-
-  } // TrackStateOnSurface
-
-  return StatusCode::SUCCESS;
-}
-
-
-int
-TrigEffJpsiTools::getL1PtThreshold(const std::string& ptname) const
-{
-  int pt = -1;
-
-  if (ptname == "L1_MU0_COMM" or ptname == "MU0_COMM") {
-    // RPC commissioning trigger, 3-station full open
-    // PT3 MU10, PT4 MU0_COMM, PT5 MU15 in early 2010 data taking
-    // assign 11 GeV for this trigger to get valid integer.
-    return 11;
-  }
-
-  const std::string prefix = "MU";
-  const size_t found = ptname.find(prefix);
-  if (found == std::string::npos) {
-    ATH_MSG_WARNING("getL1PtThreshold: cannot parse input string: " << ptname);
-    return pt;
-  }
-
-  const std::string delimiter = "_";
-  const size_t first = ptname.find_first_of(delimiter);
-  if (first != ptname.find_last_of(delimiter)) {
-    ATH_MSG_DEBUG("getL1PtThreshold: skip " << ptname);
-    return pt;  // consider single muon trigger only
-  }
-  
-  size_t offset = found + prefix.size();
-  std::string value = ptname.substr(offset);
-    
-  std::istringstream iss(value);
-  if (not (iss >> pt)) {
-    ATH_MSG_WARNING("getL1PtThreshold: Failed int conversion " << value);
-  }
-
-  ATH_MSG_DEBUG("getL1PtThreshold: " << ptname << " = " << pt);
-
-  return pt;
-}
-
-
-bool
-TrigEffJpsiTools::isConfigured(const std::string& chainName,
-                               const std::string& prefix) const
-{
-  if (chainName.find(prefix) != 0) {
-    ATH_MSG_WARNING("isConfigured: unexpected chain name: " << chainName);
-    return false;
-  }
-
-  const Trig::ChainGroup* chain = m_trigDecisionTool->getChainGroup(chainName);
-  if (chain->getListOfTriggers().empty()) {
-    if (msgLvl(MSG::DEBUG)) {
-      ATH_MSG_DEBUG("isConfigured: available triggers for " + prefix);
-      const Trig::ChainGroup *chain = m_trigDecisionTool->getChainGroup(prefix + "_.*");
-      std::vector<std::string> tmpChainName = chain->getListOfTriggers();
-      for (size_t ii = 0; ii < tmpChainName.size(); ii++) {
-        ATH_MSG_DEBUG("                   " << tmpChainName.at(ii));
-      }
-    }
-
-    ATH_MSG_WARNING("isConfigured: " << chainName << " not configured");
-    return false;
-  }
-
-  ATH_MSG_DEBUG("isConfigured: " << chainName << " configured");
-  return true;
-}
-
-
-bool
-TrigEffJpsiTools::getMatchedRoI(const Rec::TrackParticle* track,
-                                struct Match& match) const
-{
-  ATH_MSG_DEBUG("getMatchedRoI(private)");
-
-  match.roiIndex = -1;
-  match.roiWord = 0;
-  match.roiThrNumber = -1;
-  
-  if (!track) {
-    ATH_MSG_WARNING("getMatchedRoI: track pointer is null");
-    return false;
-  }
-
-  double searchRange[NUM_REGION] = {0.};
-  double etaAtPivot[NUM_REGION] = {0.};
-  double phiAtPivot[NUM_REGION] = {0.};
-  double detaAtPivot[NUM_REGION] = {0.};
-  double dphiAtPivot[NUM_REGION] = {0.};
-
-  if (match.etaExTrk) {
-    (*(match.etaExTrk))[Trk::locX] = -1.e30;
-    (*(match.etaExTrk))[Trk::locY] = -1.e30;
-  }
-
-  if (match.phiExTrk) {
-    (*(match.phiExTrk))[Trk::locX] = -1.e30;
-    (*(match.phiExTrk))[Trk::locY] = -1.e30;
-  }
-
-  // the extrapolation
-  double pivotZ = track->eta() < 0. ? -m_endcapPivotPlaneZ : m_endcapPivotPlaneZ;
-  const Trk::AtaDisc* disc = extrapolateToEndcap(track, pivotZ);
-  double pivotRadius = m_barrelPivotPlaneRadius;
-  const Trk::AtaCylinder* cylinder = extrapolateToBarrel(track, pivotRadius);
-
-  if (!disc and !cylinder) return false;
-
-  if (disc) {
-    Amg::Vector2D dEtaPhi;
-    getExtrapolationErrorOnEndcap(disc, &dEtaPhi);
-
-    searchRange[ENDCAP] = getSearchRangeOnEndcap(disc);
-    etaAtPivot[ENDCAP] = disc->position().eta();
-    phiAtPivot[ENDCAP] = disc->position().phi();
-    detaAtPivot[ENDCAP] = dEtaPhi.x();
-    dphiAtPivot[ENDCAP] = dEtaPhi.y();
-    match.endcap = true;
-
-    if (match.etaExTrk) {
-      (*(match.etaExTrk))[Trk::locX] = etaAtPivot[ENDCAP];
-      (*(match.etaExTrk))[Trk::locY] = detaAtPivot[ENDCAP];
-    }
-    if (match.phiExTrk) {
-      (*(match.phiExTrk))[Trk::locX] = phiAtPivot[ENDCAP];
-      (*(match.phiExTrk))[Trk::locY] = dphiAtPivot[ENDCAP];
-    }
-    ATH_MSG_DEBUG("getMatchedRoI: endcap: search range = " << searchRange[ENDCAP]);
-    //delete disc;
-  }
-
-  if (cylinder) {
-    Amg::Vector2D dEtaPhi;
-    getExtrapolationErrorOnBarrel(cylinder, &dEtaPhi);
-
-    searchRange[BARREL] = getSearchRangeOnBarrel(cylinder);
-    etaAtPivot[BARREL] = cylinder->position().eta();
-    phiAtPivot[BARREL] = cylinder->position().phi();
-    detaAtPivot[BARREL] = dEtaPhi.x();
-    dphiAtPivot[BARREL] = dEtaPhi.y();
-    match.barrel = true;
-
-    if (match.etaExTrk) {
-      (*(match.etaExTrk))[Trk::locX] = etaAtPivot[BARREL];
-      (*(match.etaExTrk))[Trk::locY] = detaAtPivot[BARREL];
-    }
-    if (match.phiExTrk) {
-      (*(match.phiExTrk))[Trk::locX] = phiAtPivot[BARREL];
-      (*(match.phiExTrk))[Trk::locY] = dphiAtPivot[BARREL];
-    }
-    ATH_MSG_DEBUG("getMatchedRoI: barrel: search range = " << searchRange[BARREL]);
-    //delete cylinder;
-  }
-
-  // get level1 muon rois
-  const LVL1_ROI* lvl1Roi = 0;
-  if (evtStore()->retrieve(lvl1Roi, m_Lvl1RoiName).isFailure() or
-      !lvl1Roi) {
-    ATH_MSG_WARNING("Failed to retrieve " << m_Lvl1RoiName);
-    return false;
-  }  
-  LVL1_ROI::muons_type muonRoIs = lvl1Roi->getMuonROIs();
-
-  // search for the closest roi
-  typedef LVL1_ROI::muons_type::const_iterator iterator;
-  iterator cit = muonRoIs.begin();
-  iterator cit_end = muonRoIs.end();
-  double closest = -1;
-  for (int nRoi = 0; cit != cit_end; cit++, nRoi++) {
-    const Muon_ROI* roi = &(*cit);
-    ATH_MSG_DEBUG("getMatchedRoI: " << *roi);
-    double roiEta = roi->eta(); 
-    double roiPhi = roi->phi();
-    int roiRegion = (roi->getSource() == Muon_ROI::Barrel) ? BARREL : ENDCAP;
-    double dr = getEtaPhiDistance(etaAtPivot[roiRegion], roiEta,
-                                  phiAtPivot[roiRegion], roiPhi);
-    if (dr > searchRange[roiRegion]) continue; 
-    if (closest < 0. or dr < closest) {
-      closest = dr;
-      match.roiIndex = nRoi;
-      if (match.etaExTrk) {
-        (*(match.etaExTrk))[Trk::locX] = etaAtPivot[roiRegion];
-        (*(match.etaExTrk))[Trk::locY] = detaAtPivot[roiRegion];
-      }
-      if (match.phiExTrk) {
-        (*(match.phiExTrk))[Trk::locX] = phiAtPivot[roiRegion];
-        (*(match.phiExTrk))[Trk::locY] = dphiAtPivot[roiRegion];
-      }
-    }
-  }
-
-  if (match.roiIndex < 0) return false;
-
-  const Muon_ROI roi = muonRoIs.at(match.roiIndex);
-  match.roiWord = roi.getROIWord();
-  match.roiThrNumber = roi.getThrNumber();
-  match.roiThrValue = getL1PtThreshold(roi.getThrName());
-  match.roiEta = roi.getEta();
-  match.roiPhi = roi.getPhi();
-  if (roi.getSource() == Muon_ROI::Barrel) {
-    match.barrel = true;
-    match.endcap = false;
-  } else {
-    match.barrel = false;
-    match.endcap = true;
-  }
-  ATH_MSG_DEBUG("getMatchedRoI: matched " << &roi << " : " << roi);
-
-  return true;
-}
-
-
-
-bool
-TrigEffJpsiTools::isTriggeredMuonHLT(const Rec::TrackParticle* track,
-                                     const std::string& chainName,
-                                     const Trig::ChainGroup* cg) const
-{
-  struct Match match;
-  if (not getMatchedRoI(track, match)) {
-    ATH_MSG_DEBUG("isTriggeredMuonHLT:getMatchedRoI: no " << chainName);
-    return false;
-  }
-  ATH_MSG_DEBUG("match roi: " << match.roiIndex);
-
-
-  const Trig::FeatureContainer fc = cg->features(TrigDefs::alsoDeactivateTEs);
-  const std::vector<Trig::Combination>& combinations = fc.getCombinations();
-  ATH_MSG_DEBUG("isTriggeredMuonHLT: number of combinations:" << combinations.size());
-  bool isTriggered = false;
-
-  std::vector<Trig::Combination>::const_iterator cit;
-  for (cit = combinations.begin(); cit != combinations.end(); cit++) {
-    const Trig::Combination& combination = *cit;
-    if (not combination.active()) {
-      ATH_MSG_DEBUG("isTriggeredMuonHLT: combination " << combination << " is not active");
-      continue;
-    }
-    ATH_MSG_DEBUG("isTriggeredMuonHLT: combination " << combination << " is active");
-
-    if (msgLvl(MSG::DEBUG)) {
-      const std::vector<const HLT::TriggerElement*>& tes = combination.tes();
-      for (size_t jj = 0; jj < tes.size(); jj++) {
-        ATH_MSG_DEBUG("TE name[" << jj << "] = " << Trig::getTEName(*(tes.at(jj))));
-      }
-    }
-
-
-    const std::vector<Trig::Feature<TrigRoiDescriptor> > features =
-      combination.get<TrigRoiDescriptor>("initialRoI", TrigDefs::alsoDeactivateTEs);
-    ATH_MSG_DEBUG("isTriggeredMuonHLT: number of muon features: " << features.size());
-
-    for (size_t ii = 0; ii < features.size(); ii++) {
-      const Trig::Feature<TrigRoiDescriptor> feature = features[ii];
-      const TrigRoiDescriptor* roi = feature.cptr();
-      const HLT::TriggerElement* te = features[ii].te();
-      ATH_MSG_DEBUG("feature: " << feature);
-      ATH_MSG_DEBUG("roi word: " << roi->roiWord() << " ref: " << match.roiWord);
-      ATH_MSG_DEBUG("TE name(): " << Trig::getTEName(*te));
-
-      if (roi->roiWord() == match.roiWord) {
-        isTriggered = true;
-        ATH_MSG_DEBUG("isTriggeredMuonHLT: " << chainName << " triggered");
-        break;
-      }
-    }
-    if (isTriggered) break;
-  }
-
-  return isTriggered;
-}
-
-
-
-bool
-TrigEffJpsiTools::isTriggeredMuonHLTwMuonFeature(const Rec::TrackParticle* track,
-                                                 const std::string& chainName,
-                                                 const Trig::ChainGroup* cg) const
-{
-  struct Match match;
-  if (not getMatchedRoI(track, match)) {
-    ATH_MSG_DEBUG("isTriggeredMuonHLTwMuonFeature:getMatchedRoI: no " << chainName);
-    return false;
-  }
-  ATH_MSG_DEBUG("match roi: " << match.roiIndex);
-
-
-  const Trig::FeatureContainer fc = cg->features(TrigDefs::alsoDeactivateTEs);
-  const std::vector<Trig::Combination>& combinations = fc.getCombinations();
-  ATH_MSG_DEBUG("isTriggeredMuonHLTwMuonFeature: number of combinations:" << combinations.size());
-  bool isTriggered = false;
-
-  std::vector<Trig::Combination>::const_iterator cit;
-  for (cit = combinations.begin(); cit != combinations.end(); cit++) {
-    const Trig::Combination& combination = *cit;
-    if (not combination.active()) {
-      ATH_MSG_DEBUG("isTriggeredMuonHLTwMuonFeature: combination " << combination << " is not active");
-      continue;
-    }
-    ATH_MSG_DEBUG("isTriggeredMuonHLTwMuonFeature: combination " << combination << " is active");
-
-    if (msgLvl(MSG::DEBUG)) {
-      const std::vector<const HLT::TriggerElement*>& tes = combination.tes();
-      for (size_t jj = 0; jj < tes.size(); jj++) {
-        ATH_MSG_DEBUG("TE name[" << jj << "] = " << Trig::getTEName(*(tes.at(jj))));
-      }
-    }
-
-
-    const std::vector<Trig::Feature<MuonFeature> > features =
-      combination.get<MuonFeature>("", TrigDefs::alsoDeactivateTEs);
-    ATH_MSG_DEBUG("isTriggeredMuonHLTwMuonFeature: number of muon features: " << features.size());
-
-    for (size_t ii = 0; ii < features.size(); ii++) {
-      const Trig::Feature<MuonFeature> feature = features[ii];
-      const HLT::TriggerElement* te = features[ii].te();
-      Trig::Feature<Muon_ROI> roiFeature = m_trigDecisionTool->ancestor<Muon_ROI>(te);
-      const Muon_ROI* roi = roiFeature.cptr(); 
-      //const MuonFeature* mf = feature.cptr();
-      //ATH_MSG_DEBUG("MuonFeature: " << str(mf) << " algoid = " << mf->algoId()); // MuonFeatureDetails.h
-      ATH_MSG_DEBUG("feature: " << feature);
-      ATH_MSG_DEBUG("roi word: " << roi->getROIWord() << " ref: " << match.roiWord);
-      ATH_MSG_DEBUG("TE name(): " << Trig::getTEName(*te));
-
-      if (roi->getROIWord() == match.roiWord) {
-        isTriggered = true;
-        ATH_MSG_DEBUG("isTriggeredMuonHLTwMuonFeature: " << chainName << " triggered");
-        break;
-      }
-    }
-    if (isTriggered) break;
-  }
-
-  return isTriggered;
-}
-
-
-
-bool
-TrigEffJpsiTools::addTrigObject(TrigObject& trig, TrigObjectMap* map, bool appendIfExists) const
-{
-  TrigObjectMap::iterator mIt = map->find( trig.id );
-  if (mIt == map->end()) { // Element does not exist in map
-    ATH_MSG_DEBUG( "track not in map, will add , comb Id: " << trig.id);
-    std::pair<TrigObjectMap::iterator, bool> rc;
-    rc = map->insert(TrigObjectPair(trig.id, trig));
-    if (not rc.second) {
-      ATH_MSG_WARNING( "pointerMap: map key " << trig.id << " duplicated ");
-    }
-    return true;
-  } else { // Element exists in map
-    if (appendIfExists) {
-      // Add element's name and combinations to existing element
-      ATH_MSG_DEBUG( "track already in map will add name, combId " << trig.id);
-      mIt->second.names.push_back(trig.names[0]);
-      //mIt->second.daughterIds.push_back(trig.daughterIds[0]);
-      mIt->second.combIds.push_back(trig.combIds[0]);
-      mIt->second.efObjIds.push_back(trig.efObjIds[0]);
-    }
-    return false;
-  }
-}
-
-
-/**
- * @param data_word Data word from the MuCTPI_RDO object
- * @returns The RoI word created from the data word
- */
-uint32_t
-TrigEffJpsiTools::RDOtoRoI(uint32_t data_word) const
-{
-  // MuCTPI_RDO to MuCTPIRoI
-  // ref: Fig 3.6 and Fig 3.8 in https://edms.cern.ch/file/248757/1/mirod.pdf
-  return (((data_word & 0x8000000) >> 4) | ((data_word & 0x3fe0000) >> 3) |
-          (data_word & 0x3fff));
-}
-
-
-bool
-TrigEffJpsiTools::EF_mu4_MSOnly_with_Muid(const MuonFeature* mf) const
-{
-  // apply hypo cut
-  if (not hasPassedMuFast(mf)) return false;
-
-
-  // find matching level roi
-  const LVL1_ROI* lvl1Roi = 0;
-  if (evtStore()->retrieve(lvl1Roi, m_Lvl1RoiName).isFailure() or
-      !lvl1Roi) {
-    ATH_MSG_WARNING("TrigEffJpsiTools::EF_mu4_MSOnly_with_Muid: Failed to retrieve " << m_Lvl1RoiName);
-    return false;
-  }  
-
-  LVL1_ROI::muons_type muonRoIs = lvl1Roi->getMuonROIs();
-  typedef LVL1_ROI::muons_type::const_iterator roi_it;
-  const double eta = mf->eta();
-  const double phi = mf->phi();
-  double minDist = 1.e30;
-  for (roi_it cit = muonRoIs.begin(); cit != muonRoIs.end(); cit++) {
-    double dist = getEtaPhiDistance(cit->eta(), eta, cit->phi(), phi);
-    if (dist < minDist) minDist = dist;
-  }
-
-  if (minDist > 0.5) return false;
-
-
-  // find matching muid muon
-  const Analysis::MuonContainer* muons = 0;
-  if (evtStore()->retrieve(muons, "MuidMuonCollection").isFailure() or
-      !muons) {
-    ATH_MSG_WARNING("TrigEffJpsiTools::EF_mu4_MSOnly_with_MuidSA: Failed to retrieve MuidMuonCollection");
-    return false;
-  }
-
-  minDist = 0.1;
-  typedef Analysis::MuonContainer::const_iterator mc_it;
-  for (mc_it cit = muons->begin(); cit != muons->end(); cit++) {
-    const Analysis::Muon* muon = *cit;
-    uint16_t allAuthors = muon->allAuthors();
-    if ((allAuthors & (0x1 << 10)) or // MuTagIMO
-        (allAuthors & (0x1 << 3)) or  // MuidSA
-        (allAuthors & (0x1 << 4))) {  // MuidCo
-      double dist = getEtaPhiDistance(muon->eta(), eta, muon->phi(), phi);
-      if (dist < minDist) {
-        const Rec::TrackParticle* tp;
-        tp = muon->muonSpectrometerTrackParticle();
-        if (!tp) tp = muon->innerExtrapolatedTrackParticle();
-        if (!tp) tp = muon->inDetTrackParticle();
-        if (hasPassedTrigMuonEF(tp)) return true;
-      }
-    }
-  }
-
-  return false;
-}
-
-
-bool
-TrigEffJpsiTools::hasPassedMuFast(const MuonFeature* mf) const
-{
-  // https://svnweb.cern.ch/trac/atlasoff/browser/Trigger/TrigHypothesis/TrigMuonHypo/trunk/python/TrigMuonHypoConfig.py
-  double pt = mf->pt();
-  double eta = std::abs(mf->eta());
-
-  if (eta < 1.05) {
-    if (pt < 3.0) return false;
-
-  } else if (eta < 1.5) {
-    if (pt < 2.5) return false;
-
-  } else if (eta < 2.0) {
-    if (pt < 2.5) return false;
-
-  } else if (eta < 9.9) {
-    if (pt < 3.0) return false;
-
-  } else {
-    return false;
-  }
-
-  return true;
-}
-
-
-bool
-TrigEffJpsiTools::hasPassedTrigMuonEF(const Rec::TrackParticle* tp) const
-{
-  // https://svnweb.cern.ch/trac/atlasoff/browser/Trigger/TrigHypothesis/TrigMuonHypo/trunk/python/TrigMuonHypoConfig.py
-  double pt = tp->pt();
-  double eta = std::abs(tp->eta());
-
-  if (eta < 1.05) {
-    if (pt < 3.0) return false;
-
-  } else if (eta < 1.5) {
-    if (pt < 2.5) return false;
-
-  } else if (eta < 2.0) {
-    if (pt < 2.5) return false;
-
-  } else if (eta < 9.9) {
-    if (pt < 2.5) return false;
-
-  } else {
-    return false;
-  }
-
-  return true;
-}
-
-// **************************************************************************
-bool
-TrigEffJpsiTools::selectL2TrigDiMuon(const TrigL2Bphys* trigger,
-				     const TrigInDetTrack* track1,
-				     const TrigInDetTrack* track2,
-				     bool checkOS, // if true, tracks must have opposite charge
-				     double massMin, // invariant mass lower limit
-				     double massMax, // invariant mass upper limit
-				     bool applyMassMax, // apply upper invariant mass cut
-				     int nHits, // number of matching muon hits
-				     double chi2) const // chi2 cut. If < 0, no cut is applied
-{
-  // apply chi2 cut if requested
-  if(chi2>=0 && trigger->fitchi2() > chi2) return false;
-
-  //apply invariant mass cut
-  if(trigger->mass() < massMin) return false;
-  if(applyMassMax && trigger->mass()>massMax) return false;
-
-  //apply OS cut
-  if (checkOS && track1->param()->pT() * track2->param()->pT() >= 0.0) return false;
-
-  //apply number of hits cut
-  // if nHits<0 then don't apply cut - used for topological triggers
-  if (nHits > 0) {
-    // decode number of hits
-    int32_t word1 = track1->HitPattern();
-    Encoding* pEncoding1 = (Encoding*)&word1;
-
-    int32_t word2 = track2->HitPattern();
-    Encoding* pEncoding2 = (Encoding*)&word2;
-
-    // Make sure to cast to int32_t!
-    int32_t nMdtHits[2] = { static_cast<int32_t>(pEncoding1->mdt), static_cast<int32_t>(pEncoding2->mdt) } ;
-    int32_t nRpcHits[2] = { static_cast<int32_t>(pEncoding1->rpc), static_cast<int32_t>(pEncoding2->rpc) } ;
-    int32_t nTgcHits[2] = { static_cast<int32_t>(pEncoding1->tgc), static_cast<int32_t>(pEncoding2->tgc) } ;
-    int32_t nHits1 = nMdtHits[0] + nRpcHits[0] + nTgcHits[0];
-    int32_t nHits2 = nMdtHits[1] + nRpcHits[1] + nTgcHits[1];
-    if ( nHits1 < nHits || nHits2 < nHits) return false;
-    ATH_MSG_VERBOSE("nMdtHits: " << nMdtHits[0] << ", " << nMdtHits[1]);
-    ATH_MSG_VERBOSE("nRpcHits: " << nRpcHits[0] << ", " << nRpcHits[1]);
-    ATH_MSG_VERBOSE("nTgcHits: " << nTgcHits[0] << ", " << nTgcHits[1]);
-    ATH_MSG_VERBOSE("Sum:      " << nHits1      << ", " << nHits2);
-  }
-  // if we got this far, candidate was accepted
-  ATH_MSG_DEBUG("This candidate passed hypo selection " );
-  return true;
-
-}
-// **************************************************************************
-bool
-TrigEffJpsiTools::selectEFTrigDiMuon(const TrigEFBphys* trigger,
-				     const Rec::TrackParticle* track1,
-				     const Rec::TrackParticle* track2,
-				     bool checkOS, // if true, tracks must have opposite charge
-				     double massMin, // invariant mass lower limit
-				     double massMax, // invariant mass upper limit
-				     bool applyMassMax, // apply upper invariant mass cut
-				     double chi2) const // chi2 cut. If < 0, no cut is applied
-{
-  // apply chi2 cut if requested
-  if(chi2>=0 && trigger->fitchi2() > chi2) return false;
-
-  //apply invariant mass cut
-  if(trigger->mass() < massMin) return false;
-  if(applyMassMax && trigger->mass()>massMax) return false;
-
-  //apply OS cut
-  if (checkOS && track1->measuredPerigee()->parameters()[Trk::qOverP] * track2->measuredPerigee()->parameters()[Trk::qOverP] >= 0.0) return false;
-
-  // if we got this far, candidate was accepted
-  ATH_MSG_DEBUG("This candidate passed hypo selection " );
-  return true;
-
-}
-
-// **************************************************************************
-void
-TrigEffJpsiTools::Btrig_L2_initCuts()
-{
-  ATH_MSG_DEBUG("Use manual hypo cuts: " << m_useManualHypoCuts);
-  //L2_mu4_DiMu
-  m_Btrig_L2_chain.push_back("L2_mu4_DiMu");
-  m_Btrig_L2_checkOS.push_back(true);
-  m_Btrig_L2_massMin.push_back(500.);
-  m_Btrig_L2_massMax.push_back(13000.);
-  m_Btrig_L2_applyMassMax.push_back(false);
-  m_Btrig_L2_nHits.push_back(3);
-  m_Btrig_L2_chi2.push_back(-1.);
-
-  //L2_mu4_Jpsimumu
-  m_Btrig_L2_chain.push_back("L2_mu4_Jpsimumu");
-  m_Btrig_L2_checkOS.push_back(true);
-  m_Btrig_L2_massMin.push_back(2500.);
-  m_Btrig_L2_massMax.push_back(4300.);
-  m_Btrig_L2_applyMassMax.push_back(true);
-  m_Btrig_L2_nHits.push_back(3);
-  m_Btrig_L2_chi2.push_back(-1.);
-
-  //L2_mu4_Upsimumu
-  m_Btrig_L2_chain.push_back("L2_mu4_Upsimumu");
-  m_Btrig_L2_checkOS.push_back(true);
-  m_Btrig_L2_massMin.push_back(8000.);
-  m_Btrig_L2_massMax.push_back(12000.);
-  m_Btrig_L2_applyMassMax.push_back(true);
-  m_Btrig_L2_nHits.push_back(3);
-  m_Btrig_L2_chi2.push_back(-1.);
-
-  //L2_mu4_Bmumu
-  m_Btrig_L2_chain.push_back("L2_mu4_Bmumu");
-  m_Btrig_L2_checkOS.push_back(true);
-  m_Btrig_L2_massMin.push_back(8000.);
-  m_Btrig_L2_massMax.push_back(12000.);
-  m_Btrig_L2_applyMassMax.push_back(true);
-  m_Btrig_L2_nHits.push_back(3);
-  m_Btrig_L2_chi2.push_back(-1.);
-
-  //L2_2mu4_DiMu
-  m_Btrig_L2_chain.push_back("L2_2mu4_DiMu");
-  m_Btrig_L2_checkOS.push_back(true);
-  m_Btrig_L2_massMin.push_back(500.);
-  m_Btrig_L2_massMax.push_back(13000.);
-  m_Btrig_L2_applyMassMax.push_back(false);
-  m_Btrig_L2_nHits.push_back(-1);
-  m_Btrig_L2_chi2.push_back(20.);
-
-  //L2_2mu4_Jpsimumu
-  m_Btrig_L2_chain.push_back("L2_2mu4_Jpsimumu");
-  m_Btrig_L2_checkOS.push_back(true);
-  m_Btrig_L2_massMin.push_back(2500.);
-  m_Btrig_L2_massMax.push_back(4300.);
-  m_Btrig_L2_applyMassMax.push_back(true);
-  m_Btrig_L2_nHits.push_back(-1);
-  m_Btrig_L2_chi2.push_back(20.);
-
-  //L2_2mu4_Upsimumu
-  m_Btrig_L2_chain.push_back("L2_2mu4_Upsimumu");
-  m_Btrig_L2_checkOS.push_back(true);
-  m_Btrig_L2_massMin.push_back(8000.);
-  m_Btrig_L2_massMax.push_back(12000.);
-  m_Btrig_L2_applyMassMax.push_back(true);
-  m_Btrig_L2_nHits.push_back(-1);
-  m_Btrig_L2_chi2.push_back(20.);
-
-  //L2_2mu4_Bmumu
-  m_Btrig_L2_chain.push_back("L2_2mu4_Bmumu");
-  m_Btrig_L2_checkOS.push_back(true);
-  m_Btrig_L2_massMin.push_back(4000.);
-  m_Btrig_L2_massMax.push_back(7000.);
-  m_Btrig_L2_applyMassMax.push_back(true);
-  m_Btrig_L2_nHits.push_back(-1);
-  m_Btrig_L2_chi2.push_back(20.);
-
-
-  //L2_mu4_DiMu_FS
-  m_Btrig_L2_chain.push_back("L2_mu4_DiMu_FS");
-  m_Btrig_L2_checkOS.push_back(true);
-  m_Btrig_L2_massMin.push_back(500.);
-  m_Btrig_L2_massMax.push_back(13000.);
-  m_Btrig_L2_applyMassMax.push_back(false);
-  m_Btrig_L2_nHits.push_back(3);
-  m_Btrig_L2_chi2.push_back(-1.);
-
-  //L2_mu4_Jpsimumu_FS
-  m_Btrig_L2_chain.push_back("L2_mu4_Jpsimumu_FS");
-  m_Btrig_L2_checkOS.push_back(true);
-  m_Btrig_L2_massMin.push_back(2500.);
-  m_Btrig_L2_massMax.push_back(4300.);
-  m_Btrig_L2_applyMassMax.push_back(true);
-  m_Btrig_L2_nHits.push_back(3);
-  m_Btrig_L2_chi2.push_back(-1.);
-
-  //L2_mu4_Upsimumu_FS
-  m_Btrig_L2_chain.push_back("L2_mu4_Upsimumu_FS");
-  m_Btrig_L2_checkOS.push_back(true);
-  m_Btrig_L2_massMin.push_back(8000.);
-  m_Btrig_L2_massMax.push_back(12000.);
-  m_Btrig_L2_applyMassMax.push_back(true);
-  m_Btrig_L2_nHits.push_back(3);
-  m_Btrig_L2_chi2.push_back(-1.);
-
-  //L2_mu4_Bmumu_FS
-  m_Btrig_L2_chain.push_back("L2_mu4_Bmumu_FS");
-  m_Btrig_L2_checkOS.push_back(true);
-  m_Btrig_L2_massMin.push_back(4000.);
-  m_Btrig_L2_massMax.push_back(7000.);
-  m_Btrig_L2_applyMassMax.push_back(true);
-  m_Btrig_L2_nHits.push_back(3);
-  m_Btrig_L2_chi2.push_back(-1.);
-
-
-
-  return;
-
-}
-
-void
-TrigEffJpsiTools::Btrig_EF_initCuts()
-{
-  ATH_MSG_DEBUG("Use manual hypo cuts: " << m_useManualHypoCuts);
-  //Ef_mu4_DiMu
-  m_Btrig_EF_chain.push_back("EF_mu4_DiMu");
-  m_Btrig_EF_checkOS.push_back(true);
-  m_Btrig_EF_massMin.push_back(500.);
-  m_Btrig_EF_massMax.push_back(13000.);
-  m_Btrig_EF_applyMassMax.push_back(false);
-  m_Btrig_EF_chi2.push_back(-1.);
-
-
-  //EF_mu4_Jpsimumu
-  m_Btrig_EF_chain.push_back("EF_mu4_Jpsimumu");
-  m_Btrig_EF_checkOS.push_back(true);
-  m_Btrig_EF_massMin.push_back(2500.);
-  m_Btrig_EF_massMax.push_back(4300.);
-  m_Btrig_EF_applyMassMax.push_back(true);
-  m_Btrig_EF_chi2.push_back(-1.);
-
-  //EF_mu4_Bmumu
-  m_Btrig_EF_chain.push_back("EF_mu4_Bmumu");
-  m_Btrig_EF_checkOS.push_back(true);
-  m_Btrig_EF_massMin.push_back(4000.);
-  m_Btrig_EF_massMax.push_back(7000.);
-  m_Btrig_EF_applyMassMax.push_back(true);
-  m_Btrig_EF_chi2.push_back(-1.);
-
-  //EF_2mu4_DiMu
-  m_Btrig_EF_chain.push_back("EF_2mu4_DiMu");
-  m_Btrig_EF_checkOS.push_back(true);
-  m_Btrig_EF_massMin.push_back(500.);
-  m_Btrig_EF_massMax.push_back(13000.);
-  m_Btrig_EF_applyMassMax.push_back(false);
-  m_Btrig_EF_chi2.push_back(20.);
-
-  //EF_2mu4_Bmumu
-  m_Btrig_EF_chain.push_back("EF_2mu4_Bmumu");
-  m_Btrig_EF_checkOS.push_back(true);
-  m_Btrig_EF_massMin.push_back(4000.);
-  m_Btrig_EF_massMax.push_back(7000.);
-  m_Btrig_EF_applyMassMax.push_back(true);
-  m_Btrig_EF_chi2.push_back(20.);
-
-  //EF_2mu4_Jpsimumu
-  m_Btrig_EF_chain.push_back("EF_2mu4_Jpsimumu");
-  m_Btrig_EF_checkOS.push_back(true);
-  m_Btrig_EF_massMin.push_back(2500.);
-  m_Btrig_EF_massMax.push_back(4300.);
-  m_Btrig_EF_applyMassMax.push_back(true);
-  m_Btrig_EF_chi2.push_back(20.);
-
-  //EF_2mu4_Upsimumu
-  m_Btrig_EF_chain.push_back("EF_2mu4_Upsimumu");
-  m_Btrig_EF_checkOS.push_back(true);
-  m_Btrig_EF_massMin.push_back(8000.);
-  m_Btrig_EF_massMax.push_back(12000.);
-  m_Btrig_EF_applyMassMax.push_back(true);
-  m_Btrig_EF_chi2.push_back(20.);
-
-  //EF_mu4_DiMumumu_FS
-  m_Btrig_EF_chain.push_back("EF_mu4_DiMu_FS");
-  m_Btrig_EF_checkOS.push_back(true);
-  m_Btrig_EF_massMin.push_back(500.);
-  m_Btrig_EF_massMax.push_back(13000.);
-  m_Btrig_EF_applyMassMax.push_back(false);
-  m_Btrig_EF_chi2.push_back(-1.);
-
-  //EF_mu4_Jpsimumu_FS
-  m_Btrig_EF_chain.push_back("EF_mu4_Jpsimumu_FS");
-  m_Btrig_EF_checkOS.push_back(true);
-  m_Btrig_EF_massMin.push_back(2500.);
-  m_Btrig_EF_massMax.push_back(4300.);
-  m_Btrig_EF_applyMassMax.push_back(true);
-  m_Btrig_EF_chi2.push_back(-1.);
-
-  //EF_mu4_Upsimumu_FS
-  m_Btrig_EF_chain.push_back("EF_mu4_Upsimumu_FS");
-  m_Btrig_EF_checkOS.push_back(true);
-  m_Btrig_EF_massMin.push_back(8000.);
-  m_Btrig_EF_massMax.push_back(12000.);
-  m_Btrig_EF_applyMassMax.push_back(true);
-  m_Btrig_EF_chi2.push_back(-1.);
-
-  //EF_mu4_Bmumu_FS
-  m_Btrig_EF_chain.push_back("EF_mu4_Bmumu_FS");
-  m_Btrig_EF_checkOS.push_back(true);
-  m_Btrig_EF_massMin.push_back(4000.);
-  m_Btrig_EF_massMax.push_back(7000.);
-  m_Btrig_EF_applyMassMax.push_back(true);
-  m_Btrig_EF_chi2.push_back(-1.);
-
-
-
-  return;
-
-}
-
-
-
-
-// **************************************************************************
-
-/* eof */
diff --git a/Trigger/TrigAnalysis/TrigEffJpsiTools/src/TrigEffJpsiTools.h b/Trigger/TrigAnalysis/TrigEffJpsiTools/src/TrigEffJpsiTools.h
deleted file mode 100644
index 4f5831cf466299a1d47e338c1894840d22bf27d2..0000000000000000000000000000000000000000
--- a/Trigger/TrigAnalysis/TrigEffJpsiTools/src/TrigEffJpsiTools.h
+++ /dev/null
@@ -1,394 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef TRIGEFFJPSITOOLS_H
-#define TRIGEFFJPSITOOLS_H
-/**
- * @author    Hironori Kiyamura
- * @author    Takashi Matsushita
- * @date      $Date: 2016-02-10 17:47:59 +0100 (Wed, 10 Feb 2016) $
- * @version   $Revision: 723159 $
- */
-
-/** @todo */
-/** @warnings */
-
-
-/*--------------------------------------------------------------------*
- * headers
- *--------------------------------------------------------------------*/
-#include "GaudiKernel/ToolHandle.h"
-#include "GaudiKernel/ServiceHandle.h"
-#include "AthenaBaseComps/AthAlgTool.h"
-#include "AnalysisTriggerEvent/LVL1_ROI.h"
-#include "TrigDecisionTool/TrigDecisionTool.h"
-#include "TrigEffJpsiTools/ITrigEffJpsiTools.h"
-#include "TrkParameters/TrackParameters.h"
-#include <vector>
-#include <string>
-
-class INavigable4Momentum;
-namespace Rec { class TrackParticle; }
-namespace Trk { class IExtrapolator; }
-namespace Trk { class Track; }
-namespace Trk { class RIO_OnTrack; }
-namespace Trk { class TrackStateOnSurface; }
-namespace LVL1RPC { class RPCRecRoiSvc; }
-namespace LVL1TGC { class TGCRecRoiSvc; }
-namespace Muon { class MuonIdHelperTool; }
-namespace Trig { class TrigDecisionTool; }
-namespace Trig { class ChainGroup; }
-
-
-class IRPCcablingSvc;
-class MuonFeature;
-class TrigL2Bphys;
-class TrigEFBphys;
-class TrigInDetTrack;
-
-/*--------------------------------------------------------------------*
- * classes
- *--------------------------------------------------------------------*/
-struct Encoding
-{
-  unsigned unused:18;
-  unsigned mdt:5;
-  unsigned tgc:5;
-  unsigned rpc:4;
-};
-
-class TrigEffJpsiTools : virtual public ITrigEffJpsiTools,
-                         public AthAlgTool { 
-
-  public:
-    TrigEffJpsiTools(const std::string& type,
-                     const std::string& name,
-                     const IInterface* parent);
-    ~TrigEffJpsiTools();
-
-    virtual StatusCode initialize();
-    virtual StatusCode finalize();
-
-
-    bool isTriggeredMuonEF(const Rec::TrackParticle* track,
-                           const std::string& chainName) const;
-
-    bool isTriggeredMuonL2(const Rec::TrackParticle* track,
-                           const std::string& chainName) const;
-
-    bool isTriggeredMuonL1(const Rec::TrackParticle* track,
-                           const std::string& triggerName) const;
-
-    bool isTriggeredMuon(const Rec::TrackParticle* track,
-                         int thresholdNumber) const;
-
-    bool isJPsiCandidate(const Rec::TrackParticle* track1,
-                         const Rec::TrackParticle* track2) const;
-
-    bool isJPsiCandidate(const INavigable4Momentum* mom1,
-                         const INavigable4Momentum* mom2) const;
-
-    int getMatchedRoI(const Rec::TrackParticle* track,
-                      bool* barrel = 0,
-                      bool* endcap = 0,
-                      Amg::Vector2D* eta = 0,
-                      Amg::Vector2D* phi = 0) const;
-  
-
-    StatusCode getRoiSize(const unsigned int roiWord,
-                          double* etaSize,
-                          double* phiSize) const;
-
-    StatusCode getRioOnTriggerChamber(const Trk::Track* track,
-                                      std::vector<const Trk::RIO_OnTrack*>& rots,
-                                      bool pivotOnly=true) const;
-
-    bool extrapolateToRio(const Rec::TrackParticle* track,
-                          const Trk::RIO_OnTrack* rot,
-                          Amg::Vector2D* eta,
-                          Amg::Vector2D* phi,
-                          Amg::Vector2D* ptpz,
-                          bool getTsos,
-                          const std::vector<const Trk::TrackStateOnSurface*>* &tsos) const;
-
-    bool extrapolateToPoint(const Rec::TrackParticle* track,
-                            const Amg::Vector3D* pos,
-                            const int detector,
-                            Amg::Vector2D* eta,
-                            Amg::Vector2D* phi,
-                            Amg::Vector3D* mom) const;
-
-    std::vector<HLT::TriggerElement*> getExpertTEs(const std::string& chain = "EF_mu4") const;
-
-    bool getTriggerObjects(const std::string& chain,
-                           TrigObjectMap* muonsEF = NULL,
-                           TrigObjectMap* muonsL2 = NULL,
-                           TrigObjectMap* muonsL1 = NULL) const;
-    bool getL1TriggerObjects(const std::string& chain,
-                             TrigObjectMap* muonsL1 = NULL) const;
-    bool getL2TriggerObjects(const std::string& chain,
-                             TrigObjectMap* muonsL2 = NULL,
-                             TrigObjectMap* muonsL1 = NULL) const;
-    bool getEFTriggerObjects(const std::string& chain,
-                             TrigObjectMap* muonsEF = NULL,
-                             TrigObjectMap* muonsL2 = NULL,
-                             TrigObjectMap* muonsL1 = NULL) const;
-    bool getEFAllTriggerObjects(const std::string& chain,
-			      TrigObjectMap* muonsEF = NULL,
-			      TrigObjectMap* muonsL2 = NULL,
-			      TrigObjectMap* muonsL1 = NULL) const;
-
-    bool getEFIDTriggerObjects(const std::string& chain,
-				TrigObjectMap* muonsEF = NULL,
-				TrigObjectMap* muonsL2 = NULL,
-				TrigObjectMap* muonsL1 = NULL) const;
-
-    bool getEFMSTriggerObjects(const std::string& chain,
-				TrigObjectMap* muonsEF = NULL,
-				TrigObjectMap* muonsL2 = NULL,
-				TrigObjectMap* muonsL1 = NULL) const;
-
-    bool getBPhysL2TriggerObjects(const std::string& chain,
-                                  TrigObjectMap* muonsL2 = NULL,
-                                  TrigObjectMap* muonsL1 = NULL) const;
-    bool getBPhysEFTriggerObjects(const std::string& chain,
-                                  TrigObjectMap* muonsEF = NULL,
-                                  TrigObjectMap* muonsL2 = NULL,
-                                  TrigObjectMap* muonsL1 = NULL) const;
-
-    int muctpiBcidDiff(const int roiBcid) const;
-    int getMuonRoiBcidDiff(const uint32_t roiWord) const;
-
-    bool isOffTimeTgcTrigger() const;
-    bool EF_mu4_MSOnly_from_EF_mu0_outOfTime1() const;
-
-
-  private:
-    // methods to get extrapolation error on each plane 
-    void getExtrapolationErrorOnEndcap(const Trk::AtaDisc* measurement,
-                                       Amg::Vector2D* dEtaPhi) const;
-    void getExtrapolationErrorOnBarrel(const Trk::AtaCylinder* measurement,
-                                       Amg::Vector2D* dEtaPhi) const;
-                                       
-    // methods to get search range on each plane 
-    double getSearchRangeOnEndcap(const Trk::AtaDisc* measurement) const;
-    double getSearchRangeOnBarrel(const Trk::AtaCylinder* measurement) const;
-
-    // methods to get eta-phi distance
-    double getEtaPhiDistanceAtIp(const Rec::TrackParticle* track1,
-                                 const Rec::TrackParticle* track2) const;
-    double getEtaPhiDistanceOnEndcap(const Trk::AtaDisc* measurement1,
-                                     const Trk::AtaDisc* measurement2) const;
-    double getEtaPhiDistanceOnBarrel(const Trk::AtaCylinder* measurement1,
-                                     const Trk::AtaCylinder* measurement2) const;
-    double getEtaPhiDistance(double eta1,
-                             double eta2,
-                             double phi1,
-                             double phi2) const;
-    double getEtaDistance(double eta1,
-                          double eta2) const;
-    double getPhiDistance(double phi1,
-                          double phi2) const;
-
-    // methods to check isolation
-    bool isSeparated(const Rec::TrackParticle* track1,
-                     const Rec::TrackParticle* track2) const;
-    bool isSeparatedOnEndcap(const Rec::TrackParticle* track1,
-                             const Rec::TrackParticle* track2) const;
-    bool isSeparatedOnBarrel(const Rec::TrackParticle* track1,
-                             const Rec::TrackParticle* track2) const;
-
-    // methods to convert local errors to global one
-    double getEtaErrFromRPhi(const Trk::AtaDisc* measurement) const;
-    double getEtaErrFromRPhiZ(const Trk::AtaCylinder* measurement) const;
-
-    // methods for track extrapolation to target plane
-    const Trk::AtaDisc*
-      extrapolateToEndcap(const Rec::TrackParticle* track,
-                          const double pivotZ,
-                          const bool useCache = true) const;
-    const Trk::AtaCylinder*
-      extrapolateToBarrel(const Rec::TrackParticle* track,
-                          const double pivotRadius,
-                          const bool useCache = true) const;
-
-    const std::vector<const Trk::TrackStateOnSurface*>*
-      extrapolateToEndcapM(const Rec::TrackParticle* track,
-                           const double pivotZ) const;
-    const std::vector<const Trk::TrackStateOnSurface*>*
-      extrapolateToBarrelM(const Rec::TrackParticle* track,
-                           const double pivotRadius) const;
-
-    // struct to store center of search and serch range
-    struct Search {
-      double eta;
-      double phi;
-      double searchRange;
-    };
-
-    // methods to check if track has associated muon roi or not
-    bool isTriggered(const struct Search& centre,
-                     const int thresholdNumber,
-                     const LVL1_ROI::muons_type& muonRoIs) const;
-    bool isTriggeredOnEndcap(const Rec::TrackParticle* track,
-                             LVL1_ROI::muons_type& muonRoIs,
-                             int thresholdNumber) const;
-    bool isTriggeredOnBarrel(const Rec::TrackParticle* track,
-                             LVL1_ROI::muons_type& muonRoIs,
-                             int thresholdNumber) const;
-
-    // methods to check the roi region
-    int getRoiRegion(int roiWord) const;
-    unsigned int getBitMaskValue(const unsigned int value,
-                                 const unsigned int mask) const;
-
-    // methods to get roi size
-    StatusCode getRoiSizeTgc(const unsigned int roiWord,
-                             double* etaSize,
-                             double* phiSize) const;
-
-    StatusCode getRoiSizeRpc(const unsigned int roiWord,
-                             double* etaSize,
-                             double* phiSize) const;
-
-    // method to extract pt value from chain name
-    int getL1PtThreshold(const std::string& l1TriggerName) const;
-
-    // method to check if the given chain is configured or not
-    bool isConfigured(const std::string& chainName,
-                      const std::string& prefix) const;
-
-    // struct to store matched roi information
-    struct Match {
-      int roiIndex;
-      unsigned int roiWord;
-      int roiThrNumber;
-      int roiThrValue;
-      float roiEta;
-      float roiPhi;
-      Amg::Vector2D* etaExTrk;
-      Amg::Vector2D* phiExTrk;
-      bool barrel;
-      bool endcap;
-
-      Match() : roiIndex(-1), roiWord(0), roiThrNumber(-1), roiThrValue(-1),
-                roiEta(0.), roiPhi(0.), etaExTrk(0), phiExTrk(0),
-                barrel(false), endcap(false) {}
-    };
-
-    bool getMatchedRoI(const Rec::TrackParticle* track,
-                       struct Match& match) const;
-    bool isTriggeredMuonHLT(const Rec::TrackParticle* track,
-                            const std::string& chainName,
-                            const Trig::ChainGroup *cg) const;
-    bool isTriggeredMuonHLTwMuonFeature(const Rec::TrackParticle* track,
-                                        const std::string& chainName,
-                                        const Trig::ChainGroup *cg) const;
-
-    // struct for data cache
-    typedef std::map<const Rec::TrackParticle*,
-                     const Trk::TrackParameters*> CacheMap;
-    typedef std::pair<const Rec::TrackParticle*,
-                      const Trk::TrackParameters*> CachePair;
-    struct Cache {
-      unsigned int runNo;
-      unsigned int evtNo;
-      CacheMap tp;
-    };
-
-    void validateCache(Cache& map) const;
-
-    bool addTrigObject(TrigObject& trig, TrigObjectMap* map, bool appendIfExists = true) const;
-
-    uint32_t RDOtoRoI(uint32_t data_word) const;
-
-    bool EF_mu4_MSOnly_with_Muid(const MuonFeature* mf) const;
-    bool hasPassedMuFast(const MuonFeature* mf) const;
-    bool hasPassedTrigMuonEF(const Rec::TrackParticle* tp) const;
-
-    void Btrig_L2_initCuts();
-    void Btrig_EF_initCuts();
-
-    bool selectL2TrigDiMuon(const TrigL2Bphys* trigger,
-			    const TrigInDetTrack* track1,
-			    const TrigInDetTrack* track2,
-			    bool checkOS, // if true, tracks must have opposite charge
-			    double massMin, // invariant mass lower limit
-			    double massMax, // invariant mass upper limit
-			    bool applyMassMax, // apply upper invariant mass cut
-			    int nHits, // number of matching muon hits
-			    double chi2) const;
-
-    bool selectEFTrigDiMuon(const TrigEFBphys* trigger,
-			    const Rec::TrackParticle* track1,
-			    const Rec::TrackParticle* track2,
-			    bool checkOS, // if true, tracks must have opposite charge
-			    double massMin, // invariant mass lower limit
-			    double massMax, // invariant mass upper limit
-			    bool applyMassMax, // apply upper invariant mass cut
-			    double chi2) const;
-
-    // attributes
-
-    // service handles
-    ServiceHandle<LVL1RPC::RPCRecRoiSvc> m_rpcRoiService;
-    ServiceHandle<LVL1TGC::TGCRecRoiSvc> m_tgcRoiService;
-
-    // tool handles
-    ToolHandle<Muon::MuonIdHelperTool> m_muonIdHelper;
-    ToolHandle<Trk::IExtrapolator> m_extrapolator;
-    ToolHandle<Trig::TrigDecisionTool> m_trigDecisionTool;
-
-    std::string m_Lvl1RoiName;
-    double m_endcapPivotPlaneZ;
-    double m_endcapPivotPlaneMinimumRadius;
-    double m_endcapPivotPlaneMaximumRadius;
-    double m_barrelPivotPlaneRadius;
-    double m_barrelPivotPlaneHalfLength;
-    double m_invariantMassUpperLimit;
-    double m_invariantMassLowerLimit;
-    double m_trackPtCut;
-    double m_trackEtaCut;
-    double m_roiSizeBarrel;
-    double m_roiSizeEndcap;
-    double m_roiSizeForward;
-    double m_endcapForwardBoundary;
-    double m_searchRangeTolerance;
-    double m_searchRangeOffset;
-    bool   m_appendL1IfExists;
-    bool   m_appendL2IfExists;
-    bool   m_appendEFIfExists;
-    bool   m_useManualHypoCuts;
-
-    const IRPCcablingSvc* p_rpcCablingSvc;
-
-    mutable Cache m_cacheEndcap;
-    mutable Cache m_cacheBarrel;
-
-    // constants
-    const double m_MUON_MASS;
-    enum RoiRegion {
-      BARREL,
-      ENDCAP,
-      NUM_REGION
-    };
-
-    std::vector<std::string> m_Btrig_L2_chain;
-    std::vector<bool> m_Btrig_L2_checkOS;
-    std::vector<double> m_Btrig_L2_massMin;
-    std::vector<double> m_Btrig_L2_massMax;
-    std::vector<bool> m_Btrig_L2_applyMassMax;
-    std::vector<int> m_Btrig_L2_nHits;
-    std::vector<double> m_Btrig_L2_chi2;
-
-    std::vector<std::string> m_Btrig_EF_chain;
-    std::vector<bool> m_Btrig_EF_checkOS;
-    std::vector<double> m_Btrig_EF_massMin;
-    std::vector<double> m_Btrig_EF_massMax;
-    std::vector<bool> m_Btrig_EF_applyMassMax;
-    std::vector<double> m_Btrig_EF_chi2;
-   
-};
-
-#endif // TRIGEFFJPSITOOLS_H
diff --git a/Trigger/TrigAnalysis/TrigEffJpsiTools/src/components/TrigEffJpsiTools_entries.cxx b/Trigger/TrigAnalysis/TrigEffJpsiTools/src/components/TrigEffJpsiTools_entries.cxx
deleted file mode 100644
index 4d163fffcb21094d19ef2ce5d3caf56cd22e2395..0000000000000000000000000000000000000000
--- a/Trigger/TrigAnalysis/TrigEffJpsiTools/src/components/TrigEffJpsiTools_entries.cxx
+++ /dev/null
@@ -1,8 +0,0 @@
-
-#include "src/TrigEffJpsiTools.h"
-#include "src/MuonRoiWithExtendedBunches.h"
-
-
-DECLARE_COMPONENT( TrigEffJpsiTools )
-DECLARE_COMPONENT( MuComm::MuonRoiWithExtendedBunches )
-
diff --git a/Trigger/TrigConfiguration/TrigConfigSvc/CMakeLists.txt b/Trigger/TrigConfiguration/TrigConfigSvc/CMakeLists.txt
index ef6d1bdca61260b25557baf8f36e2c809ab1d3d3..a23d389c03b76625332d413ca27841d9be7dd56a 100644
--- a/Trigger/TrigConfiguration/TrigConfigSvc/CMakeLists.txt
+++ b/Trigger/TrigConfiguration/TrigConfigSvc/CMakeLists.txt
@@ -57,7 +57,7 @@ atlas_install_joboptions(  share/hltConfigSvc_standalone_test_configurables.py
   share/lvl1ConfigSvc_standalone_test.py
   share/testKeyByNameLoader.py
   share/testTriggerFrontierQuery.py )
-atlas_install_scripts( share/checkTrigger.py share/checkTriggerConfigOld.py )
+atlas_install_scripts( share/checkTrigger.py share/checkTriggerConfigOld.py share/trigconf_property.py )
 atlas_install_xmls( data/*.dtd )
 
 # Aliases:
diff --git a/Trigger/TrigTools/TrigUtils/bin/trigconf_property.py b/Trigger/TrigConfiguration/TrigConfigSvc/share/trigconf_property.py
similarity index 100%
rename from Trigger/TrigTools/TrigUtils/bin/trigconf_property.py
rename to Trigger/TrigConfiguration/TrigConfigSvc/share/trigconf_property.py
diff --git a/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/CMakeLists.txt b/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/CMakeLists.txt
deleted file mode 100644
index 8739f3bf3547df6318a172adfff37074575ddcd0..0000000000000000000000000000000000000000
--- a/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/CMakeLists.txt
+++ /dev/null
@@ -1,44 +0,0 @@
-################################################################################
-# Package: TrigIDJpsiMonitoring
-################################################################################
-
-# Declare the package name:
-atlas_subdir( TrigIDJpsiMonitoring )
-
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Event/EventInfo
-                          InnerDetector/InDetConditions/InDetBeamSpotService
-                          Reconstruction/Particle
-                          Trigger/TrigAnalysis/TrigDecisionTool
-                          Trigger/TrigAnalysis/TrigInDetAnalysis
-                          Trigger/TrigAnalysis/TrigInDetAnalysisUtils
-                          Trigger/TrigEvent/TrigMuonEvent
-                          Trigger/TrigEvent/TrigParticle
-                          Trigger/TrigEvent/TrigSteeringEvent
-                          Trigger/TrigMonitoring/TrigHLTMonitoring
-                          Trigger/TrigTools/TrigJPsiTools
-                          PRIVATE
-                          Control/AthenaKernel
-                          Control/AthenaMonitoring
-                          GaudiKernel
-                          Reconstruction/MuonIdentification/muonEvent
-                          Reconstruction/egamma/egammaEvent
-                          Tracking/TrkEvent/VxVertex
-                          Trigger/TrigEvent/TrigInDetEvent
-                          Trigger/TrigTruthEvent/TrigInDetTruthEvent )
-
-# External dependencies:
-find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread MathMore Minuit Minuit2 Matrix Physics HistPainter Rint )
-
-# Component(s) in the package:
-atlas_add_component( TrigIDJpsiMonitoring
-                     src/*.cxx
-                     src/components/*.cxx
-                     INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                     LINK_LIBRARIES ${ROOT_LIBRARIES} EventInfo Particle TrigDecisionToolLib TrigInDetAnalysis TrigInDetAnalysisUtils TrigMuonEvent TrigParticle TrigSteeringEvent TrigHLTMonitoringLib TrigJPsiTools AthenaKernel AthenaMonitoringLib GaudiKernel muonEvent egammaEvent VxVertex TrigInDetEvent TrigInDetTruthEvent )
-
-# Install files from the package:
-atlas_install_headers( TrigIDJpsiMonitoring )
-atlas_install_python_modules( python/*.py )
-
diff --git a/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/TrigIDJpsiMonitoring/AnalysisConfig_Jpsi.h b/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/TrigIDJpsiMonitoring/AnalysisConfig_Jpsi.h
deleted file mode 100644
index c82f3053bbb4bed9e876d30a043018c10537f2e0..0000000000000000000000000000000000000000
--- a/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/TrigIDJpsiMonitoring/AnalysisConfig_Jpsi.h
+++ /dev/null
@@ -1,640 +0,0 @@
-// emacs: this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-/** @file AnalysisConfig_Jpsi.h */
-/** @author Mark Sutton (sutt@cern.ch) **/
-/** @author Peter Wijeratne (paw@hep.ucl.ac.uk) **/
-/** @author Christian Gutschow (chris.g@cern.ch) **/
-
-#ifndef TrigIDJpsiMonitoring_AnalysisConfig_Jpsi_H
-#define TrigIDJpsiMonitoring_AnalysisConfig_Jpsi_H
-
-#include "TrigHLTMonitoring/IHLTMonTool.h"
-#include "InDetBeamSpotService/IBeamCondSvc.h"
-
-#include "TrigInDetAnalysisUtils/T_AnalysisConfig.h"
-
-#include "TrigJPsiTools/MakeDiMuonsTool.h"
-
-#include "TrigIDJpsiMonitoring/JpsiTrackSelector.h"
-
-#include "TrigIDJpsiMonitoring/JpsiAnalysis.h"
-#include "TrigIDJpsiMonitoring/DuplicateRemover.h"
-
-#include "EventInfo/EventInfo.h"
-#include "EventInfo/EventID.h"
-
-#include "TrigInDetAnalysisUtils/Associator_BestMatch.h"
-//#include "TrigInDetAnalysisUtils/TIDA_newtracking.h"
-
-//#include "RecoToolInterfaces/IExtrapolateToCaloTool.h"
-//#include "TrigInDetTrackExtrapolator/TrigInDetTrackExtrapolator.h"
-
-#include "TROOT.h"
-#include "TFile.h"
-#include "TH1F.h"
-#include "TLorentzVector.h"
-
-namespace TrigInDetAnalysis {
-
-  class AnalysisConfig_Jpsi : public T_AnalysisConfig<IHLTMonTool> { 
-    
-    public:
-      
-      // Full constructor: test/reference/selection
-      // - analysisInstanceName: the name of the analysis chain being created
-      // - xxxChainName: the name of the chain to be used as test/reference/selection;
-      //                 must be "StoreGate" in case of direct access to SG containers
-      // - xxxType: the type of tracks to be retrieved from the test/reference/selection chain or container
-      // - xxxKey:  the key for tracks to be retrieved from the test/reference/selection chain or container
-      // - roiInfo: in case the test chain is a real chain, this is used to specify RoI widths;
-      //            in case the test chain is a fake chain, this is used for RoI position too
-      // - all standard operations are performed in loops over 0=test 1=reference 2=selection
-      AnalysisConfig_Jpsi(const std::string &analysisInstanceName, const std::string& testChainName, const std::string& testType,
-                          const std::string& testKey, const std::string& referenceChainName, const std::string& referenceType,
-                          const std::string& referenceKey, const std::string& selectionChainName, const std::string& selectionType,
-                          const std::string& selectionKey, TIDARoiDescriptor* roiInfo, TrackFilter* testFilter,
-                          TrackFilter* referenceFilter, TrackFilter* selectionFilter, TrackAssociator* associator,
-                         TrackAnalysis* analysis) : T_AnalysisConfig<IHLTMonTool>( analysisInstanceName, testChainName,
-                                                                                   testType, testKey, referenceChainName,
-                                                                                   referenceType, referenceKey,
-                                                                                   selectionChainName, selectionType,
-                                                                                   selectionKey, roiInfo, testFilter,
-                                                                                   referenceFilter, selectionFilter,
-                                                                                   associator, analysis),
-                                                    //m_iBeamCondSvc(0)
-                                                    m_iBeamCondSvc("BeamCondSvc",analysisInstanceName),
-                                                    m_toolSvc("ToolSvc",analysisInstanceName),
-                                                    m_selectorTestA(0), m_selectorTestB(0) {
-         // m_efExtrapolator("ExtrapolateToCaloTool/ExtrapolateToCaloTool"),
-         // m_l2Extrapolator("TrigInDetTrackExtrapolator") {
-         m_selectorJ = 0;   
-      }
-        
-      // Partial constructor: test/reference
-      // - analysisInstanceName: the name of the analysis chain being created
-      // - xxxChainName: the name of the chain to be used as test/reference;
-      // must be "StoreGate" in case of direct access to SG containers
-      // - xxxType: the type of tracks to be retrieved from the test/reference chain or container
-      // - xxxKey:  the key for tracks to be retrieved from the test/reference chain or container
-      // - roiInfo: in case the test chain is a real chain, this is used to specify RoI widths;
-      //            in case the test chain is a fake chain, this is used for RoI position too
-      // - all standard operations are performed in loops over 0=test 1=reference 2=selection
-      AnalysisConfig_Jpsi(const std::string &analysisInstanceName, const std::string &testChainName, const std::string &testType,
-                          const std::string &testKey, const std::string &referenceChainName, const std::string &referenceType,
-                          const std::string &referenceKey, TIDARoiDescriptor* roiInfo, TrackFilter* testFilter,
-                          TrackFilter* referenceFilter, TrackAssociator* associator, TrackAnalysis* analysis) :
-                          T_AnalysisConfig<IHLTMonTool>( analysisInstanceName, testChainName, testType, testKey,
-                                                         referenceChainName, referenceType, referenceKey, roiInfo,
-                                                         testFilter, referenceFilter, associator, analysis),
-                          //m_iBeamCondSvc(0),
-                          m_iBeamCondSvc("BeamCondSvc",analysisInstanceName),
-                          m_toolSvc("ToolSvc",analysisInstanceName),
-                          m_jpsi(0), m_remover(0), m_selectorTestA(0), m_selectorTestB(0) {
-        // m_efExtrapolator("ExtrapolateToCaloTool/ExtrapolateToCaloTool"),
-        // m_l2Extrapolator("TrigInDetTrackExtrapolator") {
-
-        if(m_selectorRef) {
-          delete m_selectorRef;
-          m_selectorRef = new JpsiTrackSelector( referenceFilter );
-        }
-
-        if(m_selectorTest) {
-          delete m_selectorTest;
-          m_selectorTest = new JpsiTrackSelector( testFilter );
-        }
-        m_selectorJ = 0;          
-        m_jpsi = new MakeDiMuonsTool();
-        m_remover = new DuplicateRemover();
-        m_selectorTestA = new TrigTrackSelector( testFilter );
-        m_selectorTestB = new TrigTrackSelector( testFilter );
-        //if(m_l2Extrapolator.retrieve().isFailure())  cout << ">>> Unable to locate L2 extrapol tool!!" << endl;
-        //if(m_efExtrapolator.retrieve().isFailure())  cout << ">>> Unable to locate EF extrapol tool!!" << endl;
-      } 
-
-
-      virtual ~AnalysisConfig_Jpsi() { 
-        delete m_jpsi;
-        delete m_remover;
-        delete m_analysis;
-        delete m_selectorTestA;
-        delete m_selectorTestB;
-        //if ( m_associator ){delete m_associator; m_associator=NULL;}
-      }
-
-      virtual void book();
-      virtual void finalize();
-        
-      // helper functions
-      float deltaR(  float eta1, float phi1, float eta2, float phi2);
-      float deltaPhi(float phi1, float phi2);
-      float fixPhi(  float phi);
-
-      //analysis
-
-      JpsiAnalysis* m_analysisJ; 
-
-      template<class TrackCollection> void selectTracks(const std::string& key="", unsigned index=0,const std::string& chain="") {   
-        m_provider->msg(MSG::DEBUG) << "Starting selectTracks ..." << endmsg;
-
-        Trig::ExpertMethods* em = (*m_tdt)->ExperimentalAndExpertMethods();
-        em->enable();
-        const HLT::NavigationCore* nc = em->getNavigation();
-
-        Trig::FeatureContainer fcont = (*m_tdt)->features( chain, TrigDefs::alsoDeactivateTEs );
-        const std::vector< Trig::Combination >& comb = fcont.getCombinations();
-        std::vector< Trig::Combination >::const_iterator c_itr = comb.begin();
-        std::vector< Trig::Combination >::const_iterator c_end = comb.end();
-
-        std::cout << "choosing ID chain name..." << std::endl;
-
-        std::string idChainName;
-        if(chain.find("2mu4T_")     != std::string::npos) idChainName = "L2_mu4T_IDTrkNoCut";
-        //if(chain.find("2mu4T_")     != std::string::npos) idChainName = "L2_muon_standalone_mu4T";
-        //if(chain.find("2mu4T_")     != std::string::npos) idChainName = "somestuff";
-        if(chain.find("2mu4_")      != std::string::npos) idChainName = "L2_mu4_IDTrkNoCut";
-        if(chain.find("2mu13_")     != std::string::npos) idChainName = "L2_mu13_IDTrkNoCut";
-        if(chain.find("e4_etcut_Jpsi") != std::string::npos) idChainName = "L2_e4_etcutid";
-        else if(chain.find("e5_tight1_") != std::string::npos) idChainName = "L2_e5_tight1id";
-        if(chain.find("e24vh_")     != std::string::npos) idChainName = "L2_e15_NoCutid";
-        if(chain.find("mu24i_")     != std::string::npos) idChainName = ""; //L2_mu24_tight";
-        if(chain.find("_mu20")      != std::string::npos) idChainName = "";
-        //if(chain.find("mu24i_")     != std::string::npos) idChainName = " L2_muon_standalone_mu18_tight";
-
-        m_provider->msg(MSG::DEBUG) << "chain= " << chain 
-                                    << " idChainName= " << idChainName 
-                                    << " key= " << key << endmsg;
-
-        for( ; c_itr != c_end; ++c_itr ) {
-          // Now we iterate over accepted "combinations". (Single or multiple
-          // RoIs that passed the trigger.)
-          /*if(index==0)       cout << "A Before " << idChainName << " HLTTruncated = " << HLTTruncated << std::endl;
-          if(index==1)       cout << "B Before " << idChainName << " HLTTruncated = " << HLTTruncated << std::endl;
-          if(index==2)       cout << "C Before " << idChainName << " HLTTruncated = " << HLTTruncated << std::endl;*/
-          //cout << "   header - before get<...>" << std::endl;
-          std::vector< Trig::Feature< TrackCollection > > probeTracks = c_itr->get< TrackCollection >(key, TrigDefs::alsoDeactivateTEs, idChainName);
-          //cout << "   header - after get<...>" << probeTracks.size() << std::endl;
-
-          // This will probably be a single-element vector if the chain used a
-          // single TE. But if it was constructed from multiple TEs, we should
-          // have multiple track collections here.
-          // cout << "\n# combinations = " << comb.size() << " # collections = " << probeTracks.size() << "\n" << std::endl;
-          
-          for(unsigned ifeat = 0; ifeat < probeTracks.size(); ++ifeat) {
-      
-            Trig::Feature<TrackCollection> trackfeature = probeTracks.at(ifeat);
-
-            Trig::Feature<TrigRoiDescriptor> trackroi = (*m_tdt)->ancestor<TrigRoiDescriptor>(trackfeature);
-            const TrigRoiDescriptor* roid1 = trackroi.cptr();
-            //	cout << "ID track RoI ID = " << roid1->roiId() << std::endl;
-            /// if there are > 3 combinations, roiID can be > 1; ie. there are > 2 RoIs
-            /// currently we ignore them
-            int roiID = roid1->roiId();
-            m_provider->msg(MSG::DEBUG) << "roi ID: " << roiID << endmsg;
-
-            const HLT::TriggerElement* te = trackfeature.te();
-            std::string TEName = "";
-            TEName = (Trig::getTEName(*te).c_str());
-            m_provider->msg(MSG::DEBUG) << "TE name: " << TEName << endmsg;
-              
-            // get all the named collections attached to the TE
-            //if(TEName == "L2_mu4T_IDTrkNoCut"){
-            std::vector< const TrackCollection* > collectionVector;
-            if( !const_cast<HLT::NavigationCore *>(nc)->getFeatures( te, collectionVector, key ) ) return;
-            
-            for(unsigned iv = 0; iv < collectionVector.size(); iv++ ) {
-              // collectionVector holds different algorithms (StratA, B, C)
-              // index = 0, 1, 2 is the index where the algorithm sits
-              if(index != iv) continue; // only consider one algorithm
-        
-              ///finally, extract the tracks from this RoI
-              if(collectionVector[iv]) { 
-                //if(count == ifeat){
-                //cout << "V1 - RoI num: " << roiID << std::endl;
-                getL2tracks<TrackCollection>(collectionVector[iv], roiID);
-                //cout << "AC_Jpsi collectionVector[" << iv << "]->size() " << collectionVector[iv]->size() << " roiID " << roiID << std::endl;
-                //}
-                //if(roiID == 0) selectorA->selectTracks(collectionVector[iv], truthmap);
-                //if(roiID == 1) selectorB->selectTracks(collectionVector[iv], truthmap);
-                //if(roiID != 0 && roiID != 1) cout << "ID tracks roiID = " << roiID << std::endl;
-              }
-            }
-            //}//specify TEname
-          }
-        }
-        m_provider->msg(MSG::DEBUG) << "... end of selectTracks." << endmsg;
-      }
-
-      template<class TrackCollection> void selectTracks0(const std::string &key="", unsigned index=0, const std::string& chain="") {   
-        m_provider->msg(MSG::DEBUG) << "Starting selectTracks0 ..." << endmsg;
-
-        Trig::ExpertMethods* em = (*m_tdt)->ExperimentalAndExpertMethods();
-        em->enable();
-        const HLT::NavigationCore* nc = em->getNavigation();
-
-        std::cout << "Chain: " << chain << std::endl;
-        Trig::FeatureContainer fcont = (*m_tdt)->features( chain, TrigDefs::alsoDeactivateTEs );
-        const std::vector< Trig::Combination >& comb = fcont.getCombinations();
-        std::vector< Trig::Combination >::const_iterator c_itr = comb.begin();
-        std::vector< Trig::Combination >::const_iterator c_end = comb.end();
-
-        std::string idChainName;
-        if( (chain.find("2mu4T_")!=std::string::npos) ){ 
-          if( key.find("InDetTrig") != std::string::npos) idChainName = "EFID_mu4T_IDTrkNoCut";
-          else idChainName = "L2_mu4T_IDTrkNoCut";
-        }
-        if( (chain.find("2mu4_")!=std::string::npos) ){ 
-          if( key.find("InDetTrig") != std::string::npos) idChainName = "EFID_mu4_IDTrkNoCut";
-          else idChainName = "L2_mu4_IDTrkNoCut";
-        }
-
-        if( (chain.find("2mu13_")!=std::string::npos) ){ 
-          if( key.find("InDetTrig") != std::string::npos) idChainName = "EFID_mu13_IDTrkNoCut";
-          else idChainName = "L2_mu4_IDTrkNoCut";
-        }
-        
-        if( (chain.find("mu24i_")!=std::string::npos) ) {
-          if( key.find("InDetTrig") != std::string::npos) idChainName = "";
-          else idChainName = "L2_mu24_tight";
-        }
-        if( (chain.find("_mu20")!=std::string::npos) ) {
-          if( key.find("InDetTrig") != std::string::npos) idChainName = "";
-          else idChainName = "L2_mu24_tight";
-        }
-
-        if( (chain.find("e4_etcut_Jpsi")!=std::string::npos) ){ 
-          if( key.find("InDetTrig") != std::string::npos) idChainName = "EF_e4_etcutid";
-          else idChainName = "L2_e4_etcutid";
-        }
-        else if( (chain.find("e5_tight1_")!=std::string::npos) ){ 
-          if( key.find("InDetTrig") != std::string::npos) idChainName = "EF_e5_tight1id";
-          else idChainName = "L2_e5_tight1id";
-        }
-
-       if( (chain.find("e24vh_")!=std::string::npos) ){ 
-          if( key.find("InDetTrig") != std::string::npos) idChainName = "EF_e15_NoCutid1";
-          else idChainName = "L2_e15_NoCutcl";
-        }
-
-        m_provider->msg(MSG::DEBUG) << "EF idChainName = " << idChainName  << "  key = " << key << endmsg;
-
-        for( ; c_itr != c_end; ++c_itr ) {
-          // Now we iterate over accepted "combinations". (Single or multiple
-          // RoIs that passed the trigger.)
-          //      if(index==0)       std::cout << "A Before " << idChainName << " HLTTruncated = " << HLTTruncated << std::endl;
-          /*      if(index==1)       std::cout << "B Before " << idChainName << " HLTTruncated = " << HLTTruncated << std::endl;
-          if(index==2)       std::cout << "C Before " << idChainName << " HLTTruncated = " << HLTTruncated << std::endl;*/
-          std::cout << "selectTracks0 BEFORE c_itr->get<...>(...)" << std::endl;
-          std::vector< Trig::Feature< TrackCollection > > probeTracks = c_itr->get< TrackCollection >(key, TrigDefs::alsoDeactivateTEs, idChainName);
-          std::cout << "selectTracks0 AFTER c_itr->get<...>(...)" << std::endl;
-          /// if empty, probably 2011... so try this one
-          if(chain.find("mu24i") != std::string::npos && !probeTracks.size()) {
-            if(chain.find("2mu4T_") != std::string::npos)  idChainName = "EF_EFID_mu4T_IDTrkNoCut";
-            if(chain.find("2mu13_") != std::string::npos)  idChainName = "EF_EFID_mu13_IDTrkNoCut";
-            probeTracks = c_itr->get< TrackCollection >(key, TrigDefs::alsoDeactivateTEs, idChainName);
-          }
-          /*      std::cout << "After after " << probeTracks.size() << std::endl;
-          if(probeTracks.size() == 0) idChainName = "EF_trt_mu4T_IDTrkNoCut";
-          probeTracks = c_itr->get< TrackCollection >(key, TrigDefs::alsoDeactivateTEs, idChainName);
-          std::cout << "Next try " << probeTracks.size() << std::endl;
-          if(probeTracks.size() == 0) idChainName = "EF_MS_mu4T_IDTrkNoCut";
-          probeTracks = c_itr->get< TrackCollection >(key, TrigDefs::alsoDeactivateTEs, idChainName);
-          std::cout << "And again " << probeTracks.size() << std::endl;
-          if(probeTracks.size() == 0) idChainName = "EF_TB_mu4T_IDTrkNoCut";
-          probeTracks = c_itr->get< TrackCollection >(key, TrigDefs::alsoDeactivateTEs, idChainName);
-          std::cout << "And and again " << probeTracks.size() << std::endl;
-          if(probeTracks.size() == 0) idChainName = "EF_SA_mu4T_IDTrkNoCut";
-          probeTracks = c_itr->get< TrackCollection >(key, TrigDefs::alsoDeactivateTEs, idChainName);
-          std::cout << "And and and again " << probeTracks.size() << std::endl;
-          if(probeTracks.size() == 0) idChainName = "EF_mu4T_IDTrkNoCut";
-          probeTracks = c_itr->get< TrackCollection >(key, TrigDefs::alsoDeactivateTEs, idChainName);
-          std::cout << "Last try " << probeTracks.size() << std::endl;*/
-
-          // This will probably be a single-element vector if the chain used a
-          // single TE. But if it was constructed from multiple TEs, we should
-          // have multiple track collections here.
-          //std::cout << "\n# combinations = " << comb.size() << " # collections = " << probeTracks.size()	<< "\n" << std::endl;
-          
-          for(unsigned ifeat = 0; ifeat < probeTracks.size(); ++ifeat) {
-      
-            Trig::Feature<TrackCollection> trackfeature = probeTracks[ifeat];
-
-            Trig::Feature<TrigRoiDescriptor> trackroi = (*m_tdt)->ancestor<TrigRoiDescriptor>(trackfeature);
-            const TrigRoiDescriptor* roid1 = trackroi.cptr();
-            //std::cout << "ID track RoI ID = " << roid1->roiId() << std::endl;
-
-            // if there are > 3 combinations, roiID can be > 1; ie. there are > 2 RoIs
-            // currently we ignore them
-            int roiID = roid1->roiId();
-            m_provider->msg(MSG::DEBUG) << "EF roi ID: " << roiID << "eta = " << roid1->eta() << " phi = " << roid1->phi() << endmsg;
-
-            const HLT::TriggerElement* te = trackfeature.te();
-            std::string TEName = "";
-            TEName = (Trig::getTEName(*te).c_str());
-            m_provider->msg(MSG::DEBUG) << "EF TE name: " << TEName << endmsg;
-        
-            // get all the named collections attached to the TE
-            std::vector<const TrackCollection*> collectionVector;
-            if( !const_cast<HLT::NavigationCore*>(nc)->getFeatures(te, collectionVector, key) )  return;
-      
-            for( unsigned iv = 0; iv < collectionVector.size(); iv++ ) {
-              // collectionVector holds different algorithms
-              // for EF, index is always 0
-              if(index != iv) continue; // only consider one algorithm
-              //finally, extract the tracks from this RoI
-              if(collectionVector[iv]) { 
-                //if(count == ifeat) {
-                //std::cout << "V2 - RoI num: " << roiID << std::endl;
-                getEFtracks<TrackCollection>(collectionVector[iv], roiID);
-                //std::cout << "AC_Jpsi collectionVector[" << iv << "]->size() " << collectionVector[iv]->size() << std::endl;
-                //}
-                //if(roiID == 0) selectorA->selectTracks(collectionVector[iv], truthmap);
-                //if(roiID == 1) selectorB->selectTracks(collectionVector[iv], truthmap);
-                //if(roiID != 0 && roiID != 1) std::cout << "ID tracks roiID = " << roiID << std::endl;
-              }
-            }
-          }
-        }
-        m_provider->msg(MSG::DEBUG) << "... end of selectTracks0." << endmsg;
-      }
-
-      ///PW modified for 2 RoIs
-      /*  template<class TrackCollection> 
-      void selectTracks( TrigTrackSelector* selector, const std::string& key="", const TrigInDetTrackTruthMap* truthmap=0, unsigned index=0, 
-             const std::string& chain="") {   
-
-        ///get the all-powerful expert methods
-        Trig::ExpertMethods* expert = (*m_tdt)->ExperimentalAndExpertMethods();
-        expert->enable();
-
-        ///retrieve all trigger elements for defined subchain, eg. for a primary trigger "EF_2mu4T_Jpsimumu_IDTrkNoCut", 
-        ///chain = "L2_mu4T_IDTrkNoCut"
-        std::vector<HLT::TriggerElement*> tes;
-        expert->getNavigation()->getAllOfType(chain, tes, true);
-
-        ///this loop should iterate once / RoI
-        for(std::vector<HLT::TriggerElement*>::const_iterator te = tes.begin(); te!=tes.end(); te++){
-        //    std::vector<HLT::TriggerElement*>::const_iterator te = tes.begin();
-
-          std::string TEName = "";
-          TEName = (Trig::getTEName(*(*te))).c_str();
-          std::cout << "TE name = " << TEName << std::endl;
-
-          ///using the ancestor method gives us access to all the tracks - for leading and 
-          ///test algorithms - in the RoI
-          std::vector< Trig::Feature<TrackCollection> > featureVector = (*m_tdt)->ancestors<TrackCollection>(*te, key);
-
-          ///this loop should iterate once / track collection, eg. MuonA, MuonB, etc...
-          for( unsigned iv=0; iv<featureVector.size(); iv++){
-      if( index!=iv ) continue;
-      const TrackCollection* idTracks = featureVector[iv].cptr();
-
-      ///finally, extract the tracks from this RoI
-      std::string algo;
-      if(index==0) algo = "A"; 
-      if(index==1) algo = "B"; 
-      if(index==2) algo = "C"; 
-      std::cout << "key = " << key << algo << std::endl;
-      if(idTracks) selector->selectTracks(idTracks, truthmap);
-
-          }
-        }  
-      }*/
-
-      protected:
-
-        virtual void loop();
-
-        template<class TrackCollection> void getL2tracks(const TrackCollection *collection, int roi) {
-
-          m_provider->msg(MSG::DEBUG) << "Starting getL2tracks ..." << endmsg;
-          typename TrackCollection::const_iterator trackitr = collection->begin();
-          typename TrackCollection::const_iterator trackend = collection->end();
-          for( ; trackitr != trackend; ++trackitr) {
-            const TrigInDetTrack* track = dynamic_cast<const TrigInDetTrack*>( *trackitr );
-            if(track) {
-              double eta      = track->param()->eta();
-              double phi      = track->param()->phi0();
-              double z0       = track->param()->z0(); 
-              double pT       = track->param()->pT(); 
-              double d0       = track->param()->a0();
-              double deta     = track->param()->eeta();
-              double dphi     = track->param()->ephi0();
-              double dz0      = track->param()->ez0(); 
-              double dpT      = track->param()->epT(); 
-              double dd0      = track->param()->ea0();
-
-              int algoid      = track->algorithmId(); 	      
-              int nBlayerHits = (track->HitPattern() & 0x1);
-              int nPixelHits  = 2 * track->NPixelSpacePoints();  // NB: for comparison with offline 
-              int nSctHits    = 2 * track->NSCT_SpacePoints();   //     a spacepoint is 2 "hits"
-              int nStrawHits  = track->NStrawHits();
-              int nTrHits     = track->NTRHits();
-              int nSiHits     = nPixelHits + nSctHits;
-
-              bool expectBL   = false;                           //not filled in 
-
-              unsigned int hitPattern = track->HitPattern();
-              unsigned int multiPattern = 0;
-
-              double chi2 = track->chi2();
-
-              bool truth        = false;
-              int match_barcode = -1;
-      
-              m_trigTracks.push_back( new TIDA::Track(eta, phi, z0, d0, pT, chi2, 
-                                                                   deta, dphi, dz0, dd0, dpT, 
-                                                                   nBlayerHits, nPixelHits, nSctHits,
-                                                                   nSiHits, nStrawHits, nTrHits, 
-                                                                   hitPattern, multiPattern, 
-                                                                   algoid, truth, -1, match_barcode, expectBL) ); 
-          
-              /*double phiAtCalo = 0., etaAtCalo = 0.;
-              // arguments: track, RCalBarrelFace, ZCalEndcapFace, extrapolatated phi, extrapolated phi
-              StatusCode sc = m_l2Extrapolator->extrapolateToCalo((*trackitr), 1470.0*CLHEP::mm, 3800.0*CLHEP::mm, phiAtCalo, etaAtCalo);
-              if(sc.isFailure())  std::cout << "L2 extrapolator failed " << std::endl;   
-              m_phiAtCalo[ int(m_trigTracks.size() - 1) ] = phiAtCalo;
-              m_etaAtCalo[ int(m_trigTracks.size() - 1) ] = etaAtCalo;*/
-              m_trackRois[ int(m_trigTracks.size() - 1) ] = roi;
-              //std::cout << "SUTT ID track " << *t << "\t0x" << std::hex << track->HitPattern() << std::dec << std::endl;
-              //if( !addTrack( t ) ) delete t;
-            } // if(track)
-          } // loop over collection
-          m_provider->msg(MSG::DEBUG) << "... end of getL2tracks." << endmsg;
-        }
-
-        template<class TrackCollection> void getEFtracks(const TrackCollection *collection, int roi) {
-          m_provider->msg(MSG::DEBUG) << "Starting getEFtracks ..." << endmsg;
-    
-          typename TrackCollection::const_iterator trackitr = collection->begin();
-          typename TrackCollection::const_iterator trackend = collection->end();
-          for( ; trackitr != trackend; ++trackitr) {
-            const Rec::TrackParticle* track = (*trackitr);
-            if(track) {
-              static int hpmap[] = { 0, 1, 2, 7, 8, 9, 3, 4, 5, 6, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 };
-
-
-	      // #ifndef TIDA_NEWTRACKING_H
-	      //              const Trk::MeasuredPerigee* measPer = track->measuredPerigee();
-	      // #else
-              const Trk::Perigee* measPer = track->measuredPerigee();
-	      // #endif
-              
-              double pT    = measPer->pT(); 
-              double eta   = measPer->eta();
-              double phi   = measPer->parameters()[Trk::phi0];
-              double z0    = measPer->parameters()[Trk::z0];
-              double d0    = measPer->parameters()[Trk::d0];
-
-              m_provider->msg(MSG::DEBUG) << "current track -- eta = " << eta << " phi = " << phi << endmsg;
-
-              if( measPer->parameters()[Trk::qOverP]<0 ) pT *= -1;
-
-              double deta = 1;
-              double dphi = 1;
-              double dz0  = 1;
-              double dd0  = 1;
-              double dpT  = 1;	 
-
-              // Check number of hits
-              // NB: a spacepoint is two offline "hits", so a pixel spacepoint is really 
-              // 2 "hits" and an offline SCT "hit" is really a 1D cluster, so two intersetcting
-              // stereo clusters making a spacepoint are two "hits"
-              const Trk::TrackSummary *summary = track->trackSummary();
-              int nBlayerHits = 2*summary->get(Trk::numberOfInnermostPixelLayerHits);
-              int nPixelHits  = 2*summary->get(Trk::numberOfPixelHits);  
-              int nSctHits    = summary->get(Trk::numberOfSCTHits); 
-              int nStrawHits  = summary->get(Trk::numberOfTRTHits);
-              int nTrHits     = summary->get(Trk::numberOfTRTHighThresholdHits);
-
-              int nSiHits     = nPixelHits + nSctHits;
-              bool expectBL   = summary->get(Trk::expectInnermostPixelLayerHit);
-
-              const Trk::FitQuality *quality = track->fitQuality();
-              double chi2 = quality->chiSquared();
-
-              unsigned bitmap = 0;
-              
-              for(int ih = 0; ih < 20; ih++ ) {
-                if( summary->isHit(Trk::DetectorType(ih)) )  bitmap |= ( 1<<hpmap[ih] ); 	
-              }
-
-              // now some *ridiculous* code to get the author of the 
-              // TrackParticle (offline) tracks
-              
-              int fitter = track->info().trackFitter();
-              std::string dumpinfo = track->info().dumpInfo();
-              
-              int trackAuthor = -1; 
-              if( fitter > 0 && fitter<Trk::TrackInfo::NumberOfTrackFitters ) {
-                if(      dumpinfo.find("TRTStandalone"       ) != std::string::npos)  trackAuthor = 2;
-                else if( dumpinfo.find("TRTSeededTrackFinder") != std::string::npos)  trackAuthor = 1;
-                else                                                             trackAuthor = 0;
-              }
-
-              m_trigTracks.push_back( new TIDA::Track(eta, phi, z0, d0, pT, chi2,
-                                                                   deta, dphi, dz0, dd0, dpT,
-                                                                   nBlayerHits, nPixelHits, nSctHits,
-                                                                   nSiHits, nStrawHits, nTrHits,
-                                                                   bitmap, 0, trackAuthor, expectBL) );  
-
-              const Trk::TrackParticleBase trk = (Trk::TrackParticleBase)*track;
-              m_provider->msg(MSG::DEBUG) << "original track?? " << trk.originalTrack() << endmsg;
-
-              m_trackRois[ int(m_trigTracks.size() - 1) ] = roi;
-              //std::cout << "SUTT ID track " << *t << "\t0x" << std::hex << track->HitPattern() << std::dec << std::endl;
-              //if( !addTrack( t ) ) delete t;
-              //if(result)  delete result;
-            } // if(track)
-          } // end of loop over collection
-          //delete m_test;
-          m_provider->msg(MSG::DEBUG) << "... end of getEFtracks." << endmsg;
-        }
-
-        void makeClean() {
-          m_provider->msg(MSG::DEBUG) << "Start cleaning... " << endmsg;
-          for(unsigned i=0; i < m_trigTracks.size(); i++) delete m_trigTracks[i];
-          m_trigTracks.clear();
-          m_trackRois.clear();
-          //m_etaAtCalo.clear();
-          //m_phiAtCalo.clear();
-          if(m_selectorJ)  m_selectorJ->clear();
-          if(m_selectorTestA)  m_selectorTestA->clear();
-          if(m_jpsi)  m_jpsi->clear();
-          m_provider->msg(MSG::DEBUG) << "... all clear." << endmsg;
-        }
-
-      private:
-
-        // Beamspot
-        ServiceHandle<IBeamCondSvc> m_iBeamCondSvc;
-        ServiceHandle<IToolSvc> m_toolSvc;
-        //IBeamCondSvc* m_iOnlineBeamCondSvc;
-
-        //ServiceHandle<IBeamCondSvc> m_iBeamCondSvc; // pointer to beam condition service
-        //Trk::VxCandidate* m_beamSpotVxCand;
-          
-        //TrigJpsiTools
-        std::string m_stream;
-        std::string m_tracksName;
-        std::string m_triggerChainName;
-        std::string m_muonCollection;
-        double m_jpsiPDGmass;
-        double m_jpsiwidth;
-        double m_ptcut;
-        double m_tagptcut;
-        double m_etacut;
-        double m_tagetacut;
-        double m_muonMass;
-        double m_plusMass;
-        double m_minusMass;
-        int m_checkrate;
-        int m_events;
-        bool m_TagAndProbe;
-        bool m_useTrigger;  
-        bool m_runOnline;
-
-        unsigned int m_count_before, m_count_after;
-
-        MakeDiMuonsTool* m_jpsi;
-        DuplicateRemover* m_remover;
-
-        TrigTrackSelector* m_selectorTestA;
-        TrigTrackSelector* m_selectorTestB;
-        //ToolHandle<IExtrapolateToCaloTool>      m_efExtrapolator;
-        //ToolHandle<ITrigInDetTrackExtrapolator> m_l2Extrapolator;
-
-        ///temp
-        std::vector<int> m_testtrackRoIs;
-        std::vector<int> m_reftrackRoIs;
-        ///temp
-        //TFile  *fOut;
-        //TH1F   *my_hist;
-        bool   /*my_check,*/ m_isMuon, m_isJpsi;
-        unsigned int m_trigDefs;
-
-        //map<int, std::vector<Track*> > m_trigTracks;
-        std::map<int, int> m_trackRois;
-        //map<int, double> m_phiAtCalo, m_etaAtCalo;
-        std::vector<TIDA::Track*> m_trigTracks;
-
-        // SG
-        std::string m_truthCollection;
-        
-        //selector
-        JpsiTrackSelector* m_selectorJ;
-
-        //associator
-        Associator_BestDeltaRMatcher* m_associatorJ;
-
-        //event info
-        const DataHandle<EventInfo> m_eventInfo;
-
-  };
-}
-
-#endif  // TrigIDJpsiMonitoring_AnalysisConfig_Jpsi_H
-
diff --git a/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/TrigIDJpsiMonitoring/DuplicateRemover.h b/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/TrigIDJpsiMonitoring/DuplicateRemover.h
deleted file mode 100644
index 80bad92cf86a7526480a75a735cdb025b6607e8f..0000000000000000000000000000000000000000
--- a/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/TrigIDJpsiMonitoring/DuplicateRemover.h
+++ /dev/null
@@ -1,522 +0,0 @@
-// emacs: this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// File name: DuplicateRemover.h
-// Description: Method to remove duplicated EF muons from overlapping RoIs
-// Author: Peter Wijeratne (paw@hep.ucl.ac.uk)
-// Author: Christian Gutschow (chris.g@cern.ch)
-
-#ifndef DUPLICATEREMOVER_H
-#define DUPLICATEREMOVER_H
-
-#include "TrigInDetAnalysisUtils/TIDARoiDescriptorBuilder.h"
-
-#include "TrigMuonEvent/TrigMuonEFInfoContainer.h"
-#include "TrigMuonEvent/TrigMuonEFInfo.h"
-#include "TrigMuonEvent/TrigMuonEFTrack.h"
-#include "TrigMuonEvent/TrigMuonEFCbTrack.h"
-#include "TrigMuonEvent/TrigMuonEFInfoTrackContainer.h"
-
-#include "Particle/TrackParticle.h"
-
-#include "TrigSteeringEvent/TrigRoiDescriptorCollection.h" 
-
-//tmp
-#include "TrigDecisionTool/TrigDecisionTool.h"
-
-class DuplicateRemover {
-
-public:
-
-  DuplicateRemover() { }
-  virtual ~DuplicateRemover() { }
-
-  void muonMaker( Trig::FeatureContainer::combination_const_iterator dItr, std::string chain,
-                  ToolHandle<Trig::TrigDecisionTool>* tool, unsigned int &trigDefs) {
-
-
-    //    std::cout << "START REMOVER" << std::endl;
-    //    while(dItr != dEnd){
-    ///tmp
-    //double roiEta0 = 0.;
-    //double roiPhi0 = 0.;
-    ///tmp
-
-    //cout << "duplicate remover -- get features..." << endl;
-
-    std::vector< Trig::Feature<TrigRoiDescriptor> > initRois = dItr->get<TrigRoiDescriptor>("forID", trigDefs);//TrigDefs::Physics); 
-
-    //cout << "duplicate remover -- get init rois..." << endl;
-    if(initRois.empty()) initRois = dItr->get<TrigRoiDescriptor>("", TrigDefs::Physics); 
-    if(initRois.empty()) initRois = dItr->get<TrigRoiDescriptor>("initialRoI", TrigDefs::Physics); 
-
-    //    std::vector< Trig::Feature< TrigMuonEFInfoContainer > > muons = dItr->get< TrigMuonEFInfoContainer >("MuonEFInfo", TrigDefs::Physics);
-   
-    std::string probeTE = "";
-    std::string tagTE = "";
-
-    ///default names are for data 12
-    if(chain.find("_2mu4T_")!=std::string::npos){
-      probeTE = "EF_SA_mu4T_IDTrkNoCut";
-      tagTE = "EF_mu4T";
-    }
-    if(chain.find("_2mu13_")!=std::string::npos){
-      probeTE = "EF_SA_mu13_IDTrkNoCut";
-      tagTE = "EF_mu13";
-    }
-
-    //cout << "duplicate remover -- get tag muons..." << endl;
-    std::vector< Trig::Feature< TrigMuonEFInfoContainer > > tagmuons = dItr->get< TrigMuonEFInfoContainer >("MuonEFInfo", trigDefs, tagTE);
-    //cout << "duplicate remover -- get probe muons..." << endl;
-    std::vector< Trig::Feature< TrigMuonEFInfoContainer > > probemuons = dItr->get< TrigMuonEFInfoContainer >("MuonEFInfo", trigDefs, probeTE);
-
-    //cout << "duplicate remover -- done, try again?" << endl;
-    ///if they've got size 0, it's probably because we're running on data or MC 11; if just 0 probes, probably MC12
-    if( tagmuons.size() == 0 ){
-      if(chain.find("_2mu4T_")!=std::string::npos) tagTE = "EF_MS_mu4T";
-      if(chain.find("_2mu13_")!=std::string::npos) tagTE = "EF_MS_mu13";
-      tagmuons = dItr->get< TrigMuonEFInfoContainer >("MuonEFInfo", TrigDefs::Physics, tagTE);
-    }      
-    if( probemuons.size() == 0 ){
-      if(chain.find("_2mu4T_")!=std::string::npos) probeTE = "EF_MS_mu4T_IDTrkNoCut";
-      if(chain.find("_2mu13_")!=std::string::npos) probeTE = "EF_MS_mu13_IDTrkNoCut";
-      probemuons = dItr->get< TrigMuonEFInfoContainer >("MuonEFInfo", TrigDefs::Physics, probeTE);
-    }
-    
-    /*std::cout << "\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl;
-      std::cout << "!!!!!!!!! tagmuons.size = " << tagmuons.size() << std::endl;
-      std::cout << "!!!!!!!!! probemuons.size = " << probemuons.size() << std::endl;
-      std::cout << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl;*/
-    
-    
-    /*  std::cout << "\n??????????????????????????????????????????????????" << std::endl;
-	std::cout << "????????? muons.size = " << muons.size() << std::endl;
-	std::cout << "????????????????????????????????????????????????????" << std::endl;*/
-    
-    double PI = 3.14159265;
-
-    //////
-    /////// ADD BREAK OUT OF LOOP IF roiIt2 == muons.size()
-    /////
-
-    int probeRoiID = 0;
-    int tagRoiID = 0;
-
-    std::vector<const TrigRoiDescriptor*> rois;
-
-    for( unsigned roiIt1 = 0; roiIt1 < probemuons.size(); roiIt1++ ){
-
-      Trig::Feature< TrigMuonEFInfoContainer > trackFeature1 = probemuons.at(roiIt1);
-      const TrigMuonEFInfoContainer* trigMuon1 = trackFeature1.cptr();
-      TrigMuonEFInfoContainer::const_iterator muonItr1  = trigMuon1->begin();
-      if (muonItr1==trigMuon1->end()) continue;
-      const TrigMuonEFInfo* muoninfo1 = (*muonItr1);
-
-      ///ROI associated with this Feature
-      Trig::Feature<TrigRoiDescriptor> trackroi1 = (*tool)->ancestor<TrigRoiDescriptor>(trackFeature1, "forID");
-      const TrigRoiDescriptor* roid1 = trackroi1.cptr();
-      TIDARoiDescriptor roiInfo1 = TIDARoiDescriptorBuilder(*roid1);
-      /*      std::cout << "\nROI probe eta0 = " << roiInfo1.eta() << " phi0 = " << roiInfo1.phi() << " zed0 = " << roiInfo1.zed()
-	      << "\neta halfwidth = " << roiInfo1.etaHalfWidth() << " phi halfwidth = " << roiInfo1.phiHalfWidth() 
-	      << " Z halfwidth = " << roiInfo1.zedHalfWidth() << " roiId = " << roid1->roiId() << "\n"
-	      << std::endl;*/
-      probeRoiID = roid1->roiId();
-
-      rois.push_back(roid1);
-
-      if( !initRois.empty() ){
-
-        //	const TrigRoiDescriptor* roid1 = initRois[roiIt1].cptr();
-        //	TIDARoiDescriptor roiInfo1 = TIDARoiDescriptorBuilder(*roid1);
-
-        //	std::cout << "\nROI probe eta = " << roiInfo1.eta() << " phi = " << roiInfo1.phi() 
-        //		  << std::endl;
-
-        if( muoninfo1->hasTrack() ){
-	  
-	  const TrigMuonEFInfoTrackContainer* tc1 = muoninfo1->TrackContainer();
-
-	  bool selected = false;
-
-	  for( TrigMuonEFInfoTrackContainer::const_iterator trackItr = tc1->begin(); trackItr != tc1->end(); trackItr++){
-
-	    const TrigMuonEFInfoTrack* muonInfo1 = (*trackItr);
-
-	    if( muonInfo1->hasExtrapolatedTrack() ){
-
-	      TrigMuonEFTrack* eTrack1 = muonInfo1->ExtrapolatedTrack();
-
-	      ///tmp
-	      //			Trig::Feature<TrigRoiDescriptor> trackroi1 = (*tool)->ancestor<TrigRoiDescriptor>(trackFeature1);
-	      //			const TrigRoiDescriptor* roid1 = trackroi1.cptr();
-	      //			std::cout << "\n!!!Probe!!! probe1 RoI eta = " << roid1->eta() << " phi = " << roid1->phi() 
-	      //				  << " probe pt = " << eTrack1->pt() << std::endl;
-	      ///tmp
-
-
-	      //	      std::cout << "RoI " << muoninfo1->RoINum() << " extrapolated track " << *eTrack1 << std::endl;
-
-	      for( unsigned roiIt2 = 0; roiIt2 < probemuons.size(); roiIt2++ ){
-		
-		if( roiIt1 != roiIt2 ){
-
-		  Trig::Feature< TrigMuonEFInfoContainer > trackFeature2 = probemuons.at(roiIt2);
-		  const TrigMuonEFInfoContainer* trigMuon2 = trackFeature2.cptr();
-		  TrigMuonEFInfoContainer::const_iterator muonItr2  = trigMuon2->begin();
-		  const TrigMuonEFInfo* muoninfo2 = (*muonItr2);
-
-		  Trig::Feature<TrigRoiDescriptor> trackroi2 = (*tool)->ancestor<TrigRoiDescriptor>(trackFeature2);
-		  const TrigRoiDescriptor* roid2 = trackroi2.cptr();
-		  TIDARoiDescriptor roiInfo2 = TIDARoiDescriptorBuilder(*roid2);
-
-		  if( !initRois.empty() ){
-
-		    /*		  const TrigRoiDescriptor* roid2 = initRois[roiIt2].cptr();
-				  TIDARoiDescriptor roiInfo2 = TIDARoiDescriptorBuilder(*roid2);*/
-
-		    if( muoninfo2->hasTrack() ){
-		    
-		      const TrigMuonEFInfoTrackContainer* tc2 = muoninfo2->TrackContainer();
-	  
-		      for( TrigMuonEFInfoTrackContainer::const_iterator trackItr = tc2->begin(); trackItr != tc2->end(); trackItr++){
-	  
-			const TrigMuonEFInfoTrack* muonInfo2 = (*trackItr);
-	  
-			if( muonInfo2->hasExtrapolatedTrack() ){
-
-			  TrigMuonEFTrack* eTrack2 = muonInfo2->ExtrapolatedTrack();
-
-			  ///tmp
-			  //			Trig::Feature<TrigRoiDescriptor> trackroi2 = (*tool)->ancestor<TrigRoiDescriptor>(trackFeature2);
-			  //			const TrigRoiDescriptor* roid2 = trackroi2.cptr();
-			  //			std::cout << "\n!!!Probe!!! probe2 RoI eta = " << roid2->eta() << " phi = " << roid2->phi0() 
-			  //				  << " probe pt = " << eTrack2->pt() << std::endl;
-			  ///tmp
-
-			  //	std::cout << "RoI " << muoninfo2->RoINum() << " extrapolated track " << *eTrack2 << std::endl;
-
-			  double deta = (eTrack1->eta() - eTrack2->eta());
-			  double dphi = (eTrack1->phi() - eTrack2->phi());
-			  if ( dphi > PI ) dphi -= 2*PI;
-			  if ( dphi < -PI ) dphi += 2*PI;
-
-			  ///tmp
-			  //roiEta0 = roiInfo1.eta();
-			  //roiPhi0 = roiInfo1.phi();
-			  ///tmp
-
-			  if( muoninfo1->RoINum() != muoninfo2->RoINum() && ((std::fabs(deta) < 0.08) && (std::fabs(dphi) < 0.08)) ){
-			    /// probably the same track
-
-			    double dphi1 = eTrack1->phi() - roiInfo1.phi();
-			    double dphi2 = eTrack2->phi() - roiInfo2.phi();
-			    if ( dphi1 > PI ) dphi1 -= 2*PI;
-			    if ( dphi1 < -PI ) dphi1 += 2*PI;
-			    if ( dphi2 > PI ) dphi2 -= 2*PI;
-			    if ( dphi2 < -PI ) dphi2 += 2*PI;
-			    /// track angles with respect to their RoIs
-			    double deltarT1Roi1 = std::fabs( pow(eTrack1->eta() - roiInfo1.eta(),2) + pow(dphi1,2) );
-			    double deltarT2Roi2 = std::fabs( pow(eTrack2->eta() - roiInfo2.eta(),2) + pow(dphi2,2) );
-
-			    /// pick the roi that is better aligned with this track
-			    if( deltarT1Roi1 > deltarT2Roi2 ){
-			      eTrack1 = eTrack2;
-			      ///tmp
-			      ///tmp
-			      //roiEta0 = roiInfo2.eta();
-			      //roiPhi0 = roiInfo2.phi();
-			      ///tmp
-			      /// want to keep this information to check if probe was matched to an ID
-			      muonInfo1 = muonInfo2;
-			      roiInfo1 = roiInfo2;
-			      //			    std::cout << "Switched!" << std::endl;
-			    }
-			  
-			  }//check duplcates - pick 1 closest to centre of its RoI
-			  
-			}
-		      } // loop over tracks from RoI 2
-		    } // muoninfo2->hasTrack()
-		  } // if ! initRois.empty()
-
-		  //cout << "muonInfo1: " << muonInfo1 << endl;
-		  //cout << "roiInfo1: " << roiInfo1 << endl;
-
-		}//roi1!=roi2
-		
-	      }//start 2nd RoI loop
-	      	      
-	      for( std::vector<const TrigMuonEFTrack*>::const_iterator setIt = m_muonExtrapolatedTracks.begin(); setIt != m_muonExtrapolatedTracks.end(); ++setIt){
-		
-		double deta = ((*setIt)->eta() - eTrack1->eta());
-		double dphi = ((*setIt)->phi() - eTrack1->phi());
-		if ( dphi > PI ) dphi -= 2*PI;
-		if ( dphi < -PI ) dphi += 2*PI;
-		
-		if( (std::fabs(deta) < 0.08) && (std::fabs(dphi) < 0.08) ){
-		  selected = true;
-		}
-	      }
-	      
-	      if( !selected ){
-		m_muonExtrapolatedTracks.push_back(eTrack1);
-		m_probeRoIs.push_back(probeRoiID);
-		if(muonInfo1->hasCombinedTrack()){
-		  //		  std::cout << "This should happen most of the time... " << (muonInfo1->CombinedTrack())->getIDTrackParticle() << std::endl;
-		  m_matchedProbes.push_back((muonInfo1->CombinedTrack())->getIDTrackParticle());
-		  //tmp
-		}
-		else m_matchedProbes.push_back(NULL);
-		// std::cout << "\nExtrapolatedTrack1 inserted." << *eTrack1 << "\n" << std::endl;
-	      }
-	      
-	    }//extrapolated track?
-	  }
-	}
-      }
-    }
-
-    //int iroi = 0;
-    for( unsigned roiIt1 = 0; roiIt1 < tagmuons.size(); roiIt1++ ){
-      Trig::Feature< TrigMuonEFInfoContainer > trackFeature1 = tagmuons.at(roiIt1);
-      Trig::Feature<TrigRoiDescriptor> trackroi1 = (*tool)->ancestor<TrigRoiDescriptor>(trackFeature1, "");
-      const TrigRoiDescriptor* roid1 = trackroi1.cptr();
-      rois.push_back(roid1);
-      //cout <<iroi++ << "rois: " << rois.back() << endl;
-    }
-    
-    for( unsigned roiIt1 = 0; roiIt1 < tagmuons.size(); roiIt1++ ){
-
-      ///tmp
-      //double roiEta = 0.;
-      //double roiPhi = 0.;
-      ///tmp
-      
-      Trig::Feature< TrigMuonEFInfoContainer > trackFeature1 = tagmuons.at(roiIt1);
-      const TrigMuonEFInfoContainer* trigMuon1 = trackFeature1.cptr();
-      TrigMuonEFInfoContainer::const_iterator muonItr1  = trigMuon1->begin();
-      const TrigMuonEFInfo* muoninfo1 = (*muonItr1);
-
-      ///ROI associated with this Feature
-      Trig::Feature<TrigRoiDescriptor> trackroi1 = (*tool)->ancestor<TrigRoiDescriptor>(trackFeature1, "");
-      const TrigRoiDescriptor* roid1 = trackroi1.cptr();
-      TIDARoiDescriptor roiInfo1 = TIDARoiDescriptorBuilder(*roid1);
-      /*                  std::cout << "\nROI tag eta0 = " << roiInfo1.eta() << " phi0 = " << roiInfo1.phi() << " zed0 = " << roiInfo1.zed()
-			  << "\neta halfwidth = " << roiInfo1.etaHalfWidth() << " phi halfwidth = " << roiInfo1.phiHalfWidth() 
-			  << " Z halfwidth = " << roiInfo1.zedHalfWidth() << " roiId = " << roid1->roiId() << "\n"
-			  << std::endl;*/
-
-      if( !initRois.empty() ){
-	
-	/*	const TrigRoiDescriptor* roid1 = initRois[roiIt1].cptr();
-		TIDARoiDescriptor roiInfo1 = TIDARoiDescriptorBuilder(*roid1);
-		roiID = roid1->roiId();
-		std::cout << "\nROI tag eta = " << roiInfo1.eta() << " phi = " << roiInfo1.phi0() 
-		<< std::endl;
-		//	std::cout << "\\\\roid1 = " << roid1->roiId() << std::endl;
-		*/
-	if( muoninfo1->hasTrack() ){
-	  
-	  const TrigMuonEFInfoTrackContainer* tc1 = muoninfo1->TrackContainer();
-
-	  bool selected = false;
-
-	  for( TrigMuonEFInfoTrackContainer::const_iterator trackItr = tc1->begin(); trackItr != tc1->end(); trackItr++){
-
-	    const TrigMuonEFInfoTrack* muonInfo1 = (*trackItr);
-	  
-	    if( muonInfo1->hasCombinedTrack() ){
-
-	      tagRoiID = roid1->roiId();
-
-	      TrigMuonEFCbTrack* eTrack1 = muonInfo1->CombinedTrack();
-
-	      // check if it actually fits the RoI
-	      if(tc1->size() > 1){
-		int index = 0;
-		double deltar = 0.;
-		double temp = 9999.;
-		for(unsigned i=0; i<rois.size(); i++){
-		  const Rec::TrackParticle* idComp = eTrack1->getIDTrackParticle();
-		  //double roiEtaHalfWidth = rois[i]->etaHalfWidth();
-		  //double roiPhiHalfWidth = rois[i]->phiHalfWidth();
-		  double roiEta = rois[i]->eta();
-		  double roiPhi = rois[i]->phi();
-		  double deltaPhi1 = 0.;
-		  if(idComp) deltaPhi1 = idComp->phi() - roiPhi;
-		  else deltaPhi1 = eTrack1->phi() - roiPhi;
-		  if ( deltaPhi1 > PI ) deltaPhi1 -= 2*PI;
-		  if ( deltaPhi1 < -PI ) deltaPhi1 += 2*PI;
-		  if(idComp) deltar = std::sqrt( std::pow(deltaPhi1,2) + std::pow(idComp->eta() - roiEta, 2) );
-		  else deltar = std::sqrt( std::pow(deltaPhi1,2) + std::pow(eTrack1->eta() - roiEta, 2) );
-		  //	      std::cout << "\ndeltaPhi = " << deltaPhi1 << " deta = " << idComp->eta() - roiEta << std::endl;
-		  if(deltar < temp){ 
-		    index = i;
-		    temp = deltar;
-		  }
-		  
-		  /*	      if(std::fabs(idComp->eta() - roiEta) > roiEtaHalfWidth || std::fabs(deltaPhi1) > roiPhiHalfWidth){
-			      std::cout << "Switching tag RoI ID from " << tagRoiID << " to " << probeRoiID << " because dEta = " << std::fabs(idComp->eta() - roiEta)
-			      << " dPhi = " << std::fabs(deltaPhi1) << " and roiEtaHalfWidth = " << roiEtaHalfWidth << " roiPhiHalfWidth = "
-			      << roiPhiHalfWidth
-			      << "\ntag with eta = " << idComp->eta() << " phi = " << idComp->phi() 
-			      << "\nancestor roiId = " << tagRoiID << " trigmuon EDM roiNum = " << muoninfo1->RoINum() 
-			      << std::endl;
-			      tagRoiID = probeRoiID;
-			      }*/
-		}
-		//		std::cout << "Chose index " << index << " with deltar " << temp << " rois.size " << rois.size() << std::endl;
-		tagRoiID = rois[index]->roiId();
-	      }
-	      ///tmp
-	      //			Trig::Feature<TrigRoiDescriptor> trackroi1 = (*tool)->ancestor<TrigRoiDescriptor>(trackFeature1);
-	      //			const TrigRoiDescriptor* roid1 = trackroi1.cptr();
-	      //			std::cout << "\n!!!Tag!!! tag1 RoI eta = " << roid1->eta() << " phi = " << roid1->phi0() 
-	      //				  << " tag pt = " << eTrack1->pt() << std::endl;
-	      ///tmp
-	      
-	      //	      std::cout << "RoI " << muoninfo1->RoINum() << " combined track " << *eTrack1 << std::endl;
-
-	      for( unsigned roiIt2 = roiIt1+1; roiIt2 < tagmuons.size(); roiIt2++ ){
-
-		Trig::Feature< TrigMuonEFInfoContainer > trackFeature2 = tagmuons.at(roiIt2);
-		const TrigMuonEFInfoContainer* trigMuon2 = trackFeature2.cptr();
-		TrigMuonEFInfoContainer::const_iterator muonItr2  = trigMuon2->begin();
-		const TrigMuonEFInfo* muoninfo2 = (*muonItr2);
-
-		Trig::Feature<TrigRoiDescriptor> trackroi2 = (*tool)->ancestor<TrigRoiDescriptor>(trackFeature2);
-		const TrigRoiDescriptor* roid2 = trackroi2.cptr();
-		TIDARoiDescriptor roiInfo2 = TIDARoiDescriptorBuilder(*roid2);
-
-		if( !initRois.empty() ){
-
-		  /*		  const TrigRoiDescriptor* roid2 = initRois[roiIt2].cptr();
-				  TIDARoiDescriptor roiInfo2 = TIDARoiDescriptorBuilder(*roid2);*/
-
-		  if( muoninfo2->hasTrack() ){
-
-		    const TrigMuonEFInfoTrackContainer* tc2 = muoninfo2->TrackContainer();
-	  
-		    for( TrigMuonEFInfoTrackContainer::const_iterator trackItr = tc2->begin(); trackItr != tc2->end(); trackItr++){
-	  
-		      const TrigMuonEFInfoTrack* muonInfo2 = (*trackItr);
-	  
-		      if( muonInfo2->hasCombinedTrack() ){
-
-			TrigMuonEFCbTrack* eTrack2 = muonInfo2->CombinedTrack();
-
-			///tmp
-			//			Trig::Feature<TrigRoiDescriptor> trackroi2 = (*tool)->ancestor<TrigRoiDescriptor>(trackFeature2);
-			//			const TrigRoiDescriptor* roid2 = trackroi2.cptr();
-			//			std::cout << "!!!Tag!!! tag2 RoI eta = " << roid2->eta() << " phi = " << roid2->phi0() 
-			//				  << " tag pt = " << eTrack2->pt() << std::endl;
-			///tmp
-
-			//	std::cout << "RoI " << muoninfo2->RoINum() << " combined track " << *eTrack2 << std::endl;
-
-			double deta = (eTrack1->eta() - eTrack2->eta());
-			double dphi = (eTrack1->phi() - eTrack2->phi());
-			if ( dphi > PI ) dphi -= 2*PI;
-			if ( dphi < -PI ) dphi += 2*PI;
-
-			//tmp
-			//roiEta = roiInfo1.eta();
-			//roiPhi = roiInfo1.phi();
-			//tmp
-			
-			if( muoninfo1->RoINum() != muoninfo2->RoINum() && ((std::fabs(deta) < 0.08) && (std::fabs(dphi) < 0.08)) ){
-			  
-			  double dphi1 = eTrack1->phi() - roiInfo1.phi();
-			  double dphi2 = eTrack2->phi() - roiInfo2.phi();
-			  if ( dphi1 > PI ) dphi1 -= 2*PI;
-			  if ( dphi1 < -PI ) dphi1 += 2*PI;
-			  if ( dphi2 > PI ) dphi2 -= 2*PI;
-			  if ( dphi2 < -PI ) dphi2 += 2*PI;
-			  double deltarT1Roi1 = std::fabs( pow(eTrack1->eta() - roiInfo1.eta(),2) + pow(dphi1,2) );
-			  double deltarT2Roi2 = std::fabs( pow(eTrack2->eta() - roiInfo2.eta(),2) + pow(dphi2,2) );
-			  
-			  if( deltarT1Roi1 > deltarT2Roi2 ){
-			    eTrack1 = eTrack2;
-			    //			    tagRoiID = roid2->roiId();
-			    //			    std::cout << "\\\\roid2 = " << roid2->roiId() << std::endl;
-			    //			    std::cout << "Switched!" << std::endl;
-			    //tmp
-			    //roiEta = roiInfo2.eta();
-			    //roiPhi = roiInfo2.phi();
-			    //tmp
-			  }
-			  roiInfo1 = roiInfo2;			  
-			}//check duplicates - pick 1 closest to centre of its RoI
-			
-		      }
-		    }
-		  }
-		}
-	      }//start 2nd RoI loop
-
-	      for( std::vector<const TrigMuonEFCbTrack*>::const_iterator setIt = m_muonCombinedTracks.begin(); setIt != m_muonCombinedTracks.end(); ++setIt){
-		
-		double deta = ((*setIt)->eta() - eTrack1->eta());
-		double dphi = ((*setIt)->phi() - eTrack1->phi());
-		if ( dphi > PI ) dphi -= 2*PI;
-		if ( dphi < -PI ) dphi += 2*PI;
-		
-		if( (std::fabs(deta) < 0.08) && (std::fabs(dphi) < 0.08) ){
-		  selected = true;
-		}
-	      }
-	      
-	      if( !selected ){
-		m_muonCombinedTracks.push_back(eTrack1); 
-		m_tagRoiInfo.push_back(roiInfo1);
-		//		std::cout << "DuplicateRemover finds tag with roiNum = " << tagRoiID << " eta = " << eTrack1->eta() << " phi = " << eTrack1->phi() << std::endl;
-		m_tagRoIs.push_back(tagRoiID);
-		//std::cout << "\nCombinedTrack1 inserted." << *eTrack1 << "\n" << std::endl;
-	      }
-	      
-	    }//combined track?	    
-	    
-	  }//start track container loop
-	}//if has roi
-      }//if has track
-    }//start 1st RoI loop 
-
-    //    dItr++;
-    //    }
-    
-  }
-  
-  virtual void clear() {
-    m_muonExtrapolatedTracks.clear(); m_muonCombinedTracks.clear(); 
-    m_matchedProbes.clear();          m_tagRoIs.clear(); 
-    m_probeRoIs.clear();              m_tagRoiInfo.clear();
-  }
-  
-  std::vector< const TrigMuonEFTrack* > getExTrks() const { return m_muonExtrapolatedTracks; }
-  std::vector< const TrigMuonEFCbTrack* > getCbTrks() const { return m_muonCombinedTracks; }
-
-  std::vector< const Rec::TrackParticle* > getMatches() { return m_matchedProbes; };
-
-  ///temp, store tag muon RoI number
-  std::vector<int> getTagRoIs() { return m_tagRoIs; }
-  std::vector<int> getProbeRoIs() { return m_probeRoIs; }
-  std::vector<TIDARoiDescriptor> getRoiInfo() { return m_tagRoiInfo; }
-  
-protected:
-  
-  std::vector< const TrigMuonEFTrack* > m_muonExtrapolatedTracks;
-  std::vector< const TrigMuonEFCbTrack* > m_muonCombinedTracks;
-
-  std::vector< const Rec::TrackParticle* > m_matchedProbes;
-  
-  ///temp
-  std::vector<int> m_tagRoIs;
-  std::vector<int> m_probeRoIs;
-  std::vector<TIDARoiDescriptor> m_tagRoiInfo;
-  
-};
-
-#endif
diff --git a/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/TrigIDJpsiMonitoring/JpsiAnalysis.h b/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/TrigIDJpsiMonitoring/JpsiAnalysis.h
deleted file mode 100644
index 7e0fb6e7566fea7764aed1fd0be3fac4a0c90522..0000000000000000000000000000000000000000
--- a/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/TrigIDJpsiMonitoring/JpsiAnalysis.h
+++ /dev/null
@@ -1,253 +0,0 @@
-// emacs: this is -*- c++ -*-
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-//
-//   @file    JpsiAnalysis.h       
-//
-//                   
-//
-//
-//   $Id: SigAnalysis.h, v0.0   Wed 28 Oct 2009 02:41:51 CET sutt $
-
-//edits P. Wijeratne (paw@hep.ucl.ac.uk)	
-//edits C. Gutschow (chris.g@cern.ch)	
-	
-#ifndef __JPSIANALYSIS_H
-#define __JPSIANALYSIS_H
-
-#include <iostream>
-#include <vector>
-#include <map>
-
-#include "TrigInDetAnalysis/TrackAnalysis.h"
-#include "TrigInDetAnalysis/Track.h"
-#include "TrigInDetAnalysis/Efficiency.h"
-#include "TrigInDetAnalysis/TIDDirectory.h"
-
-#include "TrigIDJpsiMonitoring/JpsiTrack.h"
-
-#include "TH1F.h"
-#include "TH2F.h"
-#include "TProfile.h"
-
-///temp
-#include "EventInfo/EventInfo.h"
-#include "EventInfo/EventID.h"
-#include "TrigHLTMonitoring/IHLTMonTool.h"
-
-///temp
-#include "TrigInDetAnalysis/TIDARoiDescriptor.h"
-
-class JpsiAnalysis : public TrackAnalysis {
-	 
-public:
-
-  JpsiAnalysis( const std::string& name ) : TrackAnalysis( name ), m_chainName(name),
-                                            m_plusMass(0), m_minusMass(0),
-                                            //Nreco(0),
-                                            m_print(true), m_keepHistos(true), m_speaker(0) { 
-  } 
-	
-  ~JpsiAnalysis() {
-    
-    if(!m_keepHistos){
-      std::map<std::string, TH1F*>::iterator hitr=m_histos.begin();
-      std::map<std::string, TH1F*>::iterator hend=m_histos.end();
-      for ( ; hitr!=hend ; hitr++ ) delete hitr->second;     
-      
-      std::map<std::string, TProfile*>::iterator tphitr=m_tphistos.begin();
-      std::map<std::string, TProfile*>::iterator tphend=m_tphistos.end();
-      for ( ; tphitr!=tphend ; tphitr++ ) delete tphitr->second;
-      
-      //    delete h2; delete h2r; delete h2m;
-    }
-
-  } 
-	 
-  virtual void initialise();
-	
-  virtual void execute(const std::vector<TIDA::Track*>& reftracks,
-                       const std::vector<TIDA::Track*>& testtracks,
-                       TrackAssociator* matcher);
-
-  virtual void finalise();
-
-  //helper functions
-  float deltaR(float eta1, float phi1, float eta2, float phi2);
-  float deltaPhi(float phi1, float phi2);
-  float fixPhi(float phi);
-	 
-  void setprint(bool p) { m_print=p; }
-  
-  std::map<std::string, TH1F*>::const_iterator THbegin() const { return m_histos.begin(); }
-  std::map<std::string, TH1F*>::const_iterator THend()   const { return m_histos.end(); }
-
-  std::map<std::string, TProfile*>::const_iterator TPbegin() const { return m_tphistos.begin(); }
-  std::map<std::string, TProfile*>::const_iterator TPend()   const { return m_tphistos.end(); }
-
-  std::map<std::string, TH2F*>::const_iterator TH2begin() const { return m_histos2d.begin(); }
-  std::map<std::string, TH2F*>::const_iterator TH2end()   const { return m_histos2d.end(); }
-
-  const std::map<std::string, TH1F*>& getHistograms() const { return m_histos; }	
-
-  void setChainName( const std::string& c ){ m_chainName = c; }  
-
-  void setPlusMass( const double& pm ){ m_plusMass = pm; }  
-  void setMinusMass( const double& mm ){ m_minusMass = mm; }  
-
-  void setTracksA( const std::vector<TIDA::Track*>& tracksA ){ m_idTracksA = tracksA; }
-  void setTracksB( const std::vector<TIDA::Track*>& tracksB ){ m_idTracksB = tracksB; }
-
-  void setSuperTracks( const std::vector< std::vector<TIDA::Track*> >& superTracks ){ m_superTracks = superTracks; }
-  void clearSuper(){ 
-    std::cout << "m_superTracks " << m_superTracks.size() << std::endl;
-    for(unsigned i=m_superTracks.size(); i--; ){
-      const std::vector<TIDA::Track*> temp = m_superTracks[i];
-      for(unsigned j=temp.size(); j--; ){
-	std::cout << "about to crash... " << temp.size() << " temp[0] eta " << temp[j]->eta() << " j " << j << std::endl;
-	delete temp[j];
-	std::cout << " ... " << std::endl;
-      }
-      m_superTracks[i].clear();
-    } 
-    m_superTracks.clear(); 
-    std::cout << "OUT" << std::endl;
-  }
-
-  void setTIDARois(std::map<int, int>    &m) { m_trackRois = &m; }
-  //void setEtaAtCalo(std::map<int, double> &m) { m_etaAtCalo = &m; }
-  //void setPhiAtCalo(std::map<int, double> &m) { m_phiAtCalo = &m; }
-
-  void clearOffline(){ m_offlineProbes->clear(); m_offlineTags->clear(); }
-  void setOfflineProbes( std::map<unsigned int, const Rec::TrackParticle*>& offs ){ 
-    m_offlineProbes = &offs;
-  }
-  void setOfflineTags(   std::map<unsigned int, const Rec::TrackParticle*>& offs ){ 
-    m_offlineTags = &offs;
-  }
-  void setSpeaker(IHLTMonTool* p){ m_speaker = p; }
-  void setVertices(std::vector<TIDA::Vertex*> &v){ m_vertices = v; }
-  void setTool(ToolHandle<Trig::TrigDecisionTool> *t){ m_tool = t; }
-  void setProbeOfflineDr( std::vector<float> &pOffDr ){ m_pOffDr = &pOffDr; }
-  void setProbeOfflineEt( std::vector<float> &pOffEt ){ m_pOffEt = &pOffEt; }
-  void setProbeOfflineDEta( std::vector<float> &pOffDeta ){ m_pOffDeta = &pOffDeta; }
-  void setProbeOfflineDPhi( std::vector<float> &pOffDphi ){ m_pOffDphi = &pOffDphi; }
-  void setProbeOfflineCharge( std::vector<float> &pOffCharge ){ m_pOffCharge = &pOffCharge; }
-  void setTagOfflineDr( std::vector<float> &tOffDr ){ m_tOffDr = &tOffDr; }
-  void setTagOfflineCharge( std::vector<float> &tOffCharge ){ m_tOffCharge = &tOffCharge; }
-  void setCase( bool isMuon, bool isJpsi ){ m_isMuon = isMuon; m_isJpsi = isJpsi; }
-
-  private:
-	 
-  void addHistogram( TH1F* h ) {
-      std::string name = h->GetName();
-      m_histos.insert( std::map<std::string, TH1F*>::value_type( name, h) );
-   }
-
-  void addHistogram( TProfile* h ) {
-    std::string name = h->GetName();
-    m_tphistos.insert( std::map<std::string, TProfile*>::value_type( name, h) );
-  }
-
-  void addHistogram( TH2F* h ) {
-    std::string name = h->GetName();
-    m_histos2d.insert( std::map<std::string, TH2F*>::value_type( name, h) );
-  }
-
-  TH1F* find( const std::string& n ) {
-    m_speaker->msg(MSG::DEBUG) << "name: " << n << endmsg;
-    std::map<std::string, TH1F*>::iterator hmitr = m_histos.find(n);
-    if ( hmitr!=m_histos.end() ) { 
-      m_speaker->msg(MSG::DEBUG) << "hmitr for " << n << ": " << hmitr->second << endmsg;
-      return hmitr->second;
-    }
-    return 0;
-  }
-
-  private:
-
-  std::string m_chainName;
-  double m_plusMass;
-  double m_minusMass;
-
-  std::map<std::string, TH1F*> m_histos;
-  std::map<std::string, TProfile*> m_tphistos;
-  std::map<std::string, TH2F*> m_histos2d;
-
-  std::vector<TIDA::Track*> m_idTracksA;
-  std::vector<TIDA::Track*> m_idTracksB;
-
-  std::vector< std::vector<TIDA::Track*> > m_superTracks;
-  
-  TProfile* m_pT_eff;
-  TProfile* m_eta_eff;	
-  TProfile* m_z0_eff;
-  TProfile* m_d0_eff;
-  TProfile* m_phi_eff;
-  TProfile* m_vert_eff;
-  TProfile* m_track_eff;
-  TProfile* m_invmass_eff;
-
-  ///temp
-  TProfile* m_pT_eff_d0cut;
-  TProfile* m_eta_eff_d0cut;	
-  TProfile* m_z0_eff_d0cut;
-  TProfile* m_d0_eff_d0cut;
-  TProfile* m_phi_eff_d0cut;
-  TProfile* m_vert_eff_d0cut;
-  TProfile* m_track_eff_d0cut;
-  TProfile* m_invmass_eff_d0cut;
-
-  TProfile* m_pT_eff_offline;
-  TProfile* m_eta_eff_offline;	
-  TProfile* m_z0_eff_offline;
-  TProfile* m_d0_eff_offline;
-  TProfile* m_phi_eff_offline;
-  TProfile* m_vert_eff_offline;
-  TProfile* m_track_eff_offline;
-  TProfile* m_invmass_eff_offline;
-
-  ///temp
-  TProfile* m_pT_eff_d0cut_offline;
-  TProfile* m_eta_eff_d0cut_offline;	
-  TProfile* m_z0_eff_d0cut_offline;
-  TProfile* m_d0_eff_d0cut_offline;
-  TProfile* m_phi_eff_d0cut_offline;
-  TProfile* m_vert_eff_d0cut_offline;
-  TProfile* m_track_eff_d0cut_offline;
-  TProfile* m_invmass_eff_d0cut_offline;
-
-  //TProfile* m_pT_pur;
-  //TProfile* m_eta_pur;
-  //TProfile* m_phi_pur;
-  //TProfile* m_z0_pur;
-  //TProfile* m_d0_pur;
-  //TProfile* m_dRvspT;
-	
-  //  TH2F* h2;
-  //  TH2F* h2m;
-  //  TH2F* h2r;
-
-  /// number of reconstructed tracks
-  //int Nreco;
-
-  /// flag to print out the matched tracks etc
-  bool m_print, m_isMuon, m_isJpsi, m_keepHistos;
-
-  ///temp
-  std::map<unsigned int, const Rec::TrackParticle*> *m_offlineProbes;
-  std::map<unsigned int, const Rec::TrackParticle*> *m_offlineTags;
-  //std::map<int, double> *m_etaAtCalo, *m_phiAtCalo;
-  std::map<int, int> *m_trackRois;
-  IHLTMonTool* m_speaker;
-  std::vector<TIDA::Vertex*> m_vertices;
-  ToolHandle<Trig::TrigDecisionTool>* m_tool;
-  const DataHandle<EventInfo> m_eventInfo;
-  std::vector<float> *m_pOffDr,     *m_tOffDr,     *m_pOffDeta, *m_pOffDphi,
-                     *m_pOffEt,     *m_pOffCharge, *m_tOffCharge;
-  ///temp
-
-};
-	
-#endif  // __JPSIANALYSIS_H 
diff --git a/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/TrigIDJpsiMonitoring/JpsiEfficiency.h b/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/TrigIDJpsiMonitoring/JpsiEfficiency.h
deleted file mode 100644
index 1fd2066756b3a028400c55c77e5e1b5422da6d5c..0000000000000000000000000000000000000000
--- a/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/TrigIDJpsiMonitoring/JpsiEfficiency.h
+++ /dev/null
@@ -1,75 +0,0 @@
-// emacs: this is -*- c++ -*- 
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-//
-//   @file    JpsiEfficiency.h        
-//
-//                   
-// 
-//
-//   $Id: TrackEfficiency.h, v0.0   Sun 18 Jan 2009 19:08:11 GMT sutt $
-
-//edits P.Wijeratne (paw@hep.ucl.ac.uk)
-
-#ifndef __JPSIEFFICIENCY_H 
-#define __JPSIEFFICIENCY_H 
-
-
-#include <iostream>
-
-#include "TrigInDetAnalysis/TrackAnalysis.h"
-
-// class Track;
-// class Effplot;
-// class Resplot;
-
-
-class JpsiEfficiency : public TrackAnalysis { 
-  
-public:
-  
-  JpsiEfficiency( const std::string& name ) : 
-    TrackAnalysis( name )
-  { }  
-  
-  virtual void initialise();
-
-  virtual void execute(const std::vector<TIDA::Track*>& tracks1,
-		       const std::vector<TIDA::Track*>& tracks2,
-		       TrackAssociator* matcher);
-
-  virtual void finalise();
-  
-private:
-
-#if 0
-  // efficiency histograms
-  Effplot*  effvsPT;
-  Effplot*  effvseta;
-  Effplot*  effvsphi;
-  Effplot*  effvsd0;
-
-  // resolution histograms 
-  Resplot* iptvipt;
-  Resplot* ptvpt;
-  Resplot* phivpt;
-  Resplot* etavpt;
-  Resplot* z0vpt;
-  Resplot* d0vpt;
-
-  Resplot* ptveta;
-  Resplot* iptveta;
-  Resplot* phiveta;
-  Resplot* etaveta;
-  Resplot* z0veta;
-
-  Resplot* z0vz0;
-  Resplot* d0vd0;
-
-#endif
-
-};
-
-
-#endif // __JPSIEFFICIENCY_H 
diff --git a/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/TrigIDJpsiMonitoring/JpsiTrack.h b/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/TrigIDJpsiMonitoring/JpsiTrack.h
deleted file mode 100644
index a77f32dc6dc02a9437f4271e1a43b480a99c4742..0000000000000000000000000000000000000000
--- a/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/TrigIDJpsiMonitoring/JpsiTrack.h
+++ /dev/null
@@ -1,79 +0,0 @@
-// emacs: this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-/** @file JpsiTrack.h **/
-/** @author Peter Wijeratne (paw@hep.ucl.ac.uk) **/
-
-#ifndef TrigIDJpsiMonitoring_JpsiTrack_H
-#define TrigIDJpsiMonitoring_JpsiTrack_H
-
-#include <iostream>
-#include <vector>
-
-#include "TrigInDetAnalysis/Track.h"
-#include "TrigInDetAnalysis/TIDAVertex.h"
-
-#include "TrigJPsiTools/MakeDiMuonsTool.h"
-
-#include "Particle/TrackParticle.h"
-
-namespace TIDA{
-
-class JpsiTrack : public TIDA::Track {
-
- public:
-
-  JpsiTrack(const TIDA::Track& t) : TIDA::Track(t) { }
-  
-  JpsiTrack(const TIDA::Track& t, const Rec::TrackParticle* m, DiMuonTool *pair, int roi) : TIDA::Track(t), m_match(m) {
-    //std::cout << "JpsiTrack constructor called." << std::endl;
-    //std::cout << "pair (pointer): " << pair << std::endl;
-    m_pair = pair;
-    m_roi = roi;
-    /*std::cout << "Call probed track..." << std::endl;
-    const Wrapper::MuonTrack* probeTrack = m_pair->ProbedTrack();
-    std::cout << "... done. Call tagged track..." << std::endl;
-    const Wrapper::MuonTrack* tagTrack = m_pair->TaggedTrack();
-    std::cout << "...done." << std::endl;
-    std::cout << "... end of JpsiTrack constructor." << std::endl;*/
-  }
-
-  virtual ~JpsiTrack() { }
-
-  const Rec::TrackParticle* hasMatch() { return m_match; }
-
-  const Wrapper::MuonTrack* getTag() { 
-    //std::cout << "JpsiTrack -- getTag() -- m_pair: " << m_pair << std::endl;
-    return m_pair->TaggedTrack();
-  }
-
-  double px() const { return ( pT() * cos( phi() ) ); }
-  double py() const { return ( pT() * sin( phi() ) ); }
-  double pz() const { return ( pT() * cos( 2. * atan(exp(-eta())) ) / sin( 2. * atan(exp(-eta())) ) ); }
-  double mass() { return m_pair->InvariantMass(); }
-
-  int getRoiNum() { return m_roi; }
-
-  const DiMuonTool* tool() const { return m_pair; }
-
- private:
-
-  const Rec::TrackParticle *m_match;
-  DiMuonTool *m_pair;
-  int m_roi;
-
-};
-
-
-
-inline std::ostream& operator<<( std::ostream& s, const JpsiTrack& t) {
-  s << *((Track*)(&t)) << "m_pair address: " << t.tool() << "  " << std::endl;
-  return s << "\t" << *t.tool();
-}
-
-}
-
-#endif
diff --git a/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/TrigIDJpsiMonitoring/JpsiTrackSelector.h b/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/TrigIDJpsiMonitoring/JpsiTrackSelector.h
deleted file mode 100644
index 28c46c7930476eb16918b4ecc2330c1f97b565ab..0000000000000000000000000000000000000000
--- a/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/TrigIDJpsiMonitoring/JpsiTrackSelector.h
+++ /dev/null
@@ -1,114 +0,0 @@
-// emacs: this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-/** @file JpsiTrackSelector.h **/
-/** @author Peter Wijeratne (paw@hep.ucl.ac.uk) **/
-
-#ifndef TrigIDJpsiMonitoring_JpsiTrackSelector_H
-#define TrigIDJpsiMonitoring_JpsiTrackSelector_H
-
-#include "TrigInDetAnalysis/TIDAVertex.h"
-
-#include "TrigInDetAnalysisUtils/TrigTrackSelector.h"
-
-#include "TrigIDJpsiMonitoring/JpsiTrack.h"
-#include "TrigMuonEvent/TrigMuonEFTrack.h"
-
-#include "Particle/TrackParticle.h"
-
-class JpsiTrackSelector : public TrigTrackSelector {
-
- public:
-
-  JpsiTrackSelector( TrackFilter* selector) : TrigTrackSelector( selector ) { }
- 
-  void addJpsi(std::vector<DiMuonTool*>& diMuon) {
-
-    std::vector<DiMuonTool*>::iterator countZero;
-
-    for (countZero=diMuon.begin();countZero!=diMuon.end();countZero++){
-
-      //std::cout << "addJpsi..." << std::endl;
-      const Wrapper::MuonTrack* probeTrack = (*countZero)->ProbedTrack();
-      //std::cout << "...probe done." << std::endl;
-      /*std::cout << "...probe done..." << std::endl;
-      const Wrapper::MuonTrack* tagTrack = (*countZero)->TaggedTrack();
-      std::cout << "...tag done." << std::endl;*/
-
-      if( probeTrack ) {
-
-        double pT  = probeTrack->pt(); 
-        double eta = probeTrack->eta();
-        double phi = probeTrack->phi();
-        double z0  = probeTrack->z0();
-        double d0  = probeTrack->a0();
-	
-        if ( pT < 0 ) pT *= -1;
-	
-        double deta = 1;
-        double dphi = 1;
-        double dz0  = 1;
-        double dd0  = 1;
-        double dpT  = 1;
-	    
-        double chi2 = probeTrack->chi2();
-          
-        // Check number of hits
-        // NB: a spacepoint is two offline "hits", so a pixel spacepoint is really 
-        // 2 "hits" and an offline SCT "hit" is really a 1D cluster, so two intersetcting
-        // stereo clusters making a spacepoint are two "hits"
-	
-        /*	int nCscHitsEta = probeTrack->bLayerHits(); 
-        int nCscHitsPhi = probeTrack->pixelHits();  
-        int nTgcHitsEta = probeTrack->sctHits(); 
-        int nTgcHitsPhi = probeTrack->siHits();
-        int nRpcHitsEta = probeTrack->strawHits();
-        int nRpcHitsPhi = probeTrack->trHits();*/
-      
-        unsigned bitmap = 0;
-        unsigned trackAuthor = 0;
-
-        const Rec::TrackParticle* match = probeTrack->match();
-
-        int roi = probeTrack->roiNum();
-        /*      
-        std::cout << "\t\t\tPAW JPSI track" 
-        	  << "\teta=" << eta  // << " +- " << (*trackitr)->params()->deta()
-        	  << "\tphi=" << phi  // << " +- " << (*trackitr)->params()->dphi()
-        	  << "\tz0="  << z0 
-        	  << "\tpT="  << pT // << "\t( " << 1/qoverp << ")"
-        	  << "\td0="  << d0
-        	  << "\tNCsc=" << nCscHitsEta 
-        	  << "\tNTgc=" << nTgcHitsEta 
-        	  << "\tNRpc=" << nRpcHitsEta
-        	  << std::endl;
-        */
-        // Create and save Track
-
-        int nRpcHitsPhi = probeTrack->nRpcHitsPhi();
-        int nTgcHitsPhi = probeTrack->nTgcHitsPhi();
-        int nCscHitsPhi = probeTrack->nCscHitsPhi();
-        int nRpcHitsEta = probeTrack->nRpcHitsEta();
-        int nTgcHitsEta = probeTrack->nTgcHitsEta();
-        int nCscHitsEta = probeTrack->nCscHitsEta();
-
-        TIDA::JpsiTrack* jpsi = new TIDA::JpsiTrack(TIDA::Track(eta, phi, z0, d0, pT, chi2,
-        											       deta, dphi, dz0, dd0, dpT,
-        											       nCscHitsEta, nCscHitsPhi, nTgcHitsEta, nTgcHitsPhi,
-        											       nRpcHitsEta, nRpcHitsPhi, bitmap, 0,
-        											       trackAuthor), match, *countZero, roi );
-	
-        if ( !addTrack( jpsi ) )  delete jpsi; 
-	
-      } // for(countZero = diMuon.begin(); countZero != diMuon.end(); countZero++)
-    } // if( probeTrack )
-  } // void addJpsi(std::vector<DiMuonTool*>& diMuon) 
-
-  virtual void clear() { delete_tracks();  }
-
-};
-
-#endif
diff --git a/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/TrigIDJpsiMonitoring/TrigJpsiMonTool.h b/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/TrigIDJpsiMonitoring/TrigJpsiMonTool.h
deleted file mode 100644
index 2ed846b7e3e5c06f99b3eafaf407fc9ae70a1d83..0000000000000000000000000000000000000000
--- a/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/TrigIDJpsiMonitoring/TrigJpsiMonTool.h
+++ /dev/null
@@ -1,142 +0,0 @@
-// emacs: this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-//edits P.Wijeratne (paw@hep.ucl.ac.uk)
-
-#ifndef TRIGIDJPSIMONITORING_TRIGJPSIMONTOOL_H
-#define TRIGIDJPSIMONITORING_TRIGJPSIMONTOOL_H
-
-#include "TrigHLTMonitoring/IHLTMonTool.h"
-
-#include "TrigInDetAnalysis/TrackFilter.h"
-#include "TrigInDetAnalysis/TIDDirectory.h"
-#include "TrigInDetAnalysis/Efficiency.h"
-
-#include "TrigInDetAnalysisUtils/Filter_Track.h"
-#include "TrigInDetAnalysisUtils/Filter_RoiSelector.h"
-#include "TrigInDetAnalysisUtils/T_AnalysisConfig.h"
-#include "TrigInDetAnalysisUtils/Associator_BestMatch.h"
-//#include "TrigInDetAnalysisUtils/TrackMatchDeltaR.h"
-//#include "TrigInDetAnalysisUtils/TrackMatchDeltaRCosmic.h"
-
-#include "TrigIDJpsiMonitoring/JpsiAnalysis.h"
-#include "TrigIDJpsiMonitoring/JpsiEfficiency.h"
-
-#include "TH1F.h"
-
-class TrigJpsiMonTool : 
-  public IHLTMonTool {  
-  
-public:
-
-
-  TrigJpsiMonTool( const std::string & type, const std::string & name, const IInterface* parent);
-
-  virtual ~TrigJpsiMonTool();
-  
-  StatusCode init();
-
-  #ifdef ManagedMonitorToolBase_Uses_API_201401
-    StatusCode book();
-    StatusCode proc();
-  #else
-    StatusCode book(bool newEventsBlock, bool newLumiBlock, bool newRun); 
-    StatusCode proc(bool endOfEventsBlock, bool endOfLumiBlock, bool endOfRun);
-  #endif
-
-  StatusCode fill();
-
-  // histogram registration
-
-  virtual void addHistogram( TH1* h , std::string MonGroup) { 
-    IHLTMonTool::addHistogram( h, MonGroup );
-  }
-
-  void setprint(bool p) { m_print=p; }
-  
-  // track selector cuts
-
-  // test tracks
-  double  m_pTCut;
-  double  m_etaCut;
-  double  m_d0Cut;
-  double  m_z0Cut;
-
-  int  m_siHits; // total number of si hits
-  int m_pixHits; // pixel hits
-  int m_sctHits; // sct hits
-
-  int   m_trtHits; // high threshold hits
-  int m_strawHits; // total number of straws
- 
-  // reference tracks
-  double  m_pTCutOffline;
-  double m_etaCutOffline;
-  double  m_d0CutOffline;
-  double  m_z0CutOffline;
- 
-  int  m_siHitsOffline; // total number of si hits
-  int m_pixHitsOffline; // pixel hits
-  int m_sctHitsOffline; // sct hits
-
-  int   m_trtHitsOffline; // high threshold hits
-  int m_strawHitsOffline; // total number of straws
-
-  // roi size 
-  double m_phiWidth;
-  double m_etaWidth;
-  double m_zedWidth;
-
-  // matching parameters
-  double m_matchR;   // for DeltaR matcher
-  double m_matchPhi; // for DeltaPhi matcher
-
-  ToolHandle<Trig::TrigDecisionTool> m_tdt;
-
-  TIDARoiDescriptor m_roiInfo;
-  
-  std::vector<TrackFilter*>  m_filters;
-  std::vector<TrackAssociator*>                 m_associators;
-
-  std::vector<T_AnalysisConfig<IHLTMonTool>*>   m_sequences;
-
-  std::vector<std::string> m_chainNames;
-  std::vector<std::string> m_collectionNames;
-
-  std::string m_chain0;
-  std::string m_chain1;
-  std::string m_chain2;
-  std::string m_chain3;
-
-  std::string m_collection0;
-  std::string m_collection1;
-  std::string m_collection2;
-  std::string m_collection3;
-  std::string m_collection4;
-  std::string m_collection5;
-  std::string m_collection6;
-  std::string m_collection7;
-
-  bool m_buildNtuple;
-  bool m_mcTruth;
-
-  private :
-
-  /// number of reconstructed tracks
-  //int Nreco;
-
-  /// flag to print out the matched tracks etc
-  bool m_print;
-
-  //  TIDDirectory* m_dir;
-
-  ///////////////////to stop multiple books
-  bool m_countBook;
-
-};
-
-
-#endif // TRIGIDJPSIMONITORING_TRIGJPSIMONTOOL_H
diff --git a/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/python/TrigIDJpsiMonitoringConfig.py b/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/python/TrigIDJpsiMonitoringConfig.py
deleted file mode 100644
index 18c2bd5d3adf92aad2a8d0a29e12109856dedd16..0000000000000000000000000000000000000000
--- a/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/python/TrigIDJpsiMonitoringConfig.py
+++ /dev/null
@@ -1,16 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-def TrigIDJpsiMonitoringTool():
-	if not 'rec' in dir():
-		from RecExConfig.RecFlags import rec
-		
-	if rec.doInDet:  
-		# MonTool
-		from TrigIDJpsiMonitoring.TrigIDJpsiMonitoringConf import TrigJpsiMonTool
-		from AthenaCommon.AppMgr import ToolSvc
-		TrigJpsiMon = TrigJpsiMonTool(name		= 'TrigJpsiMon',
-					      histoPathBase 	= "/Trigger/HLT/IDJpsiMon")
-		
-		#ToolSvc += TrigJpsiMon
-		list = [ TrigJpsiMon ]
-		return list
diff --git a/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/run/InDetBeamSpotReader_jobOptions.py b/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/run/InDetBeamSpotReader_jobOptions.py
deleted file mode 100644
index be6289a42e3bd043bccd472d4a49d020ca49b235..0000000000000000000000000000000000000000
--- a/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/run/InDetBeamSpotReader_jobOptions.py
+++ /dev/null
@@ -1,19 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-#ToolSvc = Service('ToolSvc')
-from InDetBeamSpotFinder.InDetBeamSpotFinderConf import InDet__InDetBeamSpotReader as InDetBeamSpotReader
-
-from AthenaCommon.AlgSequence import AlgSequence
-topSequence = AlgSequence()
-topSequence += InDetBeamSpotReader()
-
-from IOVDbSvc.CondDB import conddb
-
-from IOVDbSvc.IOVDbSvcConf import IOVDbSvc
-#conddb.Folders+=[ "INDET"   + "/Indet/Beampos" + "<tag>nominal</tag>"]
-IOVDbSvc = Service("IOVDbSvc")
-# IOVDbSvc.overrideTags += ["<prefix>/Indet/Beampos</prefix> <tag>nominal</tag>"]
-# IOVDbSvc.overrideTags += ["<prefix>/Indet/Beampos</prefix>"]
-# IOVDbSvc.dbConnection  = "impl=cool;techno=sqlite;schema=beamspot.db;X:TESTCOOL"
-IOVDbSvc.Folders += ["<dbConnection>impl=cool;techno=sqlite;schema=beamspot.db;X:BEAMSPOT</dbConnection> /Indet/Beampos<tag>nominal</tag>"]
-#IOVDbSvc.Folders += ["<dbConnection>sqlite://;schema=beamspot.db;dbname=BEAMSPOT</dbConnection> /Indet/Beampos<tag>nominal</tag>"]
diff --git a/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/run/RunJpsimumu.py b/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/run/RunJpsimumu.py
deleted file mode 100644
index 8c802d8f0a8fdd2d12e8570f895b89b7f86c0a35..0000000000000000000000000000000000000000
--- a/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/run/RunJpsimumu.py
+++ /dev/null
@@ -1,78 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-## set up monitoring
-from AthenaMonitoring.AthenaMonitoringConf import AthenaMonManager
-topSequence += AthenaMonManager( "HLTMonManager")
-HLTMonManager = topSequence.HLTMonManager
-
-from TrigIDJpsiMonitoring.TrigIDJpsiMonitoringConf import TrigJpsiMonTool
-TestMonTool = TrigJpsiMonTool( name="TestMonTool")
-#ToolSvc += TestMonTool
-HLTMonManager.AthenaMonTools += [ TestMonTool ]
-
-##### Trigger Decision Part #####################
-
-## set up trigger decision tool
-from TrigDecisionTool.TrigDecisionToolConf import Trig__TrigDecisionTool
-tdt = Trig__TrigDecisionTool("TrigDecisionTool")
-ToolSvc += tdt
-tdt.OutputLevel = INFO
-
-# these lines are new:
-from TriggerJobOpts.TriggerConfigGetter import TriggerConfigGetter
-cfg = TriggerConfigGetter()
-
-rec.doWriteAOD=False
-rec.doWriteESD=False
-
-#########cut part
-
-TrigJpsiMonTool.matchR = 0.1
-TrigJpsiMonTool.pTCutOffline = 4000.0
-TrigJpsiMonTool.d0Cut = 1000.0
-TrigJpsiMonTool.z0Cut = 2000.0
-TrigJpsiMonTool.d0CutOffline = 1000.0
-TrigJpsiMonTool.z0CutOffline = 2000.0
-#TrigJpsiMonTool.pTCutOffline = 4000.0
-#TrigJpsiMonTool.d0Cut = 1000.0
-#TrigJpsiMonTool.d0CutOffline = 1000.0
-#TrigJpsiMonTool.matchR = 1.0
-#TrigJpsiMonTool.z0CutOffline = 2000.0
-
-#TrigJpsiMonTool.Chain0 = "EF_2mu13_Zmumu_IDTrkNoCut"
-TrigJpsiMonTool.Chain0 = "EF_mu20"
-TrigJpsiMonTool.Chain1 = "EF_mu24i_tight"
-#TrigJpsiMonTool.Chain1 = "EF_2mu4T_Jpsimumu_IDTrkNoCut"
-#TrigJpsiMonTool.Chain1 = ""
-TrigJpsiMonTool.Chain2 = ""
-TrigJpsiMonTool.Chain3 = ""
-
-TrigJpsiMonTool.IDSCAN = ""
-TrigJpsiMonTool.SiTrack = ""
-TrigJpsiMonTool.EF = "InDetTrigParticleCreation_Muon_EFID"
-TrigJpsiMonTool.StratA = "TrigL2SiTrackFinder_MuonA"
-#TrigJpsiMonTool.StratA = "TrigSiTrackFinder_Muon"
-#TrigJpsiMonTool.StratB = "TrigL2SiTrackFinder_MuonB"
-#TrigJpsiMonTool.StratC = "TrigL2SiTrackFinder_MuonC"
-#TrigJpsiMonTool.StratA = ""
-TrigJpsiMonTool.StratB = ""
-TrigJpsiMonTool.StratC = ""
-
-
-TrigJpsiMonTool.TRTSF = "";
-TrigJpsiMonTool.EFTRT = "";
-##########################################
-# setup TTree registration Service
-# save ROOT histograms and Tuple
-from GaudiSvc.GaudiSvcConf import THistSvc
-ServiceMgr += THistSvc()
-
-ServiceMgr.THistSvc.Output = [ "AANT DATAFILE='IDTrackingCBNT.aan.root' OPT='RECREATE'" ]
-HLTMonManager.FileKey = "AANT"
-#from AnalysisTools.AnalysisToolsConf import AANTupleStream
-#topSequence += AANTupleStream()
-#AANTupleStream = AANTupleStream()
-#AANTupleStream.ExtraRefNames = [ "StreamESD","Stream1" ]
-#AANTupleStream.OutputName = 'IDTrackingCBNT.aan.root'
-#AANTupleStream.WriteInputDataHeader = True
-#AANTupleStream.OutputLevel = WARNING
diff --git a/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/run/TrigIDJpsiMonitoring_topOptions.py b/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/run/TrigIDJpsiMonitoring_topOptions.py
deleted file mode 100644
index bc7ac504d776eae2608efb950f9dd9f9131d6569..0000000000000000000000000000000000000000
--- a/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/run/TrigIDJpsiMonitoring_topOptions.py
+++ /dev/null
@@ -1,211 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-# get a handle on the ServiceManager which holds all the services
-from AthenaCommon.AppMgr import ToolSvc
-
-from AthenaCommon.AppMgr import ServiceMgr
-# Event selector
-import AthenaPoolCnvSvc.ReadAthenaPool
-
-# Import relevant libs
-import os
-import commands
-import string
-
-#set DB by hand
-ConfForMC = True
-
-from AthenaCommon.GlobalFlags import globalflags
-globalflags.DetGeo.set_Value_and_Lock('atlas')
-#GlobalFlags.DetGeo.set_atlas()
-if (ConfForMC):
-    #GlobalFlags.DataSource.set_geant4()
-    globalflags.DetGeo.set_Value_and_Lock('geant4')
-else :
-    #GlobalFlags.DataSource.set_data()
-    globalflags.DataSource.set_Value_and_Lock('data')
-from IOVDbSvc.CondDB import conddb
-
-###Define ESD location on local disk for merged ESDs; change this to the path to your datasets
-#path = "/unix/atlas2/paw/mc08.108407.Pythia_directJpsimu4mu4.recon.ESD.e347_s462_s520_r809_tid092535"
-#path = "/unix/atlas2/paw/data10_7TeV.00153599.physics_MuonswBeam.recon.ESD.f251"
-
-ServiceMgr.EventSelector.InputCollections = [ #"/unix/atlas2/paw/mc09_7TeV.108407.Pythia_directJpsimu4mu4.digit.ESD.e477_s765_s767_d300_tid130174_00/1.ESD.pool.root",
-                                              #"/unix/atlas2/paw/mc09_7TeV.108407.Pythia_directJpsimu4mu4.digit.ESD.e477_s765_s767_d300_tid130174_00/2.ESD.pool.root",
-                                              #"/unix/atlas2/paw/mc09_7TeV.108407.Pythia_directJpsimu4mu4.digit.ESD.e477_s765_s767_d300_tid130174_00/3.ESD.pool.root",
-                                              #"/unix/atlas2/paw/mc09_7TeV.108407.Pythia_directJpsimu4mu4.digit.ESD.e477_s765_s767_d300_tid130174_00/4.ESD.pool.root",
-                                              #"/unix/atlas2/paw/mc09_7TeV.108407.Pythia_directJpsimu4mu4.digit.ESD.e477_s765_s767_d300_tid130174_00/5.ESD.pool.root",
-                                              #"/unix/atlas2/paw/mc09_7TeV.108407.Pythia_directJpsimu4mu4.digit.ESD.e477_s765_s767_d300_tid130174_00/6.ESD.pool.root"
-#    "root://eosatlas.cern.ch//eos/atlas/atlasdatadisk/data11_7TeV/AOD/r3365_r3368_p902/data11_7TeV.00190933.Jpsi_JulieKirk.merge.AOD.r3365_r3368_p902_tid735922_00/AOD.735922._000001.pool.root.1"
-    "/unix/atlas2/paw/mc11_7TeV.108494.Pythia_directJpsimu2p5mu2p5.merge.AOD.e835_a131_s1353_a140_r2900_tid601752_00/AOD.601752._000001.pool.root.1"
-# "/afs/cern.ch/user/p/paw/BugFixing/myESD.pool.root"
-#   "/tmp/ESD.158525._000301.pool.root"
-#    "/tmp/Bug/myESD_express_0.pool.root"
-#    "/tmp/Bug/myESD.pool.root"
-#    "/unix/atlas2/paw/mc09_7TeV.106047.PythiaZmumu_no_filter.recon.ESD.e468_s765_s767_r1430_tid158525_00/ESD.158525._000301.pool.root"
-#    "/unix/atlas2/paw/data11_7TeV.00180664.physics_Muons.merge.AOD.o8_f375_m830/data11_7TeV.00180664.physics_Muons.merge.AOD.o8_f375_m830._lb0496-lb0498._0001.root"
-#    "/unix/atlas2/paw/mc09_7TeV.106047.PythiaZmumu_no_filter.recon.ESD.e468_s765_s767_r1430_tid158525_00/ESD.158525._000301.pool.root"
-                                              ]
-
-###code to add an ESD on InputCollections
-
-#status,output = commands.getstatusoutput('ls '+path)
-#output = output.splitlines()
-
-#istart=0
-#for i in xrange(0,len(output)) :
-#    if output[i].count(path) < 1:
-#        output[i] = path+"/"+output[i]
-#    output[i] = output[i].replace('//','/')
-
-#    ESDfile = output[i]
-#    print ESDfile
-
-#    import glob
-#    inFile = glob.glob(ESDfile)
-
-#    from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
-#    athenaCommonFlags.FilesInput = inFile
-
-#    from RecExConfig.InputFilePeeker import inputFileSummary
-
-#    import AthenaPoolCnvSvc.ReadAthenaPool
-
-#    if istart==0:
-#        ServiceMgr.EventSelector.InputCollections = [ ESDfile ]
-#        istart=1
-#    else:
-#        ServiceMgr.EventSelector.InputCollections += [ ESDfile ]
-        
-#import glob
-#inFile = glob.glob('/unix/atlas2/paw/mc08.108407.Pythia_directJpsimu4mu4.recon.ESD.e347_s462_s520_r809_tid092535/ESD.092535._000051.pool.root.1')
-
-#from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
-#athenaCommonFlags.FilesInput.set_Value_and_Lock(inFile)
-
-#from RecExConfig.InputFilePeeker import inputFileSummary
-
-#import AthenaPoolCnvSvc.ReadAthenaPool
-
-#ServiceMgr.EventSelector.InputCollections = [ "/unix/atlas2/paw/mc08.108407.Pythia_directJpsimu4mu4.recon.ESD.e347_s462_s520_r809_tid092535/ESD.092535._000051.pool.root.1" ]
-
-#from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
-#athenaCommonFlags.FilesInput=["/home/paw/data10_7TeV.00153565.physics_MuonswBeam.merge.AOD.f251_m466._lb0002-lb0022._0001.1"]
-
-#svcMgr.EventSelector.InputCollections=athenaCommonFlags.FilesInput()
-
-###test
-#from RecExConfig.InputFilePeeker import inputFileSummary
-#include ("RecExCond/RecExCommon_flags.py")
-#include( "RecExCond/AllDet_detDescr.py" )
-#include( "AthenaPoolCnvSvc/ReadAthenaPool_jobOptions.py" )
-###test
-
-# Athena-Aware NTuple making Tools
-CBNTAthenaAware = True
-include ("CBNT_Athena/CBNT_AthenaAware_jobOptions.py")
-include ("CBNT_Athena/CBNT_EventInfo_jobOptions.py")
-
-# BeamPos
-from AthenaCommon.Include import include
-include("InDetBeamSpotService/BeamCondSvc.py")
-
-# list of the algorithms to be executed at run time
-#from TrigInDetAnalysisExample.TrigInDetAnalysisExampleConf import TrigInDetAnalysisSkeleton
-#topSequence.CBNT_AthenaAware += TrigInDetAnalysisSkeleton()
-#TrigInDetAnalysisSkeleton = TrigInDetAnalysisSkeleton()
-#TrigInDetAnalysisSkeleton.OutputLevel = DEBUG
-
-## set up monitoring
-from AthenaMonitoring.AthenaMonitoringConf import AthenaMonManager
-topSequence += AthenaMonManager( "HLTMonManager")
-HLTMonManager = topSequence.HLTMonManager
-
-from TrigIDJpsiMonitoring.TrigIDJpsiMonitoringConf import TrigJpsiMonTool
-TestMonTool = TrigJpsiMonTool( name="TestMonTool")
-#ToolSvc += TestMonTool
-HLTMonManager.AthenaMonTools += [ TestMonTool ]
-
-##### Trigger Decision Part #####################
-
-## set up trigger decision tool
-from TrigDecisionTool.TrigDecisionToolConf import Trig__TrigDecisionTool
-tdt = Trig__TrigDecisionTool("TrigDecisionTool")
-ToolSvc += tdt
-tdt.OutputLevel = INFO
-
-# might be needed for TriggerConfigGetter...
-from RecExConfig.RecFlags  import rec
-rec.readRDO=False
-#rec.readESD=True
-rec.readAOD=True
-rec.doWriteAOD=False
-rec.doWriteESD=False
-
-# To read files with trigger config stored as in-file meta-data, i.e. 13.0.40
-# and above: ds. To read AOD produced with 13.0.30 you need to change ds to aod:
-#from TriggerJobOpts.TriggerFlags import TriggerFlags
-#TriggerFlags.configurationSourceList = ['ds']
-# set up trigger config service
-#from TriggerJobOpts.TriggerConfigGetter import TriggerConfigGetter
-#cfg =  TriggerConfigGetter( "ReadPool" )
-
-#########cut part
-
-TrigJpsiMonTool.matchR = 0.1
-TrigJpsiMonTool.pTCutOffline = 4000.0
-TrigJpsiMonTool.d0Cut = 1000.0
-TrigJpsiMonTool.z0Cut = 2000.0
-TrigJpsiMonTool.d0CutOffline = 1000.0
-TrigJpsiMonTool.z0CutOffline = 2000.0
-#TrigJpsiMonTool.pTCutOffline = 4000.0
-#TrigJpsiMonTool.d0Cut = 1000.0
-#TrigJpsiMonTool.d0CutOffline = 1000.0
-#TrigJpsiMonTool.matchR = 1.0
-#TrigJpsiMonTool.z0CutOffline = 2000.0
-TrigJpsiMonTool.Chain0 = "EF_2mu4T_Jpsimumu_IDTrkNoCut"
-TrigJpsiMonTool.Chain1 = ""
-TrigJpsiMonTool.Chain2 = ""
-TrigJpsiMonTool.Collection0 = ""
-#TrigJpsiMonTool.Collection1 = ""
-TrigJpsiMonTool.Collection2 = ""
-TrigJpsiMonTool.Collection3 = ""
-TrigJpsiMonTool.Collection4 = ""
-TrigJpsiMonTool.Collection5 = ""
-TrigJpsiMonTool.Collection6 = ""
-TrigJpsiMonTool.Collection7 = ""
-
-##########################################
-# setup TTree registration Service
-# save ROOT histograms and Tuple
-from GaudiSvc.GaudiSvcConf import THistSvc
-ServiceMgr += THistSvc()
-
-ServiceMgr.THistSvc.Output = [ "AANT DATAFILE='IDTrackingCBNT.aan.root' OPT='RECREATE'" ]
-HLTMonManager.FileKey = "AANT"
-from AnalysisTools.AnalysisToolsConf import AANTupleStream
-topSequence += AANTupleStream()
-AANTupleStream = AANTupleStream()
-AANTupleStream.ExtraRefNames = [ "StreamESD","Stream1" ]
-AANTupleStream.OutputName = 'IDTrackingCBNT.aan.root'
-AANTupleStream.WriteInputDataHeader = True
-AANTupleStream.OutputLevel = WARNING
-
-# Set output level threshold (2=DEBUG, 3=INFO, 4=WARNING, 5=ERROR, 6=FATAL )
-ServiceMgr.MessageSvc.OutputLevel = DEBUG
-
-theApp.EvtMax = -1
-
-from GaudiSvc.GaudiSvcConf import AuditorSvc
-ServiceMgr.AuditorSvc.Auditors  += [ "ChronoAuditor"]
-
-AthenaPoolCnvSvc = Service("AthenaPoolCnvSvc")
-AthenaPoolCnvSvc.UseDetailChronoStat = TRUE
-
-from TriggerJobOpts.TriggerConfigGetter import TriggerConfigGetter
-TriggerConfigGetter( "ReadPool" )
-
-#to dump ESD/AOD content (do only if theApp.EvtMax = 1)
-#StoreGateSvc = Service( "StoreGateSvc" )
-#StoreGateSvc.Dump = True 
-
diff --git a/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/run/TrigInDetValidation_RTT_topOptions_Bphysics.py b/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/run/TrigInDetValidation_RTT_topOptions_Bphysics.py
deleted file mode 100644
index 2dc99e8726535e40a35c7ccfcd0e2746b882b582..0000000000000000000000000000000000000000
--- a/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/run/TrigInDetValidation_RTT_topOptions_Bphysics.py
+++ /dev/null
@@ -1,121 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-#####################################################################################################
-#
-# top level jobOptions to run Muon chains in the RTT or standalone
-# sets some global variables that adjust the execution of TrigInDetValidation_RTT_Common.py
-#
-# Jiri.Masik@manchester.ac.uk
-#
-#####################################################################################################
-
-from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
-
-#set athenaCommonFlags.FilesInput to be able to use this job options standalone without RTT
-#secondSet of files can be activated by the if statement below 
-
-if athenaCommonFlags.FilesInput()==[]:
-  athenaCommonFlags.FilesInput=[
-    ]
-
-  secondSet=True
-  if secondSet: 
-    athenaCommonFlags.FilesInput=[
-      "root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/proj-sit/vchavda/TrigInDetValidation_muon/mc10_14TeV.106047.PythiaZmumu_no_filter.digit.RDO.e662_s1107_d459_tid285222_00/RDO.285222._000005.pool.root.1",       
-      "root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/proj-sit/vchavda/TrigInDetValidation_muon/mc10_14TeV.106047.PythiaZmumu_no_filter.digit.RDO.e662_s1107_d459_tid285222_00/RDO.285222._000006.pool.root.1",       
-      "root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/proj-sit/vchavda/TrigInDetValidation_muon/mc10_14TeV.106047.PythiaZmumu_no_filter.digit.RDO.e662_s1107_d459_tid285222_00/RDO.285222._000018.pool.root.1",       
-      "root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/proj-sit/vchavda/TrigInDetValidation_muon/mc10_14TeV.106047.PythiaZmumu_no_filter.digit.RDO.e662_s1107_d459_tid285222_00/RDO.285222._000019.pool.root.1",       
-      "root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/proj-sit/vchavda/TrigInDetValidation_muon/mc10_14TeV.106047.PythiaZmumu_no_filter.digit.RDO.e662_s1107_d459_tid285222_00/RDO.285222._000030.pool.root.1",       
-      "root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/proj-sit/vchavda/TrigInDetValidation_muon/mc10_14TeV.106047.PythiaZmumu_no_filter.digit.RDO.e662_s1107_d459_tid285222_00/RDO.285222._000033.pool.root.1",       
-      "root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/proj-sit/vchavda/TrigInDetValidation_muon/mc10_14TeV.106047.PythiaZmumu_no_filter.digit.RDO.e662_s1107_d459_tid285222_00/RDO.285222._000047.pool.root.1",       
-      "root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/proj-sit/vchavda/TrigInDetValidation_muon/mc10_14TeV.106047.PythiaZmumu_no_filter.digit.RDO.e662_s1107_d459_tid285222_00/RDO.285222._000048.pool.root.1",       
-      "root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/proj-sit/vchavda/TrigInDetValidation_muon/mc10_14TeV.106047.PythiaZmumu_no_filter.digit.RDO.e662_s1107_d459_tid285222_00/RDO.285222._000049.pool.root.1",       
-      "root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/proj-sit/vchavda/TrigInDetValidation_muon/mc10_14TeV.106047.PythiaZmumu_no_filter.digit.RDO.e662_s1107_d459_tid285222_00/RDO.285222._000064.pool.root.1",       
-      "root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/proj-sit/vchavda/TrigInDetValidation_muon/mc10_14TeV.106047.PythiaZmumu_no_filter.digit.RDO.e662_s1107_d459_tid285222_00/RDO.285222._000069.pool.root.1",       
-      "root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/proj-sit/vchavda/TrigInDetValidation_muon/mc10_14TeV.106047.PythiaZmumu_no_filter.digit.RDO.e662_s1107_d459_tid285222_00/RDO.285222._000073.pool.root.1",       
-    ]
-  
-
-rec.RootNtupleOutput="ntupleInDetMuonSlice.root"
-
-idTrigChainlist = [ 'mu22_IDTrkNoCut_tight',
-                    'mu24i_tight'
-                    ]
-
-tidaAnalysischains = [
-  "Truth",
-  "L2_mu22_IDTrkNoCut_tight:TrigL2SiTrackFinder_Muon:0",
-  "L2_mu22_IDTrkNoCut_tight:TrigL2SiTrackFinder_Muon:1",
-  "L2_mu22_IDTrkNoCut_tight:TrigL2SiTrackFinder_Muon:2",
-  "L2_mu22_IDTrkNoCut_tight:TrigL2SiTrackFinder_Muon:3",
-  "EF_mu22_IDTrkNoCut_tight:InDetTrigParticleCreation_Muon_EFID",
-]
-
-if 'runMergedChain' in dir() and runMergedChain==True:
-  idTrigChainlist.append('mu22_IDTrkNoCut_tight_IDT')
-  tidaAnalysischains.append('EF_mu22_IDTrkNoCut_tight_IDT:TrigFastTrackFinder_Muon')
-  tidaAnalysischains.append('EF_mu22_IDTrkNoCut_tight_IDT:InDetTrigParticleCreation_Muon_EFID')
-
-def resetSigs():
-  TriggerFlags.Slices_all_setOff()
-  TriggerFlags.MuonSlice.setAll();
-  TriggerFlags.MuonSlice.signatures = idTrigChainlist
-
-
-PdgId=13
-
-
-include("TrigInDetValidation/TrigInDetValidation_RTT_Common.py")
-
-#theApp.EvtMax = 100 # number of events to process
-
-HLTMonManager = topSequence.HLTMonManager
-
-from TrigIDJpsiMonitoring.TrigIDJpsiMonitoringConf import TrigJpsiMonTool
-TPMonTool = TrigJpsiMonTool( name="TPMonTool")
-#ToolSvc += TPMonTool
-HLTMonManager.AthenaMonTools += [ TPMonTool ]
-
-
-TPMonTool.matchR = 0.1
-TPMonTool.pTCutOffline = 4000.0
-TPMonTool.d0Cut = 1000.0
-TPMonTool.z0Cut = 2000.0
-TPMonTool.d0CutOffline = 1000.0
-TPMonTool.z0CutOffline = 2000.0
-#TPMonTool.pTCutOffline = 4000.0
-#TPMonTool.d0Cut = 1000.0
-#TPMonTool.d0CutOffline = 1000.0
-#TPMonTool.matchR = 1.0
-#TPMonTool.z0CutOffline = 2000.0
-
-#TPMonTool.Chain0 = "EF_2mu13_Zmumu_IDTrkNoCut"
-TPMonTool.Chain0 = "EF_mu24i_tight";
-#TPMonTool.Chain1 = "EF_2mu4T_Jpsimumu_IDTrkNoCut"
-TPMonTool.Chain1 = ""
-#TPMonTool.Chain2 = ""
-#TPMonTool.Chain3 = ""
-
-#TPMonTool.IDSCAN = "";
-#TPMonTool.SiTrack = "";
-TPMonTool.EF = "InDetTrigParticleCreation_Muon_EFID";
-TPMonTool.StratA = "TrigL2SiTrackFinder_MuonA";
-#TPMonTool.StratB = "TrigL2SiTrackFinder_MuonB";
-#TPMonTool.StratC = "TrigL2SiTrackFinder_MuonC";
-#TPMonTool.StratA = "";
-TPMonTool.StratB = "";
-TPMonTool.StratC = "";
-
-
-#TPMonTool.TRTSF = "";
-#TPMonTool.EFTRT = "";
-
-##########################################
-# setup TTree registration Service
-# save ROOT histograms and Tuple
-from GaudiSvc.GaudiSvcConf import THistSvc
-ServiceMgr += THistSvc()
-
-ServiceMgr.THistSvc.Output = [ "AANT DATAFILE='IDTrackingCBNT.aan.root' OPT='RECREATE'" ]
-HLTMonManager.FileKey = "AANT"
-
diff --git a/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/run/configureServices.py b/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/run/configureServices.py
deleted file mode 100644
index 140548ca75de48245c22bcbb924208f8aae2be4e..0000000000000000000000000000000000000000
--- a/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/run/configureServices.py
+++ /dev/null
@@ -1,161 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-###############################################################################
-#
-# configureServices.py
-# Author: ATLAS B-physics group
-# Configures supporting services for the B-physics AOD analyses.
-#
-###############################################################################
-
-#------------------------------------------------------------------------------
-# Magnetic field tool
-#------------------------------------------------------------------------------
-
-from TrkMagFieldTools.TrkMagFieldToolsConf import Trk__MagneticFieldTool
-InDetMagField = Trk__MagneticFieldTool('InDetMagField')
-ToolSvc += InDetMagField
-print      InDetMagField
-
-#------------------------------------------------------------------------------
-# Set up extrapolator
-#------------------------------------------------------------------------------
-
-from TrkExTools.AtlasExtrapolator import AtlasExtrapolator
-InDetExtrapolator = AtlasExtrapolator()
-ToolSvc += InDetExtrapolator
-print      InDetExtrapolator
-
-#------------------------------------------------------------------------------
-# Vertex point estimator
-#------------------------------------------------------------------------------
-
-from InDetConversionFinderTools.InDetConversionFinderToolsConf import InDet__VertexPointEstimator
-VtxPointEstimator = InDet__VertexPointEstimator(name                   = 'VtxPointEstimator',
-                                                MinDeltaR              = [ -10000., -10000., -10000. ],
-                                                MaxDeltaR              = [  10000.,  10000.,  10000. ],
-                                                MaxPhi                 = [  10000.,  10000.,  10000. ],
-                                                MaxChi2OfVtxEstimation = 2000.)
-ToolSvc += VtxPointEstimator
-
-#------------------------------------------------------------------------------
-# Helper Tools
-#------------------------------------------------------------------------------
-
-from InDetConversionFinderTools.InDetConversionFinderToolsConf import InDet__ConversionFinderUtils
-InDetConversionHelper = InDet__ConversionFinderUtils(name = 'InDetConversionFinderUtils')
-ToolSvc += InDetConversionHelper
-
-from InDetRecExample.InDetKeys import InDetKeys
-
-from InDetAssociationTools.InDetAssociationToolsConf import InDet__InDetPRD_AssociationToolGangedPixels
-InDetPrdAssociationTool = InDet__InDetPRD_AssociationToolGangedPixels(name                           = 'InDetPrdAssociationTool',
-                                                                      PixelClusterAmbiguitiesMapName = InDetKeys.GangedPixelMap())
-ToolSvc += InDetPrdAssociationTool
-
-from RecExConfig.RecFlags import rec
-CountDeadModulesAfterLastHit = False
-#rec.Commissioning=False
-
-from InDetTrackHoleSearch.InDetTrackHoleSearchConf import InDet__InDetTrackHoleSearchTool
-InDetHoleSearchTool = InDet__InDetTrackHoleSearchTool(name          = 'InDetHoleSearchTool',
-                                                      Extrapolator  = InDetExtrapolator,
-                                                      usePixel      = DetFlags.haveRIO.pixel_on(),
-                                                      useSCT        = DetFlags.haveRIO.SCT_on(),
-                                                      #Commissioning = rec.Commissioning())
-                                                      CountDeadModulesAfterLastHit = CountDeadModulesAfterLastHit)
-ToolSvc += InDetHoleSearchTool
-
-from InDetTrackSummaryHelperTool.InDetTrackSummaryHelperToolConf import InDet__InDetTrackSummaryHelperTool
-InDetTrackSummaryHelperTool = InDet__InDetTrackSummaryHelperTool(name         = 'InDetSummaryHelper',
-                                                                 AssoTool     = InDetPrdAssociationTool,
-                                                                 DoSharedHits = False,
-                                                                 HoleSearch   = InDetHoleSearchTool,
-                                                                 usePixel     = DetFlags.haveRIO.pixel_on(),
-                                                                 useSCT       = DetFlags.haveRIO.SCT_on(),
-                                                                 useTRT       = DetFlags.haveRIO.TRT_on())
-ToolSvc += InDetTrackSummaryHelperTool
-
-from TrkTrackSummaryTool.TrkTrackSummaryToolConf import Trk__TrackSummaryTool
-InDetTrackSummaryTool = Trk__TrackSummaryTool(name                   = 'InDetTrackSummaryTool',
-                                              InDetSummaryHelperTool = InDetTrackSummaryHelperTool,
-                                              doSharedHits           = False,
-                                              InDetHoleSearchTool    = InDetHoleSearchTool)
-ToolSvc += InDetTrackSummaryTool
-#------------------------------------------------------------------------------
-# Configure vertex fitters
-#------------------------------------------------------------------------------
-
-from TrkVKalVrtFitter.TrkVKalVrtFitterConf import Trk__TrkVKalVrtFitter
-TrkVKalVrtFitter = Trk__TrkVKalVrtFitter(name                    = 'VKalVrtFitterName',
-                                         Extrapolator            = InDetExtrapolator,
-                                         MagFieldSvc             = InDetMagField,
-                                         FirstMeasuredPoint      = True,
-                                         #FirstMeasuredPointLimit = True,
-                                         MakeExtendedVertex      = True)
-ToolSvc += TrkVKalVrtFitter
-print      TrkVKalVrtFitter
-
-from TrkV0Fitter.TrkV0FitterConf import Trk__TrkV0VertexFitter
-TrkV0Fitter = Trk__TrkV0VertexFitter(name              = 'TrkV0FitterName',
-                                     MaxIterations     = 10,
-                                     Use_deltaR        = False,
-                                     Extrapolator      = InDetExtrapolator,
-                                     MagneticFieldTool = InDetMagField)
-ToolSvc += TrkV0Fitter
-print      TrkV0Fitter
-
-#------------------------------------------------------------------------------
-# Load linearized track factory
-#------------------------------------------------------------------------------
-
-from TrkVertexFitterUtils.TrkVertexFitterUtilsConf import Trk__FullLinearizedTrackFactory
-InDetLinFactory = Trk__FullLinearizedTrackFactory(name              = 'InDetFullLinearizedTrackFactory',
-                                                  Extrapolator      = InDetExtrapolator,
-                                                  MagneticFieldTool = InDetMagField)
-ToolSvc += InDetLinFactory
-print      InDetLinFactory
-
-from TrkVertexBilloirTools.TrkVertexBilloirToolsConf import Trk__FastVertexFitter
-InDetFastVxFitterTool = Trk__FastVertexFitter(name                   = 'InDetFastVertexFitterTool',
-                                              LinearizedTrackFactory = InDetLinFactory,
-                                              Extrapolator           = InDetExtrapolator)
-ToolSvc += InDetFastVxFitterTool
-print      InDetFastVxFitterTool
-
-from TrkVertexBilloirTools.TrkVertexBilloirToolsConf import Trk__FullVertexFitter
-InDetFullVxFitterTool = Trk__FullVertexFitter(name                   = 'InDetFullVertexFitterTool',
-                                              LinearizedTrackFactory = InDetLinFactory,
-                                              Extrapolator           = InDetExtrapolator)
-ToolSvc += InDetFullVxFitterTool
-print      InDetFullVxFitterTool
-
-#------------------------------------------------------------------------------
-# Primary vertex refitting
-#------------------------------------------------------------------------------
-
-from TrkVertexFitterUtils.TrkVertexFitterUtilsConf import Trk__KalmanVertexUpdator
-myVertexUpdator = Trk__KalmanVertexUpdator()
-ToolSvc += myVertexUpdator
-print      myVertexUpdator
-
-#------------------------------------------------------------------------------
-# Timing
-#------------------------------------------------------------------------------
-
-from PrimaryDPDMaker.PrimaryDPDMakerConf import MBTSTimeFilterTool
-ToolSvc += MBTSTimeFilterTool()
-MBTSTimeFilterTool.ChargeThreshold   = 60.0/222.0
-MBTSTimeFilterTool.MinHitsPerSide    = 2
-MBTSTimeFilterTool.MaxTimeDifference = 10.0
-
-from TrkVertexAnalysisUtils.TrkVertexAnalysisUtilsConf import Trk__V0Tools
-InDetV0Tools = Trk__V0Tools(name = 'InDetV0Tools')
-ToolSvc += InDetV0Tools
-print      InDetV0Tools
-
-###############################################################################
-#
-# End of configureServices.py job-options
-#
-###############################################################################
diff --git a/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/run/grid_TrigIDJpsiMonitoring_topOptions.py b/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/run/grid_TrigIDJpsiMonitoring_topOptions.py
deleted file mode 100644
index fd26065e841a51847fc9d02132f89e6478bec7f1..0000000000000000000000000000000000000000
--- a/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/run/grid_TrigIDJpsiMonitoring_topOptions.py
+++ /dev/null
@@ -1,201 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-# get a handle on the ServiceManager which holds all the services
-from AthenaCommon.AppMgr import ToolSvc
-
-from AthenaCommon.AppMgr import ServiceMgr
-# Event selector
-import AthenaPoolCnvSvc.ReadAthenaPool
-
-# Import relevant libs
-import os
-import commands
-import string
-
-#set DB by hand
-ConfForMC = True
-
-from AthenaCommon.GlobalFlags import globalflags
-globalflags.DetGeo.set_Value_and_Lock('atlas')
-#GlobalFlags.DetGeo.set_atlas()
-if (ConfForMC):
-    #GlobalFlags.DataSource.set_geant4()
-    globalflags.DetGeo.set_Value_and_Lock('geant4')
-else :
-    #GlobalFlags.DataSource.set_data()
-    globalflags.DataSource.set_Value_and_Lock('data')
-from IOVDbSvc.CondDB import conddb
-
-###Define ESD location on local disk for merged ESDs; change this to the path to your datasets
-#path = "/unix/atlas2/paw/mc08.108407.Pythia_directJpsimu4mu4.recon.ESD.e347_s462_s520_r809_tid092535"
-#path = "/unix/atlas2/paw/data10_7TeV.00153599.physics_MuonswBeam.recon.ESD.f251"
-
-ServiceMgr.EventSelector.InputCollections = [ #"/unix/atlas2/paw/mc09_7TeV.108407.Pythia_directJpsimu4mu4.digit.ESD.e477_s765_s767_d300_tid130174_00/1.ESD.pool.root",
-                                              #"/unix/atlas2/paw/mc09_7TeV.108407.Pythia_directJpsimu4mu4.digit.ESD.e477_s765_s767_d300_tid130174_00/2.ESD.pool.root",
-                                              #"/unix/atlas2/paw/mc09_7TeV.108407.Pythia_directJpsimu4mu4.digit.ESD.e477_s765_s767_d300_tid130174_00/3.ESD.pool.root",
-                                              #"/unix/atlas2/paw/mc09_7TeV.108407.Pythia_directJpsimu4mu4.digit.ESD.e477_s765_s767_d300_tid130174_00/4.ESD.pool.root",
-                                              #"/unix/atlas2/paw/mc09_7TeV.108407.Pythia_directJpsimu4mu4.digit.ESD.e477_s765_s767_d300_tid130174_00/5.ESD.pool.root",
-                                              #"/unix/atlas2/paw/mc09_7TeV.108407.Pythia_directJpsimu4mu4.digit.ESD.e477_s765_s767_d300_tid130174_00/6.ESD.pool.root"
-# "/afs/cern.ch/user/p/paw/BugFixing/myESD.pool.root"
-#   "/tmp/ESD.158525._000301.pool.root"
-#    "/tmp/Bug/myESD_express_0.pool.root"
-#    "/tmp/Bug/myESD.pool.root"
-#    "/unix/atlas2/paw/mc09_7TeV.106047.PythiaZmumu_no_filter.recon.ESD.e468_s765_s767_r1430_tid158525_00/ESD.158525._000301.pool.root"
-#    "/unix/atlas2/paw/data11_7TeV.00180664.physics_Muons.merge.AOD.o8_f375_m830/data11_7TeV.00180664.physics_Muons.merge.AOD.o8_f375_m830._lb0496-lb0498._0001.root"
-#    "/unix/atlas2/paw/mc09_7TeV.106047.PythiaZmumu_no_filter.recon.ESD.e468_s765_s767_r1430_tid158525_00/ESD.158525._000301.pool.root"
-                                              ]
-
-###code to add an ESD on InputCollections
-
-#status,output = commands.getstatusoutput('ls '+path)
-#output = output.splitlines()
-
-#istart=0
-#for i in xrange(0,len(output)) :
-#    if output[i].count(path) < 1:
-#        output[i] = path+"/"+output[i]
-#    output[i] = output[i].replace('//','/')
-
-#    ESDfile = output[i]
-#    print ESDfile
-
-#    import glob
-#    inFile = glob.glob(ESDfile)
-
-#    from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
-#    athenaCommonFlags.FilesInput = inFile
-
-#    from RecExConfig.InputFilePeeker import inputFileSummary
-
-#    import AthenaPoolCnvSvc.ReadAthenaPool
-
-#    if istart==0:
-#        ServiceMgr.EventSelector.InputCollections = [ ESDfile ]
-#        istart=1
-#    else:
-#        ServiceMgr.EventSelector.InputCollections += [ ESDfile ]
-        
-#import glob
-#inFile = glob.glob('/unix/atlas2/paw/mc08.108407.Pythia_directJpsimu4mu4.recon.ESD.e347_s462_s520_r809_tid092535/ESD.092535._000051.pool.root.1')
-
-#from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
-#athenaCommonFlags.FilesInput.set_Value_and_Lock(inFile)
-
-#from RecExConfig.InputFilePeeker import inputFileSummary
-
-#import AthenaPoolCnvSvc.ReadAthenaPool
-
-#ServiceMgr.EventSelector.InputCollections = [ "/unix/atlas2/paw/mc08.108407.Pythia_directJpsimu4mu4.recon.ESD.e347_s462_s520_r809_tid092535/ESD.092535._000051.pool.root.1" ]
-
-#from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
-#athenaCommonFlags.FilesInput=["/home/paw/data10_7TeV.00153565.physics_MuonswBeam.merge.AOD.f251_m466._lb0002-lb0022._0001.1"]
-
-#svcMgr.EventSelector.InputCollections=athenaCommonFlags.FilesInput()
-
-# Athena-Aware NTuple making Tools
-CBNTAthenaAware = True
-include ("CBNT_Athena/CBNT_AthenaAware_jobOptions.py")
-include ("CBNT_Athena/CBNT_EventInfo_jobOptions.py")
-
-# BeamPos
-include("InDetBeamSpotService/BeamCondSvc.py")
-
-# list of the algorithms to be executed at run time
-#from TrigInDetAnalysisExample.TrigInDetAnalysisExampleConf import TrigInDetAnalysisSkeleton
-#topSequence.CBNT_AthenaAware += TrigInDetAnalysisSkeleton()
-#TrigInDetAnalysisSkeleton = TrigInDetAnalysisSkeleton()
-#TrigInDetAnalysisSkeleton.OutputLevel = DEBUG
-
-## set up monitoring
-from AthenaMonitoring.AthenaMonitoringConf import AthenaMonManager
-topSequence += AthenaMonManager( "HLTMonManager")
-HLTMonManager = topSequence.HLTMonManager
-
-from TrigIDJpsiMonitoring.TrigIDJpsiMonitoringConf import TrigJpsiMonTool
-TestMonTool = TrigJpsiMonTool( name="TestMonTool")
-#ToolSvc += TestMonTool
-HLTMonManager.AthenaMonTools += [ TestMonTool ]
-
-##### Trigger Decision Part #####################
-
-## set up trigger decision tool
-from TrigDecisionTool.TrigDecisionToolConf import Trig__TrigDecisionTool
-tdt = Trig__TrigDecisionTool("TrigDecisionTool")
-ToolSvc += tdt
-tdt.OutputLevel = INFO
-
-# might be needed for TriggerConfigGetter...
-from RecExConfig.RecFlags  import rec
-rec.readRDO=False
-#rec.readESD=True
-rec.readAOD=True
-rec.doWriteAOD=False
-rec.doWriteESD=False
-
-# To read files with trigger config stored as in-file meta-data, i.e. 13.0.40
-# and above: ds. To read AOD produced with 13.0.30 you need to change ds to aod:
-#from TriggerJobOpts.TriggerFlags import TriggerFlags
-#TriggerFlags.configurationSourceList = ['ds']
-# set up trigger config service
-#from TriggerJobOpts.TriggerConfigGetter import TriggerConfigGetter
-#cfg =  TriggerConfigGetter( "ReadPool" )
-
-#########cut part
-
-TrigJpsiMonTool.matchR = 0.1
-TrigJpsiMonTool.pTCutOffline = 4000.0
-TrigJpsiMonTool.d0Cut = 1000.0
-TrigJpsiMonTool.z0Cut = 2000.0
-TrigJpsiMonTool.d0CutOffline = 1000.0
-TrigJpsiMonTool.z0CutOffline = 2000.0
-#TrigJpsiMonTool.pTCutOffline = 4000.0
-#TrigJpsiMonTool.d0Cut = 1000.0
-#TrigJpsiMonTool.d0CutOffline = 1000.0
-#TrigJpsiMonTool.matchR = 1.0
-#TrigJpsiMonTool.z0CutOffline = 2000.0
-TrigJpsiMonTool.Chain0 = "EF_2mu4T_Jpsimumu_IDTrkNoCut"
-TrigJpsiMonTool.Chain1 = "EF_2mu4_Jpsimumu_IDTrkNoCut"
-TrigJpsiMonTool.Chain2 = ""
-#TrigJpsiMonTool.Collection0 = ""
-#TrigJpsiMonTool.Collection1 = ""
-TrigJpsiMonTool.Collection2 = ""
-#TrigJpsiMonTool.Collection3 = ""
-TrigJpsiMonTool.Collection4 = ""
-#TrigJpsiMonTool.Collection5 = ""
-TrigJpsiMonTool.Collection6 = ""
-TrigJpsiMonTool.Collection7 = ""
-
-##########################################
-# setup TTree registration Service
-# save ROOT histograms and Tuple
-from GaudiSvc.GaudiSvcConf import THistSvc
-ServiceMgr += THistSvc()
-
-ServiceMgr.THistSvc.Output = [ "AANT DATAFILE='IDTrackingCBNT.aan.root' OPT='RECREATE'" ]
-HLTMonManager.FileKey = "AANT"
-from AnalysisTools.AnalysisToolsConf import AANTupleStream
-topSequence += AANTupleStream()
-AANTupleStream = AANTupleStream()
-AANTupleStream.ExtraRefNames = [ "StreamESD","Stream1" ]
-AANTupleStream.OutputName = 'IDTrackingCBNT.aan.root'
-AANTupleStream.WriteInputDataHeader = True
-AANTupleStream.OutputLevel = WARNING
-
-# Set output level threshold (2=DEBUG, 3=INFO, 4=WARNING, 5=ERROR, 6=FATAL )
-ServiceMgr.MessageSvc.OutputLevel = DEBUG
-
-theApp.EvtMax = -1
-
-from GaudiSvc.GaudiSvcConf import AuditorSvc
-ServiceMgr.AuditorSvc.Auditors  += [ "ChronoAuditor"]
-
-AthenaPoolCnvSvc = Service("AthenaPoolCnvSvc")
-AthenaPoolCnvSvc.UseDetailChronoStat = TRUE
-
-from TriggerJobOpts.TriggerConfigGetter import TriggerConfigGetter
-TriggerConfigGetter( "ReadPool" )
-
-#to dump ESD/AOD content (do only if theApp.EvtMax = 1)
-#StoreGateSvc = Service( "StoreGateSvc" )
-#StoreGateSvc.Dump = True 
-
diff --git a/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/run/testOptions.py b/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/run/testOptions.py
deleted file mode 100644
index 1f4530eb0d7eeea54a54115f9684a7fceeb1ce7d..0000000000000000000000000000000000000000
--- a/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/run/testOptions.py
+++ /dev/null
@@ -1,256 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-#set DB by hand
-#ConfForMC = False
-ConfForMC = True
-
-from AthenaCommon.GlobalFlags import globalflags
-globalflags.DetGeo.set_Value_and_Lock('atlas')
-#GlobalFlags.DetGeo.set_atlas()
-if (ConfForMC):
-    #GlobalFlags.DataSource.set_geant4()
-    globalflags.DetGeo.set_Value_and_Lock('geant4')
-else :
-    #GlobalFlags.DataSource.set_data()
-    globalflags.DataSource.set_Value_and_Lock('data')
-from IOVDbSvc.CondDB import conddb
-
-from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
-
-#athenaCommonFlags.FilesInput = [ "/afs/cern.ch/work/c/cgutscho/triggerFiles/data12_8TeV.00209084.physics_Muons.merge.AOD.f473_m1213._lb0072._0001.1" ]
-
-#athenaCommonFlags.FilesInput = [ "/afs/cern.ch/work/c/cgutscho/triggerFiles/data12_8TeV.00211620.physics_Egamma.merge.AOD.f479_m1228._lb0917._0001.1" ]
-
-# Zmm MC:
-
-#athenaCommonFlags.FilesInput = [ "/afs/cern.ch/user/c/cgutscho/workspace/triggerFiles/mc10_14TeV.106047.PythiaZmumu_no_filter.recon.AOD.e662_s1107_d459_r2037.AOD.root.1" ]
-
-# Muon data12 skim:
-
-"""
-athenaCommonFlags.FilesInput = [
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00200.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00250.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00201.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00251.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00202.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00252.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00203.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00253.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00204.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00254.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00205.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00255.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00206.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00256.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00207.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00257.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00208.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00258.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00209.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00259.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00210.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00260.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00211.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00261.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00212.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00262.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00213.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00263.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00214.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00264.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00215.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00265.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00216.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00266.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00217.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00267.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00218.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00268.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00219.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00269.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00220.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00270.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00221.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00271.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00222.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00272.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00223.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00273.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00224.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00274.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00225.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00275.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00226.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00276.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00227.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00277.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00228.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00278.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00229.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00279.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00230.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00280.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00231.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00281.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00232.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00282.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00233.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00283.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00234.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00284.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00235.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00285.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00236.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00286.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00237.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00287.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00238.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00288.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00239.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00289.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00240.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00290.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00241.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00291.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00242.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00292.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00243.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00293.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00244.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00294.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00245.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00295.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00246.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00296.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00247.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00297.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00248.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00298.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00249.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkim/user.cgutscho.008429._00299.Ztomumu0.AOD.pool.root"
-]
-"""
-
-# Muon data12 inefficient events:
-
-"""
-athenaCommonFlags.FilesInput = [
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkimIneffMu/user.cgutscho.008821._00001.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkimIneffMu/user.cgutscho.008821._00008.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkimIneffMu/user.cgutscho.008821._00002.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkimIneffMu/user.cgutscho.008821._00009.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkimIneffMu/user.cgutscho.008821._00003.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkimIneffMu/user.cgutscho.008821._00010.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkimIneffMu/user.cgutscho.008821._00004.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkimIneffMu/user.cgutscho.008821._00011.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkimIneffMu/user.cgutscho.008821._00005.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkimIneffMu/user.cgutscho.008821._00012.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkimIneffMu/user.cgutscho.008821._00006.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkimIneffMu/user.cgutscho.008821._00013.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkimIneffMu/user.cgutscho.008821._00007.Ztomumu0.AOD.pool.root",
-  "/afs/cern.ch/work/c/cgutscho/trigger/mergeSkimIneffMu/user.cgutscho.008821._00014.Ztomumu0.AOD.pool.root",
-]
-"""
-
-# Egamma data12 files:
-
-"""
-athenaCommonFlags.FilesInput = [
-"/afs/cern.ch/work/c/cgutscho/triggerFiles/data12_8TeV.00211620.physics_Egamma.merge.AOD.f479_m1228._lb0813._0001.1",
-"/afs/cern.ch/work/c/cgutscho/triggerFiles/data12_8TeV.00211620.physics_Egamma.merge.AOD.f479_m1228._lb0898._0001.1",
-"/afs/cern.ch/work/c/cgutscho/triggerFiles/data12_8TeV.00211620.physics_Egamma.merge.AOD.f479_m1228._lb0917._0001.1",
-"/afs/cern.ch/work/c/cgutscho/triggerFiles/data12_8TeV.00211937.physics_Egamma.merge.AOD.f479_m1228._lb0623._0001.1",
-"/afs/cern.ch/work/c/cgutscho/triggerFiles/data12_8TeV.00212144.physics_Egamma.merge.AOD.f479_m1228._lb0296._0001.1",
-"/afs/cern.ch/work/c/cgutscho/triggerFiles/data12_8TeV.00212172.physics_Egamma.merge.AOD.f479_m1228._lb0503._0001.1",
-"/afs/cern.ch/work/c/cgutscho/triggerFiles/data12_8TeV.00211620.physics_Egamma.merge.AOD.f479_m1228._lb0837._0001.1",
-"/afs/cern.ch/work/c/cgutscho/triggerFiles/data12_8TeV.00211620.physics_Egamma.merge.AOD.f479_m1228._lb0838._0001.1",
-"/afs/cern.ch/work/c/cgutscho/triggerFiles/data12_8TeV.00211620.physics_Egamma.merge.AOD.f479_m1228._lb0839._0001.1",
-"/afs/cern.ch/work/c/cgutscho/triggerFiles/data12_8TeV.00211620.physics_Egamma.merge.AOD.f479_m1228._lb0842._0001.1",
-"/afs/cern.ch/work/c/cgutscho/triggerFiles/data12_8TeV.00211620.physics_Egamma.merge.AOD.f479_m1228._lb0843._0001.1",
-"/afs/cern.ch/work/c/cgutscho/triggerFiles/data12_8TeV.00211620.physics_Egamma.merge.AOD.f479_m1228._lb0844._0001.1",
-"/afs/cern.ch/work/c/cgutscho/triggerFiles/data12_8TeV.00211620.physics_Egamma.merge.AOD.f479_m1228._lb0840-lb0841._0001.1",
-]
-"""
-
-#mydir = "/afs/cern.ch/work/c/cgutscho/triggerFiles/temp/mc10_14TeV.106047.PythiaZmumu_no_filter.recon.AOD.e662_s1107_d459_r2037_tid285233_00/"
-"""
-athenaCommonFlags.FilesInput = [ 
-  mydir + "AOD.285233._000010.pool.root.1",
-  mydir + "AOD.285233._000014.pool.root.1",
-  mydir + "AOD.285233._000018.pool.root.1",
-  mydir + "AOD.285233._000012.pool.root.1",
-  mydir + "AOD.285233._000015.pool.root.1",
-  mydir + "AOD.285233._000019.pool.root.1",
-  mydir + "AOD.285233._000013.pool.root.1",
-  mydir + "AOD.285233._000016.pool.root.1",
-]
-"""
-
-# Athena-Aware NTuple making Tools
-#CBNTAthenaAware = True
-#include ("CBNT_Athena/CBNT_AthenaAware_jobOptions.py")
-#include ("CBNT_Athena/CBNT_EventInfo_jobOptions.py")
-#athenaCommonFlags.PoolInputQuery.set_Value_and_Lock("") # Needed for TAG jobs (as is)
-
-from RecExConfig.RecFlags import rec
-rec.doTrigger.set_Value_and_Lock(False) # leave false; nothing to do with trigger analysis
-# include your algorithm job options here
-rec.doESD.set_Value_and_Lock(False) # leave false; nothing to do with trigger analysis
-rec.doAOD.set_Value_and_Lock(False)
-rec.doFloatingPointException.set_Value_and_Lock(True)
-rec.UserAlgs.set_Value_and_Lock("RunJpsimumu.py")
-#rec.UserAlgs.set_Value_and_Lock("InDetBeamSpotReader_jobOptions.py")
-
-from InDetBeamSpotFinder.InDetBeamSpotFinderConf import InDet__InDetBeamSpotReader as InDetBeamSpotReader
-
-from AthenaCommon.AlgSequence import AlgSequence
-topSequence = AlgSequence()
-topSequence += InDetBeamSpotReader()
-
-# Jiri's suggestions:
-#topSequence.InTimeAntiKt4TruthJetsFixIt.Enable=False;
-#topSequence.InTimeAntiKt4TruthJetsSwapper.Enable=False;
-#topSequence.OutOfTimeAntiKt4TruthJetsFixIt.Enable=False;
-#topSequence.OutOfTimeAntiKt4TruthJetsSwapper.Enable=False;
-        
-
-from IOVDbSvc.CondDB import conddb
-
-from IOVDbSvc.IOVDbSvcConf import IOVDbSvc
-#conddb.Folders+=[ "INDET"   + "/Indet/Beampos" + "<tag>nominal</tag>"]
-IOVDbSvc = Service("IOVDbSvc")
-# IOVDbSvc.overrideTags += ["<prefix>/Indet/Beampos</prefix> <tag>nominal</tag>"]
-# IOVDbSvc.overrideTags += ["<prefix>/Indet/Beampos</prefix>"]
-# IOVDbSvc.dbConnection  = "impl=cool;techno=sqlite;schema=beamspot.db;X:TESTCOOL"
-#IOVDbSvc.Folders += ["<dbConnection>impl=cool;techno=sqlite;schema=beamspot.db;X:BEAMSPOT</dbConnection> /Indet/Beampos<tag>nominal</tag>"]
-#IOVDbSvc.Folders += ["<dbConnection>sqlite://;schema=beamspot.db;dbname=BEAMSPOT</dbConnection> /Indet/Beampos<tag>nominal</tag>"]
-
-
-# Output log setting; this is for the framework in general
-# You may over-ride this in your job options for your algorithm
-rec.OutputLevel.set_Value_and_Lock(WARNING);
-#rec.OutputLevel.set_Value_and_Lock(DEBUG);
-# Write settings; keep all of these to false.
-# Control the writing of your own n-tuple in the alg's job options
-rec.doCBNT.set_Value_and_Lock(False)
-rec.doWriteAOD.set_Value_and_Lock(False)
-rec.doWriteTAG.set_Value_and_Lock(False)
-rec.doHist.set_Value_and_Lock (False)
-###beam spot!!!
-#include("InDetBeamSpotReader_jobOptions.py")
-###
-# main jobOption - must always be included
-#include("RecJobTransforms/UseOracle.py") # DB access
-include("RecExCommon/RecExCommon_topOptions.py")
-# Following 3 lines needed for TAG jobs (as is)
-#svcMgr.EventSelector.RefName= "StreamAOD"
-#svcMgr.EventSelector.CollectionType="ExplicitROOT"
-#svcMgr.EventSelector.Query = ""
-#svcMgr.EventSelector.SkipEvents = 15400
-theApp.EvtMax = -1 # number of event to process
-#theApp.EvtMax = 500 # number of event to process
-# Stops writing of monitoring ntuples (big files)
-#from PerfMonComps.PerfMonFlags import jobproperties as jp
-#jp.PerfMonFlags.doMonitoring = False
-#jp.PerfMonFlags.doFastMon = False
diff --git a/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/src/AnalysisConfig_Jpsi.cxx b/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/src/AnalysisConfig_Jpsi.cxx
deleted file mode 100644
index 42e4b41311ee8e3290e4bf5498f3a54725d91e44..0000000000000000000000000000000000000000
--- a/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/src/AnalysisConfig_Jpsi.cxx
+++ /dev/null
@@ -1,985 +0,0 @@
-// emacs: this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-
-/** @file AnalysisConfig_Jpsi.cxx */
-/** @author Mark Sutton (sutt@cern.ch) **/
-/** @author Peter Wijeratne (paw@hep.ucl.ac.uk) **/
-/** @author Christian Gutschow (chris.g@cern.ch) **/
-
-#include "TrigSteeringEvent/TrigRoiDescriptorCollection.h" 
-
-#include "TrigInDetAnalysis/TIDDirectory.h"
-#include "TrigInDetAnalysis/TIDAVertex.h"
-
-#include "TrigInDetAnalysisUtils/Filter_RoiSelector.h"
-
-#include "AthenaMonitoring/AthenaMonManager.h"
-#include "AthenaMonitoring/ManagedMonitorToolBase.h"
-
-#include "muonEvent/Muon.h"
-#include "muonEvent/MuonContainer.h"
-#include "muonEvent/MuonParamDefs.h"
-
-#include "egammaEvent/ElectronContainer.h"
-#include "egammaEvent/Electron.h"
-#include "egammaEvent/egamma.h"
-
-#include "TrigIDJpsiMonitoring/AnalysisConfig_Jpsi.h"
-#include "TrigIDJpsiMonitoring/JpsiTrack.h"
-#include "TrigIDJpsiMonitoring/JpsiTrackSelector.h"
-#include "TrigIDJpsiMonitoring/JpsiAnalysis.h"
-
-#include "TrigMuonEvent/TrigMuonEFInfoContainer.h"
-#include "TrigMuonEvent/TrigMuonEFInfo.h"
-#include "TrigMuonEvent/TrigMuonEFTrack.h"
-#include "TrigMuonEvent/TrigMuonEFCbTrack.h"
-#include "TrigMuonEvent/TrigMuonEFInfoTrackContainer.h"
-
-#include "VxVertex/VxContainer.h"
-
-#include "TrigInDetTruthEvent/TrigInDetTrackTruthMap.h"
-
-#include "TrigDecisionTool/Feature.h"
-#include "TrigDecisionTool/FeatureContainer.h"
-
-#include "TrigInDetEvent/TrigInDetTrackCollection.h"
-#include "Particle/TrackParticleContainer.h"
-#include "TrigParticle/TrigElectronContainer.h"
-#include "TrigParticle/TrigPhotonContainer.h"
-
-#include "TMath.h"
-#include <cassert>
-
-using std::cout;
-using std::endl;
-using std::string;
-using std::fabs;
-using std::pow;
-using std::vector;
-using std::map;
-
-//#include "Particle/TrackParticle.h"
-
-using namespace TrigInDetAnalysis;
-
-void AnalysisConfig_Jpsi::loop() {
-
-  ++m_count_before;
-  bool isPassed = false;
-  //string inclTrigChain = "EF_mu24i_tight";
-  string inclTrigChain = "EF_mu20";
-  //string inclTrigChain = "EF_mu18"; // MC test
-  //string checkTrigger = (m_refChainName.find("Zm") != string::npos)? "EF_2mu13" : string(m_refChainName);
-  string checkTrigger = (m_refChainName.find("Zm") != string::npos)? inclTrigChain : string(m_refChainName);
-  //string checkTrigger = (m_refChainName.find("Zm") != string::npos)? "EF_mu18_IDTrkNoCut_tight" : string(m_refChainName);
-  //if( (*m_tdt)->isPassed("EF_mu20it_tight") )      isPassed = true;
-  //else if( (*m_tdt)->isPassed("EF_mu24i_tight") )  isPassed = true;
-  if( (*m_tdt)->isPassed(checkTrigger) )  isPassed = true;
-  //if( (*m_tdt)->isPassed("EF_2mu13") && (*m_tdt)->isPassed(m_refChainName) )  isPassed = true;
-  //if( (*m_tdt)->isPassed(m_refChainName) )  isPassed = true;
-
-  if( isPassed ) {
-    ++m_count_after;
-    m_provider->msg(MSG::INFO) << "EVENT PASSED TRIGGER: " << checkTrigger << endmsg;
-
-    Trig::ExpertMethods* em = (*m_tdt)->ExperimentalAndExpertMethods();
-    em->enable();
-    bool HLTTruncated = true;
-    HLTTruncated = em->isHLTTruncated();
-    if(HLTTruncated) {
-      m_provider->msg(MSG::WARNING) << "Incomplete HLT result - ABORTING EVENT." << endmsg;
-      return;
-    }
-    else {
-      m_provider->msg(MSG::INFO) << "\033[94;mSTART EVENT -- ALGORITHM: " << m_testChainKey << "\033[m" << endmsg;
-      makeClean();
-      
-      //get beam position
-      double xbeam = 0;
-      double ybeam = 0;
-      //double xbeam_online = 0;
-      //double ybeam_online = 0;
-      
-      if( m_iBeamCondSvc ) {
-
-	xbeam = m_iBeamCondSvc->beamPos()[0];
-	ybeam = m_iBeamCondSvc->beamPos()[1];
- 
-        m_analysis->setBeamRef( xbeam, ybeam );
-      }
-      /*if( m_iOnlineBeamCondSvc ) {
-        HepPoint3D vertex = m_iOnlineBeamCondSvc->beamPos();
-        //if (fabs(xbeam-vertex.x())>0.1 || fabs(ybeam-vertex.y())>0.1){
-          m_provider->msg(MSG::INFO) << " using online beam position\tx=" << vertex.x() << "\ty=" << vertex.y() << endmsg; 
-        //}
-        xbeam_online = vertex.x();
-        ybeam_online = vertex.y(); 
-      }*/
-        
-      m_events++;
-      
-      if(m_provider->evtStore()->retrieve(m_eventInfo).isFailure()) {
-        cout << "Failed to get EventInfo." << endl;
-      }
-      unsigned int runNumber   = m_eventInfo->event_ID()->run_number();
-      unsigned int eventNumber = m_eventInfo->event_ID()->event_number();
-
-      //cout << "NEW EVENT WITH RUN NUMBER: " << runNumber << " AND EVENT NUMBER: " << eventNumber << endl;
-
-      // bug in 8 TeV muon setup until July 24th 2012
-      // causing efficiency to be 100 % --> ignore!
-      //if(m_isMuon && runNumber <= 207397)  return;
-
-      //cout << "SOME VERTEX STUFF" << endl;
-
-      vector<TIDA::Vertex*> vertices;
-      const VxContainer* primaryVtxCollection;
-      if(m_provider->evtStore()->retrieve(primaryVtxCollection, "VxPrimaryCandidate").isFailure()) {
-        m_provider->msg(MSG::WARNING) << "Primary vertex container not found" << endmsg;
-      }
-      else {
-	VxContainer::const_iterator vtxitr = primaryVtxCollection->begin();
-	for(; vtxitr != primaryVtxCollection->end(); ++vtxitr) {
-	  if( (*vtxitr)->vxTrackAtVertex()->size()>0 ) {
-	    vertices.push_back( new TIDA::Vertex( (*vtxitr)->recVertex().position().x(), (*vtxitr)->recVertex().position().y(),
-						 (*vtxitr)->recVertex().position().z(), 0,0,0, (*vtxitr)->vxTrackAtVertex()->size() ) );
-	  }
-	}  
-      }
-      if( m_selectorRef )  m_selectorJ = dynamic_cast<JpsiTrackSelector*>(m_selectorRef); 
-      else {  
-        return;
-      }
-
-      //cout << "Trig::FeatureContainer" << endl;
-
-      bool doTruth = false;
-      
-      //temp
-      vector<const TrigMuonEFTrack*> muonExtrapolatedTracks;
-      vector<const TrigMuonEFCbTrack*> muonCombinedTracks;
-      vector<const TrigMuonEFCbTrack*> incCombinedTracks;
-      vector<const egamma*> tightElectrons_EF; 
-      vector<const CaloCluster*> ClusterContainer_EF;
-      const Analysis::MuonContainer* Muons = 0;
-      vector<const Rec::TrackParticle*> offlineMSOnly;
-      vector<const Rec::TrackParticle*> offlineInDet;
-      //vector<const Rec::TrackParticle*> offlineInDet2;
-      vector<const Analysis::Electron*> offTightElecs;
-      vector<int> clusterRoiIDs, tightElecsRoiIDs;
-      vector<int> tagRois, probeRois;
-      //temp
-      
-      if( doTruth ) {
-        //get truth tracks
-        const TruthParticleContainer* truthTracks = 0;
-        if(m_provider->evtStore()->contains<TruthParticleContainer>(m_truthCollection)) {
-          StatusCode scm = m_provider->evtStore()->retrieve(truthTracks,m_truthCollection);
-          if(scm.isFailure()) {
-            if(m_events == 1) {
-              m_provider->msg(MSG::WARNING) <<"No Collection with name "<<m_truthCollection<<" found in StoreGate" << endmsg;
-            }
-            else if(m_provider->msgLvl(MSG::DEBUG)) {
-              m_provider->msg(MSG::DEBUG)<< "No Collection with name "<<m_truthCollection<<" found in StoreGate" << endmsg;
-            }
-          }
-        } 
-        else if (m_provider->msgLvl(MSG::DEBUG)) {
-          m_provider->msg(MSG::DEBUG) << "StoreGate does not contain Collection with name "<<m_truthCollection<<" "<<endmsg;
-        }
-        if(!m_provider->evtStore()->contains<LVL1_ROI>("LVL1_ROI")) m_useTrigger=false;
-        m_selectorJ->selectTracks( truthTracks );
-      }
-      else {
-        if( !m_runOnline && m_isMuon ) {
-          if(m_provider->evtStore()->contains<Analysis::MuonContainer>(m_muonCollection)) {
-            StatusCode scm = m_provider->evtStore()->retrieve(Muons,m_muonCollection);
-            if(scm.isFailure()) {
-              if(m_events == 1) {
-                m_provider->msg(MSG::WARNING) <<"No Collection with name "<<m_muonCollection<<" found in StoreGate" << endmsg;
-              }
-              else if(m_provider->msgLvl(MSG::DEBUG)) {
-                m_provider->msg(MSG::DEBUG)<< "No Collection with name "<<m_muonCollection<<" found in StoreGate" << endmsg;
-              }
-            }
-          } 
-          else if(m_provider->msgLvl(MSG::DEBUG)) {
-            m_provider->msg(MSG::DEBUG) << "StoreGate does not contain Collection with name "<<m_muonCollection<<" "<<endmsg;
-          }
-          //cout << "serious business below" << endl;
-	  
-          if(!m_provider->evtStore()->contains<LVL1_ROI>("LVL1_ROI"))  m_useTrigger=false;
-          //iterators over the muon container and retrieve ID tracks only
-          Analysis::MuonContainer::const_iterator MuonItr = Muons->begin(), MuonItrEnd = Muons->end();
-          for(; MuonItr != MuonItrEnd; ++MuonItr) {
-            if((*MuonItr)->isCombinedMuon()&&(*MuonItr)->hasInDetTrackParticle()) offlineInDet.push_back((*MuonItr)->inDetTrackParticle());
-            if((*MuonItr)->hasMuonExtrapolatedTrackParticle()) offlineMSOnly.push_back((*MuonItr)->muonExtrapolatedTrackParticle());
-          }
-        }
-        else if(m_isMuon) {      
-          if(m_remover) {
-            m_remover->clear();
-
-
-            // MC test stuff:
-            // inclusive trigger chain: "EF_mu24i_tight";
-            cout << "\n\nMC test: START ..." << endl;
-
-            cout << "MC test: Inclusive trigger chain: " << m_refChainName << endl;
-            cout << "MC test: Get features with TrigDef::alsoDeactivateTEs ..." << endl;
-            Trig::FeatureContainer fdeac = (*m_tdt)->features(m_refChainName, TrigDefs::alsoDeactivateTEs);
-            cout << "MC test: Get combinations ..." << endl;
-            const vector<Trig::Combination>& incComboDeac = fdeac.getCombinations();
-            vector<Trig::Combination>::const_iterator incComboDeac_itr = incComboDeac.begin();
-            vector<Trig::Combination>::const_iterator incComboDeac_itrEnd = incComboDeac.end();
-            int nComb = (incComboDeac_itrEnd - incComboDeac_itr);
-            cout << "MC test: nComb: " << nComb << endl;
-            cout << "MC test: ... return if < 2." << endl;
-            if(nComb < 2)  return;
-
-
-            cout << "MC test: Get features with TrigDef::Physics ..." << endl;
-            Trig::FeatureContainer fphys = (*m_tdt)->features(m_refChainName, TrigDefs::Physics);
-            cout << "MC test: Get combinations ..." << endl;
-            const vector<Trig::Combination>& incCombo = fphys.getCombinations();
-            vector<Trig::Combination>::const_iterator incCombo_itr = incCombo.begin();
-            vector<Trig::Combination>::const_iterator incCombo_itrEnd = incCombo.end();
-            int nCombPhys = (incCombo_itrEnd - incCombo_itr);
-            cout << "MC test: nCombPhys, nComb = " << nCombPhys << ", " << nComb << endl;
-            cout << "MC test: ... return if nCombPhys < 1." << endl;
-            if(nCombPhys < 1)  return;
-
-            // It appears they didn't run our monitoring chain for the MC ...
-            /*cout << m_refChainName << endl;
-            Trig::FeatureContainer _fconto = (*m_tdt)->features(m_refChainName, TrigDefs::alsoDeactivateTEs);
-            cout << "Get monitoring combinations... " << endl;
-            const vector<Trig::Combination>& _combo = _fconto.getCombinations();
-            vector<Trig::Combination>::const_iterator _c_itro = _combo.begin();
-            int monitComb = (_combo.end() - _c_itro);
-            cout << "monitoring combinations: " << monitComb << endl;*/
-
-            vector<int> used_combis;
-            string tagTE = "", TEName = "";
-            //unsigned int m1roiID = 0, m2roiID = 0;
-            cout << "MC test: Loop over all tags ..." << endl;
-            for(int tag_index = 0; tag_index < nCombPhys; ++tag_index) {
-            //incCombo_itr != incCombo_itrEnd; ++incCombo_itr) {
-              cout << "   MC test: current tag: " << tag_index << endl;
-              vector< Trig::Feature< TrigMuonEFInfoContainer > > tagmuons = incCombo_itr->get< TrigMuonEFInfoContainer >("MuonEFInfo", TrigDefs::Physics, tagTE);
-              ++incCombo_itr;
-              cout << "   MC test: number of muons in tag combination: " << tagmuons.size() << endl;
-              assert(tagmuons.size() == 1 && "WARNING -- wrong number of muons in this combination!!!");
-              const HLT::TriggerElement* m1te = tagmuons[0].te();
-              TEName = (Trig::getTEName(*m1te).c_str());
-              cout << "   MC test: TE name for muon " << tag_index << " is: " << TEName << endl;
-              //cout << "   MC test: TE ID = " << (*m1te).getId() << endl;
-              cout << "   MC test: getActiveState: " << (*m1te).getActiveState() << endl;
-              //m1roiID = (*m_tdt)->ancestor<TrigRoiDescriptor>(tagmuons[0], "forID").cptr()->roiId();
-              //cout << "   MC test: RoI ID (mu1): " << m1roiID << " (" << tag_index << ")" << endl;
-
-              //Trig::Feature< TrigMuonEFInfoContainer > trackFeature1 = tagmuons.at(0);
-              const TrigMuonEFInfoContainer* trigMuon = tagmuons.at(0).cptr();
-              //TrigMuonEFInfoContainer::const_iterator muItr1  = trigMuon->begin();
-                    const TrigMuonEFInfoTrackContainer* tagCon = (*(trigMuon->begin()))->TrackContainer();
-	            TrigMuonEFInfoTrackContainer::const_iterator trackItr = tagCon->begin();
-	            TrigMuonEFInfoTrackContainer::const_iterator trackItrEnd = tagCon->end();
-              //int nCons = int(trackItrEnd - trackItr);
-              //cout << "Number of trackcontainer elements: " << nCons << endl;
-              TrigMuonEFCbTrack* tagCB = 0;
-              for(; trackItr != trackItrEnd; ++trackItr) {
-	              const TrigMuonEFInfoTrack* muonInfo = (*trackItr);
-                bool pass = muonInfo->hasCombinedTrack();
-                cout << "hasCombinedTrack: " << pass << endl;
-                if(pass)  tagCB = muonInfo->CombinedTrack();
-              }
-              if(!tagCB) { cout << "TAG IGNORED." << endl; continue; }
-              //const TrigMuonEFInfoContainer* trigMuon = tagmuons[0].cptr();
-	            //TrigMuonEFInfoTrackContainer* tagCon = trigMuon->at(0)->TrackContainer();
-	            //TrigMuonEFCbTrack* tagCB = tagCon->at(0)->CombinedTrack(); 
-	            //TrigMuonEFCbTrack* tagCB = muonInfo->CombinedTrack(); 
-			        TrigMuonEFTrack* tag = tagCon->at(0)->ExtrapolatedTrack(); 
-			        //TrigMuonEFTrack* tag   = tagmuons[0].cptr()->at(0)->TrackContainer()->at(0)->ExtrapolatedTrack(); 
-
-              cout << "   MC test: Loop over all combinations including the deactived ones ..." << endl;
-              //vector<Trig::Combination>::const_iterator deacCombo_itr = incComboDeac_itr;
-              //vector<Trig::Combination>::const_iterator deacCombo_itr = incCombo_itr + 1;
-              incComboDeac_itr = incComboDeac.begin();
-              double minMass = 0.;
-              for(int deac_index = 0; deac_index < nComb; ++deac_index) {
-              //deacCombo_itr < incComboDeac_itrEnd; ++deacCombo_itr) {
-                cout << "MC test: Indices for current combination: " << tag_index
-                     << ", " << deac_index  << " (ignore if equal)" << endl;
-                cout << "      MC test: current combination: " << deac_index << endl;
-                vector< Trig::Feature< TrigMuonEFInfoContainer > > combimuons = incComboDeac_itr->get< TrigMuonEFInfoContainer >("MuonEFInfo", TrigDefs::alsoDeactivateTEs, tagTE);
-                ++incComboDeac_itr;
-                cout << "      MC test: number of muons in current combination: " << combimuons.size() << endl;
-                assert(combimuons.size() == 1 && "WARNING -- wrong number of muons in this combination!!!");
-                const HLT::TriggerElement* m2te = combimuons[0].te();
-                TEName = (Trig::getTEName(*m2te).c_str());
-                cout << "      MC test: TE name for muon " << deac_index << " is: " << TEName << endl;
-                //cout << "      MC test: TE ID = " << (*m2te).getId() << endl;
-                cout << "      MC test: getActiveState: " << (*m2te).getActiveState() << endl;
-                //m2roiID = (*m_tdt)->ancestor<TrigRoiDescriptor>(combimuons[0], "forID").cptr()->roiId();
-                //cout << "      MC test: RoI ID (mu2): " << m2roiID << " (" << deac_index << ")" << endl;
-                //cout << "      MC test: compare RoIs: (mu1, mu2) = (" << m1roiID << ", " << m2roiID << ")" << endl;
-
-                const TrigMuonEFInfoContainer* trigMu = combimuons.at(0).cptr();
-                const TrigMuonEFInfoTrackContainer* probeCon = (*(trigMu->begin()))->TrackContainer();
-                TrigMuonEFInfoTrackContainer::const_iterator trackItr = probeCon->begin();
-                TrigMuonEFInfoTrackContainer::const_iterator trackItrEnd = probeCon->end();
-			          TrigMuonEFTrack* probe = 0; 
-                for(; trackItr != trackItrEnd; ++trackItr) {
-                  const TrigMuonEFInfoTrack* muonInfo = (*trackItr);
-                  bool pass = muonInfo->hasExtrapolatedTrack();
-                  cout << "hasExtrapolatedTrack: " << pass << endl;
-                  if(pass)  probe = muonInfo->ExtrapolatedTrack();
-                }
-                if(!probe) { cout << "PROBE IGNORED." << endl; continue; }
-			          //TrigMuonEFTrack* probe = combimuons[0].cptr()->at(0)->TrackContainer()->at(0)->ExtrapolatedTrack(); 
-                if( (*tag) == (*probe) || !tagCB )  { cout << "IGNORED." << endl; continue; }
-                int tagRoiID = (*m_tdt)->ancestor<TrigRoiDescriptor>(tagmuons[0], "").cptr()->roiId();
-                int probeRoiID = (*m_tdt)->ancestor<TrigRoiDescriptor>(combimuons[0], "").cptr()->roiId();
-                cout << "tag pt, eta, phi: "   << tag->pt()   << " " << tag->eta()   << " " << tag->phi()   << endl;
-                cout << "probe pt, eta, phi: " << probe->pt() << " " << probe->eta() << " " << probe->phi() << endl;
-                cout << ">>> TEST 1: " << tag << " " << (*tag) << endl;
-                TLorentzVector v1, v2;
-                double energy = sqrt(pow(m_muonMass,2) + pow(tag->px(),2) + pow(tag->py(),2) + pow(tag->pz(),2));
-                v1.SetPtEtaPhiE(tag->pt(), tag->eta(), tag->phi(), energy);
-                energy = sqrt(pow(m_muonMass,2) + pow(probe->px(),2) + pow(probe->py(),2) + pow(probe->pz(),2));
-                v2.SetPtEtaPhiE(probe->pt(), probe->eta(), probe->phi(), energy);
-                double mass = (v1 + v2).Mag();
-                cout << "      MC test: invariant mass: " << mass << endl;
-                if(!minMass) {
-                  minMass = mass;
-                  used_combis.push_back( 100 + 10 * tag_index + deac_index );
-                  muonExtrapolatedTracks.push_back(probe);
-                  muonCombinedTracks.push_back(tagCB);
-                  probeRois.push_back(probeRoiID);
-                  tagRois.push_back(tagRoiID);
-                }
-                else if(mass < minMass) {
-                  minMass = mass;
-                  used_combis[used_combis.size() - 1] = (100 + 10 * tag_index + deac_index );
-                  muonExtrapolatedTracks[muonExtrapolatedTracks.size() - 1] = probe;
-                  //muonCombinedTracks[muonCombinedTracks.size() - 1] = tagCB;
-                  probeRois[probeRois.size() - 1] = probeRoiID;
-                  //tagRois[tagRois.size() - 1] = tagRoiID;
-                }
-              } // loop over deactivatedTEs
-            } // loop over physics
-            cout << "MC test: combinations being used:" << endl;
-            for(int ii = 0; ii < int(used_combis.size()); ++ii) { cout << " " << used_combis[ii] << endl; }
-            cout << "MC test: END.\n" << endl;
-            //return;
-
-            /*m_provider->msg(MSG::DEBUG) << "Get features... " << endmsg;
-            Trig::FeatureContainer fconto = (*m_tdt)->features(m_refChainName, m_trigDefs);
-            m_provider->msg(MSG::DEBUG) << "Get combinations... " << endmsg;
-            const vector<Trig::Combination>& combo = fconto.getCombinations();
-            vector<Trig::Combination>::const_iterator c_itro = combo.begin();
-            m_provider->msg(MSG::DEBUG) << "combo.end() - combo.begin(): " << (combo.end() - c_itro) << endmsg;
-            if(c_itro == combo.end()) return;
-            m_provider->msg(MSG::DEBUG) << "m_remover->MuonMaker(...)" << endmsg;
-            m_remover->muonMaker(c_itro, m_refChainName, m_tdt, m_trigDefs);
-            muonExtrapolatedTracks = m_remover->getExTrks();
-            muonCombinedTracks = m_remover->getCbTrks();*/
-
-            //cout << "Number of combined tracks before making J/Psi = " << muonCombinedTracks.size()
-            //     << " extrp tracks = " << muonExtrapolatedTracks.size() << endl;
-          }
-          //temp
-          if(m_provider->evtStore()->contains<Analysis::MuonContainer>(m_muonCollection)) {
-            StatusCode scm = m_provider->evtStore()->retrieve(Muons,m_muonCollection);
-            if(scm.isFailure()) {
-              if(m_events==1) {
-                m_provider->msg(MSG::WARNING) <<"No Collection with name "<<m_muonCollection<<" found in StoreGate" << endmsg;
-              }
-              else if(m_provider->msgLvl(MSG::DEBUG)) {
-                m_provider->msg(MSG::DEBUG)<< "No Collection with name "<<m_muonCollection<<" found in StoreGate" << endmsg;
-              }
-	      Muons = 0;
-            }
-          } 
-          else {
-            if(m_provider->msgLvl(MSG::DEBUG)) {
-              m_provider->msg(MSG::DEBUG) << "StoreGate does not contain Collection with name " << m_muonCollection << " " << endmsg;
-            }
-          }
-          if(!m_provider->evtStore()->contains<LVL1_ROI>("LVL1_ROI"))  m_useTrigger = false;
-          // iterators over the muon container and retrieve ID tracks only
-	  if (Muons){
-	    Analysis::MuonContainer::const_iterator MuonItr = Muons->begin(), MuonItrEnd = Muons->end();
-	    for(; MuonItr != MuonItrEnd; ++MuonItr) {
-	      if((*MuonItr)->isCombinedMuon()&&(*MuonItr)->hasInDetTrackParticle())  offlineInDet.push_back((*MuonItr)->inDetTrackParticle());
-	      if((*MuonItr)->hasMuonExtrapolatedTrackParticle())  offlineMSOnly.push_back((*MuonItr)->muonExtrapolatedTrackParticle());
-	    }
-	  }
-          ////temp
-        }
-        else {
-          m_provider->msg(MSG::DEBUG) << "EF_egamma stuff" << endmsg;
-          Trig::FeatureContainer f = (*m_tdt)->features(m_refChainName, TrigDefs::Physics);
-          const vector<Trig::Combination> comb_container_EF = f.getCombinations();
-          Trig::FeatureContainer::combination_const_iterator c(comb_container_EF.begin()); 
-          Trig::FeatureContainer::combination_const_iterator cEnd(comb_container_EF.end());
-          if(comb_container_EF.size()) {
-            int counter_egamma  = -1;
-            int counter_cluster = -1;
-            for(Trig::FeatureContainer::combination_const_iterator my_it = c; my_it != cEnd; ++my_it) {
-              vector< Trig::Feature<TrigRoiDescriptor> > vecRoi = my_it->get<TrigRoiDescriptor>("");
-              //vector< Trig::Feature<TrigRoiDescriptor> >::const_iterator roiItr = vecRoi.begin();
-              //vector< Trig::Feature<TrigRoiDescriptor> >::const_iterator roiLast = vecRoi.end();
-              /*for( ; (roiItr != roiLast); ++roiItr) {
-                const HLT::TriggerElement* a = (*roiItr).te();
-                a = const_cast<HLT::TriggerElement*>(a);
-                string TEName = "";
-                TEName = (Trig::getTEName((*a))).c_str();
-                m_provider->msg(MSG::DEBUG) << "TE Name: " << TEName << endmsg;
-              }*/
-              //const vector<Trig::Feature<CaloClusterContainer> > cluster_cont = my_it->get<CaloClusterContainer>("");
-              m_provider->msg(MSG::DEBUG) << "Get calo cluster..." << endmsg;
-              std::string teName = "";
-              //if(m_refChainName.find("Zee") != string::npos)   teName = "EF_e15_NoCutcalo";
-              //cout << "try TE name: " << teName << endl;
-              const vector<Trig::Feature<CaloClusterContainer> > cluster_cont = my_it->get<CaloClusterContainer>("",TrigDefs::Physics,teName);
-              m_provider->msg(MSG::DEBUG) << "egamma container cluster_cont size: " << cluster_cont.size() << endmsg;
-              if(cluster_cont.size() != 0) {
-                vector<Trig::Feature<CaloClusterContainer> >::const_iterator tempEnd = cluster_cont.end();
-                for(vector<Trig::Feature<CaloClusterContainer> >::const_iterator contit = cluster_cont.begin(); contit != tempEnd; ++contit) {
-                  ++counter_cluster;
-                  if(!(counter_cluster%2 == 0)) {
-                    //cout << "There are " << ((*contit).cptr())->size() << " loose cluster(s) in this event" << endl; 
-                    Trig::Feature<TrigRoiDescriptor> trackroi = (*m_tdt)->ancestor<TrigRoiDescriptor>(*contit, "");
-                    const TrigRoiDescriptor* roiId = trackroi.cptr();
-                    DataVector<CaloCluster>::const_iterator temp2End = ((*contit).cptr())->end();
-                    for(DataVector<CaloCluster>::const_iterator clusItr = ((*contit).cptr())->begin(); clusItr!= temp2End; ++clusItr) {
-                      const CaloCluster* tempCalo = *clusItr;
-                      //if(TMath::Abs(tempCalo->eta())<1.37 || TMath::Abs(tempCalo->eta())>1.52) {
-                        ClusterContainer_EF.push_back(tempCalo);
-                        clusterRoiIDs.push_back(roiId->roiId());
-                        m_provider->msg(MSG::DEBUG) << "cluster egamma roiId: " << roiId->roiId() << endmsg;
-                      //}
-                    }
-                  }
-                }
-              }
-              //const vector< Trig::Feature<egammaContainer> > temp = my_it->get<egammaContainer>("");
-              m_provider->msg(MSG::DEBUG) << "calocluster size: " << cluster_cont.size() << endmsg;
-              m_provider->msg(MSG::DEBUG) << "get tight electrons ..." << endmsg;
-              teName = "";
-              //if(m_refChainName.find("Zee") != string::npos)  teName = "EF_e24vh_tight1";
-              //cout << "try TE name: " << teName << endl;
-              const vector<Trig::Feature<egammaContainer> > temp = my_it->get<egammaContainer>("",TrigDefs::Physics,teName);
-              m_provider->msg(MSG::DEBUG) << "egamma container temp size: " << temp.size() << endmsg;
-              if(temp.size() != 0) {
-                vector<Trig::Feature<egammaContainer> >::const_iterator t0 = temp.begin();
-                vector<Trig::Feature<egammaContainer> >::const_iterator tEnd = temp.end();
-                for(vector< Trig::Feature<egammaContainer> >::const_iterator contit = t0; contit != tEnd; ++contit){
-                  ++counter_egamma;
-                  if(counter_egamma%2 == 0) {
-                    Trig::Feature<TrigRoiDescriptor> trackroi = (*m_tdt)->ancestor<TrigRoiDescriptor>(*contit, "");
-                    const TrigRoiDescriptor* roiId = trackroi.cptr();
-                    DataVector<egamma>::const_iterator e0   = ((*contit).cptr())->begin();
-                    DataVector<egamma>::const_iterator eEnd = ((*contit).cptr())->end();
-                    for( DataVector<egamma>::const_iterator elecItr = e0; elecItr != eEnd; ++elecItr) {
-                      const egamma* tempEl = *elecItr; 
-                      //if(TMath::Abs(tempEl->eta())<1.37 ||TMath::Abs(tempEl->eta())>1.52) {
-                        tightElectrons_EF.push_back(tempEl);
-                        tightElecsRoiIDs.push_back(roiId->roiId());
-                        m_provider->msg(MSG::DEBUG) << "tight egamma roiId: " << roiId->roiId() << endmsg;
-                        //egamma_tightEl_EF.push_back(tempEl->trackParticle());
-                      //}
-                    }
-                  }
-                }
-              }
-              m_provider->msg(MSG::DEBUG) << "tightelectrons size: " << tightElectrons_EF.size() << endmsg;
-              /*vector< Trig::Feature<Rec::TrackParticleContainer> > feature_EF = my_it->get<Rec::TrackParticleContainer>("InDetTrigParticleCreation_Electron_EFID");
-              vector< Trig::Feature<Rec::TrackParticleContainer> >::const_iterator contit    = feature_EF.begin();
-              vector< Trig::Feature<Rec::TrackParticleContainer> >::const_iterator contitEnd = feature_EF.end();
-              for( ; contit != contitEnd; ++contit) {
-                const Rec::TrackParticleContainer *cont = (*contit).cptr();
-                Rec::TrackParticleContainer::const_iterator track    = cont->begin();
-                Rec::TrackParticleContainer::const_iterator trackEnd = cont->end();
-                for( ; track != trackEnd; ++track) {
-                  //cout << "NEWEST_TEST" << endl;
-                  //const Rec::TrackParticle *temp = *track;
-                  offlineInDet2.push_back(*track);
-                }
-              }*/
-            }
-          }
-          m_provider->msg(MSG::DEBUG) << "Start offline bit ..." << endmsg;
-          vector<int> tagRoIs;
-          const DataHandle<ElectronContainer> ElectronCollection;
-          string electronCollection = "ElectronAODCollection";
-          StatusCode sc_electrons = m_provider->evtStore()->retrieve( ElectronCollection, electronCollection);
-          if(!sc_electrons.isFailure())  m_provider->msg(MSG::DEBUG) << "OFFLINE -- number of electrons: " << ElectronCollection->size() << endmsg;
-          if(ElectronCollection && ElectronCollection->size() != 0) {
-            ElectronContainer::const_iterator elecItrEnd = ElectronCollection->end();
-            for(ElectronContainer::const_iterator elecItr = ElectronCollection->begin(); elecItr != elecItrEnd; ++elecItr) { 
-              const Analysis::Electron* temp = *elecItr;
-              /*cout << "isem(0) = " << temp->isem(egammaPID::ElectronMediumPP) << "  passID(1) = "
-                   << temp->passID(egammaPID::ElectronIDMediumPP) << endl;*/
-              if(temp->isem(egammaPIDObs::ElectronMediumPP)==0 || 1==temp->passID(egammaPIDObs::ElectronIDMediumPP)) {
-              //if(temp->isem(egammaPID::ElectronTightPP)==0 || 1==temp->passID(egammaPID::ElectronIDTightPP)) {
-                //if(TMath::Abs(temp->eta())<1.37 || TMath::Abs(temp->eta())>1.52) {
-                  m_provider->msg(MSG::DEBUG) << "OFFLINE -- electron passed [ pT = " << temp->pt()
-                                              << ", eta = " << temp->eta() << ", phi = " << temp->phi()
-                                              << ", charge = " << temp->charge() << " ]" << endmsg;
-                  cout << "OFFLINE -- electron passed [ pT = " << temp->pt()
-                       << ", eta = " << temp->eta() << ", phi = " << temp->phi()
-                       << ", charge = " << temp->charge() << " ]" << endl;
-                if(temp->charge())  offTightElecs.push_back(temp); // tight
-                //}       
-              }
-            } 
-            //cout << "OFFLINE -- Number of electrons after filtering: " << offlineInDet2.size() << " candidates!!" << endl;
-          }
-          //cout << "OFFLINE_END_OF_LOOP" << endl;
-        } // end of electron bit
-        if(m_jpsi) {
-          cout << "prepare making dilepton pairs..." << endl;
-          m_jpsi->initializeMembers();
-          m_jpsi->doTagAndProbe(m_TagAndProbe);
-          m_jpsi->useTrigger(m_useTrigger); //tag a combined muon passing L1 muon ROI; not necessary for EF muons
-          m_jpsi->setTrackMass(m_muonMass);
-          m_jpsi->setUpperInvMassLimit(m_jpsiPDGmass+m_plusMass);
-          m_jpsi->setLowerInvMassLimit(m_jpsiPDGmass-m_minusMass);
-          cout << "making dilepton pairs..." << endl;
-          if(m_isMuon) {
-            cout << "set tags..." << endl;
-            m_jpsi->setTags(muonCombinedTracks, tagRois); //m_remover->getTagRoIs());
-            cout << "set probes..." << endl;
-            m_jpsi->setProbes(muonExtrapolatedTracks, probeRois); //m_remover->getProbeRoIs());
-            //m_jpsi->setProbes(muonExtrapolatedTracks, m_remover->getMatches(), m_remover->getRoIs());
-          }
-          else {
-            m_jpsi->setTags(tightElectrons_EF,tightElecsRoiIDs);
-            m_jpsi->setProbes(ClusterContainer_EF,clusterRoiIDs);
-          }
-          cout << "finish off making dilepton pairs..." << endl;
-          m_jpsi->setPtcut(m_ptcut);
-          m_jpsi->setTagPtcut(m_tagptcut);
-          m_jpsi->setEtacut(m_etacut);
-          m_jpsi->setTagEtacut(m_tagetacut);
-          cout << "get the pairs..." << endl;
-
-          //cout << "AC_Jpsi extrapolated tracks " << muonExtrapolatedTracks.size() << " combined tracks " << muonCombinedTracks.size() << endl;
-          vector<DiMuonTool*> mypairs = m_jpsi->execute();
-          m_provider->msg(MSG::DEBUG) << "jpsi candidates: " << mypairs.size() << endmsg;
-          /*for(unsigned int q = 0; q < mypairs.size(); q++) {
-            m_provider->msg(MSG::DEBUG) << "pair: " << q << " mypairs[q]: " << mypairs[q] << endmsg;
-            const Wrapper::MuonTrack *p = mypairs[q]->ProbedTrack();
-            m_provider->msg(MSG::DEBUG) << "probed track -- pt = " << p->pt() << " eta = " << p->eta() << " phi = " << p->phi() << endmsg;
-            const Wrapper::MuonTrack *t = mypairs[q]->TaggedTrack();
-            m_provider->msg(MSG::DEBUG) << "tagged track -- pt = " << t->pt() << " eta = " << t->eta() << " phi = " << t->phi() << endmsg;
-          }*/
-	        //to protect against > 1 J/Psi's being made with 1 tag and > 1 similar probes
-          //take the pair with invariant mass closest to the J/Psi
-          //for 1 J/Psi, this will be seen as > 2 J/Psi candidates...
-          /*if(mypairs.size() > 2){
-            double PI=3.14159265;
-            for(unsigned i=0; i<mypairs.size(); i++) {
-              for(unsigned j = i+1; j<mypairs.size(); ) {
-                double deta = mypairs[i]->ProbedTrack()->eta() - mypairs[j]->ProbedTrack()->eta();
-                double dphi = mypairs[i]->ProbedTrack()->phi() - mypairs[j]->ProbedTrack()->phi();
-                if(dphi >  PI)  dphi -= 2*PI;
-                if(dphi < -PI)  dphi += 2*PI;
-                double dr = sqrt(pow(deta,2) + pow(dphi,2));
-                if(dr < 0.5) {
-                  if(fabs(m_jpsiPDGmass - mypairs[i]->InvariantMass()) < fabs(m_jpsiPDGmass - mypairs[j]->InvariantMass())) {
-                    mypairs.erase(mypairs.begin()+j); 
-                    break;
-                  }
-                  else {
-                    mypairs.erase(mypairs.begin()+i);
-                    break;
-                  }
-                }
-                else j++;
-              }
-            }
-          }*/
-          m_selectorJ->addJpsi(mypairs);
-          m_provider->msg(MSG::DEBUG) << "Pair added." << endmsg;
-          cout << "SKIM CANDIDATES -- event #: " << eventNumber << " run #: " << runNumber << endl;
-        } // if( m_jpsi )
-      } // end of else -> if( doTruth )
-	  
-      m_provider->msg(MSG::DEBUG) << "Call m_selectorJ->tracks()" << endmsg;
-      vector<TIDA::Track*> probeTracks = m_selectorJ->tracks();
-      unsigned int trackSize = probeTracks.size();
-      m_provider->msg(MSG::DEBUG) << "probeTracks size: " << trackSize << endmsg;
-      
-      // perform dR match between offline extrapolated tracks and EF probes
-      map<unsigned int, const Rec::TrackParticle*> offlineProbes, offlineTags;
-      vector<float> pOffDr(trackSize),   tOffDr(trackSize),     pOffDeta(trackSize),
-                    pOffDphi(trackSize), pOffCharge(trackSize), tOffCharge(trackSize),
-                    pOffEt(trackSize);
-      float ptCut = 4000., tagPtCut = 5000.;
-      if(!m_isJpsi) {
-        ptCut = 15000.;
-        tagPtCut = 24000.;
-      }
-
-      m_provider->msg(MSG::DEBUG) << "loop over probeTracks." << endmsg;
-      for(unsigned int j=0; j< trackSize; j++) {
-
-        const Rec::TrackParticle* closestProbe = 0, *closestTag = 0;
-        TIDA::JpsiTrack* probe = 0;
-        const Wrapper::MuonTrack *tag = 0;
-        const CaloCluster *offClust = 0;
-
-        // Make sure there is a default value of 0 if there is no offline match
-        offlineProbes[j] = offlineTags[j] = 0;
-        pOffDr[j] = tOffDr[j] = pOffDeta[j] = pOffDphi[j] = 0;
-        pOffCharge[j] = tOffCharge[j] = pOffEt[j] = 0;
-
-        m_provider->msg(MSG::DEBUG) << "probeTracks[j] --> " << probeTracks[j] << endmsg;
-        if(probeTracks[j]) {
-          m_provider->msg(MSG::DEBUG) << "Get probe ..."  << endmsg;
-          probe = dynamic_cast<TIDA::JpsiTrack*>(probeTracks[j]);
-          m_provider->msg(MSG::DEBUG) << "probe: " << probe << " and *probe: " << *probe << endmsg;
-          m_provider->msg(MSG::DEBUG) << "Get tag ..."  << endmsg;
-          tag = probe->getTag();
-          m_provider->msg(MSG::DEBUG) << "tag: " << tag << endmsg;
-          m_provider->msg(MSG::DEBUG) << "... done." << endmsg;
-        }
-        else throw std::runtime_error("*** TrigJpsiMonTool *** Probe not casting, aborting!!! *** TrigJpsiMonTool ***");
-
-
-        float tempP = 999., tempT = 999., detaP = 0., dphiP = 0., etP = 0.;
-        m_provider->msg(MSG::DEBUG) << "Loop over offline objects..." << endmsg;
-        unsigned int offSize = m_isMuon? offlineInDet.size() : offTightElecs.size();
-        for(unsigned int i = 0; i < offSize; i++) {
-
-          if(!m_isMuon) {
-            unsigned int author = offTightElecs[i]->author();
-            m_provider->msg(MSG::DEBUG) << "author: " << author << endmsg;
-            if(author != 1 && author != 3)  continue;
-            offClust = offTightElecs[i]->cluster();
-            //cout << "off electron pT: " << offTightElecs[i]->pt() << endl;
-            //cout << "off cluster pT: " << offClust->pt() << endl;
-            //cout << "off track pT: " << offTightElecs[i]->trackParticle()->pt() << endl;
-          }
-
-          float offEta = m_isMuon? offlineInDet[i]->eta() : offClust->eta();
-          float offPhi = m_isMuon? offlineInDet[i]->phi() : offClust->phi();
-          float offPt  = m_isMuon? offlineInDet[i]->pt()  : offClust->pt();
-          float deltar = AnalysisConfig_Jpsi::deltaR(offEta, offPhi, probe->eta(), probe->phi());
-          m_provider->msg(MSG::DEBUG) << "OFFLINE PROBE [ pt = " <<  offPt << " eta = " << offEta
-                                      << " phi = " << offPhi << " ]" << endmsg;
-          if(deltar < tempP && offPt > ptCut) {
-            tempP = deltar;
-            detaP = offEta - probe->eta();
-            dphiP = AnalysisConfig_Jpsi::deltaPhi(offPhi, probe->phi());
-            closestProbe = m_isMuon? offlineInDet[i] : offTightElecs[i]->trackParticle();
-            etP = offPt; // cluster mass always zero, so I guess ET = pT in this case?
-          }
-
-          if(!m_isMuon) {
-            offEta = offTightElecs[i]->eta();
-            offPhi = offTightElecs[i]->phi();
-            offPt  = offTightElecs[i]->pt();
-          }
-          deltar = AnalysisConfig_Jpsi::deltaR(offEta, offPhi, tag->eta(), tag->phi());
-          m_provider->msg(MSG::DEBUG) << "OFFLINE TAG [ pt = " <<  offPt << " eta = " << offEta
-                                      << " phi = " << offPhi << " ]" << endmsg;
-          //cout << deltar << endl;
-          if(deltar < tempT && offPt > tagPtCut) {
-            tempT = deltar;
-            closestTag = m_isMuon? offlineInDet[i] : offTightElecs[i]->trackParticle();
-          }
-        }
-       
-        if(closestProbe) {
-          const Trk::TrackSummary *summary = closestProbe->trackSummary();
-          int nBlayerHits = 2*summary->get(Trk::numberOfInnermostPixelLayerHits);
-          int nPixelHits  = 2*summary->get(Trk::numberOfPixelHits);  
-          int nSctHits    = summary->get(Trk::numberOfSCTHits); 
-          //int nStrawHits  = summary->get(Trk::numberOfTRTHits);
-          //int nTrHits     = summary->get(Trk::numberOfTRTHighThresholdHits);
-
-          if(tempP < 0.15 && nBlayerHits > 0 && nPixelHits > 1 && nSctHits > 5) {
-            offlineProbes[j] = closestProbe;
-            pOffDr[j] = tempP;
-            pOffDeta[j] = detaP;
-            pOffDphi[j] = dphiP;
-            pOffCharge[j] = closestProbe->charge();
-            pOffEt[j] = etP;
-          }
-        }
-        if(closestTag) {
-          const Trk::TrackSummary *summary = closestTag->trackSummary();
-          int nBlayerHits = 2*summary->get(Trk::numberOfInnermostPixelLayerHits);
-          int nPixelHits  = 2*summary->get(Trk::numberOfPixelHits);  
-          int nSctHits    = summary->get(Trk::numberOfSCTHits); 
-          //int nStrawHits  = summary->get(Trk::numberOfTRTHits);
-          //int nTrHits     = summary->get(Trk::numberOfTRTHighThresholdHits);
-
-          if(tempT < 0.15 && nBlayerHits > 0 && nPixelHits > 1 && nSctHits > 5) {
-            offlineTags[j] = closestTag;
-            tOffDr[j] = tempT;
-            tOffCharge[j] = closestTag->charge();
-          }
-        }
-      }
-
-      m_provider->msg(MSG::DEBUG) << "Set probes and tags for m_analysisJ..." << endmsg;
-      m_analysisJ->setProbeOfflineDr(pOffDr);
-      m_analysisJ->setProbeOfflineEt(pOffEt);
-      m_analysisJ->setProbeOfflineDEta(pOffDeta);
-      m_analysisJ->setProbeOfflineDPhi(pOffDphi);
-      m_analysisJ->setProbeOfflineCharge(pOffCharge);
-      m_analysisJ->setTagOfflineDr(tOffDr);
-      m_analysisJ->setTagOfflineCharge(tOffCharge);
-      m_analysisJ->setOfflineProbes(offlineProbes);
-      m_analysisJ->setOfflineTags(offlineTags);
-
-      // Fill vector of test tracks from the TDT feature 
-      vector<int> sizes;
-      m_provider->msg(MSG::DEBUG) << "Start to select tracks with " << m_testChainKey << " / " << m_refChainName << endmsg;
-      bool check  = m_testChainKey.find("IDSCAN")        != string::npos;
-      check      |= m_testChainKey.find("SegmentFinder") != string::npos;
-      check      |= m_testChainKey.find("SiTrack_")      != string::npos;
-      check      |= m_testChainKey.find("SegFinder")     != string::npos;  
-      if(check)  selectTracks<TrigInDetTrackCollection>(m_testChainKey, 0, m_refChainName);
-
-      if(m_testChainKey.find("SiTrackFinder") != string::npos) { 
-        if(m_isMuon) {
-          if(m_refChainName.find("_mu20") != string::npos) {
-            selectTracks<TrigInDetTrackCollection>("TrigSiTrack_Muon", 0, m_refChainName);
-          }
-          else if(m_testChainKey.find("MuonA") != string::npos) {
-            selectTracks<TrigInDetTrackCollection>("TrigL2SiTrackFinder_Muon", 0, m_refChainName);
-          }
-          else if(m_testChainKey.find("MuonB") != string::npos) {
-            selectTracks<TrigInDetTrackCollection>("TrigL2SiTrackFinder_Muon", 1, m_refChainName);
-          }
-          else if(m_testChainKey.find("MuonC") != string::npos) {
-            selectTracks<TrigInDetTrackCollection>("TrigL2SiTrackFinder_Muon", 2, m_refChainName);
-          }
-        }
-        else {
-          if(m_testChainKey.find("eGammaA") != string::npos) {
-            selectTracks<TrigInDetTrackCollection>("TrigL2SiTrackFinder_eGamma", 0, m_refChainName);
-          }
-          else if(m_testChainKey.find("eGammaB") != string::npos) {
-            selectTracks<TrigInDetTrackCollection>("TrigL2SiTrackFinder_eGamma", 1, m_refChainName);
-          }
-          else if(m_testChainKey.find("eGammaC") != string::npos) {
-            selectTracks<TrigInDetTrackCollection>("TrigL2SiTrackFinder_eGamma", 2, m_refChainName);
-          }
-        }
-      }
-
-      if(m_testChainKey.find("InDetTrig") != string::npos) {
-        selectTracks0<Rec::TrackParticleContainer>(m_testChainKey, 0, m_refChainName);
-      }
-      
-      //const vector<Track*> &testtracksA = m_selectorTestA->tracks();
-      const vector<TIDA::Track*> testtracksA = m_trigTracks;
-      sizes.push_back(testtracksA.size()); 
-
-      m_provider->msg(MSG::DEBUG) << "... done. Ntracks = " << testtracksA.size() << " ( " << m_testChainKey << " / " << m_refChainName << " )" << endmsg;
-
-      m_analysisJ->setTIDARois(m_trackRois);
-      //m_analysisJ->setEtaAtCalo(m_etaAtCalo);
-      //m_analysisJ->setPhiAtCalo(m_phiAtCalo);
-
-      if(m_associator) m_associatorJ = dynamic_cast<Associator_BestDeltaRMatcher*>(m_associator);
-
-      //match the 2 sets of tracks ... this is no longer necessary, since we match by mass confirmation
-      //m_associatorJ->match(probeTracks, testtracks);
-      m_analysis->setBeamRef(xbeam,  ybeam);
-      m_analysis->setBeamTest(xbeam, ybeam);
-
-      m_analysisJ->setVertices(vertices);
-      m_analysisJ->setCase(m_isMuon, m_isJpsi);
-
-      m_analysis->execute(probeTracks, testtracksA, m_associator);
-
-      m_provider->msg(MSG::DEBUG) << "Final clean up ..." << endmsg;
-      for(vector<TIDA::Vertex*>::const_iterator it = vertices.begin(); it != vertices.end(); it++)  delete (*it);
-      m_analysisJ->clearOffline();
-      // m_analysisJ->clearSuper();
-      //m_selectorTestB->clear();
-      
-      m_provider->msg(MSG::DEBUG) << "END EVENT." << endmsg;
-     }//end of complete result condition
-  }//end of trigger condition
-}
-
-/// setup the analysis the analysis, retrieve the tools etc 
-
-void AnalysisConfig_Jpsi::book() { 
-  
-  m_events = m_count_before = m_count_after = 0;
-
-  m_isJpsi  = (m_refChainName.find("Zmumu") == string::npos);
-  m_isJpsi &= (m_refChainName.find("mu24i") == string::npos);
-  m_isJpsi &= (m_refChainName.find("mu20")  == string::npos);
-  m_isJpsi &= m_refChainName.find("Zee")    == string::npos;
-
-  m_isMuon = (m_refChainName.find("mu") != string::npos);
-  m_trigDefs = m_isMuon? TrigDefs::alsoDeactivateTEs : TrigDefs::Physics;
-  //m_trigDefs = TrigDefs::Physics;
-
-  //get combined muons
-  m_muonCollection = "MuidMuonCollection";
-  m_checkrate      = 1000;
-  m_etacut         = 2.5;
-  m_tagetacut      = 2.5;
-  m_muonMass       = m_isMuon? 105.66*CLHEP::MeV : 0.511*CLHEP::MeV;
-  m_TagAndProbe    = true;
-  m_useTrigger     = false;    
-  m_runOnline      = true;
-
-/* MEEEEH   m_RCAL = 1470.0E+3;
-  m_ZCAL = 3800.0E+3;*/
-
-  if(m_isJpsi){
-    m_jpsiPDGmass = 3.097*CLHEP::GeV;
-    m_jpsiwidth   = 2.*CLHEP::GeV;
-    m_ptcut       = 4.0*CLHEP::GeV;
-    m_tagptcut    = (m_isMuon? 4.0 : 5.0) * CLHEP::GeV;
-    //m_plusMass    = 1.203*GeV;
-    //m_plusMass    = 0.603*GeV;
-    //m_minusMass   = 0.597*GeV;
-    m_plusMass    = (m_isMuon? 0.303 : 2.903) * CLHEP::GeV;
-    m_minusMass   = (m_isMuon? 0.597 : 2.097) * CLHEP::GeV;
-  }
-  else {
-    m_jpsiPDGmass = 90.097*CLHEP::GeV;
-    m_jpsiwidth   = 2.*CLHEP::GeV;
-    m_ptcut       = 15.0*CLHEP::GeV;   
-    m_tagptcut    = 24.0*CLHEP::GeV;   
-    //m_plusMass    = 19.903*CLHEP::GeV; // 110 GeV
-    m_plusMass    = 309.903*CLHEP::GeV; // 400 GeV
-    //m_minusMass   = 20.097*CLHEP::GeV; // 70 GeV  
-    m_minusMass   = 55.097*CLHEP::GeV; // 35 GeV 
-  }
-  
-  ///temp
-
-  if(m_toolSvc.retrieve().isFailure()) m_provider->msg(MSG::FATAL) << "Failed to retrieve service " << m_toolSvc << endmsg;
-  else  m_provider->msg(MSG::INFO) << "Retrieved service " << m_toolSvc << endmsg;
-  
-  // get the beam condition services
-  if(m_iBeamCondSvc.retrieve().isFailure())  m_provider->msg(MSG::ERROR) << " failed to retrieve BeamCondSvc " << endmsg;
-  else  m_provider->msg(MSG::INFO) << " retrieved BeamCondSvc " << endmsg;
-  
-  /*m_iOnlineBeamCondSvc = 0;
-  if ( m_provider->service( "InDetBeamSpotOnline", m_iOnlineBeamCondSvc ).isFailure() )  { 
-    m_provider->msg(MSG::ERROR) << " failed to retrieve Online BeamCondSvc" << endmsg;
-  }
-  else {
-    m_provider->msg(MSG::INFO) << " retrieved OnlineBeamCondSvc " << endmsg;
-  }*/
-
-  // get the TriggerDecisionTool
-
-  if(m_tdt->retrieve().isFailure()) {
-    m_provider->msg(MSG::ERROR) << "Unable to retrieve the TrigDecisionTool: Please check job options file" << endmsg;
-    //return StatusCode::FAILURE;
-  }
-
-  if(m_isMuon){
-    if(m_testChainKey.find("SiTrackFinder") != string::npos){
-      if(m_testChainKey.find("eGammaA") != string::npos) m_testChainKey = "TrigL2SiTrackFinder_MuonA";
-      if(m_testChainKey.find("eGammaB") != string::npos) m_testChainKey = "TrigL2SiTrackFinder_MuonB";
-      if(m_testChainKey.find("eGammaC") != string::npos) m_testChainKey = "TrigL2SiTrackFinder_MuonC";
-    }
-    if(m_testChainKey.find("InDetTrig") != string::npos) {
-      if(m_testChainKey.find("Electron") != string::npos) m_testChainKey = "InDetTrigParticleCreation_Muon_EFID";
-    }
-  }
-
-#ifdef ManagedMonitorToolBase_Uses_API_201401 
-  m_provider->addMonGroup( new ManagedMonitorToolBase::MonGroup( m_provider,
-                               "HLT/IDJpsiMon/" + m_analysis->name() + "/" + m_testChainKey,
-                               ManagedMonitorToolBase::run ) );
-                               // ManagedMonitorToolBase::shift, ManagedMonitorToolBase::run ) );
-#else
-  m_provider->addMonGroup( new ManagedMonitorToolBase::MonGroup( m_provider,
-                               "HLT/IDJpsiMon/" + m_analysis->name() + "/" + m_testChainKey,
-                               ManagedMonitorToolBase::shift, ManagedMonitorToolBase::run ) );
-#endif
-
-  m_analysis->initialise();
-
-  m_analysisJ = dynamic_cast<JpsiAnalysis*> (m_analysis);
-
-  m_analysisJ->setChainName(m_refChainName);
-  m_analysisJ->setPlusMass(m_plusMass);
-  m_analysisJ->setMinusMass(m_minusMass);
-      
-  map<string, TH1F*>::const_iterator hitr = m_analysisJ->THbegin();
-  map<string, TH1F*>::const_iterator hend = m_analysisJ->THend();
-
-  while ( hitr!=hend ) { 
-    m_provider->addHistogram( hitr->second,"HLT/IDJpsiMon/" +  m_analysis->name() + "/" + m_testChainKey ); 
-    hitr++; 
-  }
-
-  map<string, TProfile*>::const_iterator tphitr = m_analysisJ->TPbegin();
-  map<string, TProfile*>::const_iterator tphend = m_analysisJ->TPend();
-
-  while(tphitr != tphend) { 
-    m_provider->addHistogram( tphitr->second,"HLT/IDJpsiMon/" +  m_analysis->name() + "/" + m_testChainKey ); 
-    tphitr++; 
-  }
-
-  map<string, TH2F*>::const_iterator hitr2d = m_analysisJ->TH2begin();
-  map<string, TH2F*>::const_iterator hend2d = m_analysisJ->TH2end();
-
-  while(hitr2d != hend2d) { 
-    m_provider->addHistogram(hitr2d->second,"HLT/IDJpsiMon/" +  m_analysis->name() + "/" + m_testChainKey); 
-    hitr2d++; 
-  }
-
-  ///temp
-  m_analysisJ->setSpeaker(m_provider);
-  m_analysisJ->setTool(m_tdt);
-
-}
-
-/// finalise the analysis - take ratios for efficiencies etc
-void AnalysisConfig_Jpsi::finalize() { 
-  cout << ">>> trigger: "        << m_refChainName << std::endl;
-  cout << ">>> before trigger: " << m_count_before << std::endl;
-  cout << ">>> after trigger : " << m_count_after  << std::endl;
-  m_analysis->finalise();
-}
-
-// ###########################################################################
- 
-float AnalysisConfig_Jpsi::deltaR(float eta1, float phi1, float eta2, float phi2) {
-  float deta = eta1-eta2;
-  float dphi = deltaPhi(phi1,phi2);
-  return TMath::Sqrt(deta*deta+dphi*dphi);
-}
- 
-// ###########################################################################
-
-float AnalysisConfig_Jpsi::deltaPhi(float phi1, float phi2) {
-  if(TMath::IsNaN(phi1)||TMath::IsNaN(phi2)) {
-    cout << "> > > > > WTF!? deltaPhi(phi1,phi2) called with NaN" << endl;
-  }
-  return fixPhi(phi1-phi2);
-}
-
-// ###########################################################################
- 
-float AnalysisConfig_Jpsi::fixPhi(float phi) {
-  while(phi >=  M_PI) phi -= 2.0*M_PI;
-  while(phi <  -M_PI) phi += 2.0*M_PI;
-  return phi;
-}
- 
-// ###########################################################################
-
diff --git a/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/src/JpsiAnalysis.cxx b/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/src/JpsiAnalysis.cxx
deleted file mode 100644
index 7e52519a880bf249a48a076eb32133619d3fb14b..0000000000000000000000000000000000000000
--- a/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/src/JpsiAnalysis.cxx
+++ /dev/null
@@ -1,1313 +0,0 @@
-// emacs: this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-/** @file JpsiAnalysis.cxx */
-/** @author Mark Sutton (sutt@cern.ch) **/
-/** @author Peter Wijeratne (paw@hep.ucl.ac.uk) **/
-/** @author Christian Gutschow (chris.g@cern.ch) **/
-
-#include "TrigInDetAnalysis/TIDAVertex.h"
-
-#include "TrigIDJpsiMonitoring/JpsiAnalysis.h"
-#include "TrigIDJpsiMonitoring/JpsiTrack.h"
-#include "AthenaKernel/Units.h"
-
-#include "TLorentzVector.h"
-
-#include <stdexcept>
-
-using std::fabs;
-using std::sqrt;
-using std::pow;
-using std::string;
-using std::cout;
-using std::endl;
-using std::vector;
-using Athena::Units::GeV;
-
-//#include "Particle/TrackParticle.h"
-
-
-void JpsiAnalysis::initialise() { 
-
-  //+++ pT ranges
-  float tmp_absResPt = 0.0005;
-
-  const int pTResBins = 100;
-
-  //+++ Eta ranges
-  float tmp_maxEta    = 3.5;
-  float tmp_absResEta = 0.1; // 0.00025;
-  float absResEta2D = 2.0;
-
-  //+++ Phi ranges
-  float tmp_maxPhi = 3.5;
-  float tmp_absResPhi = 0.1; // 0.00025;
-  float absResPhi2D = 3.2;
-
-  float tmp_absResR = 0.1;
-  const int rResBins = 500;
-
-  const int etaBins    = 60;
-  const int etaResBins = 800;
-  const int etaResBins2D = 800;
-
-  const int phiBins    = 36;
-  const int phiResBins = 800;
-  const int phiResBins2D = 640;
-
-  const int   zBins = 100;      
-  const float zMax  = 400;
-
-  const int   zresBins = 110;      
-  const float zresMax  = 10;
-
-  const int   d0Bins = 1000;
-  const float d0Max  = 10;
-
-  const int   d0resBins = 110;      
-  const float d0resMax  = 5;
-
-  // beamspot corrected position
-
-  const int   a0Bins = 1000;
-  const float a0Max  = 10;
-
-  const int   a0resBins = 110;      
-  const float a0resMax  = 5;
-
-  //+++ Book histograms
-
-  // calculate a logarithmic binning in pt  
-  /*  const int  ptnbins = 500;  
-  float     ptbinlims[ptnbins+1];
-  for ( int i=0 ; i<=ptnbins ; i++ ) {     ptbinlims[i] = pow(10, 2.0*i/ptnbins+2); }*/
-
-  int pTbins = 50;
-  float pTmax = 50.;
-  float pTmin = 0.;
-  int invmBins = 50;
-  float invmMax = 5.;
-  float invmMin = 0.;
-  bool isZ = m_chainName.find("Z") != string::npos;
-  isZ |= m_chainName.find("mu24i") != string::npos;
-  isZ |= m_chainName.find("mu20")  != string::npos;
-  if(isZ) {
-    pTbins = 150;
-    pTmax = 150.;
-    invmBins = 400;
-    invmMax = 110.;
-    invmMin = 70.;
-  }
-
-  // COUNTERS
-  addHistogram( new TH1F(  "trigger_after", "after trigger", 1,  0.0, 1.0 ) );
-  addHistogram( new TH1F(  "cutflow",       "cutflow",       7, -0.5, 6.5 ) );
-  addHistogram( new TH1F(  "cutflow_tight", "cutflow tight", 7, -0.5, 6.5 ) );
-
-  // "reference" quantities
-  addHistogram(  new TH1F(  "pT",   "pT",   pTbins,   -pTmin, pTmax ) );
-  addHistogram(  new TH1F( "eta",  "eta",   etaBins,  -tmp_maxEta, tmp_maxEta ) );
-  addHistogram(  new TH1F( "phi",  "phi",   phiBins,  -tmp_maxPhi, tmp_maxPhi ) );
-  addHistogram(  new TH1F(  "z0",   "z0",     zBins,        -zMax,       zMax ) );
-  addHistogram(  new TH1F(  "d0",   "d0",    d0Bins,       -d0Max,      d0Max ) );
-  addHistogram(  new TH1F(  "a0",   "a0",    a0Bins,       -a0Max,      a0Max ) );
-
-  // "test" quantities
-  addHistogram(    new TH1F(  "pT_rec",   "pT_rec",   pTbins, -pTmin, pTmax ) );
-  addHistogram(    new TH1F( "eta_rec",  "eta_rec",   etaBins,  -tmp_maxEta, tmp_maxEta ) );
-  addHistogram(    new TH1F( "phi_rec",  "phi_rec",   phiBins,  -tmp_maxPhi, tmp_maxPhi ) );
-  addHistogram(    new TH1F(  "z0_rec",   "z0_rec",     zBins,        -zMax,       zMax ) );
-  addHistogram(    new TH1F(  "d0_rec",   "d0_rec",    d0Bins,       -d0Max,      d0Max ) );
-  addHistogram(    new TH1F(  "a0_rec",   "a0_rec",    a0Bins,       -a0Max,      a0Max ) );
-
-  // ID track quantities
-  addHistogram( new TH1F(  "pT_track",  "pT_track",  pTbins,   -pTmin,      pTmax      ) );
-  addHistogram( new TH1F( "eta_track", "eta_track",  etaBins,  -tmp_maxEta, tmp_maxEta ) );
-  addHistogram( new TH1F( "phi_track", "phi_track",  phiBins,  -tmp_maxPhi, tmp_maxPhi ) );
-  // with back-to-back requirement (in dPhi between tag and probe)
-  addHistogram( new TH1F(  "pT_track_b2b",  "pT_track",  pTbins,   -pTmin,      pTmax      ) );
-  addHistogram( new TH1F( "eta_track_b2b", "eta_track",  etaBins,  -tmp_maxEta, tmp_maxEta ) );
-  addHistogram( new TH1F( "phi_track_b2b", "phi_track",  phiBins,  -tmp_maxPhi, tmp_maxPhi ) );
-  // offline track quantities
-  addHistogram( new TH1F(  "pT_offtrack",  "pT_track",  pTbins,   -pTmin,      pTmax      ) );
-  addHistogram( new TH1F( "eta_offtrack", "eta_track",  etaBins,  -tmp_maxEta, tmp_maxEta ) );
-  addHistogram( new TH1F( "phi_offtrack", "phi_track",  phiBins,  -tmp_maxPhi, tmp_maxPhi ) );
-  // offline track quantities (with pT/ET cut)
-  addHistogram( new TH1F(  "pT_offtrackEt",  "pT_track",  pTbins,   -pTmin,      pTmax      ) );
-  addHistogram( new TH1F( "eta_offtrackEt", "eta_track",  etaBins,  -tmp_maxEta, tmp_maxEta ) );
-  addHistogram( new TH1F( "phi_offtrackEt", "phi_track",  phiBins,  -tmp_maxPhi, tmp_maxPhi ) );
-  // offline track quantities (with brem cut)
-  addHistogram( new TH1F(  "pT_offtrackbrem",  "pT_track",  pTbins,   -pTmin,      pTmax      ) );
-  addHistogram( new TH1F( "eta_offtrackbrem", "eta_track",  etaBins,  -tmp_maxEta, tmp_maxEta ) );
-  addHistogram( new TH1F( "phi_offtrackbrem", "phi_track",  phiBins,  -tmp_maxPhi, tmp_maxPhi ) );
-    
-  // resolutions
-  addHistogram( new TH1F("pT_res",     "pT_res",  pTResBins,  -tmp_absResPt,  tmp_absResPt ) );
-  addHistogram( new TH1F("eta_res",    "eta_res", etaResBins, -tmp_absResEta, tmp_absResEta) );
-  addHistogram( new TH1F("phi_res",    "phi_res", phiResBins, -tmp_absResPhi, tmp_absResPhi) );
-  addHistogram( new TH1F("z0_res",     "z0_res",  zresBins,   -zresMax,       zresMax      ) );
-  addHistogram( new TH1F("d0_res",     "d0_res",  d0resBins,  -0.5*d0resMax,  0.5*d0resMax ) );
-  addHistogram( new TH1F("a0_res",     "a0_res",  a0resBins,  -0.5*a0resMax,  0.5*a0resMax ) );
-  addHistogram( new TH1F("etaOff_res", "etaOres", etaResBins, -tmp_absResEta, tmp_absResEta) );
-  addHistogram( new TH1F("phiOff_res", "phiOres", phiResBins, -tmp_absResPhi, tmp_absResPhi) );
-  addHistogram( new TH1F("rOff_res",   "rOff_res",rResBins,   0.0,            tmp_absResR  ) );
-  addHistogram( new TH1F("minDr_res",  "rOff_res",rResBins,   0.0,            tmp_absResR  ) );
-
-  /// delta-r between probe and its matched offline track
-  addHistogram( new TH1F("probe_off_dr",   "probe_off_dr",    300, 0., 0.3) );
-  addHistogram( new TH1F("probe_off_deta", "probe_off_deta",  etaResBins, -tmp_absResEta, tmp_absResEta) );
-  addHistogram( new TH1F("probe_off_dphi", "probe_off_dphi",  phiResBins, -tmp_absResPhi, tmp_absResPhi) );
-
-  addHistogram( new TH1F("dphi_tp", "dPhi between tag and probe", 200, -1., 1.) );
-
-  addHistogram( new TH2F("asymEta", "asymEta", etaResBins2D, -absResEta2D, absResEta2D, etaResBins2D, -absResEta2D, absResEta2D ) );
-  addHistogram( new TH2F("asymPhi", "asymPhi", phiResBins2D, -absResPhi2D, absResPhi2D, phiResBins2D, -absResPhi2D, absResPhi2D ) );
-
-  // # tracks
-  int Ntracks = 50;
-
-  addHistogram( new TH1F( "ntracks",     "ntracks",     (Ntracks-40), -0.5, float(Ntracks-39.5) ) );
-  addHistogram( new TH1F( "ntracks_rec", "ntracks_rec", Ntracks, -0.5, float(Ntracks+0.5) ) );
-
-  //hit occupancies (muon system)
-  addHistogram(  new TH1F( "nRpcHitsEta",  "nRpcHitsEta",   21,  -0.5, 20.5 ) );
-  addHistogram(  new TH1F( "nTgcHitsEta",  "nTgcHitsEta",   21,  -0.5, 20.5 ) );
-  addHistogram(  new TH1F( "nCscHitsEta",  "nCscHitsEta",   21,  -0.5, 20.5 ) );
-  addHistogram(  new TH1F( "nRpcHitsPhi",  "nRpcHitsPhi",   21,  -0.5, 20.5 ) );
-  addHistogram(  new TH1F( "nTgcHitsPhi",  "nTgcHitsPhi",   21,  -0.5, 20.5 ) );
-  addHistogram(  new TH1F( "nCscHitsPhi",  "nCscHitsPhi",   21,  -0.5, 20.5 ) );
-  addHistogram(  new TH1F( "nMdtHits",  "nMdtHits",   51,  -0.5, 50.5 ) );
-
-  addHistogram(  new TH1F("tagMatch_invmass","All tag&probe candidates;Invariant mass [GeV]", invmBins, invmMin, invmMax) );
-  addHistogram(  new TH1F("tagAndProbe_invmass","All tag&probe candidates;Invariant mass [GeV]", invmBins, invmMin, invmMax) );
-  addHistogram(  new TH1F("tagAndProbe_invmass_wo_match","Tag&probe candidates wo match;Invariant mass [GeV]", invmBins, invmMin, invmMax) );
-  addHistogram(  new TH1F("tagAndProbe_invmass_offline","Tag&probe candidates (with offline electron);Invariant mass [GeV]", invmBins, invmMin, invmMax) );
-  addHistogram(  new TH1F(  "Zpt",   "dilepton pt",   pTbins, pTmin, pTmax ) );
-  addHistogram(  new TH1F(  "pTmiss",   "pTmiss",   pTbins, pTmin, pTmax ) );
-  m_pT_eff = new TProfile("pT_eff", "Efficiency versus pT; pT [MeV]", pTbins, pTmin, pTmax, 0., 110.);
-  m_pT_eff_d0cut = new TProfile("pT_eff_d0cut", "Efficiency versus pT; pT [MeV]", pTbins, pTmin, pTmax, 0., 110.);    
-  m_invmass_eff = new TProfile("invmass_eff", "Efficiency versus Invariant Mass; Invariant Mass [GeV]", invmBins, invmMin, invmMax, 0., 110.);
-  m_invmass_eff_d0cut = new TProfile("invmass_eff_d0cut", "Efficiency versus Invariant Mass; Invariant Mass [GeV]", invmBins, invmMin, invmMax, 0., 110.);
-  m_pT_eff_offline = new TProfile("pT_eff_offline", "Efficiency versus pT; pT [MeV]", pTbins, pTmin, pTmax, 0., 110.);
-  m_pT_eff_d0cut_offline = new TProfile("pT_eff_d0cut_offline", "Efficiency versus pT; pT [MeV]", pTbins, pTmin, pTmax, 0., 110.);    
-  m_invmass_eff_offline = new TProfile("invmass_eff_offline", "Efficiency versus Invariant Mass; Invariant Mass [GeV]", invmBins, invmMin, invmMax, 0., 110.);
-  m_invmass_eff_d0cut_offline = new TProfile("invmass_eff_d0cut_offline", "Efficiency versus Invariant Mass; Invariant Mass [GeV]", invmBins, invmMin, invmMax, 0., 110.);
-
-  m_eta_eff = new TProfile("eta_eff", "Efficiency versus #eta; #eta", 32, -4., 4., 0., 110.);
-  m_vert_eff = new TProfile("vert_eff", "Efficiency versus nVertices; nvertices", 36, -0.5, 35.5, 0., 110.);
-  m_z0_eff = new TProfile("z0_eff", "Efficiency versus z0; z0[mm]", 20, 0., 200., 0., 110.);
-  m_d0_eff = new TProfile("d0_eff", "Efficiency versus d0; d0[mm]", d0Bins, -d0Max, d0Max, 0., 110.);
-  m_phi_eff = new TProfile("phi_eff", "Efficiency versus #phi; #phi[rads]", 20., -4., 4., 0., 110.);
-  m_track_eff = new TProfile("track_eff", "Efficiency versus nTracks; ntracks", 80., 0., 800., 0., 110.);
-
-  m_eta_eff_d0cut = new TProfile("eta_eff_d0cut", "Efficiency versus #eta; #eta", 32, -4., 4., 0., 110.);
-  m_vert_eff_d0cut = new TProfile("vert_eff_d0cut", "Efficiency versus nVertices; nvertices", 36, -0.5, 35.5, 0., 110.);
-  m_z0_eff_d0cut = new TProfile("z0_eff_d0cut", "Efficiency versus z0; z0[mm]", 20, 0., 200., 0., 110.);
-  m_d0_eff_d0cut = new TProfile("d0_eff_d0cut", "Efficiency versus d0; d0[mm]", d0Bins, -d0Max, d0Max, 0., 110.);
-  m_phi_eff_d0cut = new TProfile("phi_eff_d0cut", "Efficiency versus #phi; #phi[rads]", 20., -4., 4., 0., 110.);
-  m_track_eff_d0cut = new TProfile("track_eff_d0cut", "Efficiency versus nTracks; ntracks", 80., 0., 800., 0., 110.);
-
-  m_eta_eff_offline = new TProfile("eta_eff_offline", "Efficiency versus #eta; #eta", 32, -4., 4., 0., 110.);
-  m_vert_eff_offline = new TProfile("vert_eff_offline", "Efficiency versus nVertices; nvertices", 36, -0.5, 35.5, 0., 110.);
-  m_z0_eff_offline = new TProfile("z0_eff_offline", "Efficiency versus z0; z0[mm]", 20, 0., 200., 0., 110.);
-  m_d0_eff_offline = new TProfile("d0_eff_offline", "Efficiency versus d0; d0[mm]", d0Bins, -d0Max, d0Max, 0., 110.);
-  m_phi_eff_offline = new TProfile("phi_eff_offline", "Efficiency versus #phi; #phi[rads]", 20., -4., 4., 0., 110.);
-  m_track_eff_offline = new TProfile("track_eff_offline", "Efficiency versus nTracks; ntracks", 80., 0., 800., 0., 110.);
-
-  m_eta_eff_d0cut_offline = new TProfile("eta_eff_d0cut_offline", "Efficiency versus #eta; #eta", 32, -4., 4., 0., 110.);
-  m_vert_eff_d0cut_offline = new TProfile("vert_eff_d0cut_offline", "Efficiency versus nVertices; nvertices", 36, -0.5, 35.5, 0., 110.);
-  m_z0_eff_d0cut_offline = new TProfile("z0_eff_d0cut_offline", "Efficiency versus z0; z0[mm]", 20, 0., 200., 0., 110.);
-  m_d0_eff_d0cut_offline = new TProfile("d0_eff_d0cut_offline", "Efficiency versus d0; d0[mm]", d0Bins, -d0Max, d0Max, 0., 110.);
-  m_phi_eff_d0cut_offline = new TProfile("phi_eff_d0cut_offline", "Efficiency versus #phi; #phi[rads]", 20., -4., 4., 0., 110.);
-  m_track_eff_d0cut_offline = new TProfile("track_eff_d0cut_offline", "Efficiency versus nTracks; ntracks", 40., 0., 400., 0., 110.);
-
-  /*  m_pT_pur = new TProfile("pT_pur", "Purity versus pT; pT [MeV]", 100, 0., 100000., 0., 110.);
-  m_eta_pur = new TProfile("eta_pur", "Purity versus #eta; #eta", 20, -4., 4., 0., 110.);
-  m_z0_pur = new TProfile("z0_pur", "Purity versus z0; z0[mm]", 20, 0., 200., 0., 110.);
-  m_d0_pur = new TProfile("d0_pur", "Purity versus d0; d0[mm]", 20, 0., 50., 0., 110.);
-  m_phi_pur = new TProfile("phi_pur", "Purity versus #phi; #phi[rads]", 20., -4., 4., 0., 110.);*/
-
-  /*  addHistogram( m_pT_pur );
-  addHistogram( m_eta_pur );
-  addHistogram( m_z0_pur );
-  addHistogram( m_d0_pur);
-  addHistogram( m_phi_pur );*/
-
-  addHistogram( m_pT_eff );
-  addHistogram( m_eta_eff );
-  addHistogram( m_vert_eff );
-  addHistogram( m_z0_eff );
-  addHistogram( m_d0_eff);
-  addHistogram( m_phi_eff );
-  addHistogram( m_track_eff );
-  addHistogram( m_invmass_eff );
-
-  /// |d0| > 1mm cut, to study delayed decays
-  addHistogram( m_pT_eff_d0cut );
-  addHistogram( m_eta_eff_d0cut );
-  addHistogram( m_vert_eff_d0cut );
-  addHistogram( m_z0_eff_d0cut );
-  addHistogram( m_d0_eff_d0cut);
-  addHistogram( m_phi_eff_d0cut );
-  addHistogram( m_track_eff_d0cut );
-  addHistogram( m_invmass_eff_d0cut );
-
-  addHistogram( m_pT_eff_offline );
-  addHistogram( m_eta_eff_offline );
-  addHistogram( m_vert_eff_offline );
-  addHistogram( m_z0_eff_offline );
-  addHistogram( m_d0_eff_offline);
-  addHistogram( m_phi_eff_offline );
-  addHistogram( m_track_eff_offline );
-  addHistogram( m_invmass_eff_offline );
-
-  /// |d0| > 1mm cut, to study delayed decays
-  addHistogram( m_pT_eff_d0cut_offline );
-  addHistogram( m_eta_eff_d0cut_offline );
-  addHistogram( m_vert_eff_d0cut_offline );
-  addHistogram( m_z0_eff_d0cut_offline );
-  addHistogram( m_d0_eff_d0cut_offline);
-  addHistogram( m_phi_eff_d0cut_offline );
-  addHistogram( m_track_eff_d0cut_offline );
-  addHistogram( m_invmass_eff_d0cut_offline );
-
-  ///
-  addHistogram( new TH1F("tag_offline_invmass", "tag_offline_invmass", invmBins, invmMin, invmMax) );
-  addHistogram( new TH2F("tomass_vs_offpt", "tomass_vs_offpt", pTbins, pTmin, pTmax, 50, invmMin, invmMax) );
-
-  /// towards asymmetric errors...
-
-  const int nTrksBins   = 250;
-  const float nTrksMax = 1000;
-  const int nVtxsBins   = 41;
-  const float nVtxsMax = 40.5;
-  const int muBins      = 1000;
-  const float muMax    = 100.5;
-
-  //standard plots
-  addHistogram( new TH1F("invmass_tt","invmass_tt", 500, 0., 500.) );
-  addHistogram( new TH1F("invmassnum","invmassnum",invmBins, invmMin, invmMax) );
-  addHistogram( new TH1F("invmassden","invmassden",invmBins, invmMin, invmMax) );
-  addHistogram( new TH1F("ETnum",    "ETnum", 200, 0., 1.) );
-  addHistogram( new TH1F("ETden",    "ETden", 200, 0., 1.) );
-  addHistogram( new TH1F("pTnum",    "pTnum", pTbins, pTmin, pTmax ) );
-  addHistogram( new TH1F("pTden",    "pTden", pTbins, pTmin, pTmax ) );
-  addHistogram( new TH1F("pTEtnum",  "pTnum", pTbins, pTmin, pTmax ) );
-  addHistogram( new TH1F("pTEtden",  "pTden", pTbins, pTmin, pTmax ) );
-  addHistogram( new TH1F("pTbremnum",  "pTnum", pTbins, pTmin, pTmax ) );
-  addHistogram( new TH1F("pTbremden",  "pTden", pTbins, pTmin, pTmax ) );
-  addHistogram( new TH1F("pTb2bnum", "pTnum", pTbins, pTmin, pTmax ) );
-  addHistogram( new TH1F("pTb2bden", "pTden", pTbins, pTmin, pTmax ) );
-  addHistogram( new TH1F("pTb2bloosenum", "pTnum", pTbins, pTmin, pTmax ) );
-  addHistogram( new TH1F("pTb2blooseden", "pTden", pTbins, pTmin, pTmax ) );
-  addHistogram( new TH1F("d0num", "d0num", d0Bins, -d0Max, d0Max ) );
-  addHistogram( new TH1F("d0den", "d0den", d0Bins, -d0Max, d0Max ) );
-  addHistogram( new TH1F("z0num", "z0num", zBins, -zMax, zMax) );
-  addHistogram( new TH1F("z0den", "z0den", zBins, -zMax, zMax) );
-  addHistogram( new TH1F("absd0num", "absd0num", d0Bins/2, 0, d0Max ) );
-  addHistogram( new TH1F("absd0den", "absd0den", d0Bins/2, 0, d0Max ) );
-  addHistogram( new TH1F("absz0num", "absz0num", zBins/2, 0, zMax) );
-  addHistogram( new TH1F("absz0den", "absz0den", zBins/2, 0, zMax) );
-  addHistogram( new TH1F("phinum", "phinum", 20., -4., 4.) );
-  addHistogram( new TH1F("phiden", "phiden", 20., -4., 4.) );
-  addHistogram( new TH1F("etanum", "etanum", 32, -4., 4.) );
-  addHistogram( new TH1F("etaden", "etaden", 32, -4., 4.) );
-  addHistogram( new TH1F("etaEtnum",  "etanum", 32, -4., 4.) );
-  addHistogram( new TH1F("etaEtden",  "etaden", 32, -4., 4.) );
-  addHistogram( new TH1F("etabremnum",  "etanum", 32, -4., 4.) );
-  addHistogram( new TH1F("etabremden",  "etaden", 32, -4., 4.) );
-  addHistogram( new TH1F("etab2bnum", "etanum", 32, -4., 4.) );
-  addHistogram( new TH1F("etab2bden", "etaden", 32, -4., 4.) );
-  addHistogram( new TH1F("etab2bloosenum", "etanum", 32, -4., 4.) );
-  addHistogram( new TH1F("etab2blooseden", "etaden", 32, -4., 4.) );
-  addHistogram( new TH1F("vertnum", "vertnum", nVtxsBins, -0.5, nVtxsMax) );
-  addHistogram( new TH1F("vertden", "vertden", nVtxsBins, -0.5, nVtxsMax) );
-  addHistogram( new TH1F("tracknum", "tracknum", nTrksBins, 0., nTrksMax) );
-  addHistogram( new TH1F("trackden", "trackden", nTrksBins, 0., nTrksMax) );
-  addHistogram( new TH1F("munum", "munum", muBins, -0.5, muMax) );
-  addHistogram( new TH1F("muden", "muden", muBins, -0.5, muMax) );
-  addHistogram( new TH1F("mub2bnum", "munum", muBins, -0.5, muMax) );
-  addHistogram( new TH1F("mub2bden", "muden", muBins, -0.5, muMax) );
-  addHistogram( new TH1F("mub2bloosenum", "munum", muBins, -0.5, muMax) );
-  addHistogram( new TH1F("mub2blooseden", "muden", muBins, -0.5, muMax) );
-  addHistogram( new TH1F("drnum", "drnum", 100., 0., 1.0) );
-  addHistogram( new TH1F("drden", "drden", 100., 0., 1.0) );
-
-  //plots where an offline track is required to be matched to the probe
-  addHistogram( new TH1F("invmassnum_off","invmassnum_off",invmBins, invmMin, invmMax) );
-  addHistogram( new TH1F("invmassden_off","invmassden_off",invmBins, invmMin, invmMax) );
-  addHistogram( new TH1F("ETnum_off",    "ETnum_off", 200, 0., 1.) );
-  addHistogram( new TH1F("ETden_off",    "ETden_off", 200, 0., 1.) );
-  addHistogram( new TH1F("pTnum_off",    "pTnum_off", pTbins, pTmin, pTmax ) );
-  addHistogram( new TH1F("pTden_off",    "pTden_off", pTbins, pTmin, pTmax ) );
-  addHistogram( new TH1F("pTEtnum_off",  "pTnum",     pTbins, pTmin, pTmax ) );
-  addHistogram( new TH1F("pTEtden_off",  "pTden",     pTbins, pTmin, pTmax ) );
-  addHistogram( new TH1F("pTbremnum_off",  "pTnum",     pTbins, pTmin, pTmax ) );
-  addHistogram( new TH1F("pTbremden_off",  "pTden",     pTbins, pTmin, pTmax ) );
-  addHistogram( new TH1F("pTofftracknum_off",    "pTnum_off", pTbins, pTmin, pTmax ) );
-  addHistogram( new TH1F("pTofftrackden_off",    "pTden_off", pTbins, pTmin, pTmax ) );
-  addHistogram( new TH1F("pTofftrackEtnum_off",  "pTnum",     pTbins, pTmin, pTmax ) );
-  addHistogram( new TH1F("pTofftrackEtden_off",  "pTden",     pTbins, pTmin, pTmax ) );
-  addHistogram( new TH1F("pTofftrackbremnum_off",  "pTnum",     pTbins, pTmin, pTmax ) );
-  addHistogram( new TH1F("pTofftrackbremden_off",  "pTden",     pTbins, pTmin, pTmax ) );
-  addHistogram( new TH1F("pTb2bnum_off", "pTnum",     pTbins, pTmin, pTmax ) );
-  addHistogram( new TH1F("pTb2bden_off", "pTden",     pTbins, pTmin, pTmax ) );
-  addHistogram( new TH1F("pTb2bloosenum_off", "pTnum",     pTbins, pTmin, pTmax ) );
-  addHistogram( new TH1F("pTb2blooseden_off", "pTden",     pTbins, pTmin, pTmax ) );
-  addHistogram( new TH1F("d0num_off", "d0num_off", d0Bins, -d0Max, d0Max ) );
-  addHistogram( new TH1F("d0den_off", "d0den_off", d0Bins, -d0Max, d0Max ) );
-  addHistogram( new TH1F("z0num_off", "z0num_off", zBins, -zMax, zMax) );
-  addHistogram( new TH1F("z0den_off", "z0den_off", zBins, -zMax, zMax ) );
-  addHistogram( new TH1F("absd0num_off", "absd0num_off", d0Bins/2, 0, d0Max ) );
-  addHistogram( new TH1F("absd0den_off", "absd0den_off", d0Bins/2, 0, d0Max ) );
-  addHistogram( new TH1F("absz0num_off", "absz0num_off", zBins/2, 0, zMax) );
-  addHistogram( new TH1F("absz0den_off", "absz0den_off", zBins/2, 0, zMax) );
-  addHistogram( new TH1F("etanum_off", "etanum_off", 32, -4., 4.) );
-  addHistogram( new TH1F("etaden_off", "etaden_off", 32, -4., 4.) );
-  addHistogram( new TH1F("etaEtnum_off",  "etanum", 32, -4., 4.) );
-  addHistogram( new TH1F("etaEtden_off",  "etaden", 32, -4., 4.) );
-  addHistogram( new TH1F("etabremnum_off",  "etanum", 32, -4., 4.) );
-  addHistogram( new TH1F("etabremden_off",  "etaden", 32, -4., 4.) );
-  addHistogram( new TH1F("etaofftracknum_off", "etanum_off", 32, -4., 4.) );
-  addHistogram( new TH1F("etaofftrackden_off", "etaden_off", 32, -4., 4.) );
-  addHistogram( new TH1F("etaofftrackEtnum_off",  "etanum", 32, -4., 4.) );
-  addHistogram( new TH1F("etaofftrackEtden_off",  "etaden", 32, -4., 4.) );
-  addHistogram( new TH1F("etaofftrackbremnum_off",  "etanum", 32, -4., 4.) );
-  addHistogram( new TH1F("etaofftrackbremden_off",  "etaden", 32, -4., 4.) );
-  addHistogram( new TH1F("etab2bnum_off", "etanum", 32, -4., 4.) );
-  addHistogram( new TH1F("etab2bden_off", "etaden", 32, -4., 4.) );
-  addHistogram( new TH1F("etab2bloosenum_off", "etanum", 32, -4., 4.) );
-  addHistogram( new TH1F("etab2blooseden_off", "etaden", 32, -4., 4.) );
-  addHistogram( new TH1F("phinum_off", "phinum_off", 20., -4., 4.) );
-  addHistogram( new TH1F("phiden_off", "phiden_off", 20., -4., 4.) );
-  addHistogram( new TH1F("vertnum_off", "vertnum_off", nVtxsBins, -0.5, nVtxsMax) );
-  addHistogram( new TH1F("vertden_off", "vertden_off", nVtxsBins, -0.5, nVtxsMax) );
-  addHistogram( new TH1F("tracknum_off", "tracknum_off", nTrksBins, 0., nTrksMax) );
-  addHistogram( new TH1F("trackden_off", "trackden_off", nTrksBins, 0., nTrksMax) );
-  addHistogram( new TH1F("munum_off", "munum_off", muBins, -0.5, muMax) );
-  addHistogram( new TH1F("muden_off", "muden_off", muBins, -0.5, muMax) );
-  addHistogram( new TH1F("mub2bnum_off", "munum_off", muBins, -0.5, muMax) );
-  addHistogram( new TH1F("mub2bden_off", "muden_off", muBins, -0.5, muMax) );
-  addHistogram( new TH1F("mub2bloosenum_off", "munum_off", muBins, -0.5, muMax) );
-  addHistogram( new TH1F("mub2blooseden_off", "muden_off", muBins, -0.5, muMax) );
-  addHistogram( new TH1F("drnum_off", "drnum_off", 100., 0., 1.0) );
-  addHistogram( new TH1F("drden_off", "drden_off", 100., 0., 1.0) );
-
-  //plots where the offline track pT is used instead of the probe pT
-  addHistogram( new TH1F("pToffnum_off", "pToffnum_off",   pTbins, pTmin, pTmax ) );
-  addHistogram( new TH1F("pToffden_off", "pToffden_off",   pTbins, pTmin, pTmax ) );
-
-  //plot of delta-r between tag and probe 
-  addHistogram( new TH1F("deltarnum", "deltarnum",   400, 0., 5. ) );
-  addHistogram( new TH1F("deltarden", "deltarden",   400, 0., 5. ) );
-  addHistogram( new TH1F("deltarnum_lowpt", "deltarnum_lowpt",   400, 0., 5. ) );
-  addHistogram( new TH1F("deltarden_lowpt", "deltarden_lowpt",   400, 0., 5. ) );
-
-  /// beamspot
-  addHistogram( new TH2F("beamspotxy", "beamspotxy", 50, -2., 2., 50, -2., 2.) );
-
-  ///tmp
-  if(m_chainName.find("Zmumu") != string::npos) {
-    invmMin = 0.;
-  }
-  addHistogram( new TH2F("invmass_vs_tinvmass", "invmass_vs_tinvmass", invmBins, invmMin, invmMax, invmBins, invmMin, invmMax) );
-
-  addHistogram( new TH1F("pToffnum_d0cut", "pToffnum_d0cut", pTbins, pTmin, pTmax) );
-  addHistogram( new TH1F("pToffden_d0cut", "pToffden_d0cut", pTbins, pTmin, pTmax) );
-  addHistogram( new TH1F("pTnum_d0cut",    "pTnum_d0cut",    pTbins, pTmin, pTmax) );
-  addHistogram( new TH1F("pTden_d0cut",    "pTden_d0cut",    pTbins, pTmin, pTmax) );
-
-  ///tmp
-  addHistogram( new TH2F("invmass_vs_deltar", "invmass_vs_deltar", 400,      0.,      5.,    invmBins, invmMin, invmMax) );
-  addHistogram( new TH2F("pt_vs_deltar",      "pt_vs_deltar",      400,      0.,      5.,    pTbins,   pTmin,   pTmax  ) );
-  addHistogram( new TH2F("pt_vs_offpt",       "pt_vs_offpt",       pTbins,   pTmin,   pTmax, pTbins,   pTmin,   pTmax  ) );
-  addHistogram( new TH1F("tinvmass_miss",     "tinvmass_miss",     invmBins, invmMin, invmMax ) );
-
-}
-  
-void JpsiAnalysis::finalise() { }
-
-/*template<class T>
-bool fillMap(std::map<std::string, T*> &m_histos, const std::string &name, float w) {
-  std::map<string, T*>::const_iterator hmitr = m_histos.find(name.c_string());
-  if(hmitr != m_histos.end()) {
-    if(hmitr->second) { hmitr->second->Fill( w ); return true; }
-  
-  }
-  return false;
-}*/
-
-
-void JpsiAnalysis::execute(const vector<TIDA::Track*>& probeTracks,
-                           const vector<TIDA::Track*>& testtracks,
-                   	       TrackAssociator* matcher=0) {
-
-  m_speaker->msg(MSG::DEBUG) << "Start of JpsiAnalysis execute ..." << endmsg;
-  matcher = 0;
-  if(!matcher)  m_speaker->msg(MSG::DEBUG) << "Matcher not used." << endmsg;
-
-  // should have these as a class variable   
-  static string varName[13] = { "pT", "eta", "phi", "z0", "d0", "a0", 
-                                "nRpcHitsEta", "nTgcHitsEta", "nCscHitsEta", 
-                                "nRpcHitsPhi", "nTgcHitsPhi", "nCscHitsPhi", "nMdtHits" };  
-
-  std::map<string, TH1F*>::iterator hmitr = m_histos.find("ntracks");
-  if(hmitr != m_histos.end())  hmitr->second->Fill(probeTracks.size());
-  //fillMap(m_histos, "ntracks", probeTracks.size());
- 
-  hmitr = m_histos.find("ntracks_rec");
-  if(hmitr != m_histos.end())  hmitr->second->Fill(testtracks.size());
-
-  hmitr = m_histos.find("trigger_after");
-  if(hmitr != m_histos.end())  hmitr->second->Fill( 0.5 );
-
-  hmitr = m_histos.find("cutflow"); // trigger hits
-  if(hmitr != m_histos.end())  hmitr->second->Fill( 0.0 );
-  hmitr = m_histos.find("cutflow_tight"); // trigger hits
-  if(hmitr != m_histos.end())  hmitr->second->Fill( 0.0 );
-
-  std::map<string, TH2F*>::iterator hmitr2d;
-
-  float pTt     = 0.0, z0t = 0.0, etat = 0.0,
-        phit    = 0.0, d0t = 0.0, a0t  = 0.0,
-        invmass = 0.0;
-  int nvert = 0, ntracks = 0; //, q = 0;
-
-  ///default is J/Psi
-  float mass = 3.097*GeV;
-  m_plusMass  = 2.903*GeV;
-  m_minusMass = 2.097*GeV;
-  if(m_chainName.find("Z") != string::npos) { 
-    mass = 90.097*GeV;
-    m_plusMass  = 19.903*GeV;
-    m_minusMass = 20.097*GeV;   
-  }
-
-  /// beamspot x,y
-  //hmitr2d = m_histos2d.find("beamspotxy");
-  //if(hmitr2d != m_histos2d.end())  hmitr2d->second->Fill(m_yBeamReference, m_xBeamReference, 1.0);
-
-  /*
-   *
-   * THIS IS WHERE SOME SERIOUS BUSINESS IS HAPPENING...
-   *
-   *
-   */
-  bool cutflow_check[] = { 1, 1, 1, 1 };
-  bool cutflow_check_tight[] = { 1, 1, 1, 1 };
-  for(unsigned int i=0; i < probeTracks.size(); i++) {
-
-    TIDA::JpsiTrack* probe = 0;
-    const Wrapper::MuonTrack *tag = 0;
-    if(probeTracks[i]) {
-      probe = dynamic_cast<TIDA::JpsiTrack*> (probeTracks[i]);
-      tag   = probe->getTag();
-    }
-    else throw std::runtime_error("*** TrigJpsiMonTool *** Probe not casting, aborting!!! *** TrigJpsiMonTool ***");
-
-    m_speaker->msg(MSG::DEBUG) << "probe [ pT = " << probe->pT()  << " eta = " << probe->eta()
-                               << " phi = "       << probe->phi() << " ]" << endmsg;
-    m_speaker->msg(MSG::DEBUG) << "tag [ pT = "   << tag->pt()    << " eta = " << tag->eta()
-                               << " phi = "       << tag->phi()   << " ]" << endmsg;
-    cout << "probe [ pT = " << probe->pT()  << " eta = " << probe->eta()
-         << " phi = "       << probe->phi() << " ]" << endl;
-    cout << "tag [ pT = "   << tag->pt()    << " eta = " << tag->eta()
-         << " phi = "       << tag->phi()   << " ]" << endl;
-
-    int probeRoiId = probe->getRoiNum();
-    int tagRoiId   = tag->roiNum();
-    if(probeRoiId == tagRoiId) {
-      m_speaker->msg(MSG::WARNING) << "*** TrigJpsiMonTool *** probe RoI == tag RoI!!! *** TrigJpsiMonTool ***" << endmsg;
-      throw std::runtime_error("*** TrigJpsiMonTool *** probe RoI == tag RoI!!! *** TrigJpsiMonTool ***");
-    }
-    else m_speaker->msg(MSG::DEBUG) << "JPsiAnalysis -- probe ROI: " << probeRoiId << "  and tag ROI: " << tagRoiId << endmsg;
-    
-    m_speaker->msg(MSG::DEBUG) << "test tracks size: " << testtracks.size()
-                               << " roi size: " << m_trackRois->size() << endmsg;
-    cout << "test tracks size: " << testtracks.size() << endl;
-    //for(unsigned int jj = 0; jj < testtracks.size(); ++jj)  cout << "testtracks - " << jj << " - " << testtracks[jj] << endl;
-    //for( std::map<int,int>::iterator ii = m_trackRois->begin(); ii != m_trackRois->end(); ++ii) {
-    //  cout << (*ii).first << " : " << (*ii).second << endl;
-    //}
-
-    float m = probe->mass();
-    bool isTightPair = m > (mass-m_minusMass) && m < (mass+m_plusMass);
-    //cout << "cutflow check ..." << endl;
-    if(cutflow_check[0]) {
-      cutflow_check[0] = 0;
-      hmitr = m_histos.find("cutflow"); // got t&p candidate
-      if(hmitr != m_histos.end())  hmitr->second->Fill( 1.0 );
-    }
-    //cout << "tight cutflow check ..." << endl;
-    if(isTightPair && cutflow_check_tight[0]) {
-      cutflow_check_tight[0] = 0;
-      hmitr = m_histos.find("cutflow_tight"); // got t&p candidate
-      if(hmitr != m_histos.end())  hmitr->second->Fill( 1.0 );
-    }
-    
-    float mu_inTime = 0; //, mu_outOfTime = 0;
-    
-    m_speaker->msg(MSG::DEBUG) << "get event info ..." << endmsg;
-    if(m_speaker->evtStore()->retrieve(m_eventInfo).isFailure())  m_speaker->msg(MSG::DEBUG) << "Failed to get EventInfo " << endmsg;
-    else {
-      mu_inTime    = m_eventInfo->actualInteractionsPerCrossing();
-      //mu_outOfTime = m_eventInfo->averageInteractionsPerCrossing();
-    }
-
-    unsigned int runNumber   = m_eventInfo->event_ID()->run_number();
-    unsigned int eventNumber = m_eventInfo->event_ID()->event_number();
-
-    ///temp
-    float offd0  = 0., offphi0 = 0., offz0 = 0., offpT = 0.,
-          offeta = 0., offphi = 0., temp_Deta = 0., temp_Dphi = 0.,
-          matched_brem = 0.;
-    /// what if there are more ef than offline tracks?!?!
-    //cout << "cutflow stuff ..." << endl;
-    bool fillOffline = false;
-    hmitr = m_histos.find("cutflow"); // offline matches
-    if(cutflow_check[1] && hmitr != m_histos.end()) {
-      //std::cout << "tag and probe pointers: " << m_offlineTags << "  " << m_offlineProbes << std::endl; 
-      //std::cout << "i: " << i << " offlineTags: " << m_offlineTags->size() << " offlineProbes: " << m_offlineProbes->size() << std::endl;
-      cutflow_check[1] = 0;
-      if(m_offlineTags->at(i))    hmitr->second->Fill( 2.0 );
-      if(m_offlineProbes->at(i))  hmitr->second->Fill( 3.0 );
-      if(m_offlineProbes->at(i) && m_offlineTags->at(i))  hmitr->second->Fill( 4.0 );
-    }
-    hmitr = m_histos.find("cutflow_tight"); // offline matches
-    if(isTightPair && cutflow_check_tight[1] && hmitr != m_histos.end()) {
-      cutflow_check_tight[1] = 0;
-      if(m_offlineTags->at(i))    hmitr->second->Fill( 2.0 );
-      if(m_offlineProbes->at(i))  hmitr->second->Fill( 3.0 );
-      if(m_offlineProbes->at(i) && m_offlineTags->at(i))  hmitr->second->Fill( 4.0 );
-    }
-
-    m_speaker->msg(MSG::DEBUG) << "require offline matches ..." << endmsg;
-
-    bool matchOffline = m_offlineProbes->at(i) ? true : false;
-    m_speaker->msg(MSG::DEBUG) << "matchOffline probes: " << matchOffline << endmsg;
-    if(!m_isMuon) {
-      matchOffline  = m_offlineTags->at(i) && m_tOffCharge->at(i) * m_pOffCharge->at(i) < 0.0;
-      m_speaker->msg(MSG::DEBUG) << "offTag: " << m_offlineTags->at(i) << endmsg;
-      m_speaker->msg(MSG::DEBUG) << "tOffCharge: " << m_tOffCharge->at(i) << endmsg;
-      m_speaker->msg(MSG::DEBUG) << "pOffCharge: " << m_pOffCharge->at(i) << endmsg;
-      m_speaker->msg(MSG::DEBUG) << "matchOffline tag: " << matchOffline << endmsg;
-    }
-
-    if(matchOffline) {
-
-      // #ifndef TIDA_NEWTRACKING_H
-      //      const Trk::MeasuredPerigee* measPer = m_offlineProbes->at(i)->measuredPerigee();
-      // #else
-      const Trk::Perigee* measPer = m_offlineProbes->at(i)->measuredPerigee();
-      // #endif
-      //      cout << "offd0 offset x = " << m_xBeamReference << " y = " << m_yBeamReference << endl;
-      offd0   = measPer->parameters()[Trk::d0] + sin(m_offlineProbes->at(i)->phi())*m_xBeamReference;
-      offd0  -= cos(m_offlineProbes->at(i)->phi())*m_yBeamReference;
-      offphi0 = fixPhi( measPer->parameters()[Trk::phi0]);
-      offz0   = measPer->parameters()[Trk::z0];
-      offpT   = m_offlineProbes->at(i)->pt();
-      offeta  = m_offlineProbes->at(i)->eta();
-      offphi  = fixPhi(m_offlineProbes->at(i)->phi());
-      temp_Deta = m_pOffDeta->at(i);
-      temp_Dphi = fixPhi(m_pOffDphi->at(i));
-      float et = m_pOffEt->at(i);
-      if(et)  matched_brem = fabs(offpT) / et;
-
-      hmitr = m_histos.find("probe_off_deta");
-      if(hmitr!=m_histos.end())  hmitr->second->Fill(temp_Deta);
-      hmitr = m_histos.find("probe_off_dphi");
-      if(hmitr!=m_histos.end())  hmitr->second->Fill(temp_Dphi);
-      hmitr = m_histos.find("probe_off_dr");
-      if(hmitr!=m_histos.end())  hmitr->second->Fill(m_pOffDr->at(i));
-
-      ///work out the tag-offline invmass
-      TLorentzVector tag4vec, probe4vec, offTag4vec, offProbe4vec, comb4vec;
-      float offtheta = 2. * atan(exp(-offeta));
-      float pxoff    = offpT * cos(m_offlineProbes->at(i)->phi());
-      float pyoff    = offpT * sin(m_offlineProbes->at(i)->phi());
-      float pzoff    = offpT * cos(offtheta) / sin(offtheta);
-      
-      float Mass = m_isMuon? 105.66 : 0.511;
-
-      tag4vec.SetPtEtaPhiE(tag->pt(), tag->eta(), fixPhi(tag->phi()),
-                             sqrt(pow(Mass,2)+pow(tag->px(),2)+pow(tag->py(),2)+pow(tag->pz(),2)));
-      probe4vec.SetPtEtaPhiE(probe->pT(), probe->eta(), fixPhi(probe->phi()),
-                             sqrt(pow(Mass,2)+pow(probe->px(),2)+pow(probe->py(),2)+pow(probe->pz(),2)));
-      offProbe4vec.SetPtEtaPhiE(offpT, offeta, offphi0,
-                             sqrt(pow(Mass,2)+pow(pxoff,2)+pow(pyoff,2)+pow(pzoff,2)));
-      comb4vec = tag4vec + offProbe4vec;
-      float vmag = comb4vec.Mag()/GeV;
-      // probe mass confirmation cut
-      fillOffline  = !(vmag < 0.5);
-      m_speaker->msg(MSG::DEBUG) << "vmag: " << vmag << endmsg;
-
-      cout << "> HIGH PT INEFFICIENCY DEBUG:" << endl;
-      cout << "> probe pT: " << probe->pT() << endl;
-      cout << "> offline probe track information:" << endl;
-      cout << "> offline probe track eta:" << offeta << endl;
-      cout << "> offline probe track phi:" << offphi << endl;
-      cout << "> offline probe track pT:" << offpT << endl;
-      //cout << (*m_offlineProbes->at(i)) << endl;
-      if(m_offlineTags->at(i)) {
-        cout << "> offline tag track information:" << endl;
-        float offTagPhi0  = fixPhi(((m_offlineTags->at(i)->measuredPerigee())->parameters())[Trk::phi0]);
-        float offTagPt    = m_offlineTags->at(i)->pt();
-        float offTagEta   = m_offlineTags->at(i)->eta();
-        float offTagTheta = 2. * atan(exp(-offTagEta));
-        float pxTag       = offTagPt * cos(m_offlineTags->at(i)->phi());
-        float pyTag       = offTagPt * sin(m_offlineTags->at(i)->phi());
-        float pzTag       = offTagPt * cos(offTagTheta) / sin(offTagTheta);
-        cout << "> offline tag track eta:" << offTagEta << endl;
-        cout << "> offline tag track phi:" << offTagPhi0 << endl;
-        cout << "> offline tag track pT:" << offTagPt << endl;
-        //cout << (*m_offlineTags->at(i)) << endl;
-        offTag4vec.SetPtEtaPhiE(offTagPt, offTagEta, offTagPhi0,
-                               sqrt(pow(Mass,2)+pow(pxTag,2)+pow(pyTag,2)+pow(pzTag,2)));
-        hmitr = m_histos.find("Zpt");
-        if(hmitr != m_histos.end())  hmitr->second->Fill((offProbe4vec + offTag4vec).Perp()/GeV);
-      }
-
-      hmitr = m_histos.find("tag_offline_invmass");
-      if(hmitr != m_histos.end())  hmitr->second->Fill(probe->mass()/GeV);
-      hmitr2d = m_histos2d.find("tomass_vs_offpt");
-      if(hmitr2d != m_histos2d.end()) hmitr2d->second->Fill(fabs(offpT/GeV), vmag, 1.0);
-
-      if(!m_isMuon) {
-        float offTagPhi0  = fixPhi(((m_offlineTags->at(i)->measuredPerigee())->parameters())[Trk::phi0]);
-        float offTagPt    = m_offlineTags->at(i)->pt();
-        float offTagEta   = m_offlineTags->at(i)->eta();
-        float offTagTheta = 2. * atan(exp(-offTagEta));
-        float pxTag       = offTagPt * cos(m_offlineTags->at(i)->phi());
-        float pyTag       = offTagPt * sin(m_offlineTags->at(i)->phi());
-        float pzTag       = offTagPt * cos(offTagTheta) / sin(offTagTheta);
-        offTag4vec.SetPtEtaPhiE(offTagPt, offTagEta, offTagPhi0,
-                               sqrt(pow(Mass,2)+pow(pxTag,2)+pow(pyTag,2)+pow(pzTag,2)));
-        // tag mass confirmation cut
-        comb4vec = probe4vec + offTag4vec;
-        vmag = comb4vec.Mag()/GeV;
-        fillOffline &= !(vmag < 0.5);
-      }
-    }
-    else  m_speaker->msg(MSG::INFO) << "No offline matches. fillOffline = " << fillOffline << endmsg;
-    //else  break;    
-
-    if(cutflow_check[2] && fillOffline) {
-      cutflow_check[2] = 0;
-      hmitr = m_histos.find("cutflow"); // is efficient
-      if(hmitr != m_histos.end())  hmitr->second->Fill( 5.0 );
-    }
-    if(isTightPair && cutflow_check_tight[2] && fillOffline) {
-      cutflow_check_tight[2] = 0;
-      hmitr = m_histos.find("cutflow_tight"); // is efficient
-      if(hmitr != m_histos.end())  hmitr->second->Fill( 5.0 );
-    }
-
-    ntracks = 0;
-    vector<TIDA::Vertex*>::const_iterator it    = m_vertices.begin();
-    vector<TIDA::Vertex*>::const_iterator itEnd = m_vertices.end();
-    for(; it != itEnd; ++it)  ntracks += (*it)->Ntracks();
-
-    // this is the dilepton invariant mass
-    invmass = probe->mass()/GeV;
-
-    pTt  = fabs(probe->pT());
-    z0t  = probe->z0();
-    etat = probe->eta();
-    phit = fixPhi(probe->phi());
-    /// use the tag variables for impact parameter, since the probe is extrapolated
-    d0t = tag->a0();
-    a0t = tag->a0() + sin(phit)*m_xBeamReference - cos(phit)*m_yBeamReference; 
-
-    //q = pTt>0? 1. : -1.;
-
-    float tnpDeltaR = deltaR(etat, phit, tag->eta(), tag->phi());
-
-    /////////////////////////////////////
-    /////////////////////////////////////
-    //    if(tnpDeltaR < 0.1) continue;
-    /////////////////////////////////////
-    /////////////////////////////////////
-
-    float dPhiTP = deltaPhi(tag->phi(), probe->phi()) / M_PI;
-
-    hmitr = m_histos.find("tagAndProbe_invmass");
-    if(hmitr != m_histos.end())  hmitr->second->Fill(invmass);
-
-    if(m_offlineTags->at(i)) {
-      hmitr = m_histos.find("tagMatch_invmass");
-      if(hmitr != m_histos.end())  hmitr->second->Fill(invmass);
-    }
-      
-    const int vpartSize = 6;
-    float vpart[vpartSize] = { fabs(offpT)/GeV, offeta, offphi0, offz0, d0t, offd0 };
-    for(int it = 0; it<vpartSize; it++) { 
-      if(TH1F* hptr = find(varName[it]))  hptr->Fill(vpart[it]); 
-    }  
-
-    int isEfficient = 0, isEfficient_nocut = 0;
-    float tinvmass = 0, ttMass = 0.;
-    TIDA::Track *matched = 0, *matched_nocut = 0;
-    double matched_eta = 0., matched_phi = 0.;
-    //       matched_eta_nocut = 0., matched_phi_nocut = 0.;
-    //int matched_roi = -1;
-
-    float tempdmass = 999999.;
-    float fillmass = 0.;
-
-    float minDR = 0., minDR_nocut = 0., etaID = 0.,
-          phiID = 0., ptID = 0., maxPt = 0.;
-    m_speaker->msg(MSG::DEBUG) << "testtracks size: " << testtracks.size()
-                               << " roi size: " << m_trackRois->size() << endmsg;
-    for(unsigned int trigind = 0; trigind < testtracks.size(); trigind++) {
-      // For electrons, require EQUAL RoIs for ID track and probe cluster
-      // For muons, require OPPOSITE RoIs for ID track and probe cluster
-      m_speaker->msg(MSG::DEBUG) << "testtrack [ pt = " << testtracks[trigind]->pT()
-                                 << " eta = " << testtracks[trigind]->eta()
-                                 << " phi = " << testtracks[trigind]->phi()
-                                 << " roi = " << m_trackRois->operator[](trigind) << " ]" << endmsg;
-      m_speaker->msg(MSG::DEBUG) << "track ROI: " << m_trackRois->operator[](trigind)
-                                 << " probeRoiId: " << probeRoiId << endmsg;
-      cout << "testtrack [ pt = " << testtracks[trigind]->pT()
-           << " eta = " << testtracks[trigind]->eta()
-           << " phi = " << testtracks[trigind]->phi()
-           << " roi = " << m_trackRois->operator[](trigind) << " ]" << endl;
-      m_speaker->msg(MSG::DEBUG) << "track ROI: " << m_trackRois->operator[](trigind)
-                                 << " probeRoiId: " << probeRoiId << endmsg;
-      cout << "track ROI: " << m_trackRois->operator[](trigind) << " probeRoiId: " << probeRoiId << endl;
-      /*if(      m_isMuon && m_trackRois->operator[](trigind) == tagRoiId)    continue;
-      else if(!m_isMuon && m_trackRois->operator[](trigind) != probeRoiId)  continue;*/
-      if(m_trackRois->operator[](trigind) != probeRoiId)  continue;
-      m_speaker->msg(MSG::INFO) << "test track passed RoI check!" << endmsg;
-      cout << "test track passed RoI check!" << endl;
-
-      TLorentzVector tagVec, trackVec, tagAndTrackPair;
-      float Mass = m_isMuon? 105.66 : 0.511;
-	
-      float idEta   = testtracks[trigind]->eta();
-      float idPhi   = fixPhi(testtracks[trigind]->phi());
-      //float thetaId = 2. * atan(exp(-testtracks[trigind]->eta()));
-      float idTheta = 2. * atan(exp(-idEta));
-      float idPt    = testtracks[trigind]->pT();
-      float idPx    = idPt * cos(idPhi);
-      float idPy    = idPt * sin(idPhi);
-      float idPz    = idPt * cos(idTheta) / sin(idTheta);
-      float idEn    = sqrt(Mass*Mass + idPx*idPx + idPy*idPy + idPz*idPz);
-
-      // TEMP !!!
-      //
-      //if( fabs(idPt) < 2000. )  continue;
-      //
-      // TEMP !!!
-
-      float tagEn = sqrt(Mass*Mass + tag->px()*tag->px() + tag->py()*tag->py() + tag->pz()*tag->pz());
-
-      tagVec.SetPtEtaPhiE(tag->pt(), tag->eta(), fixPhi(tag->phi()), tagEn);
-      trackVec.SetPtEtaPhiE(idPt, idEta, idPhi, idEn);
-      tagAndTrackPair = tagVec + trackVec;
-      tinvmass = tagAndTrackPair.Mag();
-      cout << "inv mass: " << (tinvmass / GeV)  << endl;
-
-      /// select the most J/Psi-like pair
-      if(fabs(tinvmass-mass) < tempdmass) { 
-        tempdmass = fabs(tinvmass - mass);
-        fillmass = tinvmass;
-      }
-
-      if(m_isMuon) {
-        // (mass-m_minusMass) &&  (mass+m_plusMass)
-        // this mass window matching is less than ideal
-        // need to come up with something cleverer!!
-        if(fabs(testtracks[trigind]->pT()) > maxPt) {
-        //float mdR = deltaR(probe->eta(), probe->phi(), testtracks[trigind]->eta(), testtracks[trigind]->phi());
-        //if(!minDR || mdR < minDR) {
-        //
-        /*float mdR = deltaR(probe->eta(), probe->phi(), testtracks[trigind]->eta(), testtracks[trigind]->phi());
-        m_speaker->msg(MSG::DEBUG) << "mdR(probe, track): " << mdR << " cut: 0.4" << endmsg;
-        if(!minDR_nocut || (minDR_nocut && mdR < minDR_nocut))  minDR_nocut = mdR;
-        if(mdR < 0.1) {
-          if(!isEfficient || (isEfficient && mdR < minDR)) {*/
-          //isEfficient = 1;
-          ttMass = tinvmass;
-          matched = testtracks[trigind];
-          etaID = testtracks[trigind]->eta();
-          phiID = fixPhi(testtracks[trigind]->phi());
-          matched_eta = testtracks[trigind]->eta();
-          matched_phi = fixPhi(testtracks[trigind]->phi());
-          ptID  = fabs(testtracks[trigind]->pT())/GeV;
-          maxPt = fabs(testtracks[trigind]->pT());
-          //minDR = mdR;
-        }
-      }
-      else if(fillOffline) {
-        float mdR = deltaR(offeta, offphi, testtracks[trigind]->eta(), testtracks[trigind]->phi());
-        // as long as there is any track in the RoI it is efficient
-        // use closest track as the 'matched track'
-        if(!isEfficient_nocut || (isEfficient_nocut && mdR < minDR_nocut)) {
-          matched_nocut = testtracks[trigind];
-          //matched_phi_nocut = fixPhi(m_phiAtCalo->operator[](trigind));
-          //matched_eta_nocut = m_etaAtCalo->operator[](trigind);
-          minDR_nocut = mdR;
-          isEfficient_nocut = 1; 
-        }
-        m_speaker->msg(MSG::DEBUG) << "mdR(off, track): " << mdR << endmsg;
-        if(mdR < 0.03) {
-          if(!isEfficient || (isEfficient && mdR < minDR)) {
-            //etaID = m_etaAtCalo->operator[](trigind);
-            //phiID = fixPhi(m_phiAtCalo->operator[](trigind));
-            etaID = testtracks[trigind]->eta();
-            phiID = fixPhi(testtracks[trigind]->phi());
-            ptID  = fabs(testtracks[trigind]->pT())/GeV;
-            matched = testtracks[trigind];
-            matched_eta = testtracks[trigind]->eta();
-            matched_phi = fixPhi(testtracks[trigind]->phi());
-            //matched_phi = fixPhi(m_phiAtCalo->operator[](trigind));
-            //matched_eta = m_etaAtCalo->operator[](trigind);
-            //matched_roi = m_trackRois->operator[](trigind);
-            minDR = mdR;
-        	  isEfficient = 1; 
-          }
-        }
-      } // else if (fillOffline)
-    } // loop over all tracks
-
-    if(m_isMuon) {
-      double lowerBound = m_isJpsi?  1000. :  50000.;
-      double upperBound = m_isJpsi? 20000  : 400000.;
-      m_speaker->msg(MSG::DEBUG) << "mass(ID track, tag): " << ttMass << endmsg;
-      m_speaker->msg(MSG::DEBUG) << "massLimitLow:  " << lowerBound << endmsg;
-      m_speaker->msg(MSG::DEBUG) << "massLimitHigh: " << upperBound << endmsg;
-      cout << "mass(ID track, tag): " << ttMass << endl;
-      cout << "massLimitLow:  " << lowerBound << endl;
-      cout << "massLimitHigh: " << upperBound << endl;
-      hmitr = m_histos.find("invmass_tt");
-      if(hmitr != m_histos.end())  hmitr->second->Fill( ttMass/GeV );
-      if(!isEfficient && ttMass > lowerBound && ttMass < upperBound)  isEfficient = 1;
-      else {
-        matched = 0;
-        etaID = phiID = ptID = 0.;
-      }
-    }
-    
-    if(isEfficient) {
-      cout << "\033[92;1mEvent #: " << eventNumber << ", run #: "
-           << runNumber << " --> is efficient! :-)\033[m" << endl;
-      cout << "SKIM EFFICIENT -- event #: " << eventNumber
-           << " run #: " << runNumber << endl;
-      hmitr = m_histos.find("pT_track");
-      if(hmitr != m_histos.end())  hmitr->second->Fill( ptID );
-      hmitr = m_histos.find("eta_track");
-      if(hmitr != m_histos.end())  hmitr->second->Fill( etaID );
-      hmitr = m_histos.find("phi_track");
-      if(hmitr != m_histos.end())  hmitr->second->Fill( phiID );
-      hmitr = m_histos.find("dphi_tp");
-      if(hmitr != m_histos.end())  hmitr->second->Fill( dPhiTP );
-
-      if(fabs(dPhiTP) > 0.75) {
-        hmitr = m_histos.find("pT_track_b2b");
-        if(hmitr != m_histos.end())  hmitr->second->Fill( ptID );
-        hmitr = m_histos.find("eta_track_b2b");
-        if(hmitr != m_histos.end())  hmitr->second->Fill( etaID );
-        hmitr = m_histos.find("phi_track_b2b");
-        if(hmitr != m_histos.end())  hmitr->second->Fill( phiID );
-      }
-    }
-    else {
-      cout << "\033[91;1mEvent #: " << eventNumber << ", run #: "
-           << runNumber << " --> is not efficient. :-(\033[m" << endl;
-      cout << "SKIM INEFFICIENT -- event #: " << eventNumber
-           << " run #: " << runNumber << endl;
-    }
-
-    if((probe->pT()/GeV) > 60. && !isEfficient && fillOffline) {
-      cout << "\033[92;1mHIGH PT INEFFICIENCY: INVESTIGATE!!!\033[m" << endl;
-    }
-
-    if(minDR_nocut) {
-      hmitr = m_histos.find("minDr_res");
-      if(hmitr != m_histos.end())  hmitr->second->Fill( minDR_nocut );
-    }
-
-    if(cutflow_check[3] && isEfficient) {
-      cutflow_check[3] = 0;
-      hmitr = m_histos.find("cutflow"); // is efficient
-      if(hmitr != m_histos.end())  hmitr->second->Fill( 6.0 );
-    }
-    else if(pTt > 30000.) { //DEBUG high pT inefficiency
-      if(isTightPair && cutflow_check_tight[3] && isEfficient) {
-        cutflow_check_tight[3] = 0;
-        hmitr = m_histos.find("cutflow_tight"); // is efficient
-        if(hmitr != m_histos.end())  hmitr->second->Fill( 6.0 );
-      }
-
-      if(fillOffline) {
-        hmitr2d = m_histos2d.find("pt_vs_offpt");
-        if(hmitr2d != m_histos2d.end())  hmitr2d->second->Fill(offpT/GeV, pTt/GeV, 1.0); // for most J/Psi-like, use 'fillmass'
-      }
-
-      hmitr = m_histos.find("tinvmass_miss");
-      if(hmitr!=m_histos.end())  hmitr->second->Fill(fillmass/GeV);
-
-    }
-    /////////////DEBUG high pT inefficiency
-
-    ///if you don't want to make any matching cut...
-    //      isEfficient = 1;
-    m_pT_eff->Fill(pTt/GeV,      isEfficient, 1.);
-    m_eta_eff->Fill(etat,        isEfficient, 1.);
-    m_vert_eff->Fill(nvert,      isEfficient, 1.);
-    m_z0_eff->Fill(z0t,          isEfficient, 1.);
-    m_d0_eff->Fill(a0t,          isEfficient, 1.);
-    m_phi_eff->Fill(phit,        isEfficient, 1.);
-    m_track_eff->Fill(ntracks,   isEfficient, 1.);
-    m_invmass_eff->Fill(invmass, isEfficient, 1.);
-
-
-    hmitr2d = m_histos2d.find("invmass_vs_tinvmass");
-    if(hmitr2d != m_histos2d.end())  hmitr2d->second->Fill(fillmass/GeV, invmass, 1.0); // for most J/Psi-like, use 'fillmass'
-    hmitr2d = m_histos2d.find("invmass_vs_deltar");
-    if(hmitr2d != m_histos2d.end())  hmitr2d->second->Fill(tnpDeltaR,    invmass, 1.0); // for most J/Psi-like, use 'fillmass'
-    hmitr2d = m_histos2d.find("pt_vs_deltar");
-    if(hmitr2d != m_histos2d.end())  hmitr2d->second->Fill(tnpDeltaR,    pTt/GeV, 1.0); // for most J/Psi-like, use 'fillmass'
-
-    //////FOR ONLINE-OFFLINE COMPARISONS ONLY
-    //    offpT = pTt;
-    //    offeta = etat;
-    //    offz0 = z0t;
-    //    offphi0 = phit;
-      
-    ///temp
-    if(fabs(offd0) > 1.0) {
-      m_pT_eff_d0cut->Fill(offpT/GeV,    isEfficient, 1.);
-      m_eta_eff_d0cut->Fill(offeta,      isEfficient, 1.);
-      m_vert_eff_d0cut->Fill(nvert,      isEfficient, 1.);
-      m_z0_eff_d0cut->Fill(offz0,        isEfficient, 1.);
-      m_d0_eff_d0cut->Fill(offd0,        isEfficient, 1.);
-      m_phi_eff_d0cut->Fill(offphi0,     isEfficient, 1.);
-      m_track_eff_d0cut->Fill(ntracks,   isEfficient, 1.);
-      m_invmass_eff_d0cut->Fill(invmass, isEfficient, 1.);
-    }
-
-    static const int num = 11;
-    static string effName[num] = { "pT", "eta", "phi", "d0", "absd0", "z0", "absz0",
-                                   "invmass", "track", "vert", "mu" };
-    float effVar[num] = { fabs(pTt)/GeV, etat, phit, offd0, fabs(offd0), offz0,
-                          fabs(offz0), invmass, float(ntracks), float(nvert), mu_inTime };
-
-    if(isEfficient) {
-      for (int it = 0; it<num; it++) { 
-        if(TH1F* hptr = find(effName[it]+"num"))  hptr->Fill(effVar[it]); 
-      }  
-      for(int it = 0; it<num; it++) {
-	      if(TH1F* hptr = find(effName[it]+"den"))  hptr->Fill(effVar[it]); 
-      }  
-      if(TH1F* hptr = find("deltarnum"))  hptr->Fill(tnpDeltaR);
-      if(TH1F* hptr = find("deltarden"))  hptr->Fill(tnpDeltaR);
-      if(TH1F* hptr = find("ETnum"))  hptr->Fill( matched_brem );
-      if(TH1F* hptr = find("ETden"))  hptr->Fill( matched_brem );
-      if(fabs(offd0) < 0.5) {
-        if(TH1F* hptr = find("pTnum_d0cut"))  hptr->Fill(pTt/GeV);
-	      if(TH1F* hptr = find("pTden_d0cut"))  hptr->Fill(pTt/GeV);
-      }
-      if(fabs(pTt) < 20000.) {
-        if(TH1F* hptr = find("deltarnum_lowpt"))  hptr->Fill(tnpDeltaR);
-        if(TH1F* hptr = find("deltarden_lowpt"))  hptr->Fill(tnpDeltaR);
-      }
-      if(matched_brem > 0.9) {
-        if( TH1F* hptr = find("pTEtnum") )  hptr->Fill( fabs(pTt)/GeV );
-        if( TH1F* hptr = find("pTEtden") )  hptr->Fill( fabs(pTt)/GeV );
-        if( TH1F* hptr = find("etaEtnum") ) hptr->Fill( etat );
-        if( TH1F* hptr = find("etaEtden") ) hptr->Fill( etat );
-      }
-      else if(matched_brem < 0.5) {
-        if( TH1F* hptr = find("pTbremnum") )  hptr->Fill( fabs(pTt)/GeV );
-        if( TH1F* hptr = find("pTbremden") )  hptr->Fill( fabs(pTt)/GeV );
-        if( TH1F* hptr = find("etabremnum") ) hptr->Fill( etat );
-        if( TH1F* hptr = find("etabremden") ) hptr->Fill( etat );
-      }
-      if(fabs(dPhiTP) > 0.5) {
-        if( TH1F* hptr = find("pTb2bloosenum") )  hptr->Fill( fabs(pTt)/GeV );
-        if( TH1F* hptr = find("pTb2blooseden") )  hptr->Fill( fabs(pTt)/GeV );
-        if( TH1F* hptr = find("etab2bloosenum") ) hptr->Fill( etat );
-        if( TH1F* hptr = find("etab2blooseden") ) hptr->Fill( etat );
-        if( TH1F* hptr = find("mub2bloosenum") ) hptr->Fill( mu_inTime );
-        if( TH1F* hptr = find("mub2blooseden") ) hptr->Fill( mu_inTime );
-        if(fabs(dPhiTP) > 0.75) {
-          if( TH1F* hptr = find("pTb2bnum") )  hptr->Fill( fabs(pTt)/GeV );
-          if( TH1F* hptr = find("pTb2bden") )  hptr->Fill( fabs(pTt)/GeV );
-          if( TH1F* hptr = find("etab2bnum") ) hptr->Fill( etat );
-          if( TH1F* hptr = find("etab2bden") ) hptr->Fill( etat );
-          if( TH1F* hptr = find("mub2bnum") ) hptr->Fill( mu_inTime );
-          if( TH1F* hptr = find("mub2bden") ) hptr->Fill( mu_inTime );
-        }
-      }
-    }
-    else {
-      hmitr = m_histos.find("tagAndProbe_invmass_wo_match");
-      if(hmitr!=m_histos.end())  hmitr->second->Fill(invmass);
-      ///temp, pT of missed offline track
-      hmitr = m_histos.find("pTmiss");
-      if(hmitr!=m_histos.end())  hmitr->second->Fill(fabs(offpT/GeV));
-      
-      for ( int it=0 ; it<num; it++ ) { 
-        if(TH1F* hptr = find(effName[it]+"den"))  hptr->Fill(effVar[it]); 
-      }  
-      if(TH1F* hptr = find("deltarden"))  hptr->Fill(tnpDeltaR);
-      if(TH1F* hptr = find("ETden"))  hptr->Fill( matched_brem );
-      if(fabs(offd0) < 0.5) { 
-        if(TH1F* hptr = find("pTden_d0cut"))  hptr->Fill(pTt/GeV);
-      }
-      if(fabs(pTt) < 20000.)  {
-        if(TH1F* hptr = find("deltarden_lowpt"))  hptr->Fill(tnpDeltaR);
-      }
-      if(matched_brem > 0.9) {
-        if( TH1F* hptr = find("pTEtden") )  hptr->Fill( fabs(pTt)/GeV );
-        if( TH1F* hptr = find("etaEtden") ) hptr->Fill( etat );
-      }
-      else if(matched_brem < 0.5) {
-        if( TH1F* hptr = find("pTbremden") )  hptr->Fill( fabs(pTt)/GeV );
-        if( TH1F* hptr = find("etabremden") ) hptr->Fill( etat );
-      }
-      if(fabs(dPhiTP) > 0.5) {
-        if( TH1F* hptr = find("pTb2blooseden") )  hptr->Fill( fabs(pTt)/GeV );
-        if( TH1F* hptr = find("etab2blooseden") ) hptr->Fill( etat );
-        if( TH1F* hptr = find("mub2blooseden") ) hptr->Fill( mu_inTime );
-        if(fabs(dPhiTP) > 0.75) {
-          if( TH1F* hptr = find("pTb2bden") )  hptr->Fill( fabs(pTt)/GeV );
-          if( TH1F* hptr = find("etab2bden") ) hptr->Fill( etat );
-          if( TH1F* hptr = find("mub2bden") ) hptr->Fill( mu_inTime );
-        }
-      }
-    }
-
-    if(fillOffline) {
-      hmitr = m_histos.find("pT_offtrack");
-      if(hmitr != m_histos.end())  hmitr->second->Fill( fabs(offpT)/GeV );
-      hmitr = m_histos.find("eta_offtrack");
-      if(hmitr != m_histos.end())  hmitr->second->Fill( offeta );
-      hmitr = m_histos.find("phi_offtrack");
-      if(hmitr != m_histos.end())  hmitr->second->Fill( offphi );
-      if(matched_brem > 0.9) {
-        hmitr = m_histos.find("pT_offtrackEt");
-        if(hmitr != m_histos.end())  hmitr->second->Fill( fabs(offpT)/GeV );
-        hmitr = m_histos.find("eta_offtrackEt");
-        if(hmitr != m_histos.end())  hmitr->second->Fill( offeta );
-        hmitr = m_histos.find("phi_offtrackEt");
-        if(hmitr != m_histos.end())  hmitr->second->Fill( offphi );
-      }
-      else if(matched_brem < 0.5) {
-        hmitr = m_histos.find("pT_offtrackbrem");
-        if(hmitr != m_histos.end())  hmitr->second->Fill( fabs(offpT)/GeV );
-        hmitr = m_histos.find("eta_offtrackbrem");
-        if(hmitr != m_histos.end())  hmitr->second->Fill( offeta );
-        hmitr = m_histos.find("phi_offtrackbrem");
-        if(hmitr != m_histos.end())  hmitr->second->Fill( offphi );
-      }
-
-      m_pT_eff_offline->Fill(offpT/GeV,    isEfficient, 1.);
-      m_eta_eff_offline->Fill(offeta,      isEfficient, 1.);
-      m_vert_eff_offline->Fill(nvert,      isEfficient, 1.);
-      m_z0_eff_offline->Fill(offz0,        isEfficient, 1.);
-      m_d0_eff_offline->Fill(offd0,        isEfficient, 1.);
-      m_phi_eff_offline->Fill(offphi0,     isEfficient, 1.);
-      m_track_eff_offline->Fill(ntracks,   isEfficient, 1.);
-      m_invmass_eff_offline->Fill(invmass, isEfficient, 1.);
-
-      ///temp
-      if(fabs(offd0) > 1.0){
-        m_pT_eff_d0cut_offline->Fill(offpT/GeV,    isEfficient, 1.);
-        m_eta_eff_d0cut_offline->Fill(offeta,      isEfficient, 1.);
-        m_vert_eff_d0cut_offline->Fill(nvert,      isEfficient, 1.);
-        m_z0_eff_d0cut_offline->Fill(offz0,        isEfficient, 1.);
-        m_d0_eff_d0cut_offline->Fill(offd0,        isEfficient, 1.);
-        m_phi_eff_d0cut_offline->Fill(offphi0,     isEfficient, 1.);
-        m_track_eff_d0cut_offline->Fill(ntracks,   isEfficient, 1.);
-        m_invmass_eff_d0cut_offline->Fill(invmass, isEfficient, 1.);
-      }
-
-      if(isEfficient) {
-        for(int it = 0; it<num; it++) { 
-          if(TH1F* hptr = find(effName[it]+"num_off"))  hptr->Fill(effVar[it]); 
-        }  
-        for(int it = 0; it<num; it++) { 
-          if(TH1F* hptr = find(effName[it]+"den_off"))  hptr->Fill(effVar[it]); 
-        }  
-        if(TH1F* hptr = find("pToffnum_off"))  hptr->Fill(fabs(offpT/GeV));
-        if(TH1F* hptr = find("pToffden_off"))  hptr->Fill(fabs(offpT/GeV));
-        if(fabs(offd0) < 0.5) {
-          if( TH1F* hptr = find("pToffnum_d0cut") ) hptr->Fill( offpT/GeV );
-          if( TH1F* hptr = find("pToffden_d0cut") ) hptr->Fill( offpT/GeV );
-        }
-        if( TH1F* hptr = find("pTofftracknum_off") )  hptr->Fill( fabs(offpT)/GeV );
-        if( TH1F* hptr = find("pTofftrackden_off") )  hptr->Fill( fabs(offpT)/GeV );
-        if( TH1F* hptr = find("etaofftracknum_off") )  hptr->Fill( offeta );
-        if( TH1F* hptr = find("etaofftrackden_off") )  hptr->Fill( offeta );
-        if( TH1F* hptr = find("ETnum_off") )  hptr->Fill( matched_brem );
-        if( TH1F* hptr = find("ETden_off") )  hptr->Fill( matched_brem );
-        if(matched_brem > 0.9) {
-          if( TH1F* hptr = find("pTEtnum_off") )  hptr->Fill( fabs(pTt)/GeV );
-          if( TH1F* hptr = find("pTEtden_off") )  hptr->Fill( fabs(pTt)/GeV );
-          if( TH1F* hptr = find("etaEtnum_off") ) hptr->Fill( etat );
-          if( TH1F* hptr = find("etaEtden_off") ) hptr->Fill( etat );
-          if( TH1F* hptr = find("pTofftrackEtnum_off") )  hptr->Fill( fabs(offpT)/GeV );
-          if( TH1F* hptr = find("pTofftrackEtden_off") )  hptr->Fill( fabs(offpT)/GeV );
-          if( TH1F* hptr = find("etaofftrackEtnum_off") ) hptr->Fill( offeta );
-          if( TH1F* hptr = find("etaofftrackEtden_off") ) hptr->Fill( offeta );
-        }
-        else if(matched_brem < 0.5) {
-          if( TH1F* hptr = find("pTbremnum_off") )  hptr->Fill( fabs(pTt)/GeV );
-          if( TH1F* hptr = find("pTbremden_off") )  hptr->Fill( fabs(pTt)/GeV );
-          if( TH1F* hptr = find("etabremnum_off") )  hptr->Fill( etat );
-          if( TH1F* hptr = find("etabremden_off") )  hptr->Fill( etat );
-          if( TH1F* hptr = find("pTofftrackbremnum_off") )  hptr->Fill( fabs(offpT)/GeV );
-          if( TH1F* hptr = find("pTofftrackbremden_off") )  hptr->Fill( fabs(offpT)/GeV );
-          if( TH1F* hptr = find("etaofftrackbremnum_off") )  hptr->Fill( offeta );
-          if( TH1F* hptr = find("etaofftrackbremden_off") )  hptr->Fill( offeta );
-        }
-        if(fabs(dPhiTP) > 0.5) {
-          if( TH1F* hptr = find("pTb2bloosenum_off") )  hptr->Fill( fabs(pTt)/GeV );
-          if( TH1F* hptr = find("pTb2blooseden_off") )  hptr->Fill( fabs(pTt)/GeV );
-          if( TH1F* hptr = find("etab2bloosenum_off") ) hptr->Fill( etat );
-          if( TH1F* hptr = find("etab2blooseden_off") ) hptr->Fill( etat );
-          if( TH1F* hptr = find("mub2bloosenum_off") ) hptr->Fill( mu_inTime );
-          if( TH1F* hptr = find("mub2blooseden_off") ) hptr->Fill( mu_inTime );
-          if(fabs(dPhiTP) > 0.75) {
-            if( TH1F* hptr = find("pTb2bnum_off") )  hptr->Fill( fabs(pTt)/GeV );
-            if( TH1F* hptr = find("pTb2bden_off") )  hptr->Fill( fabs(pTt)/GeV );
-            if( TH1F* hptr = find("etab2bnum_off") ) hptr->Fill( etat );
-            if( TH1F* hptr = find("etab2bden_off") ) hptr->Fill( etat );
-            if( TH1F* hptr = find("mub2bnum_off") ) hptr->Fill( mu_inTime );
-            if( TH1F* hptr = find("mub2bden_off") ) hptr->Fill( mu_inTime );
-          }
-        }
-      }    
-      else {
-        for(int it = 0; it<num; it++) { 
-          if(TH1F* hptr = find(effName[it]+"den_off"))  hptr->Fill(effVar[it]); 
-        }  
-  	    if(TH1F* hptr = find("pToffden_off"))  hptr->Fill(fabs(offpT/GeV));
-        if(TH1F* hptr = find("ETden_off"))     hptr->Fill( matched_brem );
-        if(fabs(offd0) < 0.5) {
-          if(TH1F* hptr = find("pToffden_d0cut"))  hptr->Fill(offpT/GeV);
-        }
-        if( TH1F* hptr = find("pTofftrackden_off") )  hptr->Fill( fabs(offpT)/GeV );
-        if( TH1F* hptr = find("etaofftrackden_off") ) hptr->Fill( offeta );
-        if(matched_brem > 0.9) {
-          if( TH1F* hptr = find("pTEtden_off") )  hptr->Fill( fabs(pTt)/GeV );
-          if( TH1F* hptr = find("etaEtden_off") ) hptr->Fill( etat );
-          if( TH1F* hptr = find("pTofftrackEtden_off") )  hptr->Fill( fabs(offpT)/GeV );
-          if( TH1F* hptr = find("etaofftrackEtden_off") ) hptr->Fill( offeta );
-        }
-        else if(matched_brem < 0.5) {
-          if( TH1F* hptr = find("pTbremden_off") )  hptr->Fill( fabs(pTt)/GeV );
-          if( TH1F* hptr = find("etabremden_off") ) hptr->Fill( etat );
-          if( TH1F* hptr = find("pTofftrackbremden_off") )  hptr->Fill( fabs(offpT)/GeV );
-          if( TH1F* hptr = find("etaofftrackbremden_off") ) hptr->Fill( offeta );
-        }
-        if(fabs(dPhiTP) > 0.5) {
-          if( TH1F* hptr = find("pTb2blooseden_off") )  hptr->Fill( fabs(pTt)/GeV );
-          if( TH1F* hptr = find("etab2blooseden_off") ) hptr->Fill( etat );
-          if( TH1F* hptr = find("mub2blooseden_off") ) hptr->Fill( mu_inTime );
-          if(fabs(dPhiTP) > 0.75) {
-            if( TH1F* hptr = find("pTb2bden_off") )  hptr->Fill( fabs(pTt)/GeV );
-            if( TH1F* hptr = find("etab2bden_off") ) hptr->Fill( etat );
-            if( TH1F* hptr = find("mub2bden_off") ) hptr->Fill( mu_inTime );
-          }
-        }
-      }
-    }
-      
-    // residual histos, between ID track and probe
-    if(isEfficient && matched) {
-
-      float pTr  = fabs(matched->pT());  
-      float phir = fixPhi(matched_phi);
-      float etar = matched_eta;
-      float z0r  = matched->z0(); 
-      float d0r  = matched->a0(); 
-      float a0r  = matched->a0() + sin(phir)*m_xBeamTest - cos(phir)*m_yBeamTest; // this will be changed when we know the beam spot position
-
-      string vtname[6] = { "pT_rec", "eta_rec", "phi_rec", "z0_rec", "d0_rec", "a0_rec"};
-      float vtpart[6] = { fabs(pTr)/GeV, etar, phir, z0r, d0r, a0r };
-
-      for(int it=0; it<6; it++) { 
-	      if(TH1F* hptr = find(vtname[it]))  hptr->Fill(vtpart[it]); 
-      }  
-      
-      float dphi = deltaPhi(phit, phir);
-
-      float vres[6] = { 1/pTt-1/pTr, etat-etar, dphi, z0t-z0r, d0t-d0r, a0t-a0r };
-       
-      for(int it=0; it<6; it++) { 
-        if(TH1F* hptr = find(varName[it]+"_res"))  hptr->Fill(vres[it]); 
-      }  
-      float dr = deltaR(etat, phit, etar, phir);
-      hmitr = m_histos.find("deltar");
-      if(hmitr!=m_histos.end())  hmitr->second->Fill(dr);
-      if(fillOffline) {
-        hmitr2d = m_histos2d.find("asymEta");
-        if(hmitr2d != m_histos2d.end())  hmitr2d->second->Fill(offeta, matched->eta());
-        hmitr2d = m_histos2d.find("asymPhi");
-        if(hmitr2d != m_histos2d.end())  hmitr2d->second->Fill(offphi, fixPhi(matched->phi()));
-      }
-    }
-    if(fillOffline && isEfficient_nocut && matched_nocut) {
-      float dEtaProbeOff = offeta  - matched_nocut->eta();
-      float dPhiProbeOff = deltaPhi(offphi, matched_nocut->phi());
-      /*if(fabs(dEtaProbeOff) > 0.4 || fabs(dPhiProbeOff) > 0.4) {
-        cout << "OUTLIER INFO: tag -- pt = " << tag->pt()
-             << " eta = " << tag->eta()
-             << " phi = " << tag->phi()
-             << " roi = " << tag->roiNum() << endl;
-        cout << "OUTLIER INFO: probe -- pt = " << probe->pT()
-             << " eta = " << probe->eta()
-             << " phi = " << probe->phi()
-             << " roi = " << probe->getRoiNum() << endl;
-        cout << "OUTLIER INFO: track-- pt = " << matched_nocut->pT()
-             << " eta = " << matched_nocut->eta() << " (" << matched_eta_nocut << ")"
-             << " phi = " << matched_nocut->phi() << " (" << matched_phi_nocut << ")" << endl;
-        cout << "OUTLIER INFO: offline probe track-- pt = " << offpT
-             << " eta = " << offeta
-             << " phi = " << offphi << endl;
-      }*/
-      hmitr = m_histos.find("etaOff_res");
-      if(hmitr != m_histos.end())  hmitr->second->Fill(dEtaProbeOff);
-      hmitr = m_histos.find("phiOff_res");
-      if(hmitr != m_histos.end())  hmitr->second->Fill(dPhiProbeOff);
-      hmitr = m_histos.find("rOff_res");
-      if(hmitr != m_histos.end())  hmitr->second->Fill(minDR_nocut);
-    }
-  } 
-  m_speaker->msg(MSG::DEBUG) << "... end of JpsiAnalysis execute." << endmsg;
-}
-
-// ###########################################################################
- 
-float JpsiAnalysis::deltaR(float eta1, float phi1, float eta2, float phi2) {
-  float deta = eta1-eta2;
-  float dphi = deltaPhi(phi1,phi2);
-  return TMath::Sqrt(deta*deta+dphi*dphi);
-}
- 
-// ###########################################################################
-
-float JpsiAnalysis::deltaPhi(float phi1, float phi2) {
-  if(TMath::IsNaN(phi1)||TMath::IsNaN(phi2)) {
-    cout << "> > > > > WTF!? deltaPhi(phi1,phi2) called with NaN" << endl;
-  }
-  return fixPhi(phi1-phi2);
-}
-
-// ###########################################################################
- 
-float JpsiAnalysis::fixPhi(float phi) {
-  while(phi >=  M_PI) phi -= 2.0*M_PI;
-  while(phi <  -M_PI) phi += 2.0*M_PI;
-  return phi;
-}
- 
-// ###########################################################################
-
diff --git a/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/src/TrigJpsiMonTool.cxx b/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/src/TrigJpsiMonTool.cxx
deleted file mode 100644
index 4538db4c2382af42e28869054f2c24fc1c7bcef9..0000000000000000000000000000000000000000
--- a/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/src/TrigJpsiMonTool.cxx
+++ /dev/null
@@ -1,206 +0,0 @@
-/*
-  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
-*/
-//
-//   @file    TrigJpsiMonTool.cxx         
-//   
-//            implementation of an IHLTMonToolAC 
-//                   
-// 
-//
-//   $Id: TrigTestMonToolAC.cxx, v0.0  Wed 28 Oct 2009 02:23:23 CET sutt $
-/** @author Mark Sutton (sutt@cern.ch) **/
-/** @author Peter Wijeratne (paw@hep.ucl.ac.uk) **/
-/** @author Christian Gutschow (chris.g@cern.ch) **/
-
-#include "TrigInDetAnalysisUtils/Filter_Track.h"
-
-#include "TrigIDJpsiMonitoring/TrigJpsiMonTool.h"
-#include "TrigIDJpsiMonitoring/AnalysisConfig_Jpsi.h"
-
-#include "AthenaMonitoring/AthenaMonManager.h"
-#include "AthenaMonitoring/ManagedMonitorToolTest.h"
-
-using namespace TrigInDetAnalysis;
-
-TrigJpsiMonTool::TrigJpsiMonTool(const std::string & type, const std::string & name, const IInterface* parent) 
-  :  IHLTMonTool(type, name, parent),
-     m_tdt("Trig::TrigDecisionTool/TrigDecisionTool"),
-     m_roiInfo(false),
-     m_buildNtuple(false),
-     m_countBook(true)
-{
-  //  msg(MSG::DEBUG) << "TrigJpsiMonTool::TrigJpsiMonTool() compiled: " << __DATE__ << " " << __TIME__ << endmsg;
-
-  declareProperty( "pTCut",   m_pTCut   = 0 );
-  declareProperty( "etaCut",  m_etaCut  = 5 );
-  declareProperty( "d0Cut",   m_d0Cut   = 1000 );
-  declareProperty( "z0Cut",   m_z0Cut   = 2000 );
-  declareProperty( "siHits",  m_siHits  = -1 );
-
-  declareProperty( "trtHits",   m_trtHits   = -2 );
-  declareProperty( "strawHits", m_strawHits = -2 );
-
-  declareProperty( "pTCutOffline",   m_pTCutOffline   = 4000 );
-  declareProperty( "etaCutOffline",  m_etaCutOffline  = 2.5 );
-  declareProperty( "d0CutOffline",   m_d0CutOffline   = 100 );
-  declareProperty( "z0CutOffline",   m_z0CutOffline   = 200 );
-  declareProperty( "siHitsOffline",  m_siHitsOffline  = -1 );
-  declareProperty( "pixHitsOffline", m_pixHitsOffline  = 1 );
-  declareProperty( "sctHitsOffline", m_sctHitsOffline  = 6 );
-
-  declareProperty( "trtHitsOffline",   m_trtHitsOffline   = -2 );
-  declareProperty( "strawHitsOffline", m_strawHitsOffline = -2 );
-
-  declareProperty( "phiWidth", m_phiWidth = 0.2 );
-  declareProperty( "etaWidth", m_etaWidth = 0.2 ); 
-  declareProperty( "zedWidth", m_zedWidth = 168 );
-
-  declareProperty( "matchR",   m_matchR   = 0.2 );
-  declareProperty( "matchPhi", m_matchPhi = 999 );
-
-  //  declareProperty( "Chain0", m_chain0="EF_2mu4T_Jpsimumu_IDTrkNoCut" );
-  //declareProperty( "Chain0", m_chain0="EF_e5_tight1_e5_NoCut" );
-  declareProperty( "Chain0", m_chain1="EF_e24vh_tight1_e15_NoCut_Zee" );
-  //declareProperty( "Chain1", m_chain1="EF_e5_tight1_e9_etcut_Jpsi" );
-  declareProperty( "Chain1", m_chain0="EF_e5_tight1_e4_etcut_Jpsi" );
-
-  /*declareProperty( "IDSCAN", m_collection0="TrigIDSCAN_Muon" );
-  declareProperty( "SiTrack", m_collection1="TrigSiTrack_Muon" );
-  //declareProperty( "TRTSF", m_collection2="TRTSegmentFinder" );
-  //declareProperty( "EF", m_collection3="InDetTrigParticleCreation_Muon_EFID" );
-  //declareProperty( "EFTRT", m_collection4="InDetTrigParticleCreationTRTOnly_Muon_EFID" );
-  declareProperty( "StratA", m_collection5="TrigL2SiTrackFinder_MuonA" );
-  declareProperty( "StratB", m_collection6="TrigL2SiTrackFinder_MuonB" );
-  declareProperty( "StratC", m_collection7="TrigL2SiTrackFinder_MuonC" ); */
-
-  //declareProperty( "IDSCAN", m_collection0="TrigIDSCAN_eGamma" );
-  //declareProperty( "SiTrack", m_collection1="TrigSiTrack_eGamma" );
-  //declareProperty( "TRTSF", m_collection2="TrigTRTSegFinder_eGamma" );
-  declareProperty( "EF", m_collection0="InDetTrigParticleCreation_Electron_EFID" );
-  //declareProperty( "EFTRT", m_collection4="InDetTrigParticleCreationTRTOnly_Electron_EFID" );
-  declareProperty( "StratA", m_collection1="TrigL2SiTrackFinder_eGammaA" );
-  declareProperty( "StratB", m_collection2="TrigL2SiTrackFinder_eGammaB" );
-  declareProperty( "StratC", m_collection3="TrigL2SiTrackFinder_eGammaC" );
-
-  declareProperty( "buildNtuple",   m_buildNtuple = false );
-  declareProperty( "mcTruth",       m_mcTruth = false );
-
-}
-
-
-
-TrigJpsiMonTool::~TrigJpsiMonTool() { 
-  for( unsigned int i = m_filters.size()     ; i-- ; )  delete m_filters[i];
-  for( unsigned int i = m_associators.size() ; i-- ; )  delete m_associators[i];
-  for( unsigned int i = m_sequences.size()   ; i-- ; )  delete m_sequences[i];
-}
-
-
-
-StatusCode TrigJpsiMonTool::init() {
-
-  //  msg(MSG::DEBUG) << " ----- enter init() ----- " << endmsg;
-
-  // roi width information
-  //  m_roiInfo.etaHalfWidth(m_etaWidth);
-  //  m_roiInfo.phiHalfWidth(m_phiWidth);
-  //  m_roiInfo.zedHalfWidth(m_zedWidth);
-  
-  // track filters 
-  // reference (EF) tracks...
-  TrackFilter* filterRef = new Filter_Track( m_etaCutOffline, m_d0CutOffline, m_z0CutOffline, m_pTCutOffline,
-					     -1, -1, -1, -1,  -2, -2 );
-  
-  // test (trigger) tracks...
-  TrackFilter* filterTest = new Filter_Track( m_etaCut, m_d0Cut, m_z0Cut, m_pTCut, -1, -1, -1, -1,  -2, -2 );
-  //TrackFilter* filterTest = new Filter_AcceptAll();
-  
-  // keep track of the filters so they can be cleaned up at the end
-  m_filters.push_back(filterRef);
-  m_filters.push_back(filterTest);
-
-  // track associators 
-  TrackAssociator*  dR_matcher = new   Associator_BestDeltaRMatcher(  "EBdeltaR",    m_matchR ); // this needs to be set correctly
-  
-  // keep track of the filters so they can be cleaned up at the end
-  m_associators.push_back(dR_matcher);
-  
-    if( !m_chain0.empty() ) m_chainNames.push_back( m_chain0 );
-    if( !m_chain1.empty() ) m_chainNames.push_back( m_chain1 );
-    if( !m_chain2.empty() ) m_chainNames.push_back( m_chain2 );
-    if( !m_chain3.empty() ) m_chainNames.push_back( m_chain3 );
-
-    if( !m_collection0.empty() ) m_collectionNames.push_back( m_collection0 );
-    if( !m_collection1.empty() ) m_collectionNames.push_back( m_collection1 );
-    if( !m_collection2.empty() ) m_collectionNames.push_back( m_collection2 );
-    if( !m_collection3.empty() ) m_collectionNames.push_back( m_collection3 );
-    if( !m_collection4.empty() ) m_collectionNames.push_back( m_collection4 );    
-    if( !m_collection5.empty() ) m_collectionNames.push_back( m_collection5 );
-    if( !m_collection6.empty() ) m_collectionNames.push_back( m_collection6 );
-    if( !m_collection7.empty() ) m_collectionNames.push_back( m_collection7 );    
-  
-   for( unsigned i=0 ; i<m_chainNames.size() ; i++ ){
-      for( unsigned j=0; j<m_collectionNames.size(); j++ ){
-	
-	m_sequences.push_back( new AnalysisConfig_Jpsi( m_chainNames[i],  
-							m_chainNames[i], "", m_collectionNames[j],
-							m_chainNames[i], "", "TrackParticleCandidate",
-							&m_roiInfo,
-							filterTest, filterRef, 
-							dR_matcher,
-							new JpsiAnalysis(m_chainNames[i]) ) );
-
-      }    
-    }
-
-    m_countBook = true;
-
-    //    msg(MSG::DEBUG) << " -----  exit init() ----- " << endmsg;
-    
-    return StatusCode::SUCCESS; 
-}
-
-
-
-#ifdef ManagedMonitorToolBase_Uses_API_201401
-StatusCode TrigJpsiMonTool::book() { 
-#else
-StatusCode TrigJpsiMonTool::book(bool /*newEventsBlock*/, bool /*newLumiBlock*/, bool /*newRun*/) {
-#endif
-  //  msg(MSG::DEBUG) << " ----- enter book() ----- " << endmsg;
-  if( m_countBook ){
-    for ( unsigned i=0 ; i<m_sequences.size() ; i++ ) { 
-      m_sequences[i]->initialize(this, &m_tdt);
-      m_sequences[i]->book();      
-    }
-  }
-  m_countBook=false;
-  //  msg(MSG::DEBUG) << " ----- exit book() ----- " << endmsg;
-  return StatusCode::SUCCESS; 
-}
-
-StatusCode TrigJpsiMonTool::fill() { 
-  //  msg(MSG::DEBUG) << " ----- enter fill() ----- " << endmsg;  
-  for ( unsigned i=0 ; i<m_sequences.size() ; i++ ) m_sequences[i]->execute();
-  //  msg(MSG::DEBUG) << " ----- exit fill() ----- " << endmsg;
-  return StatusCode::SUCCESS; 
-}
-
-#ifdef ManagedMonitorToolBase_Uses_API_201401
-StatusCode TrigJpsiMonTool::proc() {
-  bool endOfRun = endOfRunFlag();
-#else
-StatusCode TrigJpsiMonTool::proc(bool /*endOfEventsBlock*/, bool /*endOfLumiBlock*/, bool endOfRun) {
-#endif
-  //  msg(MSG::DEBUG) << " ----- enter proc() ----- " << endmsg;
-  if(endOfRun) {
-    for( unsigned i=0 ; i<m_sequences.size() ; i++ ) { m_sequences[i]->finalize(); }
-  }
-  //  msg(MSG::DEBUG) << " ====== exit proc() ====== " << endmsg;
-  return StatusCode::SUCCESS; 
-}
-
-
-
-
diff --git a/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/src/components/TrigIDJpsiMonitoring_entries.cxx b/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/src/components/TrigIDJpsiMonitoring_entries.cxx
deleted file mode 100644
index 5c862ec16e6dd458d06f55f1eb1be02f4dd0ad5f..0000000000000000000000000000000000000000
--- a/Trigger/TrigMonitoring/TrigIDJpsiMonitoring/src/components/TrigIDJpsiMonitoring_entries.cxx
+++ /dev/null
@@ -1,4 +0,0 @@
-#include "TrigIDJpsiMonitoring/TrigJpsiMonTool.h"
-
-DECLARE_COMPONENT( TrigJpsiMonTool )
-
diff --git a/Trigger/TrigSteer/TrigOutputHandling/CMakeLists.txt b/Trigger/TrigSteer/TrigOutputHandling/CMakeLists.txt
index 3f575d8bf995ee417d43aa94d2d2837d9fdbf865..3d88e13fef4b8d9662e1b484367271041d4f3548 100644
--- a/Trigger/TrigSteer/TrigOutputHandling/CMakeLists.txt
+++ b/Trigger/TrigSteer/TrigOutputHandling/CMakeLists.txt
@@ -26,7 +26,7 @@ atlas_depends_on_subdirs( PUBLIC
                           Trigger/TrigMonitoring/TrigCostMonitorMT
                           Trigger/TrigAlgorithms/TrigPartialEventBuilding
 			  Trigger/TrigDataAccess/TrigSerializeTP
-			  Control/AthContainersRoot/AthContainersRoot
+			  Control/AthContainersRoot
                           )
 find_package( tdaq-common COMPONENTS eformat )
 find_package( Boost )
diff --git a/Trigger/TrigT1/TrigT1Interfaces/CMakeLists.txt b/Trigger/TrigT1/TrigT1Interfaces/CMakeLists.txt
index bae7f42f98d3e9f0299f8394ef6970021ae3362d..ee3aa5e7f115734299cda9c9a66be039b8e0128a 100644
--- a/Trigger/TrigT1/TrigT1Interfaces/CMakeLists.txt
+++ b/Trigger/TrigT1/TrigT1Interfaces/CMakeLists.txt
@@ -12,7 +12,8 @@ atlas_depends_on_subdirs( PUBLIC
                           Control/AthContainers
                           GaudiKernel
                           PRIVATE
-                          Trigger/TrigConfiguration/TrigConfL1Data )
+                          Trigger/TrigConfiguration/TrigConfL1Data
+                          AtlasTest/TestTools )
 
 # External dependencies:
 find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
@@ -33,3 +34,12 @@ atlas_add_dictionary( TrigT1InterfacesDict
                       INCLUDE_DIRS ${XERCESC_INCLUDE_DIRS} ${TDAQ-COMMON_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS}
                       LINK_LIBRARIES ${XERCESC_LIBRARIES} ${TDAQ-COMMON_LIBRARIES} ${ROOT_LIBRARIES} AthenaBaseComps AthContainers AthenaKernel GaudiKernel TrigConfL1Data TrigT1Interfaces )
 
+
+atlas_add_test( CPRoIDecoder_test
+                SOURCES test/CPRoIDecoder_test.cxx
+                LINK_LIBRARIES TrigT1Interfaces )
+
+
+atlas_add_test( JEPRoIDecoder_test
+                SOURCES test/JEPRoIDecoder_test.cxx
+                LINK_LIBRARIES TrigT1Interfaces )
diff --git a/Trigger/TrigT1/TrigT1Interfaces/share/CPRoIDecoder_test.ref b/Trigger/TrigT1/TrigT1Interfaces/share/CPRoIDecoder_test.ref
new file mode 100644
index 0000000000000000000000000000000000000000..867e87fc7efd1bb6daf89905f5482ec4fad3ba8f
--- /dev/null
+++ b/Trigger/TrigT1/TrigT1Interfaces/share/CPRoIDecoder_test.ref
@@ -0,0 +1,2 @@
+CPRoIDecoder_test
+test1
diff --git a/Trigger/TrigT1/TrigT1Interfaces/share/JEPRoIDecoder_test.ref b/Trigger/TrigT1/TrigT1Interfaces/share/JEPRoIDecoder_test.ref
new file mode 100644
index 0000000000000000000000000000000000000000..78e83dbbf873b5acd9e960b6b327bcbdac6ab3d5
--- /dev/null
+++ b/Trigger/TrigT1/TrigT1Interfaces/share/JEPRoIDecoder_test.ref
@@ -0,0 +1,2 @@
+JEPRoIDecoder_test
+test1
diff --git a/Trigger/TrigT1/TrigT1Interfaces/src/JEPRoIDecoder.cxx b/Trigger/TrigT1/TrigT1Interfaces/src/JEPRoIDecoder.cxx
index 3db7a968c2a22378e0a5c0eabd751fed96594a0f..630f3ba0f19f69d46d42e52dcb0913474a61d1e3 100644
--- a/Trigger/TrigT1/TrigT1Interfaces/src/JEPRoIDecoder.cxx
+++ b/Trigger/TrigT1/TrigT1Interfaces/src/JEPRoIDecoder.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
 */
 /***************************************************************************
                          JEPRoIDecoder.cxx  -  description
@@ -320,7 +320,7 @@ unsigned int LVL1::JEPRoIDecoder::jetRoIVersion( unsigned int word ) const {
       }
     } //endfor
 
-    return m_sumEtThreshPassedVec;
+    return m_mEtSigThreshPassedVec;
   }
 
   /** returns a vector containing the numbers of threshold passed i.e. if the vector contains 1,3,5 it
diff --git a/Trigger/TrigT1/TrigT1Interfaces/test/CPRoIDecoder_test.cxx b/Trigger/TrigT1/TrigT1Interfaces/test/CPRoIDecoder_test.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..748f350f526e1ba549e4d595350f682086636652
--- /dev/null
+++ b/Trigger/TrigT1/TrigT1Interfaces/test/CPRoIDecoder_test.cxx
@@ -0,0 +1,82 @@
+/*
+ * Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+ */
+/**
+ * @file TrigT1Interfaces/test/CPRoIDecoder_test.cxx
+ * @author scott snyder <snyder@bnl.gov>
+ * @date Mar, 2019
+ * @brief Unit tests for CPRoIDecoder.
+ */
+
+
+#undef NDEBUG
+#include "TrigT1Interfaces/CPRoIDecoder.h"
+#include "TestTools/FLOATassert.h"
+#include <iostream>
+#include <cassert>
+
+
+void test1()
+{
+  std::cout << "test1\n";
+
+  const double cratePhiSize = M_PI / 2.0;
+  const double fpgaPhiSize = M_PI / 16.0;
+  const double localCoordPhiSize = M_PI / 32.0;
+  const double cpmEtaSize = 0.4;
+  const double localCoordEtaSize = 0.1;
+
+  LVL1::CPRoIDecoder d;
+  assert (d.roiType(0x22345678) == LVL1::TrigT1CaloDefs::CpRoIWordType);
+  assert (d.roiType(0xa2345678) == LVL1::TrigT1CaloDefs::EMRoIWordType);
+  assert (d.roiType(0xb2345678) == LVL1::TrigT1CaloDefs::TauRoIWordType);
+  assert (d.roiType(0xc2345678) == LVL1::TrigT1CaloDefs::RoIWordTypeError);
+
+  // EMRoI, crate=2, module=11, chip=5, localcoord=3, et=0x48, isol=0x12
+  unsigned int word1 = 0xaaeb1248;
+  assert (d.roiType(word1) == LVL1::TrigT1CaloDefs::EMRoIWordType);
+  assert (d.crate(word1) == 2);
+  assert (d.module(word1) == 11);
+  assert (d.chip(word1) == 5);
+  assert (d.localcoord(word1) == 3);
+  assert (d.thresholdsPassed(word1) == (std::vector<unsigned>{}));
+  assert (d.et(word1) == 0x48);
+  assert (d.isolationWord(word1) == 0x12);
+  LVL1::CoordinateRange cr1 = d.coordinate (word1);
+  double phi1 = 2*cratePhiSize + 5*fpgaPhiSize + 2*localCoordPhiSize;
+  double eta1 = 3*cpmEtaSize + 2*localCoordEtaSize;
+  FLOAT_EQassert (cr1.phi(), phi1);
+  FLOAT_EQassert (cr1.phiRange().min(), phi1-localCoordPhiSize);
+  FLOAT_EQassert (cr1.phiRange().max(), phi1+localCoordPhiSize);
+  FLOAT_EQassert (cr1.eta(), eta1);
+  FLOAT_EQassert (cr1.etaRange().min(), eta1-localCoordEtaSize);
+  FLOAT_EQassert (cr1.etaRange().max(), eta1+localCoordEtaSize);
+
+  // CpRoI, crate=1, module=7, chip=2, localcoord=5, tp=4,7,10,13
+  unsigned int word2 = 0x17541248;
+  assert (d.roiType(word2) == LVL1::TrigT1CaloDefs::CpRoIWordType);
+  assert (d.crate(word2) == 1);
+  assert (d.module(word2) == 7);
+  assert (d.chip(word2) == 2);
+  assert (d.localcoord(word2) == 5);
+  assert (d.thresholdsPassed(word2) == (std::vector<unsigned>{4,7,10,13}));
+  assert (d.et(word2) == 0);
+  assert (d.isolationWord(word2) == 0);
+  LVL1::CoordinateRange cr2 = d.coordinate (word2);
+  double phi2 = 1*cratePhiSize + 2*fpgaPhiSize + localCoordPhiSize;
+  double eta2 = (-1)*cpmEtaSize + 4*localCoordEtaSize;
+  FLOAT_EQassert (cr2.phi(), phi2);
+  FLOAT_EQassert (cr2.phiRange().min(), phi2-localCoordPhiSize);
+  FLOAT_EQassert (cr2.phiRange().max(), phi2+localCoordPhiSize);
+  FLOAT_EQassert (cr2.eta(), eta2);
+  FLOAT_EQassert (cr2.etaRange().min(), eta2-localCoordEtaSize);
+  FLOAT_EQassert (cr2.etaRange().max(), eta2+localCoordEtaSize);
+}
+
+
+int main()
+{
+  std::cout << "CPRoIDecoder_test\n";
+  test1();
+  return 0;
+}
diff --git a/Trigger/TrigT1/TrigT1Interfaces/test/JEPRoIDecoder_test.cxx b/Trigger/TrigT1/TrigT1Interfaces/test/JEPRoIDecoder_test.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..f55b08dae9308d8197a94e35a5a66f1e67372513
--- /dev/null
+++ b/Trigger/TrigT1/TrigT1Interfaces/test/JEPRoIDecoder_test.cxx
@@ -0,0 +1,133 @@
+/*
+ * Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+ */
+/**
+ * @file TrigT1Interfaces/test/JEPRoIDecoder_test.cxx
+ * @author scott snyder <snyder@bnl.gov>
+ * @date Mar, 2019
+ * @brief Unit tests for JEPRoIDecoder.
+ */
+
+
+#undef NDEBUG
+#include "TrigT1Interfaces/JEPRoIDecoder.h"
+#include "TestTools/FLOATassert.h"
+#include <iostream>
+#include <cassert>
+
+
+void test1()
+{
+  std::cout << "test1\n";
+
+  const double jemPhiSize = M_PI / 2;
+  const double jePhiSize = M_PI / 16;
+  const double JEMEtaSize = 0.8;
+  const double jeEtaSize = 0.2;
+
+    LVL1::JEPRoIDecoder d;
+  assert (d.roiType(0x82345678) == LVL1::TrigT1CaloDefs::JetRoIWordType);
+  assert (d.roiType(0x02345678) == LVL1::TrigT1CaloDefs::JetRoIWordType);
+  assert (d.roiType(0xa2345678) == LVL1::TrigT1CaloDefs::JetEtRoIWordType);
+  assert (d.roiType(0x42345678) == LVL1::TrigT1CaloDefs::EnergyRoIWordType0);
+  assert (d.roiType(0x52345678) == LVL1::TrigT1CaloDefs::EnergyRoIWordType2);
+  assert (d.roiType(0x62345678) == LVL1::TrigT1CaloDefs::EnergyRoIWordType1);
+
+  assert (d.jetRoIVersion(0x82345678) == 1);
+  assert (d.jetRoIVersion(0x02345678) == 2);
+  assert (d.jetRoIVersion(0x32345678) == 999);
+
+  // run1; crate=0; jem=13; col=2, row=5 [frame=6 rl=2]; th=4,7; fth=2
+  unsigned int word1 = 0x8dd01248;
+  assert (d.crate(word1) == 0);
+  assert (d.module(word1) == 13);
+  assert (d.column(word1) == 2);
+  assert (d.row(word1) == 5);
+  assert (d.thresholdsPassed(word1)    == (std::vector<unsigned>{4,7}));
+  assert (d.fwdThresholdsPassed(word1) == (std::vector<unsigned>{2}));
+  assert (d.etLarge(word1) == 0);
+  assert (d.etSmall(word1) == 0);
+  const double phi1 = 2*jemPhiSize + 6*jePhiSize;
+  const double eta1 = JEMEtaSize + 3*jeEtaSize;
+  LVL1::CoordinateRange cr1 = d.coordinate(word1);
+  FLOAT_EQassert (cr1.phi(), phi1);
+  FLOAT_EQassert (cr1.phiRange().min(), phi1-jePhiSize);
+  FLOAT_EQassert (cr1.phiRange().max(), phi1+jePhiSize);
+  FLOAT_EQassert (cr1.eta(), eta1);
+  FLOAT_EQassert (cr1.etaRange().min(), eta1-jeEtaSize);
+  FLOAT_EQassert (cr1.etaRange().max(), eta1+jeEtaSize);
+
+  // run2; crate=1; jem=7; col=1, row=6 [frame=3 rl=1]; etLarge=0x0x248; etSmall=0x40
+  unsigned int word2 = 0x17681248;
+  assert (d.crate(word2) == 1);
+  assert (d.module(word2) == 7);
+  assert (d.column(word2) == 1);
+  assert (d.row(word2) == 6);
+  assert (d.thresholdsPassed(word2)    == (std::vector<unsigned>{}));
+  assert (d.fwdThresholdsPassed(word2) == (std::vector<unsigned>{}));
+  assert (d.etLarge(word2) == 0x248);
+  assert (d.etSmall(word2) == 0x04);
+  LVL1::CoordinateRange cr2 = d.coordinate(word2);
+  const double phi2 = jemPhiSize + 7*jePhiSize;
+  FLOAT_EQassert (cr2.phi(), phi2);
+  FLOAT_EQassert (cr2.phiRange().min(), phi2-jePhiSize);
+  FLOAT_EQassert (cr2.phiRange().max(), phi2+jePhiSize);
+  FLOAT_EQassert (cr2.etaRange().min(), 2.7);
+  FLOAT_EQassert (cr2.etaRange().max(), 3.2);
+  FLOAT_EQassert (cr2.eta(), 2.95);
+
+  // run2; crate=1; jem=8; col=0, row=3 [frame=1 rl=2]; etLarge=0x0x321; etSmall=0x10
+  unsigned int word3 = 0x18304321;
+  assert (d.crate(word3) == 1);
+  assert (d.module(word3) == 8);
+  assert (d.column(word3) == 0);
+  assert (d.row(word3) == 3);
+  assert (d.thresholdsPassed(word3)    == (std::vector<unsigned>{}));
+  assert (d.fwdThresholdsPassed(word3) == (std::vector<unsigned>{}));
+  assert (d.etLarge(word3) == 0x321);
+  assert (d.etSmall(word3) == 0x10);
+  LVL1::CoordinateRange cr3 = d.coordinate(word3);
+  const double phi3 = 3*jemPhiSize + 4*jePhiSize;
+  FLOAT_EQassert (cr3.phi(), phi3);
+  FLOAT_EQassert (cr3.phiRange().min(), phi3-jePhiSize);
+  FLOAT_EQassert (cr3.phiRange().max(), phi3+jePhiSize);
+  FLOAT_EQassert (cr3.etaRange().min(), -4.9);
+  FLOAT_EQassert (cr3.etaRange().max(), -2.9);
+  FLOAT_EQassert (cr3.eta(), -3.9);
+
+  unsigned int word10 = 0x40241234;
+  assert (d.energyX(word10) == 0x1234);
+  assert (d.energyY(word10) == 0);
+  assert (d.energyT(word10) == 0);
+  assert (d.energyOverflow(word10) == false);
+  assert (d.mEtSigThresholdsPassed(word10) == (std::vector<unsigned>{3,6}));
+  assert (d.mEtSigThresholdPassed(word10, 2) == true);
+  assert (d.mEtSigThresholdPassed(word10, 5) == true);
+  assert (d.mEtSigThresholdPassed(word10, 4) == false);
+
+  unsigned int word11 = 0x6013d234;
+  assert (d.energyX(word11) == 0);
+  assert (d.energyY(word11) == -11724);
+  assert (d.energyT(word11) == 0);
+  assert (d.energyOverflow(word11) == true);
+  assert (d.etSumThresholdsPassed(word11) == (std::vector<unsigned>{1,2,5}));
+  assert (d.sumEtThresholdPassed(word11, 1) == true);
+  assert (d.sumEtThresholdPassed(word11, 2) == false);
+
+  unsigned int word12 = 0x50c2a856;
+  assert (d.energyX(word12) == 0);
+  assert (d.energyY(word12) == 0);
+  assert (d.energyT(word12) == 0x2856);
+  assert (d.energyOverflow(word12) == true);
+  assert (d.etMissThresholdsPassed(word12) == (std::vector<unsigned>{2,7,8}));
+  assert (d.etMissThresholdPassed(word12, 5) == false);
+  assert (d.etMissThresholdPassed(word12, 6) == true);
+}
+
+
+int main()
+{
+  std::cout << "JEPRoIDecoder_test\n";
+  test1();
+  return 0;
+}
diff --git a/Trigger/TrigTools/TrigJPsiTools/CMakeLists.txt b/Trigger/TrigTools/TrigJPsiTools/CMakeLists.txt
deleted file mode 100644
index c9eb2e42e23c865c36c848583744abd438da201e..0000000000000000000000000000000000000000
--- a/Trigger/TrigTools/TrigJPsiTools/CMakeLists.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-################################################################################
-# Package: TrigJPsiTools
-################################################################################
-
-# Declare the package name:
-atlas_subdir( TrigJPsiTools )
-
-# Declare the package's dependencies:
-atlas_depends_on_subdirs( PUBLIC
-                          Calorimeter/CaloEvent
-                          GaudiKernel
-                          Reconstruction/MuonIdentification/muonEvent
-                          Reconstruction/Particle
-                          Reconstruction/egamma/egammaEvent
-                          Trigger/TrigAnalysis/TrigEffJpsiTools
-                          Trigger/TrigAnalysis/TrigInDetAnalysisUtils
-                          Trigger/TrigEvent/TrigInDetEvent
-                          Trigger/TrigEvent/TrigMuonEvent )
-
-# External dependencies:
-find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread MathMore Minuit Minuit2 Matrix Physics HistPainter Rint )
-
-# Component(s) in the package:
-atlas_add_library( TrigJPsiTools
-                   src/*.cxx
-                   PUBLIC_HEADERS TrigJPsiTools
-                   PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
-                   LINK_LIBRARIES CaloEvent GaudiKernel muonEvent Particle egammaEvent TrigInDetAnalysisUtils TrigInDetEvent TrigMuonEvent
-                   PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} )
-
diff --git a/Trigger/TrigTools/TrigJPsiTools/TrigJPsiTools/DiMuonTool.h b/Trigger/TrigTools/TrigJPsiTools/TrigJPsiTools/DiMuonTool.h
deleted file mode 100644
index a48fdf2c7924eb3afd9ada9b69c25f9a10ca5b70..0000000000000000000000000000000000000000
--- a/Trigger/TrigTools/TrigJPsiTools/TrigJPsiTools/DiMuonTool.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef DiMuonTool_H
-#define DiMuonTool_H
-
-// ***********************************************************************
-// DiMuonTool.h
-// AUTHORS: Weina Ji (weina.ji@cern.ch)
-//          Peter Wijeratne (paw@hep.ucl.ac.uk)
-// ***********************************************************************
-
-#include "Particle/TrackParticle.h"
-#include "TrigEffJpsiTools/ITrigEffJpsiTools.h"
-#include "GaudiKernel/ToolHandle.h"
-
-#include "TrigJPsiTools/MuonTrackSelector.h"
-
-class DiMuonTool : public MuonTrackSelector
-{
- public:
-  DiMuonTool();
-  ~DiMuonTool();
-
-  std::vector<const Wrapper::MuonTrack*> tracks() { return m_tracks; }
-    
-  double InvariantMass();
-  double CurvatureDiff();
-  double pt();
-  double phi();
-  double eta();
-
-  const Wrapper::MuonTrack* TaggedTrack();
-  const Wrapper::MuonTrack* ProbedTrack();
-
-  bool doTagAndProbe();
-  void clear();
-
-  //Inputs given in MakeDiMuonsTool
-  void setTracks(std::vector<const Wrapper::MuonTrack*> tracksIn) {m_tracks=tracksIn;}
-  void setTracks(const Wrapper::MuonTrack* track1, const Wrapper::MuonTrack* track2) {m_tracks.push_back(track1); m_tracks.push_back(track2);}
-
-  void setTagAndProbe(bool doTAndP) {m_doTagAndProbe=doTAndP;}
-  void setTrackMass(double mass) {m_trackMass=mass;} 
-  double getTrackMass() const { return m_trackMass; } 
-
-  const std::vector<const Wrapper::MuonTrack*>& tracks() const { return m_tracks; }
-
- private:
-
-  std::vector<const Wrapper::MuonTrack*> m_tracks;
-
-  bool m_doTagAndProbe;
-
-  double m_trackMass;
-};
-
-
-
-inline std::ostream& operator<<( std::ostream& s, const DiMuonTool& t) {
-  return s << "[ mass = " << t.getTrackMass() << " m_tracks size= " << t.tracks().size() << " ] ";
-}
-
-
-#endif
diff --git a/Trigger/TrigTools/TrigJPsiTools/TrigJPsiTools/MakeDiMuonsTool.h b/Trigger/TrigTools/TrigJPsiTools/TrigJPsiTools/MakeDiMuonsTool.h
deleted file mode 100644
index e04cd7ee568509f997cc4e0dab2b1566d5bbb2b8..0000000000000000000000000000000000000000
--- a/Trigger/TrigTools/TrigJPsiTools/TrigJPsiTools/MakeDiMuonsTool.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-#ifndef MakeDiMuonsTool_H
-#define MakeDiMuonsTool_H
-
-// ***********************************************************************
-// MakeDiMuonsTool.h
-// AUTHORS: Weina Ji (weina.ji@cern.ch)
-//          Peter Wijeratne (paw@hep.ucl.ac.uk)
-//          Christian Gutschow (chris.g@cern.ch)
-// ***********************************************************************
-#include "TrigInDetEvent/TrigInDetTrackCollection.h"
-#include "GaudiKernel/StatusCode.h"
-#include "TrigEffJpsiTools/ITrigEffJpsiTools.h"
-#include "GaudiKernel/ToolHandle.h"
-#include "muonEvent/Muon.h"
-#include "muonEvent/MuonContainer.h"
-#include "muonEvent/MuonParamDefs.h"
-#include "TrigJPsiTools/DiMuonTool.h"
-#include "TrigJPsiTools/MuonTrackSelector.h"
-
-#include "TrigMuonEvent/TrigMuonEFTrack.h"
-#include "TrigMuonEvent/TrigMuonEFCbTrack.h"
-#include "TrigMuonEvent/TrigMuonEFInfoTrack.h"
-
-class MakeDiMuonsTool
-{
- public:
-  MakeDiMuonsTool();
-  virtual ~MakeDiMuonsTool();
-  bool initializeTools();
-  void initializeMembers();
-
-  void setProbes(const std::vector<const CaloCluster*>& CombinedCollection,
-                 const std::vector<int>& roi);
-  void setProbes(const std::vector< const TrigMuonEFTrack*>& trksIn,
-                 const std::vector<int>& roi);
-  void setProbes(const std::vector< const Rec::TrackParticle* >& trksIn);
-  void setProbes(const TrigInDetTrackCollection* trigCollection);
-
-  void setTags(const Analysis::MuonContainer* muonsIn);
-  void setTags(const std::vector<const TrigMuonEFCbTrack*>& muonsIn,
-               const std::vector<int>& roi);
-  void setTags(const std::vector< const egamma*>& trksIn,
-               const std::vector<int>& roi);
-
-  void doTagAndProbe(bool doTagAndProbe);
-  void useTrigger(bool useTrigger);
-  void setPtcut(double ptcut);
-  void setTagPtcut(double ptcut);
-  void setEtacut(double etacut);
-  void setTagEtacut(double etacut);
-  void setTrackMass(double muonmass);
-  void setUpperInvMassLimit(double upperlimit);
-  void setLowerInvMassLimit(double lowerlimit);
-  void makePairs(const std::vector<Wrapper::MuonTrack*>& Tracks);
-  void makePairs(const std::vector<Wrapper::MuonTrack*>& taggedTracks,std::vector<Wrapper::MuonTrack*> probedTracks);
-  std::vector<DiMuonTool*> execute();
-  void TagMuons( const std::vector< const TrigMuonEFCbTrack* >& combinedCollection,
-                 const std::vector<int>& roi );
-  void TagMuons( const Analysis::MuonContainer* muonCollection );
-
-  bool isTriggeredEF(const Rec::TrackParticle* track, std::string chainName) const;
-  bool isTriggeredL2(const Rec::TrackParticle* track, std::string chainName) const;
-  bool isTriggeredL1(const Rec::TrackParticle* track, std::string triggerName) const;
-	
-  void clear();
-
- private:
-  double m_ptcut;
-  double m_tagptcut;
-  double m_etacut;
-  double m_tagetacut;
-  bool   m_TagAndProbe;
-
-  //bool   m_runOnline;
-
-  bool   m_useTrigger;
-  //double m_invmass;
-  double m_trkmass;
-  double m_upperlimit;
-  double m_lowerlimit;
-  std::vector<Wrapper::MuonTrack*> m_tracks;
-  const Analysis::MuonContainer* m_MuonCollection;
-  std::vector<const TrigMuonEFCbTrack*> m_CombinedCollection;
-  const TrigInDetTrackCollection* m_TrigCollection;
-  std::vector<Wrapper::MuonTrack*> m_taggedMuons;
-  std::vector<DiMuonTool*> m_pairs; 
-  ToolHandle<ITrigEffJpsiTools> m_trigEffJpsiTools; 
-  MuonTrackSelector m_selectaProbe;
-  MuonTrackSelector m_selectaTag;
-};
-
-#endif
diff --git a/Trigger/TrigTools/TrigJPsiTools/TrigJPsiTools/MuonTrack.h b/Trigger/TrigTools/TrigJPsiTools/TrigJPsiTools/MuonTrack.h
deleted file mode 100644
index cdbe208f2c4ef1255ddaf8e91169913bad5c3d4b..0000000000000000000000000000000000000000
--- a/Trigger/TrigTools/TrigJPsiTools/TrigJPsiTools/MuonTrack.h
+++ /dev/null
@@ -1,151 +0,0 @@
-// emacs: this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// File name: MuonTrack.h
-// Description: General muon track class
-// Author: Peter Wijeratne (paw@hep.ucl.ac.uk)
-
-#ifndef MUONTRACK_H
-#define MUONTRACK_H
-
-#include <iostream>
-#include <string>
-
-#include "Particle/TrackParticle.h"
-
-namespace Wrapper{
-
-  class MuonTrack
-    {
-
-    public:
-
-      MuonTrack() { ; }
-      MuonTrack(double  eta, double  phi, double  z0, double  a0, double  pT, 
-		double px, double py, double pz, double charge, double chi2, double chi2prob, 
-		double deta, double dphi, double dz0, double da0, double dpT, 
-		int nCscHitsEta=0, int nCscHitsPhi=0, int nTgcHitsEta=0, int nTgcHitsPhi=0,
-		int nRpcHitsEta=0,  int nRpcHitsPhi=0, int nMdtHits=0,
-		unsigned hitPattern=0,
-		unsigned multiPattern=0,
-		int author=0,
-		const Rec::TrackParticle* match=0,
-		int roiNum=0) :
-	m_eta(eta),   m_phi(phi),   m_z0(z0),   m_a0(a0),   m_pT(pT), 
-	m_px(px), m_py(py), m_pz(pz), m_charge(charge), m_chi2(chi2), m_chi2prob(chi2prob),
-	m_deta(deta), m_dphi(dphi), m_dz0(dz0), m_da0(da0), m_dpT(dpT),
-	m_nCscHitsEta(nCscHitsEta), m_nCscHitsPhi(nCscHitsPhi), m_nTgcHitsEta(nTgcHitsEta),  m_nTgcHitsPhi(nTgcHitsPhi),
-	m_nRpcHitsEta(nRpcHitsEta), m_nRpcHitsPhi(nRpcHitsPhi), m_nMdtHits(nMdtHits),
-	m_hitPattern(hitPattern),
-	m_multiPattern(multiPattern),
-	m_author(author),
-	m_match(match),
-	m_roiNum(roiNum)
-      {} 
-      
-      virtual ~MuonTrack() { ; }
-
-      double eta() const { return m_eta; }
-      double phi() const { return m_phi; }
-      double z0()  const { return m_z0; }
-      double a0()  const { return m_a0; }
-      double pt()  const { return m_pT; }
-      double px() const { return m_px; }
-      double py() const { return m_py; }
-      double pz() const { return m_pz; }
-      
-      double charge() const { return m_charge; }
-      
-      double chi2() const {return m_chi2;}
-      double chi2prob() const {	return m_chi2prob; }
-  
-      double deta() const {return m_deta;}
-      double dphi() const {return m_dphi;}
-      double dz0()  const {return m_dz0;}
-      double da0()  const {return m_da0;}
-      double dpT()  const {return m_dpT;}  
-
-      int nCscHitsPhi()  const  { return m_nCscHitsPhi; }
-      int nTgcHitsEta()    const  { return m_nTgcHitsEta; }
-      int nTgcHitsPhi()     const  { return m_nTgcHitsPhi; }
-      int nCscHitsEta() const  { return m_nCscHitsEta; }
-      int nRpcHitsEta()  const {return m_nRpcHitsEta;}
-      int nRpcHitsPhi()     const {return m_nRpcHitsPhi;}  
-      int nMdtHits() const { return m_nMdtHits; }
-      
-      unsigned hitPattern()   const { return m_hitPattern; } 
-      unsigned multiPattern() const { return m_multiPattern; } 
-
-      int author() const { return m_author; }  
-
-      const Rec::TrackParticle* match() const { return m_match; }
-
-      int roiNum() const { return m_roiNum; }
-
-    public:
-
-      bool operator==(const MuonTrack& t) { 
-    
-	if( m_author != t.m_author ) return false;
-    
-	if( m_eta != t.m_eta )  return false;
-	if( m_phi != t.m_phi )  return false;
-	if( m_z0  != t.m_z0 )   return false;
-	if( m_a0  != t.m_a0 )   return false;
-	if( m_pT  != t.m_pT )   return false;
-  	     
-	if( m_nCscHitsEta  != t.m_nCscHitsEta ) return false;
-	if( m_nCscHitsPhi   != t.m_nCscHitsPhi )  return false;
-	if( m_nTgcHitsEta     != t.m_nTgcHitsEta )    return false;
-	if( m_nTgcHitsPhi      != t.m_nTgcHitsPhi )     return false;
-	if( m_nRpcHitsEta   != t.m_nRpcHitsEta )  return false;
-	if( m_nRpcHitsPhi      != t.m_nRpcHitsPhi )     return false;
-	if ( m_hitPattern != t.m_hitPattern ) return false;
-	if ( m_multiPattern != t.m_multiPattern ) return false;
-    
-	return true;
-      }
-
-    protected:
-  
-      // Track parameters
-      double m_eta,  m_phi,  m_z0,  m_a0,  m_pT, m_px, m_py, m_pz, m_charge, m_chi2, m_chi2prob;
-      double m_deta, m_dphi, m_dz0, m_da0, m_dpT;
-
-      // Track hits
-      int m_nCscHitsEta, m_nCscHitsPhi, m_nTgcHitsEta, m_nTgcHitsPhi;
-      int m_nRpcHitsEta, m_nRpcHitsPhi;
-      int m_nMdtHits;
-  
-      // hit bit pattern
-      unsigned m_hitPattern;
-      unsigned m_multiPattern;
-
-      //Track author;
-      int m_author;  
-
-      //matched
-      const Rec::TrackParticle* m_match;
-
-      //roi number
-      int m_roiNum;
-
-    };
-
-}
-
-inline std::ostream& operator<<( std::ostream& s, const Wrapper::MuonTrack& t) { 
-  return s<< "[ " 
-	  << "\teta=" << t.eta()
-	  << "\tphi=" << t.phi()
-	  << "\tz0="  << t.z0()
-	  << "\tpT="  << t.pt()
-	  << "\td0="  << t.a0() 
-	  << "\thp=0x"  << std::hex << t.hitPattern() << std::dec << "  "
-	  << " ]";
-}
-
-#endif
diff --git a/Trigger/TrigTools/TrigJPsiTools/TrigJPsiTools/MuonTrackAdder.h b/Trigger/TrigTools/TrigJPsiTools/TrigJPsiTools/MuonTrackAdder.h
deleted file mode 100644
index cbf6846bd72b65c1b17aa4a2f66f79c504f555b8..0000000000000000000000000000000000000000
--- a/Trigger/TrigTools/TrigJPsiTools/TrigJPsiTools/MuonTrackAdder.h
+++ /dev/null
@@ -1,43 +0,0 @@
-// emacs: this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// file name: MuonTrackAdder.h
-// description: Add muon tracks to member vector
-// author: Peter Wijeratne (paw@hep.ucl.ac.uk)
-
-#ifndef MUONTRACKADDER_H
-#define MUONTRACKADDER_H
-
-#include "TrigJPsiTools/MuonTrack.h"
-
-#include <vector>
-
-class MuonTrackAdder{
-
- public:
-
-  MuonTrackAdder() { }
-  virtual ~MuonTrackAdder() { }
-
-  virtual bool muonAdder( Wrapper::MuonTrack* t ) {
-    if( t ){
-	m_tracks.push_back(t); 
-	return true; 
-    }
-    else return false;
-  }
-
-  const std::vector< Wrapper::MuonTrack* >& tracks() const { return m_tracks; }
-
-  virtual void clear() { for(unsigned i=0; i--; ) delete m_tracks[i]; m_tracks.clear(); } 
-
-protected:
-  
-  std::vector<Wrapper::MuonTrack*> m_tracks;
-
-};
-
-#endif
diff --git a/Trigger/TrigTools/TrigJPsiTools/TrigJPsiTools/MuonTrackSelector.h b/Trigger/TrigTools/TrigJPsiTools/TrigJPsiTools/MuonTrackSelector.h
deleted file mode 100644
index e691eae4680e127138b4a47e46e0ead252d63bdd..0000000000000000000000000000000000000000
--- a/Trigger/TrigTools/TrigJPsiTools/TrigJPsiTools/MuonTrackSelector.h
+++ /dev/null
@@ -1,371 +0,0 @@
-// emacs: this is -*- c++ -*-
-
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// file name: MuonTrackSelector.h
-// description: Take input tracks and wrap in generic track object
-// author: Peter Wijeratne (paw@hep.ucl.ac.uk)
-
-#ifndef MUONTRACKSELECTOR_H
-#define MUONTRACKSELECTOR_H
-
-// L2 tracks
-#include "TrigInDetEvent/TrigInDetTrack.h"
-
-// offline and EF
-#include "Particle/TrackParticle.h"
-
-// online EF muons
-#include "TrigMuonEvent/TrigMuonEFTrack.h"
-#include "TrigMuonEvent/TrigMuonEFCbTrack.h"
-#include "CaloEvent/CaloCluster.h"
-
-#include "egammaEvent/egamma.h"
-
-// TrigJpsiTool classes
-#include "TrigJPsiTools/MuonTrackAdder.h"
-
-
-class MuonTrackSelector : public MuonTrackAdder {
-
- public:
-
-  MuonTrackSelector () : MuonTrackAdder() { }
-  ~MuonTrackSelector () { }
-
-  virtual void cleanup() { 
-
-    for (int i=m_tracks.size(); i--; ){
-      delete m_tracks[i];
-    }     
-    m_tracks.clear(); 
-
-  }
-
-  void muonSelector(const egamma* track, int roi) {
-
-    if( track ) {
-      double pT  = track->pt(); 
-      double eta = track->eta();
-      double phi = track->phi();
-      double z0  = 0;//track->z0();
-      double d0  = 0;//track->d0();
-
-      double px = track->px();
-      double py = track->py();
-      double pz = track->pz();
-      
-      double charge = track->charge();
-      
-      double deta = 1;
-      double dphi = 1;
-      double dz0  = 1;
-      double dd0  = 1;
-      double dpT  = 1;
-          
-      double chi2 = 0;
-      double chi2prob = 0;
-
-      int nCscHitsEta = 0;
-      int nCscHitsPhi = 0;
-      int nTgcHitsEta = 0;
-      int nTgcHitsPhi = 0;
-      int nRpcHitsEta = 0;
-      int nRpcHitsPhi = 0;
-      int nMdtHits = 0;
-          
-      unsigned bitmap = 0;
-      unsigned trackAuthor = 0;
-
-      Wrapper::MuonTrack* muon = new Wrapper::MuonTrack(eta, phi, z0, d0, pT, 
-							                                          px, py, pz, charge, chi2, chi2prob,
-                                                        deta, dphi, dz0, dd0, dpT,
-                                         							  nCscHitsEta, nCscHitsPhi, nTgcHitsEta, nTgcHitsPhi,
-                                                        nRpcHitsEta, nRpcHitsPhi, nMdtHits,
-                                                        bitmap, 0, trackAuthor, NULL, roi);
-      
-      if ( !muonAdder( muon ) ) delete muon;
-
-    }
-  }
-
-  void muonSelector(const CaloCluster* track, int roi=0) {
-
-    if( track ) {
-      
-      double pT  = track->pt(); 
-      double eta = track->eta();
-      double phi = track->phi();
-      double z0  = 0;//track->z0();
-      double d0  = 0;//track->d0();
-
-      double px = track->px();
-      double py = track->py();
-      double pz = track->pz();
-
-      double charge = 1.;
-      
-      if( pT < 0 ) {
-        pT *= -1;
-        charge *= -1;
-      }
-
-      double deta = 1;
-      double dphi = 1;
-      double dz0  = 1;
-      double dd0  = 1;
-      double dpT  = 1;
-          
-      double chi2 = 0;
-      double chi2prob = 0;
-
-      int nCscHitsEta = 0;
-      int nCscHitsPhi = 0;
-      int nTgcHitsEta = 0;
-      int nTgcHitsPhi = 0;
-      int nRpcHitsEta = 0;
-      int nRpcHitsPhi = 0;
-      int nMdtHits = 0;
-          
-      unsigned bitmap = 0;
-      unsigned trackAuthor = 0;
-
-      Wrapper::MuonTrack* muon = new Wrapper::MuonTrack(eta, phi, z0, d0, pT, 
-							                                          px, py, pz, charge, chi2, chi2prob,
-                                                        deta, dphi, dz0, dd0, dpT,
-                                         							  nCscHitsEta, nCscHitsPhi, nTgcHitsEta, nTgcHitsPhi,
-                                                        nRpcHitsEta, nRpcHitsPhi, nMdtHits,
-                                                        bitmap, 0, trackAuthor, NULL, roi);
-      
-      if ( !muonAdder( muon ) ) delete muon;
-
-    }
-  }
-
-  void muonSelector( const TrigMuonEFTrack* track, const Rec::TrackParticle* match=0, int roi=0){
-    
-    if( track ){
-
-      //      std::cout << "ZZZ roi = " << roi << std::endl;
-      
-	double pT  = track->pt(); 
-	double eta = track->eta();
-	double phi = track->phi();
-	double z0  = track->z0();
-	double d0  = track->d0();
-
-	double px = track->px();
-	double py = track->py();
-	double pz = track->pz();
-	
-	double charge = track->charge();
-  
-	if ( pT < 0 ) pT *= -1;
-
-	double deta = 1;
-	double dphi = 1;
-	double dz0  = 1;
-	double dd0  = 1;
-	double dpT  = 1;
-	    
-	double chi2 = track->chi2();
-	double chi2prob = track->chi2prob();
-          
-	// Check number of hits
-	// NB: a spacepoint is two offline "hits", so a pixel spacepoint is really 
-	// 2 "hits" and an offline SCT "hit" is really a 1D cluster, so two intersetcting
-	// stereo clusters making a spacepoint are two "hits"
-
-	int nCscHitsEta = track->NCscHitsEta(); 
-	int nCscHitsPhi = track->NCscHitsPhi();  
-	int nTgcHitsEta = track->NTgcHitsEta(); 
-	int nTgcHitsPhi = track->NTgcHitsPhi();
-	int nRpcHitsEta = track->NRpcHitsEta();
-	int nRpcHitsPhi = track->NRpcHitsPhi();
-	int nMdtHits = track->NMdtHits();
-      
-	unsigned bitmap = 0;
-	unsigned trackAuthor = 0;
-
-#if 0      
-	std::cout << "\t\t\tPAW MUON track" 
-		  << "\teta=" << eta  // << " +- " << (*trackitr)->params()->deta()
-		  << "\tphi=" << phi  // << " +- " << (*trackitr)->params()->dphi()
-		  << "\tz0="  << z0 
-		  << "\tpT="  << pT // << "\t( " << 1/qoverp << ")"
-		  << "\td0="  << d0
-		  << "\tNCsc=" << nCscHitsEta 
-		  << "\tNTgc=" << nTgcHitsEta 
-		  << "\tNRpc=" << nRpcHitsEta
-		  << std::endl;
-     
-	// Create and save Track
-#endif
-
-	Wrapper::MuonTrack* muon = new Wrapper::MuonTrack(eta, phi, z0, d0, pT, 
-							  px, py, pz, charge, chi2, chi2prob,
-							  deta, dphi, dz0, dd0, dpT,
-							  nCscHitsEta, nCscHitsPhi, nTgcHitsEta, nTgcHitsPhi,
-							  nRpcHitsEta, nRpcHitsPhi, nMdtHits,
-							  bitmap, 0,
-							  trackAuthor, match, roi);
-      
-	if ( !muonAdder( muon ) ) delete muon;
-
-    }
-
-  }
-
-  void muonSelector( const Rec::TrackParticle* track ){
-    
-    if( track ){
-
-	const Trk::Perigee* measPer = track->measuredPerigee();
-      
-	double pT  = measPer->pT(); 
-	double eta = measPer->eta();
-	double phi = measPer->parameters()[Trk::phi0];
-	double z0  = measPer->parameters()[Trk::z0];
-	double d0  = measPer->parameters()[Trk::d0];
-  
-	double px = track->px();
-	double py = track->py();
-	double pz = track->pz();
-	
-	double charge = track->charge();
-
-	if ( measPer->parameters()[Trk::qOverP]<0 ) pT *= -1;
-
-	double deta = 1;
-	double dphi = 1;
-	double dz0  = 1;
-	double dd0  = 1;
-	double dpT  = 1;
-	    
-	double chi2 = 0;
-          
-	// Check number of hits
-	// NB: a spacepoint is two offline "hits", so a pixel spacepoint is really 
-	// 2 "hits" and an offline SCT "hit" is really a 1D cluster, so two intersetcting
-	// stereo clusters making a spacepoint are two "hits"
-	const Trk::TrackSummary* summary = track->trackSummary();
-	int nBlayerHits = 2*summary->get(Trk::numberOfInnermostPixelLayerHits);
-	int nPixelHits  = 2*summary->get(Trk::numberOfPixelHits);  
-	int nSctHits    = summary->get(Trk::numberOfSCTHits); 
-	int nStrawHits  = summary->get(Trk::numberOfTRTHits);
-	int nTrHits     = summary->get(Trk::numberOfTRTHighThresholdHits);
-	
-	int nSiHits     = nPixelHits + nSctHits;
-      
-	unsigned bitmap = 0;
-      
-	int fitter = track->info().trackFitter();
-	std::string dumpinfo = track->info().dumpInfo();
-      
-	int trackAuthor = -1; 
-	if ( fitter>0 && fitter<Trk::TrackInfo::NumberOfTrackFitters ) {
-	  if      ( dumpinfo.find("TRTStandalone")!=std::string::npos)        trackAuthor = 2;
-	  else if ( dumpinfo.find("TRTSeededTrackFinder")!=std::string::npos) trackAuthor = 1;
-	  else                                                                trackAuthor = 0;
-	}
-
-#if 0      
-	std::cout << "\t\t\tPAW MUON track" 
-		  << "\teta=" << eta  // << " +- " << (*trackitr)->params()->deta()
-		  << "\tphi=" << phi  // << " +- " << (*trackitr)->params()->dphi()
-		  << "\tz0="  << z0 
-		  << "\tpT="  << pT // << "\t( " << 1/qoverp << ")"
-		  << "\td0="  << d0
-		  << "\tNsi=" << nSiHits 
-		  << "\tNtrt=" << nTrHits 
-		  << "\tNstr=" << nStrawHits
-		  << "\tauthor=" << trackAuthor
-		  << std::endl;
-#endif	
-	// Create and save Track
-
-	Wrapper::MuonTrack* muon = new Wrapper::MuonTrack(eta, phi, z0, d0, pT, 
-							  px, py, pz, charge, chi2,
-							  deta, dphi, dz0, dd0, dpT,
-							  nBlayerHits, nPixelHits, nSctHits, nSiHits,
-							  nStrawHits, nTrHits, bitmap, 0,
-							  trackAuthor);
-      
-	if ( !muonAdder( muon ) ) delete muon;
-
-    }
-    
-  }
-
-  void muonSelector( const TrigInDetTrack* track ) {     
-    // do the track extraction stuff here....
-    if ( track ) { 
-
-	double eta    = track->param()->eta();
-	double phi    = track->param()->phi0();
-	double z0     = track->param()->z0(); 
-	double pT     = track->param()->pT(); 
-	double d0     = track->param()->a0();
-
-	double deta    = track->param()->eeta();
-	double dphi    = track->param()->ephi0();
-	double dz0     = track->param()->ez0(); 
-	double dpT     = track->param()->epT(); 
-	double dd0     = track->param()->ea0();
-
-	int   algoid  = track->algorithmId(); 	      
-
-	int nBlayerHits = (track->HitPattern() & 0x1);
-	int nPixelHits  = 2 * track->NPixelSpacePoints();  // NB: for comparison with offline 
-	int nSctHits    = 2 * track->NSCT_SpacePoints();   //     a spacepoint is 2 "hits"
-	int nStrawHits  =  track->NStrawHits();
-	int nTrHits     =  track->NTRHits();
-	           
-	int nSiHits     = nPixelHits + nSctHits;
-
-	unsigned hitPattern = track->HitPattern();
-	unsigned multiPattern = 0;
-
-	double chi2    = track->chi2();
-	// The DoF information is not available in LVL2 track EDM
-
-	//	if ( (*trackitr)->siSpacePoints() ) { 
-	//	    NSiHits = (*trackitr)->siSpacePoints()->size();
-	//	    if ( (*trackitr)->siSpacePoints()->at(0)->layer()==0 ) NBLayerHits=1; 
-	//	}
-
-	//	std::cout << "testing trigger track " << (*trackitr) << std::endl;
-
-#if 0
-	std::cout << "\t\t\tSUTT ID track" 
-		  << "\teta=" << eta  // << " +- " << (*trackitr)->params()->deta()
-		  << "\tphi=" << phi  // << " +- " << (*trackitr)->params()->dphi()
-		  << "\tz0="  << z0 
-		  << "\tpT="  << pT // << "\t( " << 1/qoverp << ")"
-		  << "\td0="  << d0
-		  << "\tNtrt=" << nTrHits 
-		  << "\tNstr=" << nStrawHits 
-		  << "\tid="  << algoid 
-		  << "\thp=0x" << std::hex << track->HitPattern() << std::dec 
-		  << std::endl;
-#endif
-
-	Wrapper::MuonTrack* muon = new Wrapper::MuonTrack(  eta,  phi,  z0,  d0,  pT, chi2, 
-							    deta, dphi, dz0, dd0, dpT, 
-							    nBlayerHits, nPixelHits, nSctHits, nSiHits, 
-							    nStrawHits, nTrHits, 
-							    hitPattern, multiPattern, 
-							    algoid ) ; 
-
-	//	std::cout << "SUTT ID track " << *t << "\t0x" << std::hex << track->HitPattern() << std::dec << std::endl;
-
-	if ( !muonAdder( muon ) ) delete muon;
-
-    }
-  }
-
-};
-
-#endif
diff --git a/Trigger/TrigTools/TrigJPsiTools/src/DiMuonTool.cxx b/Trigger/TrigTools/TrigJPsiTools/src/DiMuonTool.cxx
deleted file mode 100644
index 2fe75f9b082ced0eb3e244b6e8c3c0c21218c6a5..0000000000000000000000000000000000000000
--- a/Trigger/TrigTools/TrigJPsiTools/src/DiMuonTool.cxx
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// ***********************************************************************
-// DiMuonTool.cxx
-// Creates an object holding a pair of tracks
-
-// AUTHORS: Weina Ji (weina.ji@cern.ch)
-//          Peter Wijeratne (paw@hep.ucl.ac.uk)
-// ***********************************************************************
-
-#include "TLorentzVector.h"
-#include "TrigJPsiTools/DiMuonTool.h"
-
-#include "TrigMuonEvent/TrigMuonEFTrack.h"
-#include "TrigMuonEvent/TrigMuonEFCbTrack.h"
-
-DiMuonTool::DiMuonTool()
-{
-
-  m_doTagAndProbe=false;
-  m_trackMass = 105.66*CLHEP::MeV;
-  m_tracks.clear();
-
-}
-
-DiMuonTool::~DiMuonTool() { }
-
-const Wrapper::MuonTrack* DiMuonTool::TaggedTrack() { 
-  /*std::cout << "DiMuonTool::TaggedTrack -- m_tracks size: "    << m_tracks.size() << std::endl;
-  std::cout << "DiMuonTool::TaggedTrack -- m_tracks[0]: "      << m_tracks[0] << std::endl;
-  std::cout << "DiMuonTool::TaggedTrack -- m_tracks[1]: "      << m_tracks[1] << std::endl;
-  std::cout << "DiMuonTool::TaggedTrack -- return m_tracks[0]" << std::endl;*/
-  return m_tracks[0];
-}
-
-const Wrapper::MuonTrack* DiMuonTool::ProbedTrack() {
-  /*std::cout << "DiMuonTool::ProbedTrack -- m_tracks size: "    << m_tracks.size() << std::endl;
-  std::cout << "DiMuonTool::ProbedTrack -- m_tracks[0]: "      << m_tracks[0] << std::endl;
-  std::cout << "DiMuonTool::ProbedTrack -- m_tracks[1]: "      << m_tracks[1] << std::endl;
-  std::cout << "DiMuonTool::ProbedTrack -- return m_tracks[1]" << std::endl;*/
-  return m_tracks[1];
-}
-
-bool DiMuonTool::doTagAndProbe() {return m_doTagAndProbe;}
-double DiMuonTool::InvariantMass() {
-  double invmass;
-  TLorentzVector particle1,particle2,v;
-  
-  if (m_tracks.size()==2) {
-    const Wrapper::MuonTrack* track1=m_tracks[0];
-    const Wrapper::MuonTrack* track2=m_tracks[1];
-    double Mass = m_trackMass;
-    particle1.SetPtEtaPhiE(track1->pt(),track1->eta(),track1->phi(),sqrt(pow(Mass,2)+pow(track1->px(),2)+pow(track1->py(),2)+pow(track1->pz(),2)));
-    particle2.SetPtEtaPhiE(track2->pt(),track2->eta(),track2->phi(),sqrt(pow(Mass,2)+pow(track2->px(),2)+pow(track2->py(),2)+pow(track2->pz(),2)));
-    v=particle1+particle2;
-    invmass = v.Mag();
-  }
-  else invmass=0;
-
-  return invmass; //CLHEP::MeV
-}
-
-double DiMuonTool::pt() {
-  double transmom;
-
-  if (m_tracks.size()==2) {
-    const Wrapper::MuonTrack* track1=m_tracks[0];
-    const Wrapper::MuonTrack* track2=m_tracks[1];
-    double px = track1->px()+track2->px();
-    double py = track1->py()+track2->py();
-    transmom=sqrt(px*px+py*py);
-  }
-  else transmom=0;
- 
-  return transmom;  //CLHEP::MeV
-}
-
-double DiMuonTool::eta() {
-  double eta;
-
-  if (m_tracks.size()==2) {
-    const Wrapper::MuonTrack* track1=m_tracks[0];
-    const Wrapper::MuonTrack* track2=m_tracks[1];
-
-    double px=track1->px()+track2->px();
-    double py = track1->py()+track2->py();
-    double pz = track1->pz()+track2->pz();
-    double p=sqrt(px*px+py*py+pz*pz);
-    eta=0.5*log((p+pz)/(p-pz));
-  }
-  else eta=0;
-    
-  return eta;
-}
-
-double DiMuonTool::phi() {  
-  double phi;
-
-  if (m_tracks.size()==2) {
-    const Wrapper::MuonTrack* track1=m_tracks[0];
-    const Wrapper::MuonTrack* track2=m_tracks[1];
-
-    double px = track1->px()+track2->px();
-    double py = track1->py()+track2->py();
-    double p=sqrt(px*px+py*py);
-    phi=acos(px/p);
-    if (py<0.) phi=-1.*phi; 
-  }
-  else phi=0;
-
-  return phi;
-}
-
-double DiMuonTool::CurvatureDiff() {
-  double asym;
-
-  if (m_tracks.size()==2) {
-    const Wrapper::MuonTrack* track1=m_tracks[0]->charge()>0?m_tracks[0]:m_tracks[1];
-    const Wrapper::MuonTrack* track2=m_tracks[1]->charge()>0?m_tracks[1]:m_tracks[0];
-
-    double qoverpt1=track1->charge()/track1->pt();
-    double qoverpt2=track2->charge()/track2->pt();
-    asym=fabs(qoverpt1)-fabs(qoverpt2);
-  }
-  else asym=0;
-
-  return asym; //[CLHEP::MeV]^-1
-}
-
-void DiMuonTool::clear()
-{
-  m_doTagAndProbe=false;
-  m_trackMass = 105.66*CLHEP::MeV;
-  for(unsigned i=0; i--; ) delete m_tracks[i];
-  m_tracks.clear();
-
-}
diff --git a/Trigger/TrigTools/TrigJPsiTools/src/MakeDiMuonsTool.cxx b/Trigger/TrigTools/TrigJPsiTools/src/MakeDiMuonsTool.cxx
deleted file mode 100644
index 134ecda8ebbaa193569989b656be74a8016504ba..0000000000000000000000000000000000000000
--- a/Trigger/TrigTools/TrigJPsiTools/src/MakeDiMuonsTool.cxx
+++ /dev/null
@@ -1,285 +0,0 @@
-/*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-*/
-
-// ***********************************************************************
-// MakeDiMuonsTool.cxx
-// Returns a vector of DiMuon objects from input tracks.
-// Possible to switch on/off tag-and-probe method.
-
-// AUTHORS: Weina Ji (weina.ji@cern.ch)
-//          Peter Wijeratne (paw@hep.ucl.ac.uk)
-//          Christian Gutschow (chris.g@cern.ch)
-// ***********************************************************************
-
-#include "TrigJPsiTools/MakeDiMuonsTool.h"
-#include "Particle/TrackParticleContainer.h"
-#include "Particle/TrackParticle.h"
-#include "TLorentzVector.h"
-
-#include "TrigMuonEvent/TrigMuonEFTrack.h"
-#include "TrigMuonEvent/TrigMuonEFCbTrack.h"
-#include "TrigMuonEvent/TrigMuonEFInfoTrack.h"
-
-#include <stdexcept>
-
-MakeDiMuonsTool::MakeDiMuonsTool()
-  :m_trigEffJpsiTools("TrigEffJpsiTools")
-{
-  m_ptcut=0*CLHEP::GeV;
-  m_tagptcut=0*CLHEP::GeV;
-  m_etacut=999;
-  m_tagetacut=999;
-  m_TagAndProbe=false;
-  m_useTrigger=false;
-  //  m_trkmass = 105.66*CLHEP::MeV;
-  m_trkmass=0.511*CLHEP::MeV;
-  m_tracks.clear();
-  m_pairs.clear();
-  m_MuonCollection=0;
-  m_TrigCollection=0;
-  m_upperlimit = 99999;
-  m_lowerlimit = -99999;
-  m_taggedMuons.clear();
-  m_selectaProbe.cleanup();
-  m_selectaTag.cleanup();
-}
-
-MakeDiMuonsTool::~MakeDiMuonsTool() { }
-
-bool MakeDiMuonsTool::initializeTools()
-{
-  if(m_trigEffJpsiTools.retrieve().isFailure()) return false; 
-  else return true;
-}
-
-void MakeDiMuonsTool::initializeMembers()
-{
-  m_ptcut=0*CLHEP::GeV;
-  m_tagptcut=0*CLHEP::GeV;
-  m_etacut=999;
-  m_tagetacut=999;
-  m_TagAndProbe=false;
-  m_useTrigger=false;
-  //m_trkmass = 105.66*CLHEP::MeV;
-  m_trkmass=0.511*CLHEP::MeV;
-  m_tracks.clear();
-  for(std::vector<Wrapper::MuonTrack*>::const_iterator it = m_tracks.begin(); it != m_tracks.end(); it++){
-    delete (*it);
-  }
-  m_pairs.clear();
-  m_MuonCollection=0;
-  m_TrigCollection=0;
-  m_upperlimit = 999;
-  m_lowerlimit = -999;
-  m_taggedMuons.clear();
-  m_selectaProbe.cleanup();
-  m_selectaTag.cleanup();
-}
-
-// input tracks, cuts or turn on tag-and-probe
-
-void MakeDiMuonsTool::setProbes(const std::vector<const TrigMuonEFTrack*>& trksIn,
-                                const std::vector<int>& roi) {
-  for( unsigned i=0; i<trksIn.size(); ++i ) m_selectaProbe.muonSelector( trksIn[i], NULL, roi[i] );
-  m_tracks = m_selectaProbe.tracks();
-}
-
-void MakeDiMuonsTool::setProbes(const std::vector<const CaloCluster*>& CombinedCollection,
-                                const std::vector<int>& roi) {
-  for( unsigned i=0; i<CombinedCollection.size(); ++i ) m_selectaProbe.muonSelector( CombinedCollection[i], roi[i] );
-  m_tracks = m_selectaProbe.tracks();
-}
-
-void MakeDiMuonsTool::setProbes(const std::vector<const Rec::TrackParticle*>& trksIn) {
-  for( unsigned i=0; i<trksIn.size(); ++i ) m_selectaProbe.muonSelector( trksIn[i] );
-  m_tracks = m_selectaProbe.tracks();
-}
-
-void MakeDiMuonsTool::setProbes( const TrigInDetTrackCollection* trigCollection ){ 
-  TrigInDetTrackCollection::const_iterator tIt = trigCollection->begin();
-  TrigInDetTrackCollection::const_iterator tLast = trigCollection->end();
-  while(tIt != tLast){
-    m_selectaProbe.muonSelector( *tIt );
-    tIt++;
-  }
-  m_tracks = m_selectaTag.tracks();
-  
-}
-
-
-void MakeDiMuonsTool::setTags( const Analysis::MuonContainer* MuonCollection) {
-  m_MuonCollection = MuonCollection;
-  TagMuons(m_MuonCollection);
-}
-
-void MakeDiMuonsTool::setTags( const std::vector< const TrigMuonEFCbTrack* >& CombinedCollection,
-                               const std::vector<int>& roiNums ){
-  m_CombinedCollection = CombinedCollection;
-  TagMuons(m_CombinedCollection, roiNums);
-}
-
-void MakeDiMuonsTool::doTagAndProbe(bool doTagAndProbe) {m_TagAndProbe = doTagAndProbe;}
-void MakeDiMuonsTool::useTrigger(bool useTrigger) {m_useTrigger=useTrigger;}
-void MakeDiMuonsTool::setPtcut(double ptcut) {m_ptcut = ptcut;}
-void MakeDiMuonsTool::setTagPtcut(double ptcut) {m_tagptcut = ptcut;}
-void MakeDiMuonsTool::setEtacut(double etacut) {m_etacut=etacut;}
-void MakeDiMuonsTool::setTagEtacut(double etacut) {m_tagetacut=etacut;}
-void MakeDiMuonsTool::setTrackMass(double muonmass) {m_trkmass=muonmass;}
-void MakeDiMuonsTool::setUpperInvMassLimit(double upperlimit) {m_upperlimit=upperlimit;}
-void MakeDiMuonsTool::setLowerInvMassLimit(double lowerlimit) {m_lowerlimit=lowerlimit;}
-
-void MakeDiMuonsTool::TagMuons( const Analysis::MuonContainer* muonCollection ){ 
-  Analysis::MuonContainer::const_iterator muonItr;
-  for (muonItr=muonCollection->begin(); muonItr != muonCollection->end(); ++muonItr)
-    {
-      if ((*muonItr)->hasInDetTrackParticle()) {
-	if (m_TagAndProbe) {
-	  if (m_useTrigger && m_trigEffJpsiTools->isTriggeredMuon( (*muonItr)->inDetTrackParticle(),1)) {
-	    m_selectaTag.muonSelector( (*muonItr)->inDetTrackParticle());
-	  }
-	  else if (!m_useTrigger && (*muonItr)->isCombinedMuon()) {
-	    m_selectaTag.muonSelector( (*muonItr)->inDetTrackParticle());
-	  }
-	}
-      }
-    }
-
-  m_taggedMuons = m_selectaTag.tracks();
-  
-}
-
-void MakeDiMuonsTool::TagMuons( const std::vector<const TrigMuonEFCbTrack*>& combinedCollection,
-                                const std::vector<int>& roiNums ){
-  std::vector<const TrigMuonEFCbTrack*>::const_iterator tagItr;
-  if (!combinedCollection.empty()){
-    int i = 0;
-    for (tagItr=combinedCollection.begin(); tagItr!=combinedCollection.end();++tagItr){
-      if ( (*tagItr) ){
-	if (m_TagAndProbe){
-	  m_selectaTag.muonSelector( (*tagItr), NULL, roiNums[i] );
-	}
-      }
-      i++;
-    }
-  }
- 
-  m_taggedMuons = m_selectaTag.tracks();
-
-}
-
-void MakeDiMuonsTool::setTags(const std::vector<const egamma*>& trksIn,
-                              const std::vector<int>& roi) {
-    for(unsigned int i=0; i < trksIn.size(); ++i) {
-      if(trksIn[i] && m_TagAndProbe) {
-        m_selectaTag.muonSelector(trksIn[i], roi[i]);
-      }
-    }
-  m_taggedMuons = m_selectaTag.tracks();
-}
-
-//Execute
-std::vector<DiMuonTool*> MakeDiMuonsTool::execute()
-{
-  if (m_TagAndProbe) makePairs(m_taggedMuons,m_tracks);
-  else makePairs(m_tracks);
-  return m_pairs;
-}
-void MakeDiMuonsTool::makePairs(const std::vector<Wrapper::MuonTrack*>& Tracks){
-  std::vector<Wrapper::MuonTrack*>::const_iterator track1;
-  std::vector<Wrapper::MuonTrack*>::const_iterator track2;
-  if(Tracks.size()>=2){
-    for(track1=Tracks.begin();track1<Tracks.end();track1++){
-      for(track2=(track1+1);track2!=Tracks.end();track2++){
-	if ((*track1)->pt()/CLHEP::GeV>(m_ptcut/CLHEP::GeV) && (fabs((*track1)->eta())<m_etacut))
-	  if ((*track2)->pt()/CLHEP::GeV>(m_ptcut/CLHEP::GeV) && (fabs((*track2)->eta())<m_etacut))
-	  if (((*track1)->charge()*(*track2)->charge())<0) {
-	      DiMuonTool* dimuon = new DiMuonTool();
-	      dimuon->setTrackMass(m_trkmass);
-	      dimuon->setTagAndProbe(m_TagAndProbe);
-	      if ((*track1)->charge()>0){
-		dimuon->setTracks(*track1,*track2);
-	      }
-	      if ((*track2)->charge()>0){
-		dimuon->setTracks(*track2,*track1);
-	      }
-	      if ( dimuon->InvariantMass()<m_upperlimit && dimuon->InvariantMass()>m_lowerlimit ) 
-		{
-                  m_pairs.push_back(dimuon);
-		}
-	      else delete dimuon;
-	  } 
-      }
-    }
-  }
-} //Muons(+,-)
-
-void MakeDiMuonsTool::makePairs(const std::vector<Wrapper::MuonTrack*>& taggedTracks,std::vector<Wrapper::MuonTrack*> probedTracks) {
-  //std::cout << "JPSI TOOLS -- makePair sizes - tag: " << taggedTracks.size() << " and probe:" << probedTracks.size() << std::endl;
-  std::vector<Wrapper::MuonTrack*>::const_iterator tagItr;
-  std::vector<Wrapper::MuonTrack*>::const_iterator probeItr;
-  if(taggedTracks.size()>=1 && probedTracks.size()>=1 ) {
-    for(tagItr=taggedTracks.begin();tagItr!=taggedTracks.end();tagItr++) {
-      //std::cout << "tag pt: " << (*tagItr)->pt() << " cut: " << m_tagptcut << std::endl;
-      //std::cout << "tag eta: " << (*tagItr)->eta() << " cut: " << m_tagetacut << std::endl;
-      if((*tagItr)->pt() > m_tagptcut && fabs((*tagItr)->eta()) < m_tagetacut) {
-        for(probeItr=probedTracks.begin();probeItr!=probedTracks.end();probeItr++) { 
-          //std::cout << "probe pt: " << (*probeItr)->pt() << " cut: " << m_ptcut << std::endl;
-          //std::cout << "probe eta: " << (*probeItr)->eta() << " cut: " << m_etacut << std::endl;
-          if((*probeItr)->pt()/CLHEP::GeV>(m_ptcut/CLHEP::GeV) && (fabs((*probeItr)->eta())<m_etacut)) {
-            //std::cout << "probe charge: " << (*probeItr)->charge() << " tag charge: " << (*tagItr)->charge() << std::endl;
-	          //if(((*tagItr)->charge()*(*probeItr)->charge())<0) {    //!!!!!!!!!!!!!!!!!!!!!!!!!!!! <----- !!!!!
-              DiMuonTool* dimuon = new DiMuonTool();
-              dimuon->setTrackMass(m_trkmass);
-              dimuon->setTagAndProbe(m_TagAndProbe);
-              dimuon->setTracks(*tagItr,*probeItr);
-              //std::cout << "mass : " << dimuon->InvariantMass()<< " upper/lower limit: " << m_upperlimit << " , " << m_lowerlimit << std::endl;
-	            if( dimuon->InvariantMass()<m_upperlimit && dimuon->InvariantMass()>m_lowerlimit) {
-                //std::cout << "Winning probe pt " <<  (*probeItr)->pt()/CLHEP::GeV << " eta " << (*probeItr)->eta()/CLHEP::GeV
-	      			  //<< "\nWinning tag pt " <<  (*tagItr)->pt()/CLHEP::GeV << " eta " << (*tagItr)->eta()/CLHEP::GeV 
-	      			  //<< std::endl;
-	              m_pairs.push_back(dimuon);
-              } 
-	            else {
-	              //std::cout << "FAILED at invmass cut with invmass " << dimuon->InvariantMass() << std::endl;
-	              delete dimuon;
-	            }
-	          //} //else std::cout << "FAILED at charge cut." << std::endl;
-	        } //else  std::cout << "FAILED at probe pt or eta cut. " << std::endl;
-        }
-      }	//else  std::cout << "FAILED at tag pt or eta cut. " << std::endl;
-    }
-  }
-  //  return(myPairs);
-} //Muons(tag,probe)
-
-bool MakeDiMuonsTool::isTriggeredEF(const Rec::TrackParticle* track,std::string chainName) const {
-  if (m_useTrigger) return m_trigEffJpsiTools->isTriggeredMuonEF(track, chainName);
-  else return false;
-}
-
-
-bool MakeDiMuonsTool::isTriggeredL2(const Rec::TrackParticle* track,std::string chainName) const {
-  if (m_useTrigger) return m_trigEffJpsiTools->isTriggeredMuonL2(track, chainName);
-  else return false;
-}
-
-bool MakeDiMuonsTool::isTriggeredL1(const Rec::TrackParticle* track,std::string triggerName) const {
-  if (m_useTrigger) return m_trigEffJpsiTools->isTriggeredMuonL1(track, triggerName);
-  else return false;
-}
-
-void MakeDiMuonsTool::clear(){
-
-  m_selectaProbe.cleanup();
-  m_selectaTag.cleanup();
-  m_tracks.clear();
-  m_taggedMuons.clear();
-  m_CombinedCollection.clear();
-  for(std::vector<DiMuonTool*>::const_iterator it = m_pairs.begin(); it != m_pairs.end(); it++){
-    (*it)->clear();
-    delete (*it);
-  }   
-  m_pairs.clear();
-
-}
diff --git a/Trigger/TrigTools/TrigUtils/CMakeLists.txt b/Trigger/TrigTools/TrigUtils/CMakeLists.txt
deleted file mode 100644
index efec566746033dd8860a7cb4837aeb9fbe3ad5e1..0000000000000000000000000000000000000000
--- a/Trigger/TrigTools/TrigUtils/CMakeLists.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-################################################################################
-# Package: TrigUtils
-################################################################################
-
-# Declare the package name:
-atlas_subdir( TrigUtils )
-
-# Install files from the package:
-atlas_install_scripts( bin/*.py )
diff --git a/Trigger/TrigTools/TrigUtils/bin/hltCoolNotify.py b/Trigger/TrigTools/TrigUtils/bin/hltCoolNotify.py
deleted file mode 100755
index 598aea9145332788e61363e4764566b098266235..0000000000000000000000000000000000000000
--- a/Trigger/TrigTools/TrigUtils/bin/hltCoolNotify.py
+++ /dev/null
@@ -1,407 +0,0 @@
-#!/usr/bin/env tdaq_python
-
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-#
-# Based on Walter Lampl's getIOVAge.py and CoolConvUtilities/AtlCoolTool.py
-#
-# Author: Frank Winklmeier
-#
-__doc__ = """\
-Usage: hltCoolNotify.py [OPTIONS] [Database ...]
-
-Show changes in COOL folders between two runs. If no run number is specified, the
-tool is running in online mode. In this case the difference between the current
-run and the last stable beams run will be shown. The GlobalTag for a given run
-is retrieved from the TriggerDB via the SuperMasterKey, which itself is retrieved
-from COOL.
-
-If only one run is specified, all COOL folders and tags will be shown.
-
-Database is one or more COOL connection strings (e.g. COOLONL_LAR/COMP200).
-If not specified, a predefined set of COOLONL database instances is used.
-"""
-
-import sys
-import time
-import operator
-import optparse
-import signal
-import cPickle
-
-import ispy
-from PyCool import cool
-from CoolConvUtilities.AtlCoolLib import indirectOpen
-from CoolConvUtilities.AtlCoolTool import AtlCoolTool
-from CoolRunQuery.AtlRunQueryIOV import IOVTime, IOVRange
-
-from TrigConfStorage.TriggerCoolUtil import TriggerCoolUtil
-from TrigConfigSvc.TrigConfigSvcUtils import getPropertyFromDB
-
-from AthenaCommon.Logging import logging
-msg = logging.getLogger("hltCoolNotify")
-msg.setLevel(logging.INFO)
-msg.setFormat("%(asctime)s  Py:%(name)-15s %(levelname)7s %(message)s")
-   
-
-# List of DB instances used by HLT
-hltCondDB = ["COOLONL_CALO/COMP200",
-             "COOLONL_CSC/COMP200",
-             #"COOLONL_FWD/COMP200",
-             "COOLONL_GLOBAL/COMP200",
-             "COOLONL_INDET/COMP200",
-             "COOLONL_LAR/COMP200",
-             "COOLONL_MDT/COMP200",
-             "COOLONL_MUONALIGN/COMP200",
-             "COOLONL_PIXEL/COMP200",
-             "COOLONL_RPC/COMP200",
-             "COOLONL_SCT/COMP200",
-             "COOLONL_TDAQ/COMP200",
-             "COOLONL_TGC/COMP200",
-             "COOLONL_TILE/COMP200",
-             "COOLONL_TRIGGER/COMP200",
-             "COOLONL_TRT/COMP200"]
-
-# Log output 
-log = []
-
-# Global stop flag
-STOP = False
-
-# Helpers to convert validity key
-def toRun(validity):
-   return (validity >> 32)
-   
-def toLB(validity):
-   return (validity & 0xFFFFFFFF)
-
-def toSec(validity):
-   return (validity / 1000000000L)
-
-class CoolDB:
-   """Cache for COOL db conneciton objects"""
-   cooldbs = {}
-   
-   @classmethod
-   def get(cls, dbname):
-      if not dbname in cls.cooldbs: 
-         cls.cooldbs[dbname] = indirectOpen(dbname,readOnly=True,oracle=True)
-
-      return cls.cooldbs[dbname]
-
-
-class Run:
-   def __init__(self, runno):
-      self.runno = runno
-      self.smk = None
-      self.sor = None         # start of run time in UTC
-      self.globalTag = None
-      if self.runno!=None: self.update()
-      
-   def update(self):
-      # SOR
-      if self.sor==None:
-         db = CoolDB.get("COOLONL_TDAQ/COMP200")
-         f = db.getFolder("/TDAQ/RunCtrl/SOR_Params")
-         o = f.findObject(cool.ValidityKey(self.runno<<32), 0)
-         self.sor = toSec(o.get().payload()['SORTime'])
-
-      # SMK
-      if self.smk==None:
-         keys = TriggerCoolUtil.getHLTConfigKeys(CoolDB.get('COOLONL_TRIGGER/COMP200'),
-                                                 [[self.runno,self.runno]])
-
-         if not self.runno in keys:
-            raise RuntimeError, ("Cannot find SMK for run %d" % self.runno)
-         self.smk = int(keys[self.runno]['SMK'])
-
-      # GlobalTag
-      if self.globalTag==None:
-         res = getPropertyFromDB('TRIGGERDB', self.smk , 'IOVDbSvc', 'GlobalTag')
-         if len(res)==0:
-            raise RuntimeError, ('Cannot find GlobalTag for SMK %d' % self.smk)
-         
-         self.globalTag = res[0][3]
-
-
-class OnlineRun(Run):
-   def __init__(self):
-      Run.__init__(self,None)
-      self.update()
-      
-   def update(self):
-      p = ispy.IPCPartition("ATLAS")
-      rp = ispy.ISObject(p, "RunParams.RunParams")
-      rp.checkout()   
-      conf = ispy.ISObject(p, "RunParams.TrigConfSmKey")
-      conf.checkout()
-
-      self.runno = rp.run_number
-      self.sor = rp.timeSOR.c_time()
-      self.smk = conf.SuperMasterKey
-
-      Run.update(self)
-
-
-class Folder:   
-   def __init__(self, folder, tag, obj, istime, channel=None):
-      self.iov = IOVRange(obj,istime)
-      self.folder = folder
-      self.tag = tag
-      self.insertTime = '%s' % obj.insertionTime()
-      self.channel = channel
-      
-   def __str__(self):
-       return '%-40s %s%s %s (%s)' % (self.iov, self.folder, (' (%s)' % self.channel) if self.channel!=None else '',
-                                      self.tag, self.insertTime.split('.')[0])
-
-   def __cmp__(self, other):
-      return cmp(self.iov, other.iov)
-
-   def __eq__(self, other):
-      return self.folder==other.folder and self.tag==other.tag and \
-             self.iov==other.iov and self.channel==self.channel
-
-   def __hash__(self):
-      return hash('%s%s%s%s%s' % (self.iov, self.folder, self.tag,
-                                  self.insertTime, self.channel))
-   
-class HltCoolTool(AtlCoolTool):
-
-   def __init__(self, database):
-      AtlCoolTool.__init__(self, database)
-   
-   def listFolders(self, run, sor, tag,
-                   chan = None, allChan = False):
-      """
-      Return folder list
-      """
-
-      folderList = []
-      
-      nodelist = self.db.listAllNodes()
-      for node in nodelist:
-         if not self.db.existsFolder(node): continue
-         f = self.db.getFolder(node)
-
-         if chan==None:
-            chansel = cool.ChannelSelection.all()
-         else:
-            chansel = cool.ChannelSelection(chan)
-
-         istime = ((f.description()).find('<timeStamp>time')!=-1)
-         if istime:
-            limmin = limmax = sor*1000000000L
-         else:
-            limmin = limmax = (run << 32)
-
-         if tag=='':
-            objs = f.browseObjects(limmin,limmax,chansel)
-         else:
-            if not tag in f.listTags():
-               # tag is not defined here, try hierarchical tag
-               try:
-                  restag = f.resolveTag(tag)
-               except Exception:
-                  continue
-            else:
-               restag = tag
-
-            objs = f.browseObjects(limmin,limmax,chansel,restag)
-
-         done = False
-         while objs.goToNext() and not done:
-            obj = objs.currentRef()
-            ch = obj.channelId()
-
-            if not allChan: done = True
-            folderList.append(Folder(node, restag, obj, istime, ch if allChan else None))
-           
-      return folderList
-      
-
-def getLastPhysicsRuns(N=1):
-   """Return the last N runs with ReadyForPhysics"""
-
-   db = CoolDB.get("COOLONL_TDAQ/COMP200")
-   f = db.getFolder("/TDAQ/RunCtrl/DataTakingMode")
-   objs = f.browseObjects(cool.ValidityKeyMin, cool.ValidityKeyMax, cool.ChannelSelection(0))
-   lastrun = []
-   while objs.goToNext():
-      obj= objs.currentRef()
-      if obj.payload()['ReadyForPhysics']==0: continue
-      lastrun.append(toRun(obj.since()))
-
-   return lastrun[len(lastrun)-N:]
-
-
-def email(toaddr, subject, log):
-   import smtplib
-   try:
-      s = smtplib.SMTP()
-      s.connect()
-   except Exception as e:
-      msg.error('%s' % e)
-      return
-   
-   fromaddr = 'atlas-trigger-conditions-commit@cern.ch' # Required to allow sending to this egroup
-   txt = 'From: %s\r\n'\
-         'To: %s\r\n'\
-         'Reply-To: %s\r\n'\
-         'Subject: %s\r\n\r\n' % (fromaddr, toaddr, toaddr, subject)
-
-   txt += '\n'.join(log)
-   try:
-      s.sendmail(fromaddr, toaddr, txt)
-   except Exception as e:
-      msg.error('Failure sending email: %s' % e)
-      return
-
-   msg.info('Successfully sent email to %s' % toaddr)
-   s.quit()
-
-
-def myhelp(option, opt_str, value, parser):
-   """Custom help callback since optparse does not preserve newlines"""
-
-   print __doc__
-   
-   parser.print_help()
-   sys.exit(1)
-
-
-def handler(signum, f_globals):
-   global STOP
-   msg.warning('Signal handler called with signal %d' % signum)
-   STOP = True
-
-
-def main():
-   signal.signal(signal.SIGTERM, handler)
-   
-   parser = optparse.OptionParser(usage = '',
-                                  add_help_option = False)
-
-   parser.add_option("-r", "--run", action="append", type='int',
-                     help="Run number(s). If two runs are given a diff will be done.")
-
-   parser.add_option("-c", "--channels", action="store_true", default = False,
-                     help="Show all channels, otherwise only first one")
-
-   parser.add_option("-m", "--mail", type="string",
-                     help="Email non-zero differences to given mailing address(es)")
-
-   parser.add_option("-i", "--ignore", type="string",
-                     help="File name with list of folders to ignore in diff")
-
-   parser.add_option("-o","--oldDiff", type="string",
-                     help="File name with already reported diffs")
-   
-   parser.add_option("-h", "--help", action="callback", callback=myhelp)
-     
-   (opt, args) = parser.parse_args()
-
-   oldDiff = set()  # pairs of folder diffs already reported
-   if opt.oldDiff:
-      try:
-         oldDiff = cPickle.load(open(opt.oldDiff))
-      except:
-         pass
-      
-   if opt.run!=None and len(opt.run)>2:
-      parser.print_help()
-      parser.error('Cannot specify more than two run numbers')
-
-   if opt.run==None:
-      r = OnlineRun()
-      runs = [r]
-      lastruns = sorted(getLastPhysicsRuns(2))
-      if lastruns[1]==r.runno: runs.append(Run(int(lastruns[0])))
-      else: runs.append(Run(int(lastruns[1])))
-   else:
-      runs = [Run(r) for r in opt.run]
-
-   # Order by run number
-   runs = sorted(runs, key=operator.attrgetter('runno'))
-   msg.info('Reading conditions for %s' % [r.runno for r in runs])
-   
-   cooldb = args if len(args)>0 else hltCondDB
-
-   for r in runs:
-      log.append('=== Run: %d %s (%s)' %
-                 (r.runno,time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(r.sor)),r.globalTag))
-
-   log.append('=== DBs: %s' % cooldb)
-   
-   folders = {}
-   for db in cooldb:
-      msg.info('Reading %s' % db)
-      try:
-         coolTool = HltCoolTool(db)
-      except:
-         msg.error('Cannot connect to %s' % db)
-         continue
-
-      for r in runs:
-         if STOP:
-            msg.warning('Aborting...')
-            return 0
-
-         if not r.runno in folders: folders[r.runno] = []
-         folders[r.runno] += coolTool.listFolders(r.runno, r.sor, r.globalTag,
-                                                  allChan = opt.channels)
-
-   # Diff or printout
-   diff = []
-   ignored = []
-   if len(runs)==2:
-
-      ignore = []
-      if opt.ignore!=None:
-         try:
-            ignore = [l.strip() for l in open(opt.ignore).readlines() if not l.startswith('#')]
-         except:
-            msg.warning('Cannot open file %s' % opt.ignore)
-         
-      folders_r0 = dict([(f.folder,f) for f in folders[runs[0].runno]])
-      for f in folders[runs[1].runno]:
-         if not f in folders[runs[0].runno]:
-            pair = (folders_r0[f.folder],f)
-            if (f.folder in ignore or pair in oldDiff):
-               l = ignored
-            else:
-               l = diff
-               oldDiff.add(pair)
-               
-            l.append("    %s" % folders_r0[f.folder])
-            l.append("--> %s" % f)
-            
-      if len(diff)>0:
-         log.append('\nConditions differences found:')
-         log.extend(diff)
-      else:
-         log.append('\nNo conditions differences found')
-         
-      if len(ignored)>0:
-         log.append('\nConditions differences ignored:')
-         log.extend(ignored)
-
-   else:
-      for f in folders[runs[0].runno]:
-         log.append(f)
-
-   print '='*80
-   for l in log: print l
-   print '='*80
-   
-   if opt.mail!=None and len(diff)>0:
-      email(opt.mail, ('HLT conditions changes for run %d' % runs[1].runno),log)
-
-   if opt.oldDiff:
-      msg.info('Writing already reported differences to %s' % opt.oldDiff)
-      cPickle.dump(oldDiff, open(opt.oldDiff,'w'))
-      
-   msg.info('Exiting')
-         
-if __name__ == "__main__":
-   sys.exit(main())
-      
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_mc_pp_v7_ftk_rdotoesdaod_build.sh b/Trigger/TrigValidation/TrigAnalysisTest/test/test_mc_pp_v7_ftk_rdotoesdaod_build.sh
index 5e3a4c2672d683358fec04966052f5bb03f6ff06..0fdd410b9256ca09a07e192f5753e384d047254f 100755
--- a/Trigger/TrigValidation/TrigAnalysisTest/test/test_mc_pp_v7_ftk_rdotoesdaod_build.sh
+++ b/Trigger/TrigValidation/TrigAnalysisTest/test/test_mc_pp_v7_ftk_rdotoesdaod_build.sh
@@ -20,7 +20,7 @@
 # art-output: ntuple.pmon.gz
 # art-output: *perfmon*
 # art-output: TotalEventsProcessed.txt
-# art-output: *.regtest
+# art-output: *.regtest.new
 
 export NAME="mc_pp_v7_ftk_rdotoesdaod_build"
 export INPUT="ftk"
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_mc_pp_v7_ftk_rdotoesdaod_grid.sh b/Trigger/TrigValidation/TrigAnalysisTest/test/test_mc_pp_v7_ftk_rdotoesdaod_grid.sh
index ab2cf4679dd4d07ae2ad56cb941962faea8ac876..cbf91c60e7ed0a5a7aa4869e3fa5a1bbc00d8c2b 100755
--- a/Trigger/TrigValidation/TrigAnalysisTest/test/test_mc_pp_v7_ftk_rdotoesdaod_grid.sh
+++ b/Trigger/TrigValidation/TrigAnalysisTest/test/test_mc_pp_v7_ftk_rdotoesdaod_grid.sh
@@ -4,10 +4,8 @@
 # art-type: grid
 # art-include: 21.0/Athena
 # art-include: 21.3/Athena
-# art-include: 21.0-TrigMC/Athena
 # art-include: master/Athena
 # art-include: 21.1/AthenaP1
-# art-include: 21.1-dev/AthenaP1
 # art-output: *check*
 # art-output: HLTChain.txt
 # art-output: HLTTE.txt
@@ -22,7 +20,7 @@
 # art-output: TotalEventsProcessed.txt
 # art-output: AOD.pool.root.checkFile0
 # art-output: AOD.pool.root.checkFiletrigSize.txt
-# art-output: *.regtest
+# art-output: *.regtest.new
 
 
 export NAME="mc_pp_v7_ftk_rdotoesdaod_grid"
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_mc_pp_v7_rdotoaod_build.sh b/Trigger/TrigValidation/TrigAnalysisTest/test/test_mc_pp_v7_rdotoaod_build.sh
index e4b5bbf03d73c0ac0c4a285ad42d3ef05da90f58..7dd0408b2805563603a6fff2cb05a84a53da0606 100755
--- a/Trigger/TrigValidation/TrigAnalysisTest/test/test_mc_pp_v7_rdotoaod_build.sh
+++ b/Trigger/TrigValidation/TrigAnalysisTest/test/test_mc_pp_v7_rdotoaod_build.sh
@@ -4,10 +4,8 @@
 # art-type: build
 # art-include: 21.0/Athena
 # art-include: 21.3/Athena
-# art-include: 21.0-TrigMC/Athena
 # art-include: master/Athena
 # art-include: 21.1/AthenaP1
-# art-include: 21.1-dev/AthenaP1
 # art-output: *check*
 # art-output: HLTChain.txt
 # art-output: HLTTE.txt
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_mc_pp_v7_rdotoaod_grid.sh b/Trigger/TrigValidation/TrigAnalysisTest/test/test_mc_pp_v7_rdotoaod_grid.sh
index 569f5c9ce3aeacac96462d603703a32ab77fac46..9d14548fac169cea4a3f6abf65c5f3c19cfeb0a7 100755
--- a/Trigger/TrigValidation/TrigAnalysisTest/test/test_mc_pp_v7_rdotoaod_grid.sh
+++ b/Trigger/TrigValidation/TrigAnalysisTest/test/test_mc_pp_v7_rdotoaod_grid.sh
@@ -3,10 +3,9 @@
 # art-description: Trigger MC pp v7 RDO to AOD test
 # art-type: grid
 # art-include: 21.0/Athena
-# art-include: 21.0-TrigMC/Athena
+# art-include: 21.3/Athena
 # art-include: master/Athena
 # art-include: 21.1/AthenaP1
-# art-include: 21.1-dev/AthenaP1
 # art-output: *check*
 # art-output: HLTChain.txt
 # art-output: HLTTE.txt
@@ -21,6 +20,7 @@
 # art-output: TotalEventsProcessed.txt
 # art-output: AOD.pool.root.checkFile0
 # art-output: AOD.pool.root.checkFiletrigSize.txt
+# art-output: *.regtest.new
 
 export NAME="mc_pp_v7_rdotoaod_grid"
 export COST_MONITORING="False"
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_mc_pp_v7_rdotoaodslim_build.sh b/Trigger/TrigValidation/TrigAnalysisTest/test/test_mc_pp_v7_rdotoaodslim_build.sh
index 7bcc30c274b7003b18dda13a6afc464db57028d2..1f45f9e87c09e9043cc7c08cd59186e08320781d 100755
--- a/Trigger/TrigValidation/TrigAnalysisTest/test/test_mc_pp_v7_rdotoaodslim_build.sh
+++ b/Trigger/TrigValidation/TrigAnalysisTest/test/test_mc_pp_v7_rdotoaodslim_build.sh
@@ -3,10 +3,9 @@
 # art-description: Trigger MC pp v7 RDO to AODSLIM
 # art-type: build
 # art-include: 21.0/Athena
-# art-include: 21.0-TrigMC/Athena
+# art-include: 21.3/Athena
 # art-include: master/Athena
 # art-include: 21.1/AthenaP1
-# art-include: 21.1-dev/AthenaP1
 # art-output: *check*
 # art-output: HLTChain.txt
 # art-output: HLTTE.txt
@@ -19,6 +18,7 @@
 # art-output: ntuple.pmon.gz
 # art-output: *perfmon*
 # art-output: TotalEventsProcessed.txt
+# art-output: *.regtest.new
 
 export NAME="mc_pp_v7_rdotoaodslim_build"
 export COST_MONITORING="False"
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_mc_pp_v7_rdotobstoesd_build.sh b/Trigger/TrigValidation/TrigAnalysisTest/test/test_mc_pp_v7_rdotobstoesd_build.sh
index 3ac4133cbb32a08549a2cf1db9affbe117121802..2e97fafe16d0616a5fe954c313384a1c37e73c82 100755
--- a/Trigger/TrigValidation/TrigAnalysisTest/test/test_mc_pp_v7_rdotobstoesd_build.sh
+++ b/Trigger/TrigValidation/TrigAnalysisTest/test/test_mc_pp_v7_rdotobstoesd_build.sh
@@ -3,10 +3,9 @@
 # art-description: Trigger MC pp v7 RDO to BS and BS to ESD test
 # art-type: build
 # art-include: 21.0/Athena
-# art-include: 21.0-TrigMC/Athena
+# art-include: 21.3/Athena
 # art-include: master/Athena
 # art-include: 21.1/AthenaP1
-# art-include: 21.1-dev/AthenaP1
 # art-output: *check*
 # art-output: HLTChain.txt
 # art-output: HLTTE.txt
@@ -19,6 +18,7 @@
 # art-output: ntuple.pmon.gz
 # art-output: *perfmon*
 # art-output: TotalEventsProcessed.txt
+# art-output: *.regtest.new
 
 export NAME="mc_pp_v7_rdotobstoesd_build"
 export COST_MONITORING="False"
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_mc_pp_v7_rdotoesdaod_build.sh b/Trigger/TrigValidation/TrigAnalysisTest/test/test_mc_pp_v7_rdotoesdaod_build.sh
index 63dfe7f9011f9cda3de3a4db543ac457c60871af..1c7ba8a7adb0ddf73d675887fed6fb86c8e92422 100755
--- a/Trigger/TrigValidation/TrigAnalysisTest/test/test_mc_pp_v7_rdotoesdaod_build.sh
+++ b/Trigger/TrigValidation/TrigAnalysisTest/test/test_mc_pp_v7_rdotoesdaod_build.sh
@@ -3,10 +3,9 @@
 # art-description: Trigger MC pp v7 RDO to ESD and AOD test, plus extra tests using these files
 # art-type: build
 # art-include: 21.0/Athena
-# art-include: 21.0-TrigMC/Athena
+# art-include: 21.3/Athena
 # art-include: master/Athena
 # art-include: 21.1/AthenaP1
-# art-include: 21.1-dev/AthenaP1
 # art-output: *check*
 # art-output: HLTChain.txt
 # art-output: HLTTE.txt
@@ -19,6 +18,7 @@
 # art-output: ntuple.pmon.gz
 # art-output: *perfmon*
 # art-output: TotalEventsProcessed.txt
+# art-output: *.regtest.new
 
 export NAME="mc_pp_v7_rdotoesdaod_build"
 export COST_MONITORING="False"
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_mc_pp_v7_rdotoesdaod_grid.sh b/Trigger/TrigValidation/TrigAnalysisTest/test/test_mc_pp_v7_rdotoesdaod_grid.sh
index fa5c0e0799d609edeabd9001a2eaef8602924fb1..892f6ea67c8e39e4fecd492418257d9b8f782883 100755
--- a/Trigger/TrigValidation/TrigAnalysisTest/test/test_mc_pp_v7_rdotoesdaod_grid.sh
+++ b/Trigger/TrigValidation/TrigAnalysisTest/test/test_mc_pp_v7_rdotoesdaod_grid.sh
@@ -3,10 +3,9 @@
 # art-description: Trigger MC pp v7 RDO to ESD and AOD test, plus extra tests using these files
 # art-type: grid
 # art-include: 21.0/Athena
-# art-include: 21.0-TrigMC/Athena
+# art-include: 21.3/Athena
 # art-include: master/Athena
 # art-include: 21.1/AthenaP1
-# art-include: 21.1-dev/AthenaP1
 # art-output: *check*
 # art-output: HLTChain.txt
 # art-output: HLTTE.txt
@@ -21,6 +20,7 @@
 # art-output: TotalEventsProcessed.txt
 # art-output: AOD.pool.root.checkFile0
 # art-output: AOD.pool.root.checkFiletrigSize.txt
+# art-output: *.regtest.new
 
 
 export NAME="mc_pp_v7_rdotoesdaod_grid"
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_mc_pp_v7_trigdecisiontool_grid.sh b/Trigger/TrigValidation/TrigAnalysisTest/test/test_mc_pp_v7_trigdecisiontool_grid.sh
index c571290406b5dd592a2e4a09c14df700a51ee5dd..a1d746fc9c357a4287e2bb29e322bd1c3021fd83 100755
--- a/Trigger/TrigValidation/TrigAnalysisTest/test/test_mc_pp_v7_trigdecisiontool_grid.sh
+++ b/Trigger/TrigValidation/TrigAnalysisTest/test/test_mc_pp_v7_trigdecisiontool_grid.sh
@@ -3,13 +3,9 @@
 # art-description: Trigger Decision Tool test on AOD
 # art-type: grid
 # art-include: 21.1/AthenaP1
-# art-include: 21.1-dev/AthenaP1
 # art-include: 21.0/Athena
-# art-include: 21.0-TrigMC/Athena
+# art-include: 21.3/Athena
 # art-include: master/Athena
-# art-include: master/AthenaP1
-# art-include: 21.1/AthenaP1
-# art-include: 21.1-dev/AthenaP1
 # art-output: *check*
 # art-output: HLTChain.txt
 # art-output: HLTTE.txt
@@ -22,6 +18,7 @@
 # art-output: ntuple.pmon.gz
 # art-output: *perfmon*
 # art-output: TotalEventsProcessed.txt
+# art-output: *.regtest.new
 
 export NAME="mc_pp_v7_trigdecisiontool_grid"
 export JOB_LOG="athena.log"
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_mc_pp_v7_trigedm_grid.sh b/Trigger/TrigValidation/TrigAnalysisTest/test/test_mc_pp_v7_trigedm_grid.sh
index 8f2e084f0c68a002a87243832c655e25db640e08..18b7e54ce7f5a49826d219461ad82b4efaaf3e73 100755
--- a/Trigger/TrigValidation/TrigAnalysisTest/test/test_mc_pp_v7_trigedm_grid.sh
+++ b/Trigger/TrigValidation/TrigAnalysisTest/test/test_mc_pp_v7_trigedm_grid.sh
@@ -3,13 +3,9 @@
 # art-description: Trigger Event Data Model test on AOD
 # art-type: grid
 # art-include: 21.1/AthenaP1
-# art-include: 21.1-dev/AthenaP1
 # art-include: 21.0/Athena
-# art-include: 21.0-TrigMC/Athena
+# art-include: 21.3/Athena
 # art-include: master/Athena
-# art-include: master/AthenaP1
-# art-include: 21.1/AthenaP1
-# art-include: 21.1-dev/AthenaP1
 # art-output: *check*
 # art-output: HLTChain.txt
 # art-output: HLTTE.txt
@@ -22,6 +18,7 @@
 # art-output: ntuple.pmon.gz
 # art-output: *perfmon*
 # art-output: TotalEventsProcessed.txt
+# art-output: *.regtest.new
 
 export NAME="mc_pp_v7_trigedm_grid"
 export JOB_LOG="athena.log"
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_physics_pp_v7_rdotoaod_grid.sh b/Trigger/TrigValidation/TrigAnalysisTest/test/test_physics_pp_v7_rdotoaod_grid.sh
index 52e3a9884d3de867a8c274c0e58c3120ac3111c1..f42e1c4b2e1f0eecdfef06ad29c67c4c26352c05 100755
--- a/Trigger/TrigValidation/TrigAnalysisTest/test/test_physics_pp_v7_rdotoaod_grid.sh
+++ b/Trigger/TrigValidation/TrigAnalysisTest/test/test_physics_pp_v7_rdotoaod_grid.sh
@@ -3,10 +3,9 @@
 # art-description: Trigger Physics pp v7 RDO to AOD test
 # art-type: grid
 # art-include: 21.0/Athena
-# art-include: 21.0-TrigMC/Athena
+# art-include: 21.3/Athena
 # art-include: master/Athena
 # art-include: 21.1/AthenaP1
-# art-include: 21.1-dev/AthenaP1
 # art-output: *check*
 # art-output: HLTChain.txt
 # art-output: HLTTE.txt
@@ -21,6 +20,7 @@
 # art-output: TotalEventsProcessed.txt
 # art-output: AOD.pool.root.checkFile0
 # art-output: AOD.pool.root.checkFiletrigSize.txt
+# art-output: *.regtest.new
 
 export NAME="physics_pp_v7_rdotoaod_grid"
 export COST_MONITORING="False"
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_physics_pp_v7_rdotobstoesd_build.sh b/Trigger/TrigValidation/TrigAnalysisTest/test/test_physics_pp_v7_rdotobstoesd_build.sh
index 967ff8d8ee32763f10f654e865bf19181304662e..4cba6c7df599b8529df494c2f8a81a0794494d4c 100755
--- a/Trigger/TrigValidation/TrigAnalysisTest/test/test_physics_pp_v7_rdotobstoesd_build.sh
+++ b/Trigger/TrigValidation/TrigAnalysisTest/test/test_physics_pp_v7_rdotobstoesd_build.sh
@@ -3,10 +3,9 @@
 # art-description: Trigger Physics pp v7 RDO to BS and BS to AOD test
 # art-type: build
 # art-include: 21.0/Athena
-# art-include: 21.0-TrigMC/Athena
+# art-include: 21.3/Athena
 # art-include: master/Athena
 # art-include: 21.1/AthenaP1
-# art-include: 21.1-dev/AthenaP1
 # art-output: *check*
 # art-output: HLTChain.txt
 # art-output: HLTTE.txt
@@ -19,6 +18,7 @@
 # art-output: ntuple.pmon.gz
 # art-output: *perfmon*
 # art-output: TotalEventsProcessed.txt
+# art-output: *.regtest.new
 
 export NAME="physics_pp_v7_rdotobstoesd_build"
 export COST_MONITORING="False"
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_physics_pp_v7_rdotoesdaod_build.sh b/Trigger/TrigValidation/TrigAnalysisTest/test/test_physics_pp_v7_rdotoesdaod_build.sh
index e115425f15fda44c8cd8a8fcef823ddd5b1e275d..8c6a483d769cdbd3db76bb0abdb281c23736b24f 100755
--- a/Trigger/TrigValidation/TrigAnalysisTest/test/test_physics_pp_v7_rdotoesdaod_build.sh
+++ b/Trigger/TrigValidation/TrigAnalysisTest/test/test_physics_pp_v7_rdotoesdaod_build.sh
@@ -3,10 +3,9 @@
 # art-description: Trigger Physics pp v7 RDO to ESD and AOD test, plus extra tests using these files
 # art-type: build
 # art-include: 21.0/Athena
-# art-include: 21.0-TrigMC/Athena
+# art-include: 21.3/Athena
 # art-include: master/Athena
 # art-include: 21.1/AthenaP1
-# art-include: 21.1-dev/AthenaP1
 # art-output: *check*
 # art-output: HLTChain.txt
 # art-output: HLTTE.txt
@@ -19,6 +18,7 @@
 # art-output: ntuple.pmon.gz
 # art-output: *perfmon*
 # art-output: TotalEventsProcessed.txt
+# art-output: *.regtest.new
 
 export NAME="physics_pp_v7_rdotoesdaod_build"
 export COST_MONITORING="False"
diff --git a/Trigger/TrigValidation/TrigAnalysisTest/test/test_physics_pp_v7_rdotoesdaod_grid.sh b/Trigger/TrigValidation/TrigAnalysisTest/test/test_physics_pp_v7_rdotoesdaod_grid.sh
index 61500481109ba0994b15f2dd2003939d6a6cde2a..6532b427227f6dae5a18fb7e957bd5f90bbc4fd9 100755
--- a/Trigger/TrigValidation/TrigAnalysisTest/test/test_physics_pp_v7_rdotoesdaod_grid.sh
+++ b/Trigger/TrigValidation/TrigAnalysisTest/test/test_physics_pp_v7_rdotoesdaod_grid.sh
@@ -3,10 +3,9 @@
 # art-description: Trigger Physics pp v7 RDO to ESD and AOD test, plus extra tests using these files
 # art-type: grid
 # art-include: 21.0/Athena
-# art-include: 21.0-TrigMC/Athena
+# art-include: 21.3/Athena
 # art-include: master/Athena
 # art-include: 21.1/AthenaP1
-# art-include: 21.1-dev/AthenaP1
 # art-output: *check*
 # art-output: HLTChain.txt
 # art-output: HLTTE.txt
@@ -21,6 +20,7 @@
 # art-output: TotalEventsProcessed.txt
 # art-output: AOD.pool.root.checkFile0
 # art-output: AOD.pool.root.checkFiletrigSize.txt
+# art-output: *.regtest.new
 
 export NAME="physics_pp_v7_rdotoesdaod_grid"
 export COST_MONITORING="False"
diff --git a/Trigger/TrigValidation/TriggerTest/CMakeLists.txt b/Trigger/TrigValidation/TriggerTest/CMakeLists.txt
index 4e6aee869bca9d868632b5aa2b29997c4983487e..a1fc922d3ed83dc79ee06d29dc4e60a77afc08b1 100644
--- a/Trigger/TrigValidation/TriggerTest/CMakeLists.txt
+++ b/Trigger/TrigValidation/TriggerTest/CMakeLists.txt
@@ -10,8 +10,7 @@ atlas_depends_on_subdirs( PUBLIC
                           TestPolicy )
 
 # Install files from the package:
-atlas_install_python_modules( python/__init__.py )
 atlas_install_joboptions( share/*.py )
-atlas_install_runtime( python/RttScriptRunner_TriggerTest.py share/*.cxx python/CheckLog_TriggerTest.py python/LogTail_TriggerTest.py python/CheckForTrigCostD3PD_TriggerTest.py python/CheckForHLTChainAllZero_TriggerTest.py python/CheckForHLTTEAllZero_TriggerTest.py python/CheckForL1AllZero_TriggerTest.py python/CreateIgprofReport_TriggerTest.py python/TruncateLog_TriggerTest.py python/ValGrindPostScript_TriggerTest.py python/ValgrindAnalysisScript_TriggerTest.py Testing/*.conf )
-atlas_install_scripts( Testing/*.sh Testing/*.pl test/exec*.sh test/test*sh )
+atlas_install_runtime( share/*.cxx Testing/*.conf )
+atlas_install_scripts( test/exec*.sh test/test*.sh )
 
diff --git a/Trigger/TrigValidation/TriggerTest/Testing/TriggerTest.conf b/Trigger/TrigValidation/TriggerTest/Testing/TriggerTest.conf
deleted file mode 100644
index c30834d027cfebec6ae5a82310ce50fa2b111946..0000000000000000000000000000000000000000
--- a/Trigger/TrigValidation/TriggerTest/Testing/TriggerTest.conf
+++ /dev/null
@@ -1,452 +0,0 @@
-# Configuration file for regression tests based on algorithm output
-# - "test" keyword marks the start of a new test configuration
-#   must be followed by an identifier that is unique in this file
-# - test names must also be unique; tests can be refered to by name or number
-# - indentation is optional but is recommended for clarity
-# - white space is ignored
-# - key words, on the left, must be lower case,
-#   and exactly match to one of the known keywords
-# - usually, any characters are valid for values, except white space
-# - white space is a separater when multiple values are needed
-# - except for regtest, if key words are repeated, the last one will override
-#   the others
-# - multiple regtest can be specified
-# See example and documentation at end for more details
-# tests for trigger QA and nightly builds
-# see other conf files for more tests
-
-
-###################################################################################################################################################
-#1 #Standalone and co block ~1h 
-#test 1-10 moved to P1Test
-
-###################################################################################################################################################
-#2 #Full Menu jobs (as these run forever MC 25mins actually - so try running these 3 in parallel please) 
-
-test 20
-  name AthenaTrigRDO_MC_pp_v6
-  doc MC_pp_v6
-  joboptions testCommonSliceAthenaTrigRDO.py
-  athena_args -c 'from TriggerJobOpts.TriggerFlags import TriggerFlags as TF;TF.run2Config.set_Value_and_Lock("2016"); menu="MC_pp_v6" ;  jp.AthenaCommonFlags.EvtMax.set_Value_and_Lock(5); jp.AthenaCommonFlags.FilesInput=["root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/trig-daq/validation/test_data/valid1.110401.PowhegPythia_P2012_ttbar_nonallhad.recon.RDO.e3099_s2578_r7572_tid07644622_00/RDO.07644622._000001.pool.root.1"] '
-  checklog --config checklogTriggerTest.conf --showexcludestats
-  regtest TrigSteer_HLT.TrigChainMoniValidation REGTEST /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/triggertest_AthenaRDO_MC_pp_v6.TrigChainMoniValidation.reference
-  rootcomp /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/triggertest_AthenaTrigRDO_MC_pp_v6.root
-  checkcount /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/triggertest_AthenaTrigRDO_MC_pp_v6.root 1
-  pre_command RecExCommon_links.sh
-  post_command chainDump.py -n -S
-
-test 21
-  name AthenaTrigRDO_Physics_pp_v7
-  doc Physics_pp_v7
-  joboptions testCommonSliceAthenaTrigRDO.py
-  athena_args -c 'RunningRTT=TRUE ; menu="Physics_pp_v7" ; jp.AthenaCommonFlags.EvtMax.set_Value_and_Lock(5); jp.AthenaCommonFlags.FilesInput=["root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/trig-daq/validation/test_data/valid1.110401.PowhegPythia_P2012_ttbar_nonallhad.recon.RDO.e3099_s2578_r7572_tid07644622_00/RDO.07644622._000001.pool.root.1"] '
-  checklog --config checklogTriggerTest.conf --showexcludestats
-  regtest TrigSteer_HLT.TrigChainMoniValidation REGTEST /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/triggertest_AthenaRDO_Physics_pp_v7.TrigChainMoniValidation.reference
-  rootcomp /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/triggertest_AthenaTrigRDO_Physics_pp_v7.root
-  checkcount /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/triggertest_AthenaTrigRDO_Physics_pp_v7.root 1
-  pre_command RecExCommon_links.sh
-  post_command chainDump.py -n -S
-
-test 22
-  name AthenaTrigRDO_Physics_HI_v3
-  doc Physics_HI_v3 
-  joboptions testCommonSliceAthenaTrigRDO.py
-  athena_args -c 'jp.AthenaCommonFlags.EvtMax.set_Value_and_Lock(5);menu="Physics_HI_v3"; jp.AthenaCommonFlags.FilesInput=["root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/trig-daq/validation/test_data/mc15_5TeV.420000.Hijing_PbPb_5p02TeV_MinBias_Flow_JJFV6.recon.RDO.e3754_s2633_r7161/RDO.06677682._000001.pool.root.1"]'
-  checklog --config checklogTriggerTest.conf --showexcludestats
-  regtest TrigSteer_HLT.TrigChainMoniValidation REGTEST /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/triggertest_AthenaRDO_Physics_HI_v3.TrigChainMoniValidation.reference
-  rootcomp /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/triggertest_AthenaTrigRDO_Physics_HI_v3.root
-  checkcount /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/triggertest_AthenaTrigRDO_Physics_HI_v3.root 1
-  pre_command RecExCommon_links.sh
-  post_command chainDump.py -n -S
-
-test 23
-  name AthenaTrigRDO_Physics_HI_v4
-  doc Physics_HI_v4 on ttbar
-  joboptions testCommonSliceAthenaTrigRDO.py
-  athena_args -c 'jp.AthenaCommonFlags.EvtMax.set_Value_and_Lock(5);menu="Physics_HI_v4"; jp.AthenaCommonFlags.FilesInput=["root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/trig-daq/validation/test_data/valid1.110401.PowhegPythia_P2012_ttbar_nonallhad.recon.RDO.e3099_s2578_r7572_tid07644622_00/RDO.07644622._000001.pool.root.1"]'
-  checklog --config checklogTriggerTest.conf --showexcludestats
-  regtest TrigSteer_HLT.TrigChainMoniValidation REGTEST /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/triggertest_AthenaRDO_Physics_HI_v4.TrigChainMoniValidation.reference
-  rootcomp /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/triggertest_AthenaTrigRDO_Physics_HI_v4.root
-  checkcount /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/triggertest_AthenaTrigRDO_Physics_HI_v4.root 1
-  pre_command RecExCommon_links.sh
-  post_command chainDump.py -n -S
-
-test 24
-  name AthenaTrigRDO_MC_HI_v4
-  doc AthenaTrigRDO_MC_HI_v4 on ttbar
-  joboptions testCommonSliceAthenaTrigRDO.py
-  athena_args -c 'jp.AthenaCommonFlags.EvtMax.set_Value_and_Lock(5);menu="MC_HI_v4"; jp.AthenaCommonFlags.FilesInput=["root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/trig-daq/validation/test_data/valid1.110401.PowhegPythia_P2012_ttbar_nonallhad.recon.RDO.e3099_s2578_r7572_tid07644622_00/RDO.07644622._000001.pool.root.1"]'
-  checklog --config checklogTriggerTest.conf --showexcludestats
-  regtest TrigSteer_HLT.TrigChainMoniValidation REGTEST /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/triggertest_AthenaRDO_MC_HI_v4.TrigChainMoniValidation.reference
-  rootcomp /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/triggertest_AthenaTrigRDO_MC_HI_v4.root
-  checkcount /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/triggertest_AthenaTrigRDO_MC_HI_v4.root 1
-  pre_command RecExCommon_links.sh
-  post_command chainDump.py -n -S
-
-test 25
-  name AthenaTrigRDO_MC_pp_v6_no_prescale_toxAOD_FTK
-  doc FTK_MC_pp_v6_no_prescale
-  joboptions testCommonSliceAthenaTrigRDOtoAOD.py
-  athena_args -c 'from TriggerJobOpts.TriggerFlags import TriggerFlags as TF;TF.run2Config.set_Value_and_Lock("2016"); enableCostMonitoring=True;RunningRTT=True;menu="MC_pp_v6_no_prescale";jp.AthenaCommonFlags.EvtMax.set_Value_and_Lock(3);jp.Rec.OutputLevel=WARNING;LVL1OutputLevel=WARNING;HLTOutputLevel=WARNING;jp.AthenaCommonFlags.FilesInput=["root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/trig-daq/validation/test_data/RDO_FTK.10733709._000019.pool.root.1"];from TriggerJobOpts.TriggerFlags import TriggerFlags;TriggerFlags.doFTK=True;from RecExConfig.RecFlags import rec;rec.doFTK.set_Value_and_Lock(True)' 
-  checklog --config checklogTriggerTest.conf --showexcludestats
-  regtest TrigSteer_HLT.TrigChainMoniValidation REGTEST /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/triggertest_AthenaTrigRDO_FTK_MC_pp_v6_no_prescale.TrigChainMoniValidation.reference
-  rootcomp /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/triggertest_AthenaTrigRDO_FTK_MC_pp_v6_no_prescale.root
-  checkcount /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/triggertest_AthenaTrigRDO_FTK_MC_pp_v6_no_prescale.root 1
-  pre_command RecExCommon_links.sh
-  post_command chainDump.py -n -S
-
-test 26
-  name AthenaTrigRDO_MC_pp_v7
-  doc MC_pp_v7
-  joboptions testCommonSliceAthenaTrigRDO.py
-  athena_args -c 'menu="MC_pp_v7" ; jp.AthenaCommonFlags.EvtMax.set_Value_and_Lock(5); jp.AthenaCommonFlags.FilesInput=["root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/trig-daq/validation/test_data/valid1.110401.PowhegPythia_P2012_ttbar_nonallhad.recon.RDO.e3099_s2578_r7572_tid07644622_00/RDO.07644622._000001.pool.root.1"] '
-  checklog --config checklogTriggerTest.conf --showexcludestats
-  regtest TrigSteer_HLT.TrigChainMoniValidation REGTEST /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/triggertest_AthenaRDO_MC_pp_v7.TrigChainMoniValidation.reference
-  rootcomp /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/triggertest_AthenaTrigRDO_MC_pp_v7.root
-  checkcount /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/triggertest_AthenaTrigRDO_MC_pp_v7.root 1
-  pre_command RecExCommon_links.sh
-  post_command chainDump.py -n -S
-  extra_failure_codes ATHENA_ERROR_IN_LOG
-
-test 27
-  name AthenaTrigRDO_MC_pp_v7_no_prescale_toxAOD_FTK
-  doc FTK_MC_pp_v7_no_prescale
-  joboptions testCommonSliceAthenaTrigRDOtoAOD.py
-  athena_args -c "enableCostMonitoring=True;RunningRTT=True;menu='MC_pp_v7_no_prescale';jp.AthenaCommonFlags.EvtMax.set_Value_and_Lock(3);jp.Rec.OutputLevel=WARNING;LVL1OutputLevel=WARNING;HLTOutputLevel=WARNING;jp.AthenaCommonFlags.FilesInput=['root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/trig-daq/validation/test_data/RDO_FTK.10733709._000019.pool.root.1'];from TriggerJobOpts.TriggerFlags import TriggerFlags;TriggerFlags.doFTK=True;from RecExConfig.RecFlags import rec;rec.doFTK.set_Value_and_Lock(True)" 
-  checklog --config checklogTriggerTest.conf --showexcludestats
-  regtest TrigSteer_HLT.TrigChainMoniValidation REGTEST /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/triggertest_AthenaTrigRDO_FTK_MC_pp_v7_no_prescale.TrigChainMoniValidation.reference
-  rootcomp /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/triggertest_AthenaTrigRDO_FTK_MC_pp_v7_no_prescale.root
-  checkcount /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/triggertest_AthenaTrigRDO_FTK_MC_pp_v7_no_prescale.root 1
-  pre_command RecExCommon_links.sh
-  post_command chainDump.py -n -S
-
-
-###################################################################################################################################################
-#currently NOT needed anymore 
-#3 #create a new pseudo-test directory (ALWAYS called AthenaTrigRDO) a sym/soft link to one of the above  
-
-test 30
-  name link_AthenaTrigRDO_MC
-  doc run ln -s AthenaTrigRDO_MC_pp_v7 ../AthenaTrigRDO 
-  athena_cmd echo "Not running athena"
-  pre_condition if [[ $(find ../AthenaTrigRDO_MC_pp_v7/expert-monitoring.root -type f -size +1000000c 2>/dev/null) ]] ; then test -e ../AthenaTrigRDO_MC_pp_v7/expert-monitoring.root ; else test -e non_existing_file ; fi  
-  post_command ln -s AthenaTrigRDO_MC_pp_v7 ../AthenaTrigRDO 
-
-test 31
-  name link_AthenaTrigRDO_Physics
-  doc run ln -s AthenaTrigRDO_Physics_pp_v7 ../AthenaTrigRDO 
-  athena_cmd echo "Not running athena"
-  pre_condition if [[ $(find ../AthenaTrigRDO_Physics_pp_v7/expert-monitoring.root -type f -size +1000000c 2>/dev/null) ]] ; then test -e ../AthenaTrigRDO_Physics_pp_v7/expert-monitoring.root ; else test -e non_existing_file ; fi  
-  post_command ln -s AthenaTrigRDO_Physics_pp_v7 ../AthenaTrigRDO 
-
-###################################################################################################################################################
-#4 #the below tests run AthenaTrigRDO with splc. additions - running in OPT builds only!
-
-test 40
-  name AthenaTrigRDO_leakcheck
-  doc --leak-check-execute, otherwise standare, REGTEST wrt AthenaTrigRDO
-  joboptions testCommonSliceAthenaTrigRDO.py
-  #this export of the LD_PRELOAD path somehow aint working in the perl-script so do it in the xml setup file now
-  athena_args --stdcmalloc --leak-check-execute -c 'checkLeak="True";jp.AthenaCommonFlags.EvtMax.set_Value_and_Lock(3);include("TriggerTest/TriggerTestSilence.py")'
-  checklog --config checklogTriggerTest.conf --showexcludestats
-#  regtest TrigSteer_HLT.TrigChainMoniValidation REGTEST ../AthenaTrigRDO/triggertest_AthenaTrigRDO.TrigChainMoniValidation.reference
-#  rootcomp /afs/cern.ch/atlas/project/trigger ../AthenaTrigRDO/expert-monitoring.root
-#  checkcount ../AthenaTrigRDO/expert-monitoring.root 0
-  pre_command RecExCommon_links.sh
-  
-test 41
-  name AthenaTrigRDO_StatusCodes
-  doc standard trigger job, will crash on status codes
-  joboptions testCommonSliceAthenaTrigRDO.py
-  athena_args -c 'StatusCodeSvc.AbortOnError=True'
-  checklog --config checklogTriggerTest.conf --showexcludestats
-  pre_command RecExCommon_links.sh
-  post_command chainDump.py -n -S
-
-test 42
-  name AthenaTrigRDO_noFPE
-  doc standard trigger job no Floating Point Exceptions
-  joboptions testCommonSliceAthenaTrigRDO.py
-  athena_args -c 'jp.Rec.doFloatingPointException=True;AbortOnError=True' 
-  checklog --config checklogTriggerTest.conf --showexcludestats
-  pre_command RecExCommon_links.sh
-  post_command chainDump.py -n -S
-
-###################################################################################################################################################
-#5 #compare chain-order up and down - choose Phys or MC in the CONF 
-
-test 50
-  name AthenaTrigRDO_chainOrderAscend
-  doc changes order of chains, based on AthenaTrigRDO
-  joboptions testCommonSliceAthenaTrigRDO.py
-  athena_args -c 'chainOrderOption=-1'
-  checklog --config checklogTriggerTest.conf --showexcludestats
-  regtest TrigSteer_HLT.TrigChainMoniValidation REGTEST /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/triggertest_AthenaRDO_chainOrderAscend.TrigChainMoniValidation.reference
-  pre_command RecExCommon_links.sh
-  post_command chainDump.py -n -S
-  
-test 51
-  name AthenaTrigRDO_chainOrderDescend
-  doc changes order of chains based on AthenaTrigRDO
-  joboptions testCommonSliceAthenaTrigRDO.py
-  athena_args -c 'chainOrderOption=1'
-  checklog --config checklogTriggerTest.conf --showexcludestats
-  regtest TrigSteer_HLT.TrigChainMoniValidation REGTEST /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/triggertest_AthenaRDO_chainOrderDescend.TrigChainMoniValidation.reference
-  pre_command RecExCommon_links.sh
-  post_command chainDump.py -n -S
-  
-test 52
-  name AthenaTrigRDO_chainOrder_compare
-  doc compare result of chainOrderAscend/Descend tests
-  athena_cmd echo "Not running athena"
-  pre_condition if [[ $(find ../AthenaTrigRDO_chainOrderAscend/expert-monitoring.root -type f -size +1000000c 2>/dev/null) ]] ; then test -e ../AthenaTrigRDO_chainOrderAscend/expert-monitoring.root ; else test -e non_existing_file ; fi  
-  pre_condition if [[ $(find ../AthenaTrigRDO_chainOrderDescend/expert-monitoring.root -type f -size +1000000c 2>/dev/null) ]] ; then test -e ../AthenaTrigRDO_chainOrderDescend/expert-monitoring.root ; else test -e non_existing_file ; fi  
-  post_command ln -s ../AthenaTrigRDO_chainOrderDescend/expert-monitoring.root
-  checkcount ../AthenaTrigRDO_chainOrderAscend/expert-monitoring.root 0 BOTH
-  rootcomp ../AthenaTrigRDO_chainOrderAscend/expert-monitoring.root ../AthenaTrigRDO_chainOrderDescend/expert-monitoring.root
-  extra_failure_codes CHECKCOUNTS_FAILED
-
-###################################################################################################################################################
-#6+ (->8)#Signature/Slice tests - dont depend on anything really - so could in priciple run all by themselves:
-#6) MC_Menu (each of the 2 blocks runs ~1h) & 7)special setups: 
-
-###################################################################################################################################################
-#6 #MC_Menu
-
-test 60
-  name BjetSliceAthenaTrigRDO
-  doc Bjet slice on top
-  joboptions testCommonSliceAthenaTrigRDO.py
-  athena_args -c 'menu="MC_pp_v7_TriggerValidation_mc_prescale"; sliceName="bjet" ; jp.AthenaCommonFlags.EvtMax.set_Value_and_Lock(10); jp.AthenaCommonFlags.FilesInput=["root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/trig-daq/validation/test_data/valid1.110401.PowhegPythia_P2012_ttbar_nonallhad.recon.RDO.e3099_s2578_r7572_tid07644622_00/RDO.07644622._000001.pool.root.1"] '
-  checklog --config checklogTriggerTest.conf --showexcludestats
-  fullregtest REGTEST /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/triggertest_BjetSliceAthenaTrigRDO.reference
-  rootcomp /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/triggertest_BjetSliceAthenaTrigRDO.root
-  checkcount /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/triggertest_BjetSliceAthenaTrigRDO.root 1
-  pre_command RecExCommon_links.sh
-  post_command chainDump.py -n -S
-
-test 61
-  name BphysicsSliceAthenaTrigRDO
-  doc Bphysics on top
-  joboptions testCommonSliceAthenaTrigRDO.py
-  athena_args -c 'menu="MC_pp_v7_TriggerValidation_mc_prescale"; sliceName="bphysics"; jp.AthenaCommonFlags.EvtMax.set_Value_and_Lock(10); jp.AthenaCommonFlags.FilesInput=["root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/trig-daq/validation/test_data/valid1.110401.PowhegPythia_P2012_ttbar_nonallhad.recon.RDO.e3099_s2578_r7572_tid07644622_00/RDO.07644622._000001.pool.root.1"]'
-  checklog --config checklogTriggerTest.conf --showexcludestats
-  fullregtest REGTEST /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/triggertest_BphysicsSliceAthenaTrigRDO.reference
-  rootcomp /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/triggertest_BphysicsSliceAthenaTrigRDO.root
-  checkcount /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/triggertest_BphysicsSliceAthenaTrigRDO.root 1
-  pre_command RecExCommon_links.sh
-  post_command chainDump.py -n -S
-
-test 62
-  name ElectronSliceAthenaTrigRDO
-  doc runs electron slice only on top
-  joboptions testCommonSliceAthenaTrigRDO.py
-  athena_args -c 'menu="MC_pp_v7_TriggerValidation_mc_prescale"; sliceName="egamma" ; jp.AthenaCommonFlags.EvtMax.set_Value_and_Lock(10); jp.AthenaCommonFlags.FilesInput=["root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/trig-daq/validation/test_data/valid1.110401.PowhegPythia_P2012_ttbar_nonallhad.recon.RDO.e3099_s2578_r7572_tid07644622_00/RDO.07644622._000001.pool.root.1"]'
-  checklog --config checklogTriggerTest.conf --showexcludestats
-  fullregtest REGTEST /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/triggertest_ElectronSliceAthenaTrigRDO.reference
-  rootcomp /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/triggertest_ElectronSliceAthenaTrigRDO.root
-  checkcount /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/triggertest_ElectronSliceAthenaTrigRDO.root 1
-  pre_command RecExCommon_links.sh
-  post_command chainDump.py -n -S
-
-test 63
-  name JetSliceAthenaTrigRDO
-  doc Jet slice on top
-  joboptions testCommonSliceAthenaTrigRDO.py
-  athena_args -c 'menu="MC_pp_v7_TriggerValidation_mc_prescale"; sliceName="jet" ; jp.AthenaCommonFlags.EvtMax.set_Value_and_Lock(10); jp.AthenaCommonFlags.FilesInput=["root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/trig-daq/validation/test_data/valid1.110401.PowhegPythia_P2012_ttbar_nonallhad.recon.RDO.e3099_s2578_r7572_tid07644622_00/RDO.07644622._000001.pool.root.1"]'
-  checklog --config checklogTriggerTest.conf --showexcludestats
-  fullregtest REGTEST /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/triggertest_JetSliceAthenaTrigRDO.reference
-  rootcomp /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/triggertest_JetSliceAthenaTrigRDO.root
-  checkcount /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/triggertest_JetSliceAthenaTrigRDO.root 1
-  pre_command RecExCommon_links.sh
-  post_command chainDump.py -n -S
-
-test 64
-  name METSliceAthenaTrigRDO
-  doc MET slice on top  
-  joboptions testCommonSliceAthenaTrigRDO.py
-  athena_args -c 'menu="MC_pp_v7_TriggerValidation_mc_prescale"; sliceName="met" ; jp.AthenaCommonFlags.EvtMax.set_Value_and_Lock(10); jp.AthenaCommonFlags.FilesInput=["root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/trig-daq/validation/test_data/valid1.110401.PowhegPythia_P2012_ttbar_nonallhad.recon.RDO.e3099_s2578_r7572_tid07644622_00/RDO.07644622._000001.pool.root.1"]'
-  checklog --config checklogTriggerTest.conf --showexcludestats
-  fullregtest REGTEST /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/triggertest_METSliceAthenaTrigRDO.reference
-  rootcomp /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/triggertest_METSliceAthenaTrigRDO.root
-  checkcount /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/triggertest_METSliceAthenaTrigRDO.root 1
-  pre_command RecExCommon_links.sh
-  post_command chainDump.py -n -S
-
-test 65
-  name MinBiasSliceAthenaTrigRDO
-  doc minbias slice, does not use top events
-  joboptions testCommonSliceAthenaTrigRDO.py  
-  athena_args -c 'jp.AthenaCommonFlags.EvtMax.set_Value_and_Lock(100) ; menu="Physics_pp_v7"; sliceName="minbias" ;  LVL1OutputLevel=DEBUG ; jp.AthenaCommonFlags.FilesInput=["root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/trig-daq/validation/test_data/mc15_13TeV.361203.Pythia8_A2_MSTW2008LO_ND_minbias.recon.RDO.e3639_s2606_s2174_r7661_tid07858100_00/RDO.07858100._000087.pool.root.1"]'
-  checklog --config checklogTriggerTest.conf --showexcludestats
-  fullregtest REGTEST /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/triggertest_MinBiasSliceAthenaTrigRDO.reference
-  rootcomp /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/triggertest_MinBiasSliceAthenaTrigRDO.root
-  checkcount /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/triggertest_MinBiasSliceAthenaTrigRDO.root 1
-  pre_command RecExCommon_links.sh
-  post_command chainDump.py -n -S
-
-test 66
-  name MuonSliceAthenaTrigRDO
-  doc muon on top
-  joboptions testCommonSliceAthenaTrigRDO.py
-  athena_args -c 'menu="MC_pp_v7_TriggerValidation_mc_prescale"; sliceName="muon"; jp.AthenaCommonFlags.EvtMax.set_Value_and_Lock(10); jp.AthenaCommonFlags.FilesInput=["root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/trig-daq/validation/test_data/valid1.110401.PowhegPythia_P2012_ttbar_nonallhad.recon.RDO.e3099_s2578_r7572_tid07644622_00/RDO.07644622._000001.pool.root.1"]'
-  checklog --config checklogTriggerTest.conf --showexcludestats
-  fullregtest REGTEST /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/triggertest_MuonSliceAthenaTrigRDO.reference
-  rootcomp /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/triggertest_MuonSliceAthenaTrigRDO.root
-  checkcount /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/triggertest_MuonSliceAthenaTrigRDO.root 1
-  pre_command RecExCommon_links.sh
-  post_command chainDump.py -n -S
- 
-test 67
-  name TauSliceAthenaTrigRDO
-  doc Tau on top
-  joboptions testCommonSliceAthenaTrigRDO.py
-  athena_args -c 'menu="MC_pp_v7_TriggerValidation_mc_prescale"; sliceName="tau" ; jp.AthenaCommonFlags.EvtMax.set_Value_and_Lock(10); jp.AthenaCommonFlags.FilesInput=["root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/trig-daq/validation/test_data/valid1.110401.PowhegPythia_P2012_ttbar_nonallhad.recon.RDO.e3099_s2578_r7572_tid07644622_00/RDO.07644622._000001.pool.root.1"]'
-  checklog --config checklogTriggerTest.conf --showexcludestats
-  fullregtest REGTEST /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/triggertest_TauSliceAthenaTrigRDO.reference
-  rootcomp /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/triggertest_TauSliceAthenaTrigRDO.root
-  checkcount /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/triggertest_TauSliceAthenaTrigRDO.root 1
-  pre_command RecExCommon_links.sh
-  post_command chainDump.py -n -S
-
-###################################################################################################################################################
-#7 #special setups
-
-test 70
-  name MinBiasSliceAthenaTrigRDO_Enhanced
-  doc MinBias triggers configured by hand on top
-  joboptions testCommonSliceAthenaTrigRDO.py
-  athena_args -c 'sliceName="minbiasEnhanced"; jp.AthenaCommonFlags.EvtMax.set_Value_and_Lock(5) ; jp.AthenaCommonFlags.FilesInput=["root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/trig-daq/validation/test_data/valid1.110401.PowhegPythia_P2012_ttbar_nonallhad.recon.RDO.e3099_s2578_r7572_tid07644622_00/RDO.07644622._000001.pool.root.1"]'
-#  athena_args -c 'sliceName="minbiasEnhanced"; jp.AthenaCommonFlags.EvtMax.set_Value_and_Lock(5) ; LVL1OutputLevel=DEBUG ; jp.AthenaCommonFlags.FilesInput=["root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/trig-daq/validation/test_data/valid1.110401.PowhegPythia_P2012_ttbar_nonallhad.recon.RDO.e3099_s2578_r7572_tid07644622_00/RDO.07644622._000001.pool.root.1"]'
-  checklog --config checklogTriggerTest.conf --showexcludestats
-  fullregtest REGTEST /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/triggertest_MinBiasSliceAthenaTrigRDO_Enhanced.reference
-  rootcomp /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/triggertest_MinBiasSliceAthenaTrigRDO_Enhanced.root
-  checkcount /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/triggertest_MinBiasSliceAthenaTrigRDO_Enhanced.root 1
-  pre_command RecExCommon_links.sh
-  post_command chainDump.py -n -S
-
-test 71
-  name AthenaTrigRDO_LVL1CTP
-  doc Level1 LVL1CTP
-  joboptions testLVL1CTPAthenaTrigRDO.py
-  athena_args -c 'jp.AthenaCommonFlags.EvtMax.set_Value_and_Lock(10); jp.AthenaCommonFlags.FilesInput=["root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/trig-daq/validation/test_data/valid1.110401.PowhegPythia_P2012_ttbar_nonallhad.recon.RDO.e3099_s2578_r7572_tid07644622_00/RDO.07644622._000001.pool.root.1"]'
-  checklog --config checklogTriggerTest.conf --showexcludestats
-  fullregtest REGTEST /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/triggertest_AthenaTrigRDO_LVL1CTP.reference
-  rootcomp /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/triggertest_LVL1CTPAthenaTrigRDO.root
-  pre_command RecExCommon_links.sh
-
-test 72
-  name AthenaTrigRDO_ID
-  doc runs ID 
-  joboptions testIDAthenaTrigRDO.py
-  checklog --config checklogTriggerTest.conf --showexcludestats
-  fullregtest REGTEST /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/triggertest_AthenaTrigRDO_ID.reference
-  pre_command RecExCommon_links.sh
-  post_command chainDump.py -n -S
-  
-test 73
-  name AthenaTrigRDO_IDpreRTTtest
-  doc checks ID RTT jo
-  joboptions testIDAthenaTrigRDO_preRTTtest.py
-  checklog --config checklogTriggerTest.conf --showexcludestats
-  fullregtest REGTEST /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/triggertest_AthenaTrigRDO_IDpreRTTtest.reference
-  pre_command RecExCommon_links.sh
-
-###################################################################################################################################################
-#special requests / tests
-
-test 201
-  name AthenaTrigRDO_MC_pp_v5
-  doc MC_pp_v5
-  joboptions testCommonSliceAthenaTrigRDO.py
-  athena_args -c 'menu="MC_pp_v5" ; jp.AthenaCommonFlags.EvtMax.set_Value_and_Lock(5); jp.AthenaCommonFlags.FilesInput=["root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/trig-daq/validation/test_data/valid1.110401.PowhegPythia_P2012_ttbar_nonallhad.recon.RDO.e3099_s2578_r7572_tid07644622_00/RDO.07644622._000001.pool.root.1"] '
-  checklog --config checklogTriggerTest.conf --showexcludestats
-  regtest TrigSteer_HLT.TrigChainMoniValidation REGTEST /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/triggertest_AthenaRDO_MC_pp_v5.TrigChainMoniValidation.reference
-  rootcomp /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/triggertest_AthenaTrigRDO_MC_pp_v5.root
-  checkcount /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/postrel20/latest/triggertest_AthenaTrigRDO_MC_pp_v5.root 1
-  pre_command RecExCommon_links.sh
-  post_command chainDump.py -n -S
-
-# THE END for now ....
-
-
-# Example/documentation
-test 0 # must have a unique id
-
-  # name must also be unique, and should be meaningful
-  # if not specified, will default to test_<id>
-  name demo_only
-
-  # comment this out to enable the test
-  disable
-
-  # Input data file for the job
-  # This is optional - you can omit it and provide a data file by hand
-  # Will be linked to ZEBRA.P in the run directory by default,
-  # otherwise specify name of link as second argument, separated by a space
-  # An attempt will be made to expand environment variables of the form ${ENV}
-  # in the name of the data file, from those in the shell from which you call
-  # the test script and those set by cmt setup.
-  datafile /afs/cern.ch/atlas/offline/data/testfile/dc1.001003.simul.redig.00001.test.h130_2e2mu_extract.zebra
-  # another example, using environment variable
-  #datafile ${ATLASTESTDATA}/dc1.001003.simul.redig.00001.test.h130_2e2mu_extract.zebra
-  # another example, with a non-default link name:
-  # datafile /afs/cern.ch/atlas/offline/data/testfile/some_bytestream_file RawEvent.re
-
-  # name of joboptions file - NB it is mandatory to specify this
-  # named file will be copied with get_files and modified
-  joboptions testIDtransBS_Flags.py
-
-  # run the checklog script on the log file produced by this job
-  checklog
-  # optional checklog arguments can be given, e.g. to specify alternative
-  # config file for 'excludes' list, to add the option to print table of
-  # exclusion counts, etc.
-  # unusually, spaces are retained as part of the options up to end of line
-  # checklog --config ../Testing/check_log_idexcludes.conf --showexcludestats
-
-  # regtest specifies an algorithm name, a pattern that log lines from
-  #this algorithm will be matched to, and the name of a reference file to
-  #compare these lines with:
-  regtest IdScan_IdScanMain_1_L2 REGTEST idscan.reference
-  # you can specify multiple regtest lines, all will be checked
-  # reference files are assumed to be in the directory ../reference/
-
-  # fullregtest is like regtest but it
-  # applies to the whole job, not just one algorithm. The arguments
-  # specify a pattern that log lines from the full log will be matched to, 
-  # and the name of a reference file to compare these lines with:
-  fullregtest REGTEST full.reference
-  # reference files are assumed to be in the directory ../reference/
-  # it only makes sense once per event for a given pattern.
-
-  # rootcomp
-  # runs the rootcomp.py script on the expert-monitoring.root file and
-  # the reference file given as an argument
-  # https://twiki.cern.ch/twiki/bin/view/Atlas/TrigValTools#rootcomp_py
-  rootcomp /afs/cern.ch/atlas/project/trigger/pesa-sw/validation/references/ATN/latest/atn_102.root
-
-  # pre_command is used to specify a command that must be run before athena
-  # unusually, spaces are retained as part of the command up to end of line
-  # e.g. remove a file, stage a file
-  # can give multiple shell commands by using ; between them
-  # can give multiple pre_command lines
-  pre_command test -f RawEvent.re && rm -f RawEvent.re
-  pre_command RecExCommon_links.sh
-
-  # post_command is used to specify a command that must be run after athena
-  # it will be run from the run directory in which the job was run
-  # and $packagedir can be used to indicate the top dir of the package.
-  # unusually, spaces are retained as part of the command up to end of line
-  # e.g. remove a file, stage a file
-  # can give multiple shell commands by using ; between them
-  # can give multiple post_command lines
-  post_command $packagedir/Testing/vmem.sh
-
-  # override default athena command, athena.py -bs
-  # unusually, spaces are retained as part of the command up to end of line
-  athena_cmd athenaMT
-
-  # add extra athena options, will be included in athena.py command line
-  # unusually, spaces are retained as part of the command up to end of line
-  athena_args -c onlyMuon=True
diff --git a/Trigger/TrigValidation/TriggerTest/Testing/compareXMLvsDBconfig.sh b/Trigger/TrigValidation/TriggerTest/Testing/compareXMLvsDBconfig.sh
deleted file mode 100755
index 2072c88cc0050de3e949e0a7e85be9354eb90c27..0000000000000000000000000000000000000000
--- a/Trigger/TrigValidation/TriggerTest/Testing/compareXMLvsDBconfig.sh
+++ /dev/null
@@ -1,98 +0,0 @@
-#!/bin/sh
-#
-# Compare output of tests starting from XML and DB trigger configuration
-#
-# mimick timer.log created by trigtest.pl to simply show the date
-starttimer=`date +%s`
-
-# leave record of current directory in test results and create working directory
-echo "List of current directory"
-ls -l
-echo "Moving to  AthenaXMLvsDBcompare"
-#mkdir  AthenaXMLvsDBcompare
-#cd  AthenaXMLvsDBcompare
-pwd
-date
-
-# search for the right output: important to sort lines
-LogFileXML=../AthenaXMLConfigRDO/testAthenaXMLConfigRDO_test.log
-if [ -e $LogFileXML ]; then
-    menuXML=`grep 'INFO Menu name:' $LogFileXML | awk '{print $NF}'`
-    echo XML menu: $menuXML
-    echo "Checking ${LogFileXML} for CTPSimulation and TrigChainMoniValidation"
-    rm -rf REGTEST.XML.txt
-    grep "CTPSimulation"  ${LogFileXML} | grep "REGTEST - |" | sort > REGTEST.XML.txt
-    grep "TrigChainMoniValidation               INFO  REGTEST" ${LogFileXML} | sort >> REGTEST.XML.txt
-else 
-    echo "${LogFileXML} not found "
-    printf "ATHENA_BAD_EXIT (8)\nATHENA_NO_LOG (16)\nATHENA_ERROR_IN_LOG (32)\nATHENA_REGTEST_FAILED (64)\n exitcode = 120\n maskedcode = 8\n" > summary.log
-    (( timer=`date +%s` - $starttimer )); printf "$timer $starttimer `date +%s`" > timer.log 
-    exit 0
-fi
-
-LogFileDB=../AthenaDBConfigRDO/testAthenaDBConfigRDO_test.log
-if [ -e ${LogFileDB} ]; then
-    menuDB=`grep 'INFO Menu name:' $LogFileDB | awk '{print $NF}'`
-    echo DB menu: $menuDB
-    echo "Checking ${LogFileDB} for CTPSimulation and TrigChainMoniValidation"
-    rm -rf REGTEST.DB.txt
-    grep "CTPSimulation" ${LogFileDB} | grep "REGTEST - |" | sort > REGTEST.DB.txt
-    grep "TrigChainMoniValidation               INFO  REGTEST" ${LogFileDB} | sort >>  REGTEST.DB.txt
-else 
-    echo "${LogFileDB} not found"
-    printf "ATHENA_BAD_EXIT (8)\nATHENA_NO_LOG (16)\nATHENA_ERROR_IN_LOG (32)\nATHENA_REGTEST_FAILED (64)\n exitcode = 120\n maskedcode = 8\n" > summary.log
-    (( timer=`date +%s` - $starttimer )); printf "$timer $starttimer `date +%s`" > timer.log 
-    exit 0
-fi
-echo "Good start: logfiles have been found."
-
-# check same menus used
-if [ "$menuDB" != "$menuXML" ]; then
-    echo "ERROR Menu mismatch: DB $menuDB != XML $menuXML; please fix the test!"
-    printf "ATHENA_BAD_EXIT (8)\nATHENA_ERROR_IN_LOG (32)\nATHENA_REGTEST_FAILED (64)\n exitcode = 120\n maskedcode = 40\n" > summary.log
-    (( timer=`date +%s` - $starttimer )); printf "$timer $starttimer `date +%s`" > timer.log
-    exit 0
-fi
-
-# test if REGTEST.XML/DB.log files are empty and search for differences in log
-rm -rf checklog.log
-if [ -s REGTEST.DB.txt -a -s REGTEST.XML.txt ]; then
-    diff REGTEST.DB.txt REGTEST.XML.txt > checklog.log
-else
-    echo "At least one of the jobs (XML or DB reading) has not been completed! Exit."
-    printf "POST_COMMAND1_BAD_EXIT (2)\nATHENA_BAD_EXIT (8)\nATHENA_ERROR_IN_LOG (32)\nATHENA_REGTEST_FAILED (64)\n exitcode = 106\n maskedcode = 8\n" > summary.log
-    (( timer=`date +%s` - $starttimer )); printf "$timer $starttimer `date +%s`" > timer.log 
-    exit 0
-fi
-echo "Logfile diff successful."
-
-# count line differences and decide exit code
-if [ -e checklog.log ]; then
-    nerrors=0
-    while read line
-      do
-      (( nerrors += 1 ))
-    done < checklog.log
-else
-    echo "checklog.log not found"
-    printf "POST_COMMAND1_BAD_EXIT (2)\nATHENA_ERROR_IN_LOG (32)\nATHENA_REGTEST_FAILED (64)\n exitcode = 98\n maskedcode = 2\n" > summary.log
-    (( timer=`date +%s` - $starttimer )); printf "$timer $starttimer `date +%s`" > timer.log 
-    exit 0
-fi
-echo "Found $nerrors configuration differences between DB and XML jobs."
-
-# return error code if differences found
-if [ $nerrors != 0 ]; then
-    echo "$nerrors differences found in XML and DB trigger configuration tests"
-    printf "ATHENA_ERROR_IN_LOG (32)\nATHENA_REGTEST_FAILED (64)\n exitcode = 96\n maskedcode = 32\n" > summary.log
-    cat checklog.log
-    (( timer=`date +%s` - $starttimer )); printf "$timer $starttimer `date +%s`" > timer.log 
-    exit 0
-else
-    # otherwise return exit code 0
-    echo "No differences found in XML and DB trigger configuration tests"
-    printf " exitcode = 0\n maskedcode = 0\n" > summary.log
-    (( timer=`date +%s` - $starttimer )); printf "$timer $starttimer `date +%s`" > timer.log 
-    exit 0
-fi
-
diff --git a/Trigger/TrigValidation/TriggerTest/Testing/faketest.pl b/Trigger/TrigValidation/TriggerTest/Testing/faketest.pl
deleted file mode 100755
index faf533dc5bd562fd005fbc75370db5b28eaad3d5..0000000000000000000000000000000000000000
--- a/Trigger/TrigValidation/TriggerTest/Testing/faketest.pl
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/usr/bin/perl -w
-# these lines must match trigtest.pl:
-$summaryout = "summary.log";
-%ERROR = (
-          OK => 0,
-          SCRIPT_MISC => 1,
-          POST_COMMAND1_BAD_EXIT => 2,
-          ROOTCOMP_MISMATCH => 4,
-          ATHENA_BAD_EXIT => 8,
-          ATHENA_NO_LOG => 16,
-          ATHENA_ERROR_IN_LOG => 32,
-          ATHENA_REGTEST_FAILED => 64,
-          ATN_TIME_LIMIT => 128
-          );
-sub main();
-main();
-exit;
-
-sub process_error_codes(@) {
-    my (@error_strings) = @_;
-    my $exitcode=0;
-    # | sort | uniq
-    my %saw;
-    undef %saw;
-    @saw{@error_strings} = ();
-    my @error_strings_uniq = sort keys %saw;
-    print "$prog: debug: all statuscodes: @error_strings\n" if ($debug);
-    print "$prog: debug: uniq statuscodes: @error_strings_uniq\n" if ($debug);
-    # convert strings, keep numbers as they are, add together
-    print "=== These errors occured: ";
-    open SUMMARY, ">$summaryout";
-    for (@error_strings_uniq){
-        my $code;
-        if (/^\d+$/){
-            # it's already a number
-            $code = $_;
-        } else {
-            # translate string
-            $code = $ERROR{$_};
-        }
-        $exitcode += $code;
-        if ($code != 0){ # print all except ok.
-            print "$_ ($code) ";
-            print SUMMARY "$_ ($code)\n";
-        }
-    }
-    print " exitcode = $exitcode\n";
-    print SUMMARY " exitcode = $exitcode\n";
-    close SUMMARY;
-    return $exitcode;
-}
-sub main(){
-    my @errors = qw(ATHENA_ERROR_IN_LOG);
-    process_error_codes(@errors);
-}
diff --git a/Trigger/TrigValidation/TriggerTest/python/CheckForHLTChainAllZero_TriggerTest.py b/Trigger/TrigValidation/TriggerTest/python/CheckForHLTChainAllZero_TriggerTest.py
deleted file mode 100755
index 3f9d47e1519bdb975094a830b18c08cc06af4620..0000000000000000000000000000000000000000
--- a/Trigger/TrigValidation/TriggerTest/python/CheckForHLTChainAllZero_TriggerTest.py
+++ /dev/null
@@ -1,16 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-# Simple wrapper for specific RttScriptRunner instances
-# This is done to get "pretty" names on the RTT web pages
-
-from RecExConfig.RecFlags import rec
-from AthenaCommon.AthenaCommonFlags import athenaCommonFlags as acf
-
-import sys, os
-sys.path.append(os.path.dirname(sys.modules[__name__].__file__))
-
-from RttScriptRunner_TriggerTest import RttScriptRunner_TriggerTest
-
-class CheckForHLTChainAllZero_TriggerTest(RttScriptRunner_TriggerTest):
-    pass
-
diff --git a/Trigger/TrigValidation/TriggerTest/python/CheckForHLTTEAllZero_TriggerTest.py b/Trigger/TrigValidation/TriggerTest/python/CheckForHLTTEAllZero_TriggerTest.py
deleted file mode 100755
index fb9f6d9b4671f37e5bf2ce7dfb642ef8ab8b59aa..0000000000000000000000000000000000000000
--- a/Trigger/TrigValidation/TriggerTest/python/CheckForHLTTEAllZero_TriggerTest.py
+++ /dev/null
@@ -1,16 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-# Simple wrapper for specific RttScriptRunner instances
-# This is done to get "pretty" names on the RTT web pages
-
-from RecExConfig.RecFlags import rec
-from AthenaCommon.AthenaCommonFlags import athenaCommonFlags as acf
-
-import sys, os
-sys.path.append(os.path.dirname(sys.modules[__name__].__file__))
-
-from RttScriptRunner_TriggerTest import RttScriptRunner_TriggerTest
-
-class CheckForHLTTEAllZero_TriggerTest(RttScriptRunner_TriggerTest):
-    pass
-
diff --git a/Trigger/TrigValidation/TriggerTest/python/CheckForL1AllZero_TriggerTest.py b/Trigger/TrigValidation/TriggerTest/python/CheckForL1AllZero_TriggerTest.py
deleted file mode 100755
index 2c0e91d80c5e1e6f8ad5295c88fffa83dfabcc18..0000000000000000000000000000000000000000
--- a/Trigger/TrigValidation/TriggerTest/python/CheckForL1AllZero_TriggerTest.py
+++ /dev/null
@@ -1,16 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-# Simple wrapper for specific RttScriptRunner instances
-# This is done to get "pretty" names on the RTT web pages
-
-from RecExConfig.RecFlags import rec
-from AthenaCommon.AthenaCommonFlags import athenaCommonFlags as acf
-
-import sys, os
-sys.path.append(os.path.dirname(sys.modules[__name__].__file__))
-
-from RttScriptRunner_TriggerTest import RttScriptRunner_TriggerTest
-
-class CheckForL1AllZero_TriggerTest(RttScriptRunner_TriggerTest):
-    pass
-
diff --git a/Trigger/TrigValidation/TriggerTest/python/CheckForTrigCostD3PD_TriggerTest.py b/Trigger/TrigValidation/TriggerTest/python/CheckForTrigCostD3PD_TriggerTest.py
deleted file mode 100755
index 709fd171b2a3f736022cc4e425adac858ec465c8..0000000000000000000000000000000000000000
--- a/Trigger/TrigValidation/TriggerTest/python/CheckForTrigCostD3PD_TriggerTest.py
+++ /dev/null
@@ -1,16 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-# Simple wrapper for specific RttScriptRunner instances
-# This is done to get "pretty" names on the RTT web pages
-
-from RecExConfig.RecFlags import rec
-from AthenaCommon.AthenaCommonFlags import athenaCommonFlags as acf
-
-import sys, os
-sys.path.append(os.path.dirname(sys.modules[__name__].__file__))
-
-from RttScriptRunner_TriggerTest import RttScriptRunner_TriggerTest
-
-class CheckForTrigCostD3PD_TriggerTest(RttScriptRunner_TriggerTest):
-    pass
-
diff --git a/Trigger/TrigValidation/TriggerTest/python/CheckLog_TriggerTest.py b/Trigger/TrigValidation/TriggerTest/python/CheckLog_TriggerTest.py
deleted file mode 100644
index 9f1240c26ff09ed067cd118ee50039ac7ff53f94..0000000000000000000000000000000000000000
--- a/Trigger/TrigValidation/TriggerTest/python/CheckLog_TriggerTest.py
+++ /dev/null
@@ -1,16 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-# Simple wrapper for specific RttScriptRunner instances
-# This is done to get "pretty" names on the RTT web pages
-
-from RecExConfig.RecFlags import rec
-from AthenaCommon.AthenaCommonFlags import athenaCommonFlags as acf
-
-import sys, os
-sys.path.append(os.path.dirname(sys.modules[__name__].__file__))
-
-from RttScriptRunner_TriggerTest import RttScriptRunner_TriggerTest
-
-class CheckLog_TriggerTest(RttScriptRunner_TriggerTest):
-   pass
-
diff --git a/Trigger/TrigValidation/TriggerTest/python/CreateIgprofReport_TriggerTest.py b/Trigger/TrigValidation/TriggerTest/python/CreateIgprofReport_TriggerTest.py
deleted file mode 100755
index b78a0e40a0ed06dc5536b5563cec3b6ad2c70020..0000000000000000000000000000000000000000
--- a/Trigger/TrigValidation/TriggerTest/python/CreateIgprofReport_TriggerTest.py
+++ /dev/null
@@ -1,16 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-# Simple wrapper for specific RttScriptRunner instances
-# This is done to get "pretty" names on the RTT web pages
-
-from RecExConfig.RecFlags import rec
-from AthenaCommon.AthenaCommonFlags import athenaCommonFlags as acf
-
-import sys, os
-sys.path.append(os.path.dirname(sys.modules[__name__].__file__))
-
-from RttScriptRunner_TriggerTest import RttScriptRunner_TriggerTest
-
-class CreateIgprofReport_TriggerTest(RttScriptRunner_TriggerTest):
-    pass
-
diff --git a/Trigger/TrigValidation/TriggerTest/python/LogTail_TriggerTest.py b/Trigger/TrigValidation/TriggerTest/python/LogTail_TriggerTest.py
deleted file mode 100755
index 4e1746baa307bf8ea73bdc536713671a7de803c3..0000000000000000000000000000000000000000
--- a/Trigger/TrigValidation/TriggerTest/python/LogTail_TriggerTest.py
+++ /dev/null
@@ -1,16 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-# Simple wrapper for specific RttScriptRunner instances
-# This is done to get "pretty" names on the RTT web pages
-
-from RecExConfig.RecFlags import rec
-from AthenaCommon.AthenaCommonFlags import athenaCommonFlags as acf
-
-import sys, os
-sys.path.append(os.path.dirname(sys.modules[__name__].__file__))
-
-from RttScriptRunner_TriggerTest import RttScriptRunner_TriggerTest
-
-class LogTail_TriggerTest(RttScriptRunner_TriggerTest):
-   pass
-
diff --git a/Trigger/TrigValidation/TriggerTest/python/RttScriptRunner_TriggerTest.py b/Trigger/TrigValidation/TriggerTest/python/RttScriptRunner_TriggerTest.py
deleted file mode 100755
index dff9860885c865cfdb6bab7d169a8ad2a0aecd5a..0000000000000000000000000000000000000000
--- a/Trigger/TrigValidation/TriggerTest/python/RttScriptRunner_TriggerTest.py
+++ /dev/null
@@ -1,91 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-# @file: RttScriptRunner.py
-# @purpose: Run any command in RTT post-processing
-# @author: Frank Winklmeier (fwinkl)
-# $Id: RttScriptRunner_TriggerTest.py,v 1.3 2008-08-22 11:35:28 fwinkl Exp $
-
-from RecExConfig.RecFlags import rec
-from AthenaCommon.AthenaCommonFlags import athenaCommonFlags as acf
-
-import sys
-import os
-
-class RttScriptRunner_TriggerTest:
-    """
-    Class to run any command within the RTT post-processing
-    'command': command to run (including any arguments)
-               %TESTNAME is replaced with the jobDisplayName (or test name if not set)
-               %JOBLOG is replaced with the RTT job log file
-               %BRANCH is replaces with the release branch
-               $<ENVVAR> is replaced with the environment variable (if exists)
-               
-    'logfile': log file, if not given write to RTT logger
-    """
-    
-    def __init__(self, paramDict={}):
-
-        from Logger import Logger
-        
-        self.success   =  0
-        self.error     = -1
-        self.logger    = Logger()
-
-        self.command = paramDict.get('command', None)
-        self.logfile = paramDict.get('logfile', "test."+self.__class__.__name__+".log")
-
-        jDescriptor = paramDict.get('JobDescriptor',None)
-        if jDescriptor:
-            testname = jDescriptor.jobDisplayName
-            if testname=='': testname = jDescriptor.name
-            self.command = self.command.replace("%TESTNAME",testname)
-            self.command = self.command.replace("%JOBLOG",jDescriptor.log)
-            self.command = self.command.replace("%BRANCH",jDescriptor.paths.branch)
-
-            for k,v in os.environ.iteritems():
-                self.command = self.command.replace("$"+k,v)
-                
-    def run(self):
-        
-        if not self.command:
-            self.logger.error("'command' parameter not set")
-            return self.error
-
-        self.logger.debug("ScriptRunner: Executing '%s'" % self.command)
-
-        # Run command and get output
-        import subprocess as sp
-        proc = sp.Popen(self.command, shell=True, stdout=sp.PIPE, stderr=sp.STDOUT)
-        stdout = proc.communicate()[0]
-
-        # Write output to log file or RTT logger
-        if self.logfile:
-            f = open(self.logfile,"w")
-            f.write(stdout)
-            f.close()
-        else:
-            for l in stdout.splitlines(True): self.logger.info(l.rstrip('\n'))
-            
-        if proc.returncode!=0: return self.error
-        else: return self.success
-
-
-# This is just for testing outside of the RTT
-if __name__ == "__main__":
-
-    sys.path.append('/afs/cern.ch/atlas/project/RTT/prod/Tools/RunTimeTester/src')
-    sys.path.append('/afs/cern.ch/atlas/project/RTT/prod/Tools/RunTimeTester/share')    
-
-    params = {'command' : 'ls -l',
-              'logfile': 'rttscript.log'}
-    
-    r = RttScriptRunner_TriggerTest(params)
-    status = r.run()
-    
-    for l in r.logger.debugL: print l,
-    for l in r.logger.infoL: print l,
-    for l in r.logger.warningL: print l,
-    for l in r.logger.errorL: print l,
-
-    sys.exit(status)
-    
diff --git a/Trigger/TrigValidation/TriggerTest/python/TrigValConfigBlock.py b/Trigger/TrigValidation/TriggerTest/python/TrigValConfigBlock.py
deleted file mode 100644
index 7ddafbac13065c2daf62b9c66aaf134373e37239..0000000000000000000000000000000000000000
--- a/Trigger/TrigValidation/TriggerTest/python/TrigValConfigBlock.py
+++ /dev/null
@@ -1,38 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-from RecExConfig.RecFlags import rec
-from AthenaCommon.AthenaCommonFlags import athenaCommonFlags as acf
-
-from TrigValJobOptionBlock import   TrigValJobOptionBlock
-
-#
-# Block added temporarily to test new vs. old Python configuration 
-#
-class TrigValConfigBlock(TrigValJobOptionBlock):
-   def __init__(self, current) :
-      TrigValJobOptionBlock.__init__(self, "Modern",['Modern','OldConfig']) 
-      
-      self.name = "Modern"
-      if(current  == "" ) : current = "Modern"
-      self.setCurrent(current)  # this calls initializeBlocks()
-
-
-   def jobNameBlock(self) :
-      return self.current()
-   
-   def  initializeBlocks(self) :
-
-      if( self.current() == 'Modern' ) :
-         self.jobProperties     += """
-
-TriggerModernConfig=True
-
-"""
-      else :
-         self.jobProperties     += """
-
-TriggerModernConfig=False
-
-"""
-
-
diff --git a/Trigger/TrigValidation/TriggerTest/python/TrigValDetectorBlock.py b/Trigger/TrigValidation/TriggerTest/python/TrigValDetectorBlock.py
deleted file mode 100755
index 87a36e97b1984726c5db29217692c3b242a7f032..0000000000000000000000000000000000000000
--- a/Trigger/TrigValidation/TriggerTest/python/TrigValDetectorBlock.py
+++ /dev/null
@@ -1,81 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-from RecExConfig.RecFlags import rec
-from AthenaCommon.AthenaCommonFlags import athenaCommonFlags as acf
-
-from TrigValJobOptionBlock import   TrigValJobOptionBlock
-
-class TrigValDetectorBlock(TrigValJobOptionBlock):
-   def __init__(self, current) :
-     TrigValJobOptionBlock.__init__(self, 'All', ['All','ID', 'Calo', 'Muon'])
-
-     self.name = "Detector"
-     if( current == "" ) : current = "All"
-     self.setCurrent(current)  # this calls initializeBlocks()
-
-
-   def jobNameBlock(self) :
-      if( self.current() == 'All' ) :
-          return ""
-      else:
-          return self.current()
-
-
-   def  initializeBlocks(self) :
-
-     ####################    ID     ###############################
-     if(    self.current() == 'ID' ) :
-         self.jobFlags     = """
-# switch OFF other detectors
-DetFlags.Muon_setOff()
-TriggerFlags.doMuon=False
-
-# has to allow Calo for now!
-#DetFlags.Calo_setOff()
-#TriggerFlags.doCalo=False
-
-#### for now include only electron and tau slice
-TriggerFlags.Slices_all_setOff()
-
-TriggerFlags.EgammaSlice.setL2ID()
-TriggerFlags.EgammaSlice.setEFID()
-triggerMenu.disableAll()
-triggerMenu.enableSignature("e10")
-TriggerFlags.EgammaSlice.setFlag("doSiTrack",True)
-TriggerFlags.EgammaSlice.setFlag("doTRTxK", False)
-
-TriggerFlags.TauSlice.setL2ID()
-#TriggerFlags.TauSlice.setEFID()
-triggerMenu.enableSignature("tau10")
-
-"""
-     ####################    Calo     ###############################
-     elif(  self.current() == 'Calo' ) :
-         self.jobFlags     = """
-# switch OFF other detectors
-DetFlags.Muon_setOff()
-DetFlags.ID_setOff()
-
-TriggerFlags.doMuon=False
-TriggerFlags.doID=False
-
-TriggerFlags.TauSlice.unsetEF()
-TriggerFlags.BphysicsSlice.unsetAll()
-"""
-
-     ####################    Muon     ###############################
-     elif(  self.current() == 'Muon' ) :
-         self.jobFlags     = """
-# switch OFF other detectors
-DetFlags.ID_setOff()
-DetFlags.Calo_setOff()
-
-TriggerFlags.doID=False
-TriggerFlags.doCalo=False
-
-
-TriggerFlags.BphysicsSlice.unsetAll()
-TriggerFlags.MuonSlice.unsetEFID()
-
-"""
-
diff --git a/Trigger/TrigValidation/TriggerTest/python/TrigValExecutableBlock.py b/Trigger/TrigValidation/TriggerTest/python/TrigValExecutableBlock.py
deleted file mode 100755
index b0da865081387a949b83c382bca252d6dc9142ea..0000000000000000000000000000000000000000
--- a/Trigger/TrigValidation/TriggerTest/python/TrigValExecutableBlock.py
+++ /dev/null
@@ -1,106 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-from RecExConfig.RecFlags import rec
-from AthenaCommon.AthenaCommonFlags import athenaCommonFlags as acf
-
-from TrigValJobOptionBlock import   TrigValJobOptionBlock
-
-class TrigValExecutableBlock(TrigValJobOptionBlock):
-   def __init__(self, current) :
-     TrigValJobOptionBlock.__init__(self, "Athena",['Athena','AthenaAllAlgsTrue','AthenaNoTrigger',  #RecExCommon topO
-                                                    'AthenaL1Only','AthenaStandalone', 'AthenaMT','AthenaPT']) #Standalone topO
-
-     self.name = "Executable"
-     if(current  == "" ) : current = "Athena"
-     self.setCurrent(current)  # this calls initializeBlocks()
-
-
-   def jobNameBlock(self) :
-     return self.current()
-  
-   ######## RecExCommon vs Standalone ###############################
-   def includeRecExCommon_flags(self) :
-     if( self.current() ==  'AthenaStandalone' or  self.current() == 'AthenaMT' or self.current() == 'AthenaPT') :
-       tmpStr="""
-rec.doTruth=False       
-#-----------------------------------------------------------
-include(\"RecExCommon/RecExCommon_flags.py\")
-#-----------------------------------------------------------
-"""
-     else :
-       tmpStr="""
-#-----------------------------------------------------------
-include(\"RecExCommon/RecExCommon_flags.py\")
-#-----------------------------------------------------------
-"""
-     return tmpStr
-
-
-   def includeRecExCommon_topOptions(self) :
-     if( self.current() ==  'AthenaStandalone' or  self.current() == 'AthenaMT' or self.current() == 'AthenaPT') :
-       tmpStr="""
-#-----------------------------------------------------------       
-include(\"TriggerRelease/Trigger_topOptions_standalone.py\")
-#-----------------------------------------------------------
-"""
-     else :
-       tmpStr="""
-#-----------------------------------------------------------
-include(\"RecExCommon/RecExCommon_topOptions.py\")
-#-----------------------------------------------------------
-"""
-     return tmpStr
-
-
-   def  initializeBlocks(self) :
-
-     ######## Common settings ###############################
-     self.jobProperties     = """
-
-if not ('EvtMax' in dir()):
-    acf.EvtMax=10
-if not ('OutputLevel' in dir()):
-    rec.OutputLevel=INFO
-
-###############################
-rec.doCBNT=False
-
-"""
-     if( self.current() != 'AthenaNoTrigger' ) :
-        self.jobProperties     += """
-rec.doTrigger=True
-"""
-     else :
-        self.jobProperties     += """
-rec.doTrigger=False
-"""
-        
-     ####################     Athena    ###############################
-     if(  self.current() != 'AthenaAllAlgsTrue' and self.current() != 'AthenaNoTrigger' ) :
-           self.jobProperties     += "doESD=False\n"
-     else :
-           self.jobProperties     += "doESD=True \n"
-
-     if(    self.current() == 'Athena' or  self.current() == 'AthenaAllAlgsTrue' or self.current() == 'AthenaStandalone' ) :
-        self.extraTopOptions = """
-jobproperties.PerfMonFlags.doMonitoring = True
-
-MessageSvc.debugLimit = 10000000
-MessageSvc.Format = "% F%48W%S%7W%R%T %0W%M"
-
-#get rid of messages and increase speed
-Service ("StoreGateSvc" ).ActivateHistory=False
-
-#from AthenaCommon.AlgSequence import AlgSequence
-print AlgSequence
-print ServiceMgr
-
-"""
-
-
-
-     ####################     AthenaAllFlagsTrue    ###############################
-     else :
-        self.jobProperties     = "## WARNING jobO are not yet setup for "+self.current()
-
-
diff --git a/Trigger/TrigValidation/TriggerTest/python/TrigValInputBlock.py b/Trigger/TrigValidation/TriggerTest/python/TrigValInputBlock.py
deleted file mode 100755
index 9bfefab486e428bbb7ad10ae049d18a6b1a4dc57..0000000000000000000000000000000000000000
--- a/Trigger/TrigValidation/TriggerTest/python/TrigValInputBlock.py
+++ /dev/null
@@ -1,90 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-from RecExConfig.RecFlags import rec
-from AthenaCommon.AthenaCommonFlags import athenaCommonFlags as acf
-
-from TrigValJobOptionBlock import   TrigValJobOptionBlock
-
-class TrigValInputBlock(TrigValJobOptionBlock):
-   def __init__(self, current) :
-     TrigValJobOptionBlock.__init__(self, 'RDO', ['RDO','BS', 'ESD','AOD','BStmp'])
-
-     self.name = "Input"
-     if(current  == "" ) : current = "RDO"
-     self.setCurrent(current)  # this calls initializeBlocks()
-
-
-   def jobNameBlock(self) :
-      return self.current()
-
-
-   def  initializeBlocks(self) :
-
-     ####################    RDO     ###############################
-     if(    self.current() == 'RDO' ) :
-         self.jobProperties    = """
-### usually ATN tests runs with following RDO input:
-#PoolRDOInput=["/afs/cern.ch/atlas/offline/data/testfile/calib1_csc11.005200.T1_McAtNlo_Jimmy.digit.RDO.v12000301_tid003138._00016_extract_10evt.pool.root"]
-"""
-         self.jobFlags = """
-TriggerFlags.readHLTconfigFromXML=False
-TriggerFlags.readLVL1configFromXML=False
-"""
-
-     ####################    ESD     ###############################
-     elif(    self.current() == 'ESD' ) :
-         self.jobProperties    = """
-acf.PoolESDInput=[\"../trigger.ESD.pool.root\"]
-rec.readESD=True
-"""
-         self.jobFlags = """
-TriggerFlags.readHLTconfigFromXML=False
-TriggerFlags.readLVL1configFromXML=False
-"""
-     ####################    AOD     ###############################
-     elif(    self.current() == 'AOD' ) :
-         self.jobProperties    = """
-acf.PoolAODInput=[\"../trigger.AOD.pool.root\"]
-rec.readAOD=True
-"""
-         self.jobFlags     += """
-TriggerFlags.readHLTconfigFromXML=True
-TriggerFlags.readLVL1configFromXML=True
-# WARNING: please don't try running from ./outputLVL1/HLTconfig.xml, since Athena will try writing to that file
-TriggerFlags.inputLVL1configFile = \"../outputLVL1config.xml\"
-TriggerFlags.inputHLTconfigFile = \"../outputHLTconfig.xml\"
-#### to avoid segmentation violation in 12.0.6
-DetFlags.Muon_setOff()
-"""
-     ####################    BS     ###############################
-     elif(  self.current() == 'BS' ) :
-         self.jobProperties   = """
-from AthenaCommon.GlobalFlags import GlobalFlags
-    GlobalFlags.InputFormat.set_bytestream()
-    acf.BSRDOInput=[\"/afs/cern.ch/atlas/project/trigger/pesa-sw/releases/data/daq.csc13.0000000.Single.Stream.LB0000.Athena._0001.data\"]
-    DetDescrVersion = \"ATLAS-CSC-01-02-00\"
-
-"""
-         self.jobFlags     += """
-TriggerFlags.doHLTpersistency=False
-TriggerFlags.readLVL1configFromXML=True
-# WARNING: please don't try running from ./outputLVL1config.xml, since Athena will try writing to that file
-TriggerFlags.inputLVL1configFile = \"../outputLVL1config.xml\"
-
-"""
-     ####################    BStmp     ###############################
-     elif(  self.current() == 'BStmp' ) :
-         self.jobProperties   = """
-from AthenaCommon.GlobalFlags import GlobalFlags
-    GlobalFlags.InputFormat.set_bytestream()
-    acf.BSRDOInput=[\"../trigger.BS.data\"]
-    DetDescrVersion = \"ATLAS-CSC-01-02-00\"
-
-"""
-         self.jobFlags     += """
-TriggerFlags.doHLTpersistency=False
-TriggerFlags.readLVL1configFromXML=True
-# WARNING: please don't try running from ./outputLVL1config.xml, since Athena will try writing to that file
-TriggerFlags.inputLVL1configFile = \"../outputLVL1config.xml\"
-
-"""
diff --git a/Trigger/TrigValidation/TriggerTest/python/TrigValJobOptionBlock.py b/Trigger/TrigValidation/TriggerTest/python/TrigValJobOptionBlock.py
deleted file mode 100755
index 1695a770052c3e1aa344baacb3453b56c438f566..0000000000000000000000000000000000000000
--- a/Trigger/TrigValidation/TriggerTest/python/TrigValJobOptionBlock.py
+++ /dev/null
@@ -1,70 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-from RecExConfig.RecFlags import rec
-from AthenaCommon.AthenaCommonFlags import athenaCommonFlags as acf
-
-class TrigValJobOptionBlock:
-  def __init__(self, defaultOption, allOptions ):
-     self._list = allOptions
-     self._current = defaultOption
-     if( defaultOption not in self._list ) :
-        self._list += defaultOption
-     
-     self.name              = "NotSet"
-     self.jobProperties     = ""
-     self.jobFlags          = ""
-     self.extraTopOptions   = ""
-
-     self.isJobOptionBlock  = True
-
-  def help(self) :
-     print "=== JobO block "+self.name+" has options"
-     print self._list
-     print "    current default is "+self.current()
-
-  def current(self) :
-     return self._current
-
-  def setCurrent(self, option) :
-     if( self.has_option(option) ):
-        self._current = option
-        self.initializeBlocks()
-
-  def has_option(self, option) :
-     if( option in self._list ): 
-        return True
-     else :
-        print "jobOptionDict "+self.name+" ERROR : uknown option "+option+", possible candidates are :"
-        print self._list
-        return False
- 
-
-  def initializeBlocks():  # by default do nothing, but derived classes should overwrite this
-        return None
-
-  def die(self) :
-     print " TrigValJobOptionBlock kills the job"
-     import sys 
-     sys.exit(2)
-
-  def  includeJobProperties(self, jobO) :
-     try :
-        jobO.write(self.jobProperties )  
-     except :
-        print " TrigValJobOptionBlock   ERROR cannot write block to "+jobO.name
-        self.die()
-
-  def  modifyJobFlags(self, jobO) :
-     try :
-        jobO.write(self.jobFlags )  
-     except :
-        print " TrigValJobOptionBlock   ERROR cannot write block to "+jobO.name
-        self.die()
-
-  def  addExtraTopOption(self, jobO) :
-     try :
-        jobO.write(self.extraTopOptions )  
-     except :
-        print " TrigValJobOptionBlock   ERROR cannot write block to "+jobO.name
-        self.die()
-
diff --git a/Trigger/TrigValidation/TriggerTest/python/TrigValJobOptionBuilder.py b/Trigger/TrigValidation/TriggerTest/python/TrigValJobOptionBuilder.py
deleted file mode 100755
index 5b55185f5c9cbea7b463a9795dda692acda657ea..0000000000000000000000000000000000000000
--- a/Trigger/TrigValidation/TriggerTest/python/TrigValJobOptionBuilder.py
+++ /dev/null
@@ -1,202 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-from RecExConfig.RecFlags import rec
-from AthenaCommon.AthenaCommonFlags import athenaCommonFlags as acf
-
-from TrigValJobOptionBlock    import TrigValJobOptionBlock
-from TrigValExecutableBlock   import TrigValExecutableBlock
-from TrigValConfigBlock       import TrigValConfigBlock
-from TrigValDetectorBlock     import TrigValDetectorBlock
-from TrigValSliceBlock        import TrigValSliceBlock
-from TrigValMenuBlock         import TrigValMenuBlock
-from TrigValInputBlock        import TrigValInputBlock
-from TrigValOutputBlock       import TrigValOutputBlock
-from TrigValValidationBlock   import TrigValValidationBlock
-from TrigValSpecialFlagsBlock import TrigValSpecialFlagsBlock 
-from TrigValTemporaryFixBlock import TrigValTemporaryFixBlock
-from TrigValValidationBlock   import TrigValValidationBlock
-
-
-##################################################
-
-class TrigValJobOptionBuilder :
-  def __init__(self, detector = "All", slice = "All", menu = "Default", 
-               executable = "Athena", config = "Modern", input = "RDO",
-               output = "", specialFlags = "", validation = "") :
-
-    self.Input         = TrigValInputBlock(        input        )
-    self.Executable    = TrigValExecutableBlock(   executable   )
-    self.Config        = TrigValConfigBlock(       config       )    
-    self.Output        = TrigValOutputBlock(       output       )
-    self.SpecialFlags  = TrigValSpecialFlagsBlock( specialFlags )
-    self.Detector      = TrigValDetectorBlock(     detector     )
-    # temporary fix for the Muon and Bphysics slices
-    if ( slice == "Muon" and config == "OldConfig" ) :
-      print "WARNING: temporary fix for Muon slice"
-      self.Slice         = TrigValSliceBlock( "MuonOldConfig" )
-    elif ( slice == "Bphysics" and config == "OldConfig" ) :
-      print "WARNING: temporary fix for Bphysics slice"
-      self.Slice         = TrigValSliceBlock( "BphysicsOldConfig" )      
-    else :
-      self.Slice         = TrigValSliceBlock(        slice        )
-    self.Menu          = TrigValMenuBlock(         menu         )
-    self.Validation    = TrigValValidationBlock(   validation   )
-    self.TemporaryFix  = TrigValTemporaryFixBlock( 'Fix' )  # choose from ['Fix','None']
-   
-
-    self.blockOrder = ['Input', 'Executable', 'Config', 'Output','SpecialFlags', 'Detector', 'Menu',
-                       'Validation',  'TemporaryFix', 'Slice' ]
-
-
-    self.selfConsistent =  self.consistentTags()
-    if( not self.selfConsistent ): self.die()
-
-
-    self.jobNamePath = "TriggerTest"
-    if( output == 'ESD' or output == 'AOD' or output == 'ESDAOD' or input=='ESD' or input == 'AOD' ) :
-       self.jobNamePath = "TrigAnalysisTest"
-
-
-
-  #################### this will go on top of each jobO : #############################
-  def printHead(self, jobO):
-
-    tmpStr="# To generate "+jobO.name+" use  TriggerTest/python/trigValMakeJobOptions.py \n"
-
-    self.HeadComment="""######################################################################################
-#
-# This file is automatically generated with TriggerTest/python/TrigvalJobOptionBuilder.py
-"""
-    self.HeadComment += tmpStr
-    self.HeadComment+="""#
-######################################################################################
-
-"""
-    self.write(jobO, self.HeadComment)
-
-
-  ############ restrict particular combinations of tags here############################
-  def consistentTags(self) :
-    #if( self.Input.current() == '' ) :
-    #   print " TrigValJobOptionBuilder   ERROR : wrong I/O "+input+" to "+output
-    #   return False
-    #else :
-       return True
-      
-  ####################################################################################  
-
-  def die(self) :
-     print " TrigValJobOptionBuilder kills the job"
-     import sys 
-     sys.exit(2)
-
-  def write(self, jobO, whatToWrite) :
-    try :
-      jobO.write(whatToWrite)
-    except IOError:
-      print "TrigValJobOptionBuilder    ERROR:   Can not open "+topOname
-      self.die() 
-    
-
-
-  def jobName(self) :
-    if( not  self.selfConsistent ) :
-       print " TrigValJobOptionBuilder   ERROR : inconsistent set of tags"
-       return ""
-    else :
-       jobname = self.jobNamePath+"/"+"test"+self.Detector.jobNameBlock()
-       jobname += self.Slice.jobNameBlock()
-       jobname += self.Menu.jobNameBlock()
-       jobname += self.Executable.jobNameBlock()
-       jobname += self.Config.jobNameBlock()
-       jobname += self.Input.jobNameBlock() + self.Output.jobNameBlock()
-       jobname += self.SpecialFlags.jobNameBlock()
-       jobname += ".py"       
-       return jobname
-
-
-  def includeRecExCommon_flags(self, jobO) : 
-     self.write(jobO,self.Executable.includeRecExCommon_flags()) 
-
-
-  def includeRecExCommon_topOptions(self, jobO) :
-     self.write(jobO,self.Executable.includeRecExCommon_topOptions()) 
-
-  #################################################################
-  def makeJobOption(self) :
-     if( not  self.selfConsistent ) : return None
-     topOname = self.jobName()
-     try :
-       import os
-       if( not os.path.isdir(self.jobNamePath )) :
-          os.makedirs( self.jobNamePath )
-       jobO = open( topOname, mode = "w")
-       print "Creating top jobOption "+topOname
-
-       #### print comments to topO
-       self.printHead(jobO)
-
-       #### this goes before RecExCommon_flags
-       for x in  self.blockOrder :
-         block = self.__dict__.get(x)
-         if( isinstance(block, TrigValJobOptionBlock)) :
-            block.includeJobProperties(jobO)
-
-       #### include RecExCommon_flags
-       self.includeRecExCommon_flags(jobO)  
-
-       #### this goes between RecExCommon_flags and  RecExCommon_topOption
-       for x in   self.blockOrder :
-         block = self.__dict__.get(x)
-         if( isinstance(block, TrigValJobOptionBlock)) :
-            block.modifyJobFlags(jobO)
-
-       #### include RecExCommon_topOption
-       self.includeRecExCommon_topOptions(jobO)  
-
-
-       #### this goes after  RecExCommon_topOption
-       for x in   self.blockOrder : 
-         block = self.__dict__.get(x)
-         if( isinstance(block, TrigValJobOptionBlock)) :
-            block.addExtraTopOption(jobO)
-
-       #### jobO is done
-       jobO.close()
-
-       #### now grep for WARNING
-       jobO = open( topOname, mode ="r")
-       foundWarning=False
-       import string
-       for line in jobO :
-          if (( string.find(line,"WARNING" )>0 or string.find(line,"ERROR" )>0 ) and string.find(line,"OutputLevel") == 0 ) :
-             foundWarning=True
-       if( foundWarning ) :
-          jobO.seek(0)
-          print "There are WARNING/ERROR in "+topOname +"  :"
-          for line in jobO :
-            if ( string.find(line,"WARNING" )>0 or string.find(line,"ERROR" )>0 ) :
-               print line
-       jobO.close()
-
-     except IOError:
-         print "TrigValJobOptionBuilder    ERROR:   Can not open "+topOname
-         
-    ### end of makeJobOption
-
-
-  def help(self) :
-     tmpHelp="""
-
-To generate jobOptions please use e.g :
-  builder = TrigValJobOptionBuilder('Calo','All','All','Athena', 'RDO', "", "")
-  builder.makeJobOption()
-where options are :
-"""
-     print tmpHelp
-     for x in  self.__dict__ :
-        block = self.__dict__.get(x)
-        if( isinstance(block, TrigValJobOptionBlock)) :
-           block.help()
-
-
diff --git a/Trigger/TrigValidation/TriggerTest/python/TrigValMakeTestConf.py b/Trigger/TrigValidation/TriggerTest/python/TrigValMakeTestConf.py
deleted file mode 100755
index 252ad76a105cba9edd63ef09002b5c0667ea6dc1..0000000000000000000000000000000000000000
--- a/Trigger/TrigValidation/TriggerTest/python/TrigValMakeTestConf.py
+++ /dev/null
@@ -1,91 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-
-################################################################
-
-from RecExConfig.RecFlags import rec
-from AthenaCommon.AthenaCommonFlags import athenaCommonFlags as acf
-
-def writeTestXML (testConf, testJobO, mailto, path="TriggerTest"):
-
-# Write xml configuration for some test to temp file TriggerTest_TestConfiguration.xml.fragment
-# this should then be added to TriggerTest_TestConfiguration.xml in the ATN block
-# example:
-#   <TEST name="ElectronSliceAthenaRDO" type="script" suite="tapm_val">
-#      <options_atn>trigtest.pl --test ElectronSliceAthenaRDO --run ElectronSliceAthenaRDO --conf $ATN_PACKAGE/Testing/trigValidation.conf</options_atn>
-#      <timelimit>5</timelimit>
-#      <author>TAPM validation</author>
-#      <expectations>
-#         <errorMessage>FAILURE </errorMessage>
-#         <returnValue>0</returnValue>
-#      </expectations>
-#   </TEST>
-
-    import os
-
-    if( not os.path.isdir( path )) :
-       os.makedirs( path )
-       
-    fTestFile=path+"/"+"TriggerTest_TestConfiguration.xml.fragment"
-    if( os.path.isfile( fTestFile ) ) :
-        fTest = open( fTestFile,mode="a")
-    else :
-        fTest = open( fTestFile,mode="w")
-
-    fTest.write("   <TEST name=\""+testJobO+"\" type=\"script\" suite=\"tapm_val\"> \n")
-    fTest.write("      <options_atn>trigtest.pl --test "+testJobO+" --run "+testJobO+" --conf $ATN_PACKAGE/Testing/trigValidation.conf</options_atn> \n")
-    fTest.write("      <timelimit>5</timelimit> \n")
-    fTest.write("      <author>TAPM validation</author> \n")
-    for address in mailto :
-        if( address != "" ) :
-            fTest.write("      <mailto> "+address+" </mailto> \n")
-    fTest.write("      <expectations> \n")
-    fTest.write("         <errorMessage>FAILURE </errorMessage> \n")    
-    fTest.write("         <returnValue>0</returnValue> \n")
-    fTest.write("      </expectations> \n")
-    fTest.write("   </TEST> \n\n")
-    fTest.close()
-
-    print "xml fragment for test "+testJobO+" added to file "+fTestFile
-
-################################################################
-def addTrigTestConf(testConf, testId, testJobO, regtests, regtesttag,
-                    post_command="", makeReferenceLink=False,useTmpReference=False) :
-    from TrigValPrintRegtest import TrigValPrintRegtestSet
-    fTest = open(testConf, mode = "a")
-    fTest.write("test "+str(testId)+"\n")
-    fTest.write("  name "+testJobO+"\n")
-    fTest.write("  joboptions test"+testJobO+".py\n")
-    fTest.write("  checklog\n")
-    fTest.close()
-    for x in regtests :
-       post_command += TrigValPrintRegtestSet( testConf, x, regtesttag, makeReferenceLink,useTmpReference )
-
-    fTest = open(testConf, mode = "a")
-    if( post_command != "" ) :
-       fTest.write("  post_command "+post_command+"\n")
-
-    fTest.write("  pre_command export ERS_DEBUG_1='filter:!@default'\n")
-    fTest.write("  pre_command export ERS_DEBUG_2='filter:!@default'\n")
-    fTest.write("  pre_command export ERS_DEBUG_3='filter:!@default'\n")
-    fTest.close()
-    
-    #print testConf+" is updated with test "+testJobO;
-   
-
-################################################################
-
-def TrigValMakeTestConf(testConf, testId, testShId, testJobO, regtests,
-                        regtesttag, mailto, path = "TriggerTest",post_command="",
-                        makeReferenceLink=False,useTmpReference=False) :
-
-    if( path == "" ) : path = "TriggerTest"
-
-    # write xml fragment to be replaced in TriggerTest_TestConfiguration.xml
-    writeTestXML(testConf, testJobO, mailto, path)
-
-    addTrigTestConf(testConf, testId, testJobO, regtests, regtesttag, post_command,
-                        makeReferenceLink,useTmpReference)
-
-
-################################################################
diff --git a/Trigger/TrigValidation/TriggerTest/python/TrigValMenuBlock.py b/Trigger/TrigValidation/TriggerTest/python/TrigValMenuBlock.py
deleted file mode 100755
index 09d637bf39c511475901a0a0b569ce7667b9bcaf..0000000000000000000000000000000000000000
--- a/Trigger/TrigValidation/TriggerTest/python/TrigValMenuBlock.py
+++ /dev/null
@@ -1,57 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-from RecExConfig.RecFlags import rec
-from AthenaCommon.AthenaCommonFlags import athenaCommonFlags as acf
-
-from TrigValJobOptionBlock import   TrigValJobOptionBlock
-
-class TrigValMenuBlock(TrigValJobOptionBlock):
-   def __init__(self, current) :
-     TrigValJobOptionBlock.__init__(self, 'Default', ['Default','Physics','CSC-06'])
-
-     self.name = "Menu"
-     if(current  == "" ) : current = "Default"
-     self.setCurrent(current)  # this calls initializeBlocks()
-
-
-   def jobNameBlock(self) :
-      if( self.current() == 'Default' ) :
-          return ""
-      else:
-          return self.current()+"Menu"
-
-
-   def  initializeBlocks(self) :
-
-     ####################    All     ###############################
-     if(    self.current() == 'Physics' ) :
-         self.jobFlags     = """
-triggerMenu.disableAll()
-
-#### WARNING First attempt of Physics menu. The list below needs to be revised!!
-triggerMenu.enableSignatures(["2e15i","e25i","e60"])
-triggerMenu.enableSignatures(["2g20i","g60"])
-triggerMenu.enableSignatures(["mu20"])
-triggerMenu.enableSignatures(["tau25i"])
-triggerMenu.enableSignatures(["jet160","2jet120","3jet65"])
-
-# following menus are not available yet
-#triggerMenu.enableSignatures(["4jet55","mu10"])
-
-"""
-     ####################    Calo     ###############################
-     elif(  self.current() == 'CSC-06' ) :
-         self.jobFlags     = """
-triggerMenu.disableAll()
-
-#### 
-triggerMenu.enableSignatures(["e10","e10TRTxK", "2e15i","e25i","e60"])
-triggerMenu.enableSignatures(["g10","2g20i","g60"])
-triggerMenu.enableSignatures(["mu6l","mu6","mu20"])
-triggerMenu.enableSignatures(["tau10","tau10i","tau15","tau15i","tau20i","tau25i","tau35i","tauNoCut"])
-triggerMenu.enableSignatures(["jet20a","jet20b","jet20c","jet20d","jet20kt","jet160","2jet120","3jet65","4jet50])
-triggerMenu.enableSignatures(["met10"])
-triggerMenu.enableSignatures(["frjet10","fljet10", "b35"])
-triggerMenu.enableSignatures(["L2_Zee"])
-"""
-
diff --git a/Trigger/TrigValidation/TriggerTest/python/TrigValOutputBlock.py b/Trigger/TrigValidation/TriggerTest/python/TrigValOutputBlock.py
deleted file mode 100755
index 1cc677f328efa49a9a21abeb85133da0e86787da..0000000000000000000000000000000000000000
--- a/Trigger/TrigValidation/TriggerTest/python/TrigValOutputBlock.py
+++ /dev/null
@@ -1,172 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-from RecExConfig.RecFlags import rec
-from AthenaCommon.AthenaCommonFlags import athenaCommonFlags as acf
-
-from TrigValJobOptionBlock import   TrigValJobOptionBlock
-
-class TrigValOutputBlock(TrigValJobOptionBlock):
-   def __init__(self, current) :
-     TrigValJobOptionBlock.__init__(self, 'None', ['None','BS','ESDAOD','AOD','ESD','TAG'])
-
-     self.name = "Output"
-    
-     if( current == "" ) : current = "None"
-     self.setCurrent(current)  # this calls initializeBlocks()
-
-
-   def jobNameBlock(self) :
-      if( self.current() == 'None' ) :
-          return ""
-      else:
-          return "to"+self.current()
-
-
-   def  initializeBlocks(self) :
-
-     ####################         ###############################
-     if(    self.current() == 'None' ) :
-        self.jobProperties     = """
-rec.doWriteAOD=False
-rec.doWriteESD=False
-rec.doWriteTAG=False
-rec.doAOD=False 
-rec.doESD=False 
-doTAG=False
-"""
-     elif ( self.current() == 'ESD' ) :
-        self.jobProperties     = """
-rec.doWriteAOD=False
-rec.doWriteESD=True
-rec.doWriteTAG=False
-rec.doAOD=False 
-rec.doESD=True 
-doTAG=False
-"""
-
-        self.extraTopOptions   = """
-## to remove any particular class uncomment and modify  :
-#StreamESD.ItemList.remove("LVL1_ROI#*")
-"""
-
-     elif ( self.current() == 'ESDAOD' ) :
-        self.jobProperties     = """
-rec.doWriteAOD=True
-rec.doWriteESD=True
-rec.doWriteTAG=False
-rec.doAOD=False 
-rec.doESD=True 
-doTAG=False
-"""
-#        self.jobFlags     += """
-#TriggerFlags.outputLVL1configFile = "/tmp/outputLVL1config.xml"
-#TriggerFlags.outputHLTconfigFile = "/tmp/outputHLTconfig.xml"
-#"""
-        self.extraTopOptions   = """
-## to remove any particular class uncomment and modify  :
-#StreamESD.ItemList.remove("LVL1_ROI#*")
-#StreamAOD.ItemList.remove("LVL1_ROI#*")
-"""
-
-     elif ( self.current() == 'AOD' ) :
-        self.jobProperties     = """
-rec.doWriteAOD=True
-rec.doWriteESD=False
-rec.doWriteTAG=False
-rec.doAOD=True 
-rec.doESD=False 
-doTAG=False
-
-"""
-#        self.jobFlags     += """
-#TriggerFlags.outputLVL1configFile = "/tmp/outputLVL1config.xml"
-#TriggerFlags.outputHLTconfigFile = "/tmp/outputHLTconfig.xml"
-#"""
-        self.extraTopOptions   = """
-## to remove any particular class uncomment and modify  :
-#StreamAOD.ItemList.remove("LVL1_ROI#*")
-"""
-
-     elif ( self.current() == 'TAG' ) :
-
-        self.jobProperties     = """
-rec.doWriteAOD=False
-rec.doWriteESD=False
-rec.doWriteTAG=TAG
-rec.doAOD=False
-rec.doESD=False 
-doTAG=TAG
-"""
-
-     elif ( self.current() == 'BS' ) :
-
-        self.jobProperties     = """
-rec.doWriteAOD=False
-rec.doWriteESD=False
-rec.doWriteTAG=False
-rec.doAOD=False
-rec.doESD=False 
-doTAG=False
-"""
-
-        self.extraTopOptions     = """
-ServiceMgr.LVL1ConfigSvc.CreateLegacyObjects=True
-
-include( "ByteStreamCnvSvc/WriteByteStream_EventStorage_jobOptions.py" )
-#ByteStreamEventStorageOutputSvc = ServiceMgr.ByteStreamEventStorageOutputSvc
-#ByteStreamEventStorageOutputSvc.DumpFlag    = True
-StreamBS = AthenaOutputStream("StreamBS",
-                              EvtConversionSvc = "ByteStreamCnvSvc")
-StreamBS.ForceRead=True
-StreamBS.ItemList  += [ "ROIB::RoIBResult#*" ]
-#StreamBS.ItemList +=["2542#*"]
-#StreamBS.ItemList +=["2541#*"]
-#StreamBS.ItemList +=["2540#*"]
-StreamBS.ItemList += [ "TRT_RDO_Container#*" ]
-StreamBS.ItemList += [ "SCT_RDO_Container#*" ]
-StreamBS.ItemList += [ "PixelRDO_Container#*" ]
-StreamBS.ItemList +=["2721#*"]
-StreamBS.ItemList +=["2927#*"]
-#StreamBS.ItemList +=["MdtCsmContainer#*"]
-#StreamBS.ItemList +=["RpcPadContainer#*"]
-#StreamBS.ItemList +=["TgcRdoContainer#*"]
-#StreamBS.ItemList +=["CscRawDataContainer#*"]
-
-# -------------------------------------------------------------
-# Dectector BS converters
-# -------------------------------------------------------------
-theApp.Dlls += [ "TrigT1ResultByteStream" ]
-theApp.Dlls += [ "LArCalibUtils" ]
-theApp.Dlls += [ "LArByteStream" ]
-theApp.Dlls += [ "TileByteStream" ]
-theApp.Dlls += [ "MuonByteStream" ]
-
-theApp.CreateSvc  += ["StoreGateSvc/StoreGateSvc" ]
-ByteStreamAddressProviderSvc = Service( "ByteStreamAddressProviderSvc" )
-ByteStreamAddressProviderSvc.TypeNames += [ 
-	"PixelRDO_Container/PixelRDOs", 
-	"SCT_RDO_Container/SCT_RDOs", 
-	"TRT_RDO_Container/TRT_RDOs", 
-	"LArRawChannelContainer/LArRawChannels", 
-	"TileRawChannelContainer/TileRawChannelCnt", 
-	"RpcPadContainer/RPCPAD",
-	"MdtCsmContainer/MDTCSM",
-	"TgcRdoContainer/TGCRDO",
-	"CscRawDataContainer/CSCRDO",
-	"ROIB::RoIBResult/RoIBResult",
-	"MuCTPI_RDO/MUCTPI_RDO",
-        "CTP_RDO/CTP_RDO"
-	] 
-ProxyProviderSvc = Service( "ProxyProviderSvc" )
-ProxyProviderSvc.ProviderNames += [ "ByteStreamAddressProviderSvc" ] 
-
-
-
-"""
-
-     ####################         ###############################
-     else :
-         self.jobProperties  = "#WARNING job block output option "+self.current()+" is not implemented yet !"
-
-    
-
diff --git a/Trigger/TrigValidation/TriggerTest/python/TrigValPrintRegtest.py b/Trigger/TrigValidation/TriggerTest/python/TrigValPrintRegtest.py
deleted file mode 100755
index 2e71039c8436daa6da550f5db1c23406e87f67f0..0000000000000000000000000000000000000000
--- a/Trigger/TrigValidation/TriggerTest/python/TrigValPrintRegtest.py
+++ /dev/null
@@ -1,65 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-
-from RecExConfig.RecFlags import rec
-from AthenaCommon.AthenaCommonFlags import athenaCommonFlags as acf
-
-from TrigValRegtestLibrary import TrigValRegtestLibrary, TrigValRegtestSet
-
-##########################################################################
-
-def TrigValPrintRegtest( fileObj, HLTalgo, tag ='Default'):
-   refFile = TrigValRegtestLibrary[ HLTalgo].getFile(tag)
-   if( refFile != "" ):
-      try :
-         fil = open( fileObj, mode="a")
-         if( HLTalgo == "Full" or HLTalgo == "full" ) :
-            fil.write("  fullregtest    REGTEST "+refFile+"\n")
-         else :   
-            fil.write("  regtest  "+HLTalgo+"   REGTEST "+refFile+"\n")
-         fil.close()
-      except IOError: 
-         print "TrigValRegtestFile    ERROR:   Can not open "+refFile+", print no regtest"
-  
-
-def TrigValPrintRegtestSet( fileObj, hltsetTag, tag='Default',
-                            makeReferenceLink=False, useTmpReference=False):
-    try :
-       fil = open( fileObj, mode="a")
-
-       post_command = ""
-       if ( TrigValRegtestLibrary.has_key( hltsetTag) ) :
-         refFile = TrigValRegtestLibrary[hltsetTag ].getFile(tag)
-         if( makeReferenceLink ) : post_command += "rm -f /tmp/"+refFile+"; ln -s $PWD/"+refFile+".new /tmp/"+refFile+" ;"
-         if( useTmpReference ) : refFile = "/tmp/"+refFile # important to have it after post_command
-         
-         if( hltsetTag == "Full" or hltsetTag == "full" ) :
-            fil.write("  fullregtest    REGTEST "+refFile+"\n")
-         else :   
-            fil.write("  regtest  "+hltsetTag+"   REGTEST "+refFile+"\n")
-
-       elif ( TrigValRegtestSet.has_key( hltsetTag) ) :
-          hltset = TrigValRegtestSet[hltsetTag]
-          for hltAlgo in hltset :
-            if ( TrigValRegtestLibrary.has_key(hltAlgo ) ) :
-               refFile = TrigValRegtestLibrary[ hltAlgo ].getFile(tag)
-               if( makeReferenceLink ) : post_command += "rm -f /tmp/"+refFile+"; ln -s $PWD/"+refFile+".new /tmp/"+refFile+" ;"
-               if( useTmpReference ) : refFile = "/tmp/"+refFile # important to have it after post_command
-               if( refFile != "" ):
-                 fil.write("  regtest  "+hltAlgo+"   REGTEST "+refFile+"\n")
-            else :
-               print "TrigValRegtestFile    ERROR:   Can not find HLTalgo or HLT set "+hltAlgo+" ignore it"
-       else :
-         print "TrigValRegtestFile    ERROR:  Can not find HLTalgo or HLT set "+hltsetTag+" ignore it"
-       fil.close()
-       return post_command
-    
-    except IOError: 
-       print "TrigValRegtestFile    ERROR:  Can not open "+refFile+", print no regtest"
-       return ""
- 
-    
-
-#printRegtest( 'f1.txt', 'T2CaloTau_Tau' )
-#printRegtest( 'f1.txt', 'T2CaloTauHypo_tau10i', 'Default' )
-#printRegtestSet( 'f1.txt', 'Tau' )
diff --git a/Trigger/TrigValidation/TriggerTest/python/TrigValRegtestFile.py b/Trigger/TrigValidation/TriggerTest/python/TrigValRegtestFile.py
deleted file mode 100755
index b097bc156b6e01edd77d5f814d6d924684d2efd6..0000000000000000000000000000000000000000
--- a/Trigger/TrigValidation/TriggerTest/python/TrigValRegtestFile.py
+++ /dev/null
@@ -1,19 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-from RecExConfig.RecFlags import rec
-from AthenaCommon.AthenaCommonFlags import athenaCommonFlags as acf
-
-class TrigValRegtestFile:
-   def __init__(self, defaultFile):
-      self.Default =  defaultFile
-
-   def addFile(self, tag, file ):
-      self.__dict__[tag] = file
-
-   def getFile(self, tag='Default' ) :
-      if( self.__dict__.has_key(tag) ):
-          return self.__dict__[tag]
-      else :
-          #if( tag != "" ) :
-          #   print "TrigValRegtestFile   INFO : use tag \"Default\" instead of \""+tag+"\""
-          return self.__dict__['Default']
diff --git a/Trigger/TrigValidation/TriggerTest/python/TrigValRegtestLibrary.py b/Trigger/TrigValidation/TriggerTest/python/TrigValRegtestLibrary.py
deleted file mode 100755
index 09adb2ec860e4cf6a73f41b5c17ad76bcebbfeba..0000000000000000000000000000000000000000
--- a/Trigger/TrigValidation/TriggerTest/python/TrigValRegtestLibrary.py
+++ /dev/null
@@ -1,151 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-from RecExConfig.RecFlags import rec
-from AthenaCommon.AthenaCommonFlags import athenaCommonFlags as acf
-
-from TrigValRegtestFile import TrigValRegtestFile
-############## this is default Regtest references  #######################
-
-TrigValRegtestLibrary = {
-   'TrigSteer' :                     TrigValRegtestFile('nofile_TrigSteer.reference'),
-   'Full' :                          TrigValRegtestFile('nofile_Full.reference'),
- 
-
-    #'' :    TrigValRegtestFile(''),
-   ########### egamma
-    'TrigIDSCAN_eGamma' :    TrigValRegtestFile('testElectronSlice_top_CSC-01-02-00_RDO_extract_TrigIDSCAN_eGamma.reference'),
-    'TrigSiTrack_eGamma' :    TrigValRegtestFile('testElectronSlice_top_CSC-01-02-00_RDO_extract_TrigSiTrack_eGamma.reference'),
-    'T2CaloEgamma_eGamma' :    TrigValRegtestFile('testElectronSlice_top_CSC-01-02-00_RDO_extract_T2CaloEgamma_eGamma.reference'),
-    'TrigCaloTowerMaker_eGamma' :    TrigValRegtestFile('testElectronSlice_top_CSC-01-02-00_RDO_extract_TrigCaloTowerMaker_eGamma.reference'),
-    'TrigCaloCellMaker_eGamma' :    TrigValRegtestFile('testElectronSlice_top_CSC-01-02-00_RDO_extract_TrigCaloCellMaker_eGamma.reference'),
-    'TrigCaloClusterMaker_slw' :    TrigValRegtestFile('testElectronSlice_top_CSC-01-02-00_RDO_extract_TrigCaloClusterMaker_slw.reference'),
-    'TrigEgammaRec_eGamma' :    TrigValRegtestFile('testElectronSlice_top_CSC-01-02-00_RDO_extract_TrigEgammaRec_eGamma.reference'),
-    'Electron_EFID' :    TrigValRegtestFile('testElectronSlice_top_CSC-01-02-00_RDO_extract_Electron_EFID.reference'),
-    'EFTrackHypo' :    TrigValRegtestFile('testElectronSlice_top_CSC-01-02-00_RDO_extract_EFTrackHypo.reference'),
-    'TrigEFEgammaHypo' :    TrigValRegtestFile('testElectronSlice_top_CSC-01-02-00_RDO_extract_TrigEFEgammaHypo.reference'),
-
-    'L2PhotonFex' :    TrigValRegtestFile('testPhotonSlice_top_CSC-01-02-00_RDO_extract_L2PhotonFex.reference'),
-
-
-    ######### tau 
-    'T2CaloTau_Tau' :    TrigValRegtestFile('testTauSlice_top_CSC-01-02-00_RDO_extract_T2CaloTau_Tau.reference'),
-    'TauHypo' :    TrigValRegtestFile('testTauSlice_top_CSC-01-02-00_RDO_extract_TauHypo.reference'),
-    'TrigTauRec' :    TrigValRegtestFile('testTauSlice_top_CSC-01-02-00_RDO_extract_TrigTauRec.reference'),
-    'Tau_EFID' :    TrigValRegtestFile('testTauSlice_top_CSC-01-02-00_RDO_extract_Tau_EFID.reference'),
-    'T2TauFinal' :    TrigValRegtestFile('testTauSlice_top_CSC-01-02-00_RDO_extract_T2TauFinal.reference'),
-    'TrigIDSCAN_Tau' :    TrigValRegtestFile('testTauSlice_top_CSC-01-02-00_RDO_extract_TrigIDSCAN_Tau.reference'),
-    'TrigCaloCellMaker_tau' :    TrigValRegtestFile('testTauSlice_top_CSC-01-02-00_RDO_extract_TrigCaloCellMaker_tau.reference'),
-
-    ######### muons
-    'muComb_Muon' :    TrigValRegtestFile('testMuonSlice_top_CSC-01-02-00_RDO_extract_muComb_Muon.reference'),
-    'TrigIDSCAN_Muon' :    TrigValRegtestFile('testMuonSlice_top_CSC-01-02-00_RDO_extract_TrigIDSCAN_Muon.reference'),
-    'muFast_Muon' :    TrigValRegtestFile('testMuonSlice_top_CSC-01-02-00_RDO_extract_muFast_Muon.reference'),
-    'MufastHypo_Muon' :    TrigValRegtestFile('testMuonSlice_top_CSC-01-02-00_RDO_extract_MufastHypo_Muon.reference'),
-    'MucombHypo_Muon' :    TrigValRegtestFile('testMuonSlice_top_CSC-01-02-00_RDO_extract_MucombHypo_Muon.reference'),
- 
-    ######### Jet
-    'T2CaloJet_Jet' :    TrigValRegtestFile('testJetSlice_top_CSC-01-02-00_RDO_extract_T2CaloJet_Jet.reference'),
-
-    ######### MET
-    'EFMetHypo' :    TrigValRegtestFile('testMETSlice_top_CSC-01-02-00_RDO_extract_EFMetHypo.reference'),
-    'EFMissingET_Met' :    TrigValRegtestFile('testMETSlice_top_CSC-01-02-00_RDO_extract_EFMissingET_Met.reference'),
-
-    ######### Bphys
-    'Bphysics_EFID' :    TrigValRegtestFile('testBphysicsSlice_top_CSC-01-02-00_RDO_extract_Bphysics_EFID.reference'),
-    'TrigIDSCAN_Bphysics' :    TrigValRegtestFile('testBphysicsSlice_top_CSC-01-02-00_RDO_extract_TrigIDSCAN_Bphysics.reference'),
-    'L2DsPhiPiFex_1' :    TrigValRegtestFile('testBphysicsSlice_top_CSC-01-02-00_RDO_extract_L2DsPhiPiFex_1.reference'),
-    'FullScan_EFID' :    TrigValRegtestFile('testBphysicsSlice_top_CSC-01-02-00_RDO_extract_FullScan_EFID.reference'),
-    'L2DsPhiPiFex_FS' :    TrigValRegtestFile('testBphysicsSlice_top_CSC-01-02-00_RDO_extract_L2DsPhiPiFex_FS.reference'),
-    'L2DsPhiPiFex_FS' :    TrigValRegtestFile('testBphysicsSlice_top_CSC-01-02-00_RDO_extract_L2DsPhiPiFex_FS.reference'),
-    'TrigIDSCAN_FullScan' :    TrigValRegtestFile('testBphysicsSlice_top_CSC-01-02-00_RDO_extract_TrigIDSCAN_FullScan.reference'),
-    'EFDsPhiPiFex_1' :    TrigValRegtestFile('testBphysicsSlice_top_CSC-01-02-00_RDO_extract_EFDsPhiPiFex_1.reference'),
-
-    ######### Bjet
-    'Bjet_EFID' :    TrigValRegtestFile('testBjetSlice_top_CSC-01-02-00_RDO_extract_Bjet_EFID.reference'),
-    'TrigSiTrack_Jet' :    TrigValRegtestFile('testBjetSlice_top_CSC-01-02-00_RDO_extract_TrigSiTrack_Jet.reference'),
-
-    'TrigIDSCAN_Cosmics' :    TrigValRegtestFile('testCosmicsSlice_top_CSC-01-02-00_RDO_extract_TrigIDSCAN_Cosmics.reference'),
-    'TrigL2CosmicMuon_Cosmic' :    TrigValRegtestFile('testCosmicsSlice_top_CSC-01-02-00_RDO_extract_TrigL2CosmicMuon_Cosmic.reference'),
-    'CombinedIDHalfTracks_Cosmic' :    TrigValRegtestFile('testCosmicsSlice_top_CSC-01-02-00_RDO_extract_CombinedIDHalfTracks_Cosmic.reference'),
-
-    ######### LVL1
-    'CTPSimulation' : TrigValRegtestFile('testLVL1CTP_top_CSC-01-02-00_RDO_extract_CTPSimulation.reference'),
-
-
-#   'TriggerDecisionMaker' :            TrigValRegtestFile('TriggerDecisionMaker.reference'),
-#   'IdScan_Bphysics_L2' :              TrigValRegtestFile('IdScan_Bphysics.reference'),
-#   'MufastHypo_900GeV_2GeV_L2':        TrigValRegtestFile('MufastHypo_Muon_2GeV_Bphysics.reference'),
-#   'TrigDiMuonFast_1_L2':              TrigValRegtestFile('TrigDiMuonFast.reference'),
-#   'TrigL2BMuMuHypo_B0_L2':            TrigValRegtestFile('TrigL2BMuMuHypo_B0.reference'),
-#   'JpsiHypo_1_L2' :                   TrigValRegtestFile('JpsiHypo.reference'),
-#   'L2dimuonHypo_Jpsi_L2' :            TrigValRegtestFile('L2dimuonHypo_Jpsi.reference'),
-#   'TrigL2BMuMuXHypo_B0_L2' :          TrigValRegtestFile('TrigL2BMuMuXHypo_B0.reference'),
-#   'MucombHypo_900GeV_2GeV_L2' :       TrigValRegtestFile('muComb_Muon_Bphysics.reference'),
-#   'L2dimuonHypo_Jpsi_L2' :            TrigValRegtestFile('L2dimuonHypo_Jpsi.reference'),
-#   'TrigL2BMuMuXHypo_B0_L2' :          TrigValRegtestFile('TrigL2BMuMuXHypo_B0.reference'),
-#   'IdScan_FullScan_L2' :              TrigValRegtestFile('IdScan_FullScan.reference'),
-#   'DsPhiPiHypo_1_L2' :                TrigValRegtestFile('DsPhiPiHypo.reference'),
-#   'DsPhiPiHypo_Full_L2' :             TrigValRegtestFile('DsPhiPiHypo_Full.reference'),
-#   'hltSteer_L2.ResultBuilder' :       TrigValRegtestFile('hltSteer_L2.ResultBuilder.reference'),
-#   'hltSteer_EF.ResultBuilder' :       TrigValRegtestFile('hltSteer_EF.ResultBuilder.reference'),
-
-            
-}
-
-
-############## these are full  references  #######################
-
-TrigValRegtestLibrary[ 'Full'].addFile( "testAthenaRDO", "testAthenaRDO_top_CSC-01-02-00_RDO_extract_full.reference")
-TrigValRegtestLibrary[ 'Full'].addFile( "testCalo", "testCalo_top_CSC-01-02-00_RDO_extract_full.reference")
-TrigValRegtestLibrary[ 'Full'].addFile( "testID", "testID_top_CSC-01-02-00_RDO_extract_full.reference")
-TrigValRegtestLibrary[ 'Full'].addFile( "testMuon", "testMuon_top_CSC-01-02-00_RDO_extract_full.reference")
-TrigValRegtestLibrary[ 'Full'].addFile( "testElectronSlice", "testElectronSlice_top_CSC-01-02-00_RDO_extract_full.reference")
-TrigValRegtestLibrary[ 'Full'].addFile( "testPhotonSlice", "testPhotonSlice_top_CSC-01-02-00_RDO_extract_full.reference")
-TrigValRegtestLibrary[ 'Full'].addFile( "testTauSlice", "testTauSlice_top_CSC-01-02-00_RDO_extract_full.reference")
-TrigValRegtestLibrary[ 'Full'].addFile( "testMuonSlice", "testMuonSlice_top_CSC-01-02-00_RDO_extract_full.reference")
-TrigValRegtestLibrary[ 'Full'].addFile( "testJetSlice", "testJetSlice_top_CSC-01-02-00_RDO_extract_full.reference")
-TrigValRegtestLibrary[ 'Full'].addFile( "testMETSlice", "testMETSlice_top_CSC-01-02-00_RDO_extract_full.reference")
-TrigValRegtestLibrary[ 'Full'].addFile( "testBjetSlice", "testBjetSlice_top_CSC-01-02-00_RDO_extract_full.reference")
-TrigValRegtestLibrary[ 'Full'].addFile( "testBphysicsSlice", "testBphysicsSlice_top_CSC-01-02-00_RDO_extract_full.reference")
-TrigValRegtestLibrary[ 'Full'].addFile( "testCosmicsSlice", "testCosmicsSlice_top_CSC-01-02-00_RDO_extract_full.reference")
-
-############## these are additional  references  #######################
-
-TrigValRegtestLibrary[ 'T2TauFinal'].addFile( "testCalo", "testCalo_top_CSC-01-02-00_RDO_extract_T2TauFinal.reference")
-TrigValRegtestLibrary[ 'TauHypo'   ].addFile( "testCalo", "testCalo_top_CSC-01-02-00_RDO_extract_TauHypo.reference")
-
-TrigValRegtestLibrary[ 'TrigSteer'].addFile( "testMuonSlice",      "testMuonSlice_top_CSC-01-02-00_RDO_extract_TrigSteer.reference")
-TrigValRegtestLibrary[ 'TrigSteer'].addFile( "testPhotonSlice",    "testPhotonSlice_top_CSC-01-02-00_RDO_extract_TrigSteer.reference")
-TrigValRegtestLibrary[ 'TrigSteer'].addFile( "testMETSlice",       "testMETSlice_top_CSC-01-02-00_RDO_extract_TrigSteer.reference")
-TrigValRegtestLibrary[ 'TrigSteer'].addFile( "testElectronSlice",  "testElectronSlice_top_CSC-01-02-00_RDO_extract_TrigSteer.reference")
-TrigValRegtestLibrary[ 'TrigSteer'].addFile( "testTauSlice",       "testTauSlice_top_CSC-01-02-00_RDO_extract_TrigSteer.reference")
-TrigValRegtestLibrary[ 'TrigSteer'].addFile( "testBphysicsSlice",  "testBphysicsSlice_top_CSC-01-02-00_RDO_extract_TrigSteer.reference")
-TrigValRegtestLibrary[ 'TrigSteer'].addFile( "testJetSlice",       "testJetSlice_top_CSC-01-02-00_RDO_extract_TrigSteer.reference")
-TrigValRegtestLibrary[ 'TrigSteer'].addFile( "testBjetSlice",      "testBjetSlice_top_CSC-01-02-00_RDO_extract_TrigSteer.reference")
-TrigValRegtestLibrary[ 'TrigSteer'].addFile( "testCosmicsSlice",   "testCosmicsSlice_top_CSC-01-02-00_RDO_extract_TrigSteer.reference")
-
-############## these are  sets of references  #######################
-
-TrigValRegtestSet = {
-         'Electron' : ['T2CaloEgamma_eGamma','TrigIDSCAN_eGamma', 'TrigSiTrack_eGamma','TrigCaloTowerMaker_eGamma', 
-                       'TrigCaloCellMaker_eGamma',  'TrigCaloClusterMaker_slw', 'Electron_EFID','TrigEgammaRec_eGamma', 
-                       'EFTrackHypo', 'TrigEFEgammaHypo' ],
-         'Photon'   : ['T2CaloEgamma_eGamma', 'L2PhotonFex','TrigCaloTowerMaker_eGamma', 
-                       'TrigCaloCellMaker_eGamma',  'TrigCaloClusterMaker_slw',
-                       'TrigEgammaRec_eGamma' ],
-         'Tau' : ['T2CaloTau_Tau','TrigIDSCAN_Tau', 'T2TauFinal', 'TrigCaloCellMaker_tau',
-                  'Tau_EFID', 'TrigTauRec', 'TauHypo'],
-         'Muon'  : ['muComb_Muon', 'TrigIDSCAN_Muon', 'muFast_Muon','MufastHypo_Muon','MucombHypo_Muon' ],
-         
-         'Jet' : ['T2CaloJet_Jet'],
-         'MET' : ['EFMetHypo', 'EFMissingET_Met'],
-
-         'IDSCAN' : ['TrigIDSCAN_Muon', 'TrigIDSCAN_eGamma', 'TrigSiTrack_eGamma', 'TrigIDSCAN_Tau'],
-         'Bphysics'  : ['L2DsPhiPiFex_1', 'TrigIDSCAN_Bphysics', 'Bphysics_EFID', 'FullScan_EFID','L2DsPhiPiFex_FS','TrigIDSCAN_FullScan'],
-         'Bjet' : ['Bjet_EFID','TrigSiTrack_Jet' ],
-
-         'Cosmics' : ['TrigIDSCAN_Cosmics', 'TrigL2CosmicMuon_Cosmic', 'CombinedIDHalfTracks_Cosmic'],
-
-         'LVL1CTP'  : ['CTPSimulation'],
-
-}
diff --git a/Trigger/TrigValidation/TriggerTest/python/TrigValSliceBlock.py b/Trigger/TrigValidation/TriggerTest/python/TrigValSliceBlock.py
deleted file mode 100755
index cbd4fedeee6699db5f0d05e76460e0c693e9c7c3..0000000000000000000000000000000000000000
--- a/Trigger/TrigValidation/TriggerTest/python/TrigValSliceBlock.py
+++ /dev/null
@@ -1,296 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-from RecExConfig.RecFlags import rec
-from AthenaCommon.AthenaCommonFlags import athenaCommonFlags as acf
-
-from TrigValJobOptionBlock import   TrigValJobOptionBlock
-
-class TrigValSliceBlock(TrigValJobOptionBlock):
-   def __init__(self, current) :
-     TrigValJobOptionBlock.__init__(self, 'All', ['All','Electron', 'Photon', 'Muon','MuonOldConfig', 'Tau',
-                                                  'Jet', 'MET', 'Bphysics','BphysicsOldConfig','Bjet','Cosmics'])
-
-     self.name = "Slice"
-     if(current  == "" ) : current = "All"
-     self.setCurrent(current)  # this calls initializeBlocks()
-
-
-
-   def jobNameBlock(self) :
-      # all exclude Cosmics
-      if( self.current() == 'All' ) :
-          return ""
-      else:
-          # temporary fix for Bphys and Muon: should
-          # be removed when OldConfig disappears-RG23/8
-          if ( self.current() == "BphysicsOldConfig" ) :
-             return "BphysicsSlice"
-          elif ( self.current() == "MuonOldConfig" ) :
-             return "MuonSlice"          
-          else :
-             return self.current()+"Slice"
-
-
-   def  initializeBlocks(self) :
-     if(  self.current() != 'All' ) :
-        self.jobFlags     = """
-####  First switch all slices OFF
-TriggerFlags.Slices_all_setOff()
-"""
-
-     ####################   Electron      ###############################
-     if(    self.current() == 'Electron' ) :
-         self.jobFlags     += """
-###### This is a temporary fix ################
-DetFlags.simulateLVL1.Calo_setOn()
-
-# Enable electron slice
-TriggerFlags.EgammaSlice.setAll()
-triggerMenu.disableAll()
-triggerMenu.enableSignatures(["e10", "e25i", "e60", "2e15i", "e10TRTxK", "Zee", "Jpsiee"])
-"""
-
-     ####################   Photon      ###############################
-     if(    self.current() == 'Photon' ) :
-         self.jobFlags     += """
-###### This is a temporary fix ################
-DetFlags.simulateLVL1.Calo_setOn()
-
-# Enable Photon slice
-TriggerFlags.EgammaSlice.unsetAll()
-triggerMenu.disableAll()
-triggerMenu.enableSignature("g10")
-triggerMenu.enableSignature("g60")
-triggerMenu.enableSignature("2g20i")
-
-#enable only calorimeter parts for photon standalone
-TriggerFlags.EgammaSlice.setL2Calo()
-TriggerFlags.EgammaSlice.setEFCalo()
-#TriggerFlags.EgammaSlice.setL2ID()
-#TriggerFlags.EgammaSlice.setEFID()
-"""
-
-     ####################   Muon  #########################################
-     if(    self.current() == 'Muon' ) :
-         self.jobFlags     += """
-# Enable Muon slice
-DetFlags.digitize.Muon_setOff()
-
-TriggerFlags.MuonSlice.doL2Muon()
-TriggerFlags.MuonSlice.doL2ID()
-#TriggerFlags.MuonSlice.setL2Calo()
-
-# Muon EF part
-TriggerFlags.MuonSlice.doEFMuon()
-TriggerFlags.MuonSlice.doEFID()
-
-"""
-
-     if(    self.current() == 'MuonOldConfig' ) :
-         self.jobFlags     += """         
-if readMuonHits: 
-    DetFlags.digitize.Muon_setOn()
-    DetFlags.readRIOBS.Muon_setOff()
-    DetFlags.readRIOPool.LVL1_setOff()
-    TriggerFlags.doLVL1=True
-#    ###### This is a temporary fix ################
-    DetFlags.simulateLVL1.Muon_setOn()
-else:
-    DetFlags.digitize.Muon_setOff()
-
-TriggerFlags.MuonSlice.setL2Muon()
-TriggerFlags.MuonSlice.setL2ID()
-
-# Muon EF part
-TriggerFlags.MuonSlice.setEFMuon()
-TriggerFlags.MuonSlice.setEFID()
-
-"""
-
-         self.extraTopOptions   += """
-muFast = TrigSteer_L2.allConfigurables.get('muFast_Muon')
-
-muFast.OutputLevel = DEBUG
-
-muFast.MUlvl1INFO  = True
-muFast.MUtrackINFO = True
-muFast.MUroadsINFO = True
-muFast.MUdecoINFO  = True
-muFast.MUcontINFO  = True
-muFast.MUfitINFO   = True
-muFast.MUsagINFO   = True
-muFast.MUptINFO    = True
-
-muFast.TestString = "muFast_Muon_L2 REGTEST "
-
-#TrigSteer_L2.OutputLevel=DEBUG
-#TrigSteer_L2.allConfigurables.get('TrigIDSCAN_Muon').OutputLevel=DEBUG
-#TrigSteer_L2.allConfigurables.get("muComb_Muon").OutputLevel=DEBUG
-#TrigSteer_L2.allConfigurables.get("MucombHypo_Muon_6GeV").OutputLevel=DEBUG
-TrigSteer_EF.allConfigurables.get("MooHLTAlgo_CB_Muon").IDFromTrigger = True
-"""
-
-
-     ####################   Tau      ###############################
-     if(    self.current() == 'Tau' ) :
-         self.jobFlags     += """
-###### This is a temporary fix ################
-DetFlags.simulateLVL1.Calo_setOn()
-
-# Enable Tau slice
-TriggerFlags.TauSlice.setAll()
-#triggerMenu.disableAll()
-#triggerMenu.enableSignatures(["tau10","tau10i","tau15","tau15i","tau20i","tau25i","tau35i","tauNoCut"])
-"""
-
-     ####################   Jet      ###############################
-     if(    self.current() == 'Jet' ) :
-         self.jobFlags     += """
-###### This is a temporary fix ################
-DetFlags.simulateLVL1.Calo_setOn()
-
-# Enable Jet slice
-TriggerFlags.JetSlice.setAll()
-#triggerMenu.disableAll()
-#triggerMenu.enableSignatures(["jet160"])
-"""
-
-     ####################   MET      ###############################
-     if(    self.current() == 'MET' ) :
-         self.jobFlags     += """
-
-# add muons for MET ... !
-if readMuonHits:
-    DetFlags.digitize.Muon_setOn()
-    DetFlags.readRIOBS.Muon_setOff()
-    DetFlags.readRIOPool.LVL1_setOff()
-    TriggerFlags.doLVL1=True
-    ###### This is a temporary fix ################
-    DetFlags.simulateLVL1.Muon_setOn()
-else:
-    DetFlags.digitize.Muon_setOff()
-
-###### This is a temporary fix ################
-DetFlags.simulateLVL1.Calo_setOn()
-
-# Enable MET slice
-#TriggerFlags.METSlice.unsetAll()
-TriggerFlags.METSlice.setL2Calo()
-TriggerFlags.METSlice.setEFCalo()
-
-"""
-
-     ####################   Bjet      ###############################
-     if(    self.current() == 'Bjet' ) :
-         self.jobFlags     += """
-
-###### This is a temporary fix ################
-DetFlags.simulateLVL1.Muon_setOn()
-
-# Enable Bjet slice
-TriggerFlags.BjetSlice.setAll()
-triggerMenu.disableAll()
-triggerMenu.enableSignature("b35")
-"""
-
-     ####################   Bphysics      ###############################
-     if(    self.current() == 'Bphysics' ) :
-         self.jobFlags     += """
-###### This is a temporary fix ################
-DetFlags.simulateLVL1.Muon_setOn()
-
-# Enable Bphysics slice: needs muon slice
-TriggerFlags.MuonSlice.setAll()
-TriggerFlags.BphysicsSlice.setAll()
-
-# hack for L=10^31 (repeated in special flags)
-if hasattr(ServiceMgr,'RPCcblingSvc')
-    ServiceMgr.RPCcablingSvc.HackFor1031 = True
-"""
-
-     if(    self.current() == 'BphysicsOldConfig' ) :
-         self.jobFlags     += """
-###### This is a temporary fix ################
-DetFlags.simulateLVL1.Muon_setOn()
-
-# Enable Bphysics slice: needs muon slice
-TriggerFlags.BphysicsSlice.unsetAll()
-TriggerFlags.BphysicsSlice.setL2Muon()
-TriggerFlags.BphysicsSlice.setL2ID()
-TriggerFlags.BphysicsSlice.setEFID()
-
-# Enable muon slice
-TriggerFlags.MuonSlice.setL2Muon()
-TriggerFlags.MuonSlice.setL2ID()
-TriggerFlags.MuonSlice.unsetEF()
-
-triggerMenu.disableAll()
-triggerMenu.enableSignatures(["BJpsiMU6mu", "Bmu6mu6" ,"BsDsPhiPi","BsDsPhiPiFullScan"])
-triggerMenu.enableSignatures(["BJpsiee"])
-triggerMenu.enableSignatures(["mu6", "mu6l"])
-
-"""
-
-     ####################   Cosmics      ###############################
-     if(    self.current() == 'Cosmics' ) :
-        self.jobProperties     = """
-if not 'FakeLVL1' in dir():
-    FakeLVL1 = True
-
-if not 'doSiTrack' in dir():
-    doSiTrack = False
-        
-if not 'PoolRDOInput' in dir():
-    acf.PoolRDOInput = ['/afs/cern.ch/atlas/project/trigger/pesa-sw/releases/data/cosmic.10evts.rdo.root']
-    DetDescrVersion='ATLAS-CSC-00-00-00'
-
-# make sure Truth is OFF, even if it was set to ON before
-rec.doTruth=False
-
-"""
-        self.jobFlags          = """
-TriggerFlags.doEF=False
-#TriggerFlags.doID=True
-#TriggerFlags.doMuon=False
-
-TriggerFlags.CosmicSlice.setL2()
-
-triggerMenu.disableAll()
-
-if doSiTrack:
-    triggerMenu.enableSignature("cosmic_SiTrack")
-else:
-    triggerMenu.enableSignature("cosmic_IDSCAN")
-    
-theApp.Dlls   += [ "TrigmuFast" ] # needed for MUON::ROBmapper::ROBmapper(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)
-#theApp.Dlls += ['TrigL2CosmicMuonHypo']
-theApp.Dlls += [ "TrigOnlineSpacePointTool","TrigOfflineSpacePointTool" ]
-
-theApp.Dlls += [ "TrkExTools" ]
-
-
-    
-
-"""
-        
-        self.extraTopOptions   = """
-if FakeLVL1:
-
-    from TrigFake.TrigFakeConf import FakeLvl1RoIatFixedEtaPhi
-#    from TrigFake.TrigFakeConf import FakeLvl1MultipleRoIsatFixedEtaPhi
-
-#    fake = FakeLvl1MultipleRoIsatFixedEtaPhi()
-#    fake.FakeMuonRoiPhi=[1.5708]#,-1.5708]
-#    fake.FakeMuonRoiEta=[0.1]#,0.2]
-#    fake.FakeMuonRoiLabel=["MU06"]#,"MU06"]
-    fake = FakeLvl1RoIatFixedEtaPhi()
-    fake.FakeMuonRoiPhi=3.1
-    fake.FakeMuonRoiEta=0.1
-    fake.FakeMuonRoiLabel="MU06"
-
-    # fake.OutputLevel=VERBOSE
-
-    job.TrigSteer_L2.LvlConverterTool =  fake
-
-"""
-
diff --git a/Trigger/TrigValidation/TriggerTest/python/TrigValSpecialFlagsBlock.py b/Trigger/TrigValidation/TriggerTest/python/TrigValSpecialFlagsBlock.py
deleted file mode 100755
index 7ab9e7f9dac5cd88efd15adf14763e67f42abf03..0000000000000000000000000000000000000000
--- a/Trigger/TrigValidation/TriggerTest/python/TrigValSpecialFlagsBlock.py
+++ /dev/null
@@ -1,74 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-from RecExConfig.RecFlags import rec
-from AthenaCommon.AthenaCommonFlags import athenaCommonFlags as acf
-
-from TrigValJobOptionBlock import   TrigValJobOptionBlock
-
-class TrigValSpecialFlagsBlock(TrigValJobOptionBlock):
-   def __init__(self, current) :
-     TrigValJobOptionBlock.__init__(self, 'None',['None','doTruthFalse','memTrack', 'rerunHYPO','hackRPC'])
-
-     self.name = "SpecialFlags"
-     if(current  == "" ) : current = "None"
-     self.setCurrent(current)  # this calls initializeBlocks()
-
-
-   def jobNameBlock(self) :
-      if( self.current() == 'None' ) :
-          return ""
-      else:
-          return "_"+self.current()
-
-
-   def  initializeBlocks(self) :
-
-     ####################     doTruthFalse    ###############################
-     if(    self.current() == 'doTruthFalse' ) :
-        self.jobProperties     = """
-rec.doTruth=False
-"""
-     else :
-        self.jobProperties     = """
-rec.doTruth=True
-"""
-
-     ####################     check mem leaks    ###############################
-     if(    self.current() == 'memTrack' ) :
-        self.jobProperties     += """
-# Run the memory leak checker
-# This is equivalent to athena --leak-check-execute
-import Hephaestus.MemoryTracker as memtrack
-memtrack.trace("Algorithm::sysExecute")
-memtrack.ignore("StoreGateSvc::setupProxy")
-memtrack.configure(memtrack.LEAK_CHECK | memtrack.PROFILE)
-"""
-
-
-
-     ####################     rerunHYPO    ###############################
-     if(    self.current() == 'rerunHYPO' ) :
-        self.jobProperties     += """
-"""
-        self.jobFlags          += """
-#jobOptions to re-run HYPO only        
-TriggerFlags.doHypo=True
-TriggerFlags.doFEX=False
-"""
-        self.extraTopOptions   += ""
-
-
-
-     ####################     RPC hack for L=10^31    ###############################
-     if(    self.current() == 'hackRPC' ) :
-        self.jobProperties     += """
-"""
-        self.jobFlags          += """
-if hasattr(svcMgr,'THistSvc'):
-    svcMgr.THistSvc.OutputLevel = WARNING
-
-# hack for L=10^31 (repeated in special flags)
-if hasattr(ServiceMgr,'RPCcblingSvc')
-    ServiceMgr.RPCcablingSvc.HackFor1031 = True
-"""
-        self.extraTopOptions   += ""
diff --git a/Trigger/TrigValidation/TriggerTest/python/TrigValTemporaryFixBlock.py b/Trigger/TrigValidation/TriggerTest/python/TrigValTemporaryFixBlock.py
deleted file mode 100755
index e76874353c3a9621b8df322c00b895d7b85e1848..0000000000000000000000000000000000000000
--- a/Trigger/TrigValidation/TriggerTest/python/TrigValTemporaryFixBlock.py
+++ /dev/null
@@ -1,41 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-from RecExConfig.RecFlags import rec
-from AthenaCommon.AthenaCommonFlags import athenaCommonFlags as acf
-
-from TrigValJobOptionBlock import   TrigValJobOptionBlock
-
-class TrigValTemporaryFixBlock(TrigValJobOptionBlock):
-   def __init__(self, current) :
-     TrigValJobOptionBlock.__init__(self, 'Fix',['None','Fix'])
-
-     self.name = "TemporaryFix"
-     if(current  == "" ) : current = "Fix"
-     self.setCurrent(current)  # this calls initializeBlocks()
-
-
-   def jobNameBlock(self) :
-      if( self.current() == 'None' ) :
-          return "NoFix"
-      else:
-          return ""
-
-
-   def  initializeBlocks(self) :
-
-     ####################         ###############################
-     if(    self.current() == 'Fix' ) :
-         self.jobProperties     = ""
-         self.jobFlags          = """
-#------------ This is a temporary fix ---------------
-TriggerFlags.abortOnConfigurationError=True
-#-------------end of temporary fix-------------------
-"""
-         self.extraTopOptions   = """
-# disable printing of histograms in finalize
-if hasattr(svcMgr,'THistSvc'):
-    svcMgr.THistSvc.OutputLevel = WARNING
-
-# THistSvc = Service ( \"THistSvc\" )
-# THistSvc.OutputLevel=WARNING
-"""
diff --git a/Trigger/TrigValidation/TriggerTest/python/TrigValValidationBlock.py b/Trigger/TrigValidation/TriggerTest/python/TrigValValidationBlock.py
deleted file mode 100755
index 7776e11e8205923feb51bf35e3941603b5abf60b..0000000000000000000000000000000000000000
--- a/Trigger/TrigValidation/TriggerTest/python/TrigValValidationBlock.py
+++ /dev/null
@@ -1,33 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-from RecExConfig.RecFlags import rec
-from AthenaCommon.AthenaCommonFlags import athenaCommonFlags as acf
-
-from TrigValJobOptionBlock import   TrigValJobOptionBlock
-
-class TrigValValidationBlock(TrigValJobOptionBlock):
-   def __init__(self, current) :
-     TrigValJobOptionBlock.__init__(self, 'None', ['None','NODEBUG'])
-
-     self.name = "Validation"
-     if(current  == "" ) : self.setCurrent('None')  # this calls initializeBlocks()
-
-
-   def jobNameBlock(self) :
-      return ""
-
-   def  initializeBlocks(self) :
-
-     ####################         ###############################
-     if(    self.current() == 'NODEBUG' ) :
-         self.jobFlags  = """
-TriggerFlags.enableMonitoring = [ 'Validation', 'Time' ]
-"""
-     else :        
-         self.jobFlags  = """
-TriggerFlags.enableMonitoring = [ 'Validation', 'Time', 'Log' ]
-"""
-
-         self.extraTopOptions  = """
-"""
-
diff --git a/Trigger/TrigValidation/TriggerTest/python/TruncateLog_TriggerTest.py b/Trigger/TrigValidation/TriggerTest/python/TruncateLog_TriggerTest.py
deleted file mode 100755
index 544aac1e56590411d3426901362c240ae798f8fb..0000000000000000000000000000000000000000
--- a/Trigger/TrigValidation/TriggerTest/python/TruncateLog_TriggerTest.py
+++ /dev/null
@@ -1,16 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-# Simple wrapper for specific RttScriptRunner instances
-# This is done to get "pretty" names on the RTT web pages
-
-from RecExConfig.RecFlags import rec
-from AthenaCommon.AthenaCommonFlags import athenaCommonFlags as acf
-
-import sys, os
-sys.path.append(os.path.dirname(sys.modules[__name__].__file__))
-
-from RttScriptRunner_TriggerTest import RttScriptRunner_TriggerTest
-
-class TruncateLog_TriggerTest(RttScriptRunner_TriggerTest):
-   pass
-
diff --git a/Trigger/TrigValidation/TriggerTest/python/ValGrindPostScript_TriggerTest.py b/Trigger/TrigValidation/TriggerTest/python/ValGrindPostScript_TriggerTest.py
deleted file mode 100755
index c1f955cd91e5c75e84a7c3ba3079c99f4b073b07..0000000000000000000000000000000000000000
--- a/Trigger/TrigValidation/TriggerTest/python/ValGrindPostScript_TriggerTest.py
+++ /dev/null
@@ -1,19 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-# Simple wrapper for specific RttScriptRunner instances
-# This is done to get "pretty" names on the RTT web pages
-
-from RecExConfig.RecFlags import rec
-from AthenaCommon.AthenaCommonFlags import athenaCommonFlags as acf
-
-import sys, os
-sys.path.append(os.path.dirname(sys.modules[__name__].__file__))
-
-from RttScriptRunner_TriggerTest import RttScriptRunner_TriggerTest
-
-class ValGrindPostScript_TriggerTest(RttScriptRunner_TriggerTest):
-    pass
-
-#add tony's python post script for valgrind after this:
-#sed -e '/    definitely lost: / { N; d; }' Valgrind_*_log > Valgrind_test_log_1
-#!!!
\ No newline at end of file
diff --git a/Trigger/TrigValidation/TriggerTest/python/ValgrindAnalysisScript_TriggerTest.py b/Trigger/TrigValidation/TriggerTest/python/ValgrindAnalysisScript_TriggerTest.py
deleted file mode 100755
index 82ab916f50bbe501655a64010fdcea012185859a..0000000000000000000000000000000000000000
--- a/Trigger/TrigValidation/TriggerTest/python/ValgrindAnalysisScript_TriggerTest.py
+++ /dev/null
@@ -1,50 +0,0 @@
-#!/usr/bin/env python
-
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-import glob
-import commands
-import os
-import subprocess
-import string
-import locale
-import fnmatch
-
-myfile=""
-for file in os.listdir('.'):
-    if fnmatch.fnmatch(file, 'Valgrind_*_log_1'):
-        f=open(file,"r")
-        myfile=file
-#        exit()
-
-
-if not os.path.isfile(myfile):
-    print "Did not find a log file matching to Valgrind_*_log_1"
-    quit() 
-
-# Find top 20 instances of memory leaks as reported by valgrind
-
-#f = open("/atlas/scratch0/limosani/valgrind_memcheck_devval_Jan11_esdtoaod/valgrind.out","r")
-#f = open("Valgrind_*_2","r")
-#f = open("/afs/cern.ch/user/l/limosani/atpc2/trigger_memory_tests/Valgrind_MC_pp_v5_log")
-
-searchlines = f.readlines()
-f.close()
-
-newfile = open('compact_valgrind_log', 'w+')
-
-for i,line in enumerate(searchlines):
-   if "definitely lost" in line:
-       #decompose line to check the size of the memory leak
-       words = searchlines[i].split()
-       #convert memory leak size to a number
-       locale.setlocale( locale.LC_ALL, 'en_US.UTF-8' )
-       memleakSize = locale.atoi(words[1])
-       if memleakSize > 500 :
-           print >> newfile
-           print >> newfile, "-------------------------------------------------------------------------------------------------------------"
-           print >> newfile, "//// Memory leak ", memleakSize
-#            if "execute" in searchlines[i:i+30]:
-           for l in searchlines[i:i+30]:
-               print >> newfile, l,
-           print >> newfile
-           print >> newfile
diff --git a/Trigger/TrigValidation/TriggerTest/python/__init__.py b/Trigger/TrigValidation/TriggerTest/python/__init__.py
deleted file mode 100644
index aab4d50d3d60cac1d2da21073fa0e45f8baa3485..0000000000000000000000000000000000000000
--- a/Trigger/TrigValidation/TriggerTest/python/__init__.py
+++ /dev/null
@@ -1,3 +0,0 @@
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-# File: TriggerTest/__init__.py
diff --git a/Trigger/TrigValidation/TriggerTest/python/trigValMakeJobOptions.py b/Trigger/TrigValidation/TriggerTest/python/trigValMakeJobOptions.py
deleted file mode 100755
index 94034905f961dc40fd4df5e19657b3c00a57aa7d..0000000000000000000000000000000000000000
--- a/Trigger/TrigValidation/TriggerTest/python/trigValMakeJobOptions.py
+++ /dev/null
@@ -1,174 +0,0 @@
-#!/usr/bin/env python
-
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-from RecExConfig.RecFlags import rec
-from AthenaCommon.AthenaCommonFlags import athenaCommonFlags as acf
-
-import getopt, sys
-from TrigValJobOptionBuilder import TrigValJobOptionBuilder
-
-def makeSlice(slice, executable="", config="", iinput="RDO", output = "") :
-    TrigValJobOptionBuilder("",slice,"",executable,config,iinput,output).makeJobOption()
-
-def makeAllSlicesOldConfig( executable = "", iinput="RDO",output = "") :
-    makeSlice("Electron", executable, "OldConfig", iinput, output)
-    makeSlice("Photon"  , executable, "OldConfig", iinput, output)
-    makeSlice("Tau"     , executable, "OldConfig", iinput, output)
-    makeSlice("Muon"    , executable, "OldConfig", iinput, output)
-    makeSlice("Jet"     , executable, "OldConfig", iinput, output)
-    makeSlice("MET"     , executable, "OldConfig", iinput, output)
-    makeSlice("Bjet"    , executable, "OldConfig", iinput, output)
-#    makeSlice("Bphysics", executable, "OldConfig", iinput, output)
-
-def makeAllSlices( executable = "", iinput="RDO",output = "") :
-    makeSlice("Electron", executable, "Modern", iinput, output)
-    makeSlice("Photon"  , executable, "Modern", iinput, output)
-    makeSlice("Tau"     , executable, "Modern", iinput, output)
-    makeSlice("Muon"    , executable, "Modern", iinput, output)
-    makeSlice("Jet"     , executable, "Modern", iinput, output)
-    makeSlice("MET"     , executable, "Modern", iinput, output)
-    makeSlice("Bjet"    , executable, "Modern", iinput, output)
-#    makeSlice("Bphysics", executable, "Modern", iinput, output)
-
-
-def makeDetector(detector) :
-    TrigValJobOptionBuilder(detector,"","","","Modern").makeJobOption()
-    TrigValJobOptionBuilder(detector,"","","","OldConfig").makeJobOption()    
-
-
-def makeAll() :
-    # TrigValJobOptionBuilder (detector = "All", slice = "All", menu = "Default", 
-    #                          executable = "Athena", input = "RDO", output = "",
-    #                          specialFlags = "", validation = "") :
-    # absolute default
-    TrigValJobOptionBuilder().makeJobOption()
-    TrigValJobOptionBuilder("","","","","OldConfig").makeJobOption()
-    # AllAlgs=True
-    TrigValJobOptionBuilder("","","","AthenaAllAlgsTrue").makeJobOption()
-    TrigValJobOptionBuilder("","","","AthenaAllAlgsTrue","OldConfig").makeJobOption()
-
-    # memleak checks (old config)
-    TrigValJobOptionBuilder("","","","","OldConfig","","","memTrack","NODEBUG").makeJobOption()
-    TrigValJobOptionBuilder("","","","","OldConfig","","ESDAOD","memTrack","NODEBUG").makeJobOption()
-    TrigValJobOptionBuilder("","","","AthenaAllAlgsTrue","OldConfig","","","memTrack","NODEBUG").makeJobOption()
-    TrigValJobOptionBuilder("","Electron","","","OldConfig","","","memTrack","NODEBUG").makeJobOption()
-    TrigValJobOptionBuilder("","","","AthenaStandalone","OldConfig","","","","").makeJobOption()
-    # memleak checks (new config)
-    TrigValJobOptionBuilder("","","","","Modern","","","memTrack","NODEBUG").makeJobOption()
-    TrigValJobOptionBuilder("","","","","Modern","","ESDAOD","memTrack","NODEBUG").makeJobOption()
-    TrigValJobOptionBuilder("","","","AthenaAllAlgsTrue","Modern","","","memTrack","NODEBUG").makeJobOption()
-    TrigValJobOptionBuilder("","Electron","","","Modern","","","memTrack","NODEBUG").makeJobOption()
-    TrigValJobOptionBuilder("","","","AthenaStandalone","Modern","","","","").makeJobOption()
-
-    # Detector specific
-    makeDetector("Calo")
-    makeDetector("ID")
-    makeDetector("Muon")
-
-    # Slice specific
-    makeAllSlices()
-    makeAllSlicesOldConfig()    
-    makeSlice("Cosmics", "", "OldConfig", "RDO")
-    makeSlice("Cosmics", "", "Modern", "RDO")
-
-    # moving Bphys here temporarily because it needs special flags (RPC hack) - RG 23/8
-    TrigValJobOptionBuilder("","Bphysics","","","OldConfig","","","hackRPC","").makeJobOption()
-    TrigValJobOptionBuilder("","Bphysics","","","Modern","","","hackRPC","").makeJobOption()    
-    
-    # write ESD
-    TrigValJobOptionBuilder("","","","","OldConfig","RDO","ESDAOD","","").makeJobOption()
-    TrigValJobOptionBuilder("","","","","Modern","RDO","ESDAOD","","").makeJobOption()    
-    makeAllSlices("","RDO","ESDAOD")
-    makeAllSlicesOldConfig("","RDO","ESDAOD")    
-
-    #read ESD
-    TrigValJobOptionBuilder("","","","","OldConfig","ESD","AOD","","").makeJobOption()
-    TrigValJobOptionBuilder("","","","","Modern","ESD","AOD","","").makeJobOption()
-    #read ESD
-    TrigValJobOptionBuilder("","","","","OldConfig","ESD","","rerunHYPO","").makeJobOption()
-    TrigValJobOptionBuilder("","","","","OldConfig","AOD","","rerunHYPO","").makeJobOption()
-    TrigValJobOptionBuilder("","","","","Modern","ESD","","rerunHYPO","").makeJobOption()
-    TrigValJobOptionBuilder("","","","","Modern","AOD","","rerunHYPO","").makeJobOption()    
-
-    #write BS
-    TrigValJobOptionBuilder("","","","","OldConfig","RDO","BS","","").makeJobOption()
-    TrigValJobOptionBuilder("","","","","Modern","RDO","BS","","").makeJobOption()
-    #read BS (standalone)
-    TrigValJobOptionBuilder("","","","AthenaStandalone","OldConfig","BS","","","").makeJobOption()
-    TrigValJobOptionBuilder("","","","AthenaStandalone","OldConfig","BStmp","","","").makeJobOption()
-    TrigValJobOptionBuilder("","","","AthenaStandalone","Modern","BS","","","").makeJobOption()
-    TrigValJobOptionBuilder("","","","AthenaStandalone","Modern","BStmp","","","").makeJobOption()    
-    makeAllSlices("AthenaStandalone","BStmp")
-    makeAllSlicesOldConfig("AthenaStandalone","BStmp")    
-
-    #standalone tests
-    TrigValJobOptionBuilder("","Electron","","","OldConfig","","","memTrack","NODEBUG").makeJobOption()
-    TrigValJobOptionBuilder("","Electron","","","Modern","","","memTrack","NODEBUG").makeJobOption()
-    
-
-
-###################################################################################    
-def usage(): 
-   print """To run the script do :
-./TrigValMakeJobOption <options> 
-
-   where  <options> are
-        -h , --help            - print this message
-        -o , --options         - print all options of TrigValMakeJobBuilder
-        -a , --all             - make all jobOptions
-        -d , --detector <Det>  - make jobO for a particular detector Calo, ID, Muon 
-        -s , --slice <slice>   - make jobO for a particular slice : Electron, Photon, Muon,
-                                                                    Tau, Jet, MET, 
-                                                                    Bjet, Bphysics, Cosmics
-"""
-def lastStep():
-    print "to copy it is to relase do : "
-    print "  mv TriggerTest/* ../share/"
-    print "  mv TrigAnalysisTest/* ../../TrigAnalysisTest/share/"
-    
-def warning() :
-   answer = raw_input("This scripts overwrites files in TriggerTest directory. Are you sure you want to proceed (y/n)?")
-   if( answer.lower() != "y" and answer.lower() !=  "yes" ) :
-      import sys
-      sys.exit("Nothing is touched")
-
-def main():
-    try:
-        opts, args = getopt.getopt(sys.argv[1:], "ds:hoa", ["help", "options", "all=","slice=","detector="])
-    except getopt.GetoptError:
-        # print help information and exit:
-        usage()
-        sys.exit(2)
-    output = None
-    verbose = False
-    if( opts == [] ) :
-       #usage()
-       #sys.exit(2)
-       makeAll()
-       lastStep()
-       sys.exit()
-    for o, a in opts:
-        if o in ("-h", "--help"):
-            usage()
-            sys.exit()
-        if o in ("--options", "-o"):
-            TrigValJobOptionBuilder().help()
-            sys.exit()
-        if o in ("-s", "--slice"):
-            #warning()
-            makeSlice(a)
-            lastStep()
-        if o in ("-d", "--detector"):
-            #warning()
-            makeDetector(a)
-            lastStep()
-        if o in ("-a", "--all"):
-            #warning()
-            makeAll()
-            lastStep()
-            sys.exit()
-    # ...
-    
-if __name__ == "__main__":
-    main()
diff --git a/Trigger/TrigValidation/TriggerTest/python/trigValMakeTests.py b/Trigger/TrigValidation/TriggerTest/python/trigValMakeTests.py
deleted file mode 100755
index bbb85beca7c1600d870e271256a7776c51271ede..0000000000000000000000000000000000000000
--- a/Trigger/TrigValidation/TriggerTest/python/trigValMakeTests.py
+++ /dev/null
@@ -1,282 +0,0 @@
-#!/usr/bin/env python
-
-# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
-
-from RecExConfig.RecFlags import rec
-from AthenaCommon.AthenaCommonFlags import athenaCommonFlags as acf
-
-import getopt, sys
-##################################################
-#     DEFAULTS 
-
-output=""
-defaultPath="TriggerTest"
-testConfName="trigValidation.conf"
-defaultEmail=""
-defaultHNEmail="hn-atlas-trig-validation-nightly-reports@cern.ch"
-import os
-if( not os.path.isdir(defaultPath )) :
-   os.makedirs( defaultPath )
-
-
-
-####################################################
-
-from TrigValMakeTestConf import TrigValMakeTestConf
-
-def warning() :
-   answer = raw_input("This scripts overwrites files in TriggerTest directory. Are you sure you want to proceed (y/n)?")
-   if( answer.lower() != "y" and answer.lower() !=  "yes" ) :
-      import sys
-      sys.exit("Nothing is touched")
-
-def detectorSet(icounter,  testBase=120, config="Modern", output="" ) :
-
-   if( output != "" ) : output = "to"+output
-
-   itest=testBase
-   icounter+= 1
-   TrigValMakeTestConf(testConfName, icounter, itest, "CaloAthena"+config+"RDO"+output, 
-                              ['Full' ],"testCalo",  [defaultEmail, "Denis.Damazio@cern.ch"], "",  )
-#                              ['T2CaloEgamma_eGamma','T2CaloTau_Tau', 'T2TauFinal', 'TauHypo' ],"testCalo",  [defaultEmail])
-   icounter+= 1
-   itest +=1
-   TrigValMakeTestConf(testConfName, icounter, itest, "IDAthena"+config+"RDO"+output, 
-                              ['Full'], "testID", [defaultEmail, "Denis.Damazio@cern.ch"], "" )
-   icounter+= 1
-   itest +=1
-   TrigValMakeTestConf(testConfName, icounter,itest , "MuonAthena"+config+"RDO"+output, 
-                              ['Muon'], "", [defaultEmail], "" )
-
-def sliceSet(icounter, testBase=150, config="Modern", iinput="", output="", path="TriggerTest") :
-
-   if( iinput == "" ) : iinput = "RDO"
-   if( output != "" ) : output = "to"+output
-   if( iinput == "BS" or  iinput == "BStmp" ) : config = "Standalone"+config
-
-
-   icounter+= 1
-   itest=testBase+1
-   TrigValMakeTestConf(testConfName, icounter, itest, "ElectronSliceAthena"+config+iinput+output, 
-                              ['Full'], "testElectronSlice" , 
-                              [defaultEmail, "Denis.Damazio@cern.ch","Teresa.Fonseca.Martin@cern.ch"], path )
-   icounter+= 1
-   itest +=1
-   TrigValMakeTestConf(testConfName, icounter, itest, "PhotonSliceAthena"+config+iinput+output, 
-                              ['Full'], "testPhotonSlice", 
-                              [defaultEmail,"Valeria.Perez.Reale@cern.ch"], path)
-   icounter+= 1
-   itest +=1
-   TrigValMakeTestConf(testConfName, icounter, itest, "MuonSliceAthena"+config+iinput+output, 
-                              ['Full'], "testMuonSlice",
-                              [defaultEmail,"alessandro.dimattia@roma1.infn.it"], path)
-   icounter+= 1
-   itest +=1
-   TrigValMakeTestConf(testConfName, icounter, itest, "TauSliceAthena"+config+iinput+output, 
-                              ['Full'], "testTauSlice",
-                              [defaultEmail,"strom@physics.uoregon.edu"], path)
-  
-   icounter+= 1
-   itest +=1
-   TrigValMakeTestConf(testConfName, icounter, itest, "JetSliceAthena"+config+iinput+output, 
-                              ['Full'], "testJetSlice", [defaultEmail,"cpotter@physics.mcgill.ca"], path)
-  
-   icounter+= 1
-   itest +=1
-   TrigValMakeTestConf(testConfName, icounter, itest, "METSliceAthena"+config+iinput+output, 
-                       ['Full'], "testMETSlice",
-                       [defaultEmail,"Allen.Mincer@cern.ch"], path)
-
-   icounter+= 1
-   itest +=1
-   TrigValMakeTestConf(testConfName, icounter, itest, "BphysicsSliceAthena"+config+iinput+output, 
-                           ['Full']  , "testBphysicsSlice",
-                       [defaultEmail,"j.kirk@rl.ac.uk"], path)
-  
-   icounter+= 1
-   itest +=1
-   TrigValMakeTestConf(testConfName, icounter, itest, "BjetSliceAthena"+config+iinput+output, 
-                              [    'Full'], "testBjetSlice",
-                       [defaultEmail,"Andrea.Coccaro@cern.ch"], path)
-
-   icounter+= 1
-   itest +=1
-   TrigValMakeTestConf(testConfName, icounter, itest, "LVL1CTPAthena"+config+iinput+output, 
-                       [ 'LVL1CTP' ], "testLVL1CTP",
-                       [ defaultEmail, "Wolfgang.Ehrenfeld@cern.ch"], path)
-
-   if( iinput == "RDO" and  output == "" ) : #toESDAOD" and output !="toAOD" and output != "toESD" ) :
-     icounter+= 1
-     itest +=1
-     TrigValMakeTestConf(testConfName, icounter, itest, "CosmicsSliceAthena"+config+iinput+output, 
-                              ['Full'], "testCosmicsSlice", [defaultEmail,"jamie.boyd@cern.ch"], path)
-
-
-
-def main():
-  #warning()
-  testConfigFullPath=defaultPath+"/"+testConfName
-
-  try :
-    testCF = open(testConfigFullPath,"w") # remove everything - we will prepare new tests
-    testCF.write("# This file is created automatically . To recreate it use :\n")
-    testCF.write("# python makeTests.py\n")
-    testCF.write("# from Trigger/TrigValidation/TriggerTest/python directory \n")
-  
-    testCF.close()
-
-    #########################################################
-    #         PUT YOUR MODIFICATIONS BELOW THIS LINE
-    #########################################################
-
-    # by default NO AOD link from tmp directory is made.
-  
-    icounter = 1
-    TrigValMakeTestConf(testConfName, icounter, 101, "AthenaModernRDO", 
-                        ['Full'],"testAthenaRDO",  [defaultHNEmail], "",
-                         makeReferenceLink=True )
-    icounter += 1
-    TrigValMakeTestConf(testConfName, icounter, 201, "AthenaOldConfigRDO", 
-                        ['Full'],"testAthenaRDO",  [defaultHNEmail], "",
-                         makeReferenceLink=True )
-
-    icounter += 1  
-    TrigValMakeTestConf(testConfName, icounter, 102, "AthenaAllAlgsTrueModernRDO", 
-                        ['Full'], "testAthenaRDO",  [defaultEmail], "",
-                         useTmpReference=True )
-    icounter += 1  
-    TrigValMakeTestConf(testConfName, icounter, 202, "AthenaAllAlgsTrueOldConfigRDO", 
-                        ['Full'], "testAthenaRDO",  [defaultEmail], "",
-                         useTmpReference=True )
-                              
-    icounter += 1
-    TrigValMakeTestConf(testConfName, icounter, 103, "AthenaModernRDOtoBS", 
-                        ['Full'],"testAthenaRDO",  [defaultEmail], "",
-                        post_command="rm -f ../trigger.BS.data; ln -s $PWD/daq.csc13.0000000.Single.Stream.LB0000.Athena._0001.data ../trigger.BS.data",
-                        useTmpReference=True)
-    icounter += 1
-    TrigValMakeTestConf(testConfName, icounter, 203, "AthenaOldConfigRDOtoBS", 
-                        ['Full'],"testAthenaRDO",  [defaultEmail], "",
-                        post_command="rm -f ../trigger.BS.data; ln -s $PWD/daq.csc13.0000000.Single.Stream.LB0000.Athena._0001.data ../trigger.BS.data",
-                        useTmpReference=True)
-
-    icounter += 1
-    TrigValMakeTestConf(testConfName, icounter, 104, "AthenaModernRDOtoESDAOD", 
-                        ['Full'],"testAthenaRDO",  [defaultEmail], "TrigAnalysisTest",
-                        post_command="rm -f ../trigger*root; rm -f ../output*xml; ln -s $PWD/ESD.pool.root ../trigger.ESD.pool.root;  ln -s $PWD/AOD.pool.root ../trigger.AOD.pool.root; \n  post_command ln -s $PWD/outputLVL1config.xml ../outputLVL1config.xml; \n  post_command ln -s $PWD/outputHLTconfig.xml ../outputHLTconfig.xml;", useTmpReference=True)
-    icounter += 1
-    TrigValMakeTestConf(testConfName, icounter, 204, "AthenaOldConfigRDOtoESDAOD", 
-                        ['Full'],"testAthenaRDO",  [defaultEmail], "TrigAnalysisTest",
-                        post_command="rm -f ../trigger*root; rm -f ../output*xml; ln -s $PWD/ESD.pool.root ../trigger.ESD.pool.root;  ln -s $PWD/AOD.pool.root ../trigger.AOD.pool.root; \n  post_command ln -s $PWD/outputLVL1config.xml ../outputLVL1config.xml; \n  post_command ln -s $PWD/outputHLTconfig.xml ../outputHLTconfig.xml;", useTmpReference=True)
-
-    icounter += 1
-    TrigValMakeTestConf(testConfName, icounter, 105, "AthenaModernAOD_rerunHYPO", 
-                        ['Full'],"testAthenaRDO",  [defaultEmail], "TrigAnalysisTest",
-                         useTmpReference=True)
-    icounter += 1
-    TrigValMakeTestConf(testConfName, icounter, 205, "AthenaOldConfigAOD_rerunHYPO", 
-                        ['Full'],"testAthenaRDO",  [defaultEmail], "TrigAnalysisTest",
-                         useTmpReference=True)
-
-  
-    icounter += 1
-    TrigValMakeTestConf(testConfName, icounter, 106, "AthenaStandaloneModernRDO", 
-                        ['Full'],"testAthenaRDO",  [defaultEmail], "",
-                        useTmpReference=True) 
-    icounter += 1
-    TrigValMakeTestConf(testConfName, icounter, 206, "AthenaStandaloneOldConfigRDO", 
-                        ['Full'],"testAthenaRDO",  [defaultEmail], "",
-                        useTmpReference=True)
-
-    icounter += 1
-    TrigValMakeTestConf(testConfName, icounter, 107, "AthenaStandaloneModernBS", 
-                        ['Full'],"testAthenaRDO",  [defaultEmail], "",
-                        useTmpReference=True)
-    icounter += 1
-    TrigValMakeTestConf(testConfName, icounter, 207, "AthenaStandaloneOldConfigBS", 
-                        ['Full'],"testAthenaRDO",  [defaultEmail], "",
-                        useTmpReference=True)
-
-    icounter += 1
-    TrigValMakeTestConf(testConfName, icounter, 108, "AthenaStandaloneModernBStmp", 
-                        ['Full'],"testAthenaRDO",  [defaultEmail], "",
-                        useTmpReference=True)
-    icounter += 1
-    TrigValMakeTestConf(testConfName, icounter, 208, "AthenaStandaloneOldConfigBStmp", 
-                        ['Full'],"testAthenaRDO",  [defaultEmail], "",
-                        useTmpReference=True)
-
-
-    detectorSet(icounter, 110, "Modern", "")
-    icounter += 3
-    detectorSet(icounter, 210, "OldConfig", "")    
-    icounter += 3    
-    sliceSet(icounter, 130, "Modern", "RDO", "")
-    icounter += 9
-    sliceSet(icounter, 230, "OldConfig", "RDO", "")
-    #icounter += 9
-    #sliceSet(icounter, 160, "RDO", "ESD","TrigAnalysisTest")
-    #icounter += 9
-    #sliceSet(icounter, 170, "RDO", "AOD","TrigAnalysisTest")
-    icounter += 9
-    sliceSet(icounter, 150, "Modern", "RDO", "ESDAOD","TrigAnalysisTest")
-    icounter += 9
-    sliceSet(icounter, 250, "OldConfig", "RDO", "ESDAOD","TrigAnalysisTest")
-    icounter += 9
-    sliceSet(icounter, 170, "Modern", "BStmp", "","")
-    icounter += 9
-    sliceSet(icounter, 270, "OldConfig", "BStmp", "","")
-    
-    icounter += 9
-    TrigValMakeTestConf(testConfName, icounter, 301, "AthenaAllAlgsTrueModernRDO_memTrack", 
-                        ['Full'], "testAthenaRDO",  [defaultEmail], "",
-                         useTmpReference=True)
-    icounter += 1
-    TrigValMakeTestConf(testConfName, icounter, 402, "AthenaAllAlgsTrueOldConfigRDO_memTrack", 
-                        ['Full'], "testAthenaRDO",  [defaultEmail], "",
-                         useTmpReference=True)
-    icounter += 1
-    TrigValMakeTestConf(testConfName, icounter, 303, "AthenaModernRDO_memTrack", 
-                        ['Full'],"testAthenaRDO",  [defaultEmail], "",
-                         useTmpReference=True)
-    icounter += 1
-    TrigValMakeTestConf(testConfName, icounter, 404, "AthenaOldConfigRDO_memTrack", 
-                        ['Full'],"testAthenaRDO",  [defaultEmail], "",
-                         useTmpReference=True)
-    icounter += 1
-    TrigValMakeTestConf(testConfName, icounter, 305, "AthenaModernRDOtoESDAOD_memTrack", 
-                        ['Full'],"testAthenaRDO",  [defaultEmail], "TrigAnalysisTest",
-                        useTmpReference=True)
-    icounter += 1
-    TrigValMakeTestConf(testConfName, icounter, 406, "AthenaOldconfigRDOtoESDAOD_memTrack", 
-                        ['Full'],"testAthenaRDO",  [defaultEmail], "TrigAnalysisTest",
-                        useTmpReference=True)
-    
-    icounter += 1
-    TrigValMakeTestConf(testConfName, icounter, 351, "ElectronSliceAthenaModernRDO_memTrack", 
-                        ['Full'], "testElectronSlice" , 
-                        [defaultEmail], "")
-    icounter += 1
-    TrigValMakeTestConf(testConfName, icounter, 452, "ElectronSliceAthenaOldConfigRDO_memTrack", 
-                        ['Full'], "testElectronSlice" , 
-                        [defaultEmail], "")
-
-
-  
-    import os
-    os.rename( testConfName, testConfigFullPath)
-    print "trigtest config file created as "+testConfigFullPath
-    print " to put this in  release do : "
-    print "     mv TriggerTest/*sh ../test"
-    print "     mv "+defaultPath+"/"+testConfName+" ../Testing"
-    print "     mv TrigAnalysisTest/*sh ../../TrigAnalysisTest/test"
-
-
-  #############################################################
-  
-  except IOError: 
-    print "TrigValMakeTests   ERROR: Can not open "+testConfigFullPath+". will do nothing"
-  
-  
-if __name__ == "__main__":
-    main()
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/CMakeLists.txt b/Trigger/TriggerCommon/TriggerMenuMT/CMakeLists.txt
index 0f06716225e314cbca3049decfe9b1053e196d21..68705d84fe3ba858a27f75e9ea0598536677b7d1 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/CMakeLists.txt
+++ b/Trigger/TriggerCommon/TriggerMenuMT/CMakeLists.txt
@@ -10,6 +10,10 @@ atlas_subdir( TriggerMenuMT )
 atlas_depends_on_subdirs( PRIVATE
                           Trigger/TriggerCommon/TriggerJobOpts)
 
+atlas_add_test( flake8
+   SCRIPT flake8 --select=F,E7,E9,W6 ${CMAKE_CURRENT_SOURCE_DIR}/python/HLTMenuConfig
+   POST_EXEC_SCRIPT nopost.sh )
+
 #----------------------------------
 # Function to build trigger menu:
 function( atlas_build_lvl1_trigger_menu menu )
@@ -140,3 +144,6 @@ atlas_add_test( generateMenuMT SCRIPT bash test_HLTmenu.sh
 #----------------------------------
 # List of menus to be created:
 atlas_build_lvl1_trigger_menu( LS2_v1 )
+
+
+
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/ElectronDef.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/ElectronDef.py
index 396c86fbb55e7f487ea7bdf144c75172807439c3..199e7bb3163609eaeabae1b70917b9811612634d 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/ElectronDef.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/ElectronDef.py
@@ -6,9 +6,7 @@ log = logging.getLogger("TriggerMenuMT.HLTMenuConfig.Egamma.ElectronDef")
 
 
 from TriggerMenuMT.HLTMenuConfig.Menu.ChainConfigurationBase import ChainConfigurationBase
-from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import Chain, ChainStep, RecoFragmentsPool
-from TriggerMenuMT.HLTMenuConfig.Menu.TriggerConfigHLT import TriggerConfigHLT
-
+from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import ChainStep, RecoFragmentsPool
 
 from TrigUpgradeTest.CaloMenuDefs import fastCaloMenuSequence
 from TrigUpgradeTest.electronMenuDefs import electronMenuSequence, inDetSetup
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/generateElectronChainDefs.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/generateElectronChainDefs.py
index 6634c719aa25899b3665fdad2d9e828cf573ae4b..3f6a17edb10ff6e999cbcadb1fc9c0bf5e594101 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/generateElectronChainDefs.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Egamma/generateElectronChainDefs.py
@@ -1,6 +1,5 @@
 # Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 
-from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import Chain
 from TriggerMenuMT.HLTMenuConfig.Menu.ChainDictTools import splitChainDict
 from TriggerMenuMT.HLTMenuConfig.Egamma.ElectronDef import ElectronChainConfiguration as ElectronChainConfiguration
 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/generateElectron.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/generateElectron.py
index f19133836caffc4d78002afa535ead52dcd56f71..5ec1220829649d22ba8aaed32d8541083628ff59 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/generateElectron.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/generateElectron.py
@@ -1,11 +1,10 @@
 # Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
 
-from TrigUpgradeTest.ElectronMenuConfig import l2CaloRecoCfg, l2CaloHypoCfg, l2CaloAlgCfg
+from TrigUpgradeTest.ElectronMenuConfig import l2CaloRecoCfg, l2CaloHypoCfg
 from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import MenuSequence, \
     ChainStep, Chain, RecoFragmentsPool, getChainStepName
 
 from TrigEgammaHypo.TrigL2CaloHypoTool import TrigL2CaloHypoToolFromDict
-from TrigEgammaHypo.TrigEgammaHypoConf import TrigL2CaloHypoAlgMT
 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
 
 # TODO remove once full tracking is in place
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/CPS.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/CPS.py
index 0b14852a8a3661f363e41918ee03820de95eab97..350d8f3d63d7a9f57b23cffab144908168ed20eb 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/CPS.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/CPS.py
@@ -4,8 +4,6 @@
 
 __doc__="Addition of coherent prescales to the list of chains"
 
-from TriggerJobOpts.TriggerFlags import TriggerFlags
-
 from AthenaCommon.Logging import logging
 log = logging.getLogger(__name__)
 
@@ -35,7 +33,7 @@ def genericCPSAdder(groups, signatures, chains, level, signatureOverwritten):
                     for g in c.groups:
                         if g.find('CPS') == 5:
                             cpsFound = g
-                    if cpsFound == None:
+                    if cpsFound is None:
                         log.info('CPS group %s added to %s', cpsGroup, chain_name)
                         c.addGroup(cpsGroup)
                     elif cpsFound == cpsGroup:
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/ChainConfigurationBase.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/ChainConfigurationBase.py
index 6b70ec409f90502dff480b94cac1d9016218ff2e..8bf1cb115b7a3adde60322b32d2a09e4f0cd7225 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/ChainConfigurationBase.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/ChainConfigurationBase.py
@@ -1,7 +1,7 @@
 # Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 
 
-from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import Chain, ChainStep, RecoFragmentsPool
+from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import Chain, RecoFragmentsPool
 
 #----------------------------------------------------------------
 # Base class to configure chain
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/ChainDictTools.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/ChainDictTools.py
index f3abbd87114cef5567586356f03bccb2a14ddf59..326ab7510317d14859bbce354e57df8f9d6d1e3f 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/ChainDictTools.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/ChainDictTools.py
@@ -1,6 +1,5 @@
 # Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
 
-from collections import Counter
 from copy import deepcopy
 from AthenaCommon.Logging import logging
 log = logging.getLogger( 'TriggerMenu.menu.ChainDictTools' )
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/DictFromChainName.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/DictFromChainName.py
index 2a2e85080ddebcc0ecdab73ac9b0234368db21ba..3fd843917fec5b07d0205363b91f1ff8d6a41e0a 100755
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/DictFromChainName.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/DictFromChainName.py
@@ -12,8 +12,6 @@ __version__=""
 __doc__="Decoding of chain name into a dictionary"
 
 
-import re
-
 from AthenaCommon.Logging import logging
 logging.getLogger().info("Importing %s",__name__)
 logDict = logging.getLogger('TriggerMenu.menu.DictFromChainName')
@@ -68,13 +66,16 @@ class DictFromChainName(object):
             for i in xrange(6, len(chainInfo)):
                 mergingInfoFilled = False
                 tsfInfoFilled = False
-                if (type(chainInfo[i]) is list):
-                    if mergingInfoFilled == False:
+                typeOfChainInfo = type(chainInfo[i])
+
+                if typeOfChainInfo is list:
+                    if mergingInfoFilled is False:
                         m_mergingStrategy = chainInfo[i][0]
                         if not (m_mergingStrategy == "parallel" or m_mergingStrategy == "serial"):
                             logDict.error("Merging strategy %s is not known.", m_mergingStrategy)
                         m_mergingOffset = chainInfo[i][1]
                         m_mergingOrder = chainInfo[i][2]
+
                         if(len(chainInfo[i]) >3):
                             m_preserveL2EFOrder = chainInfo[i][3]
                         else:
@@ -86,14 +87,17 @@ class DictFromChainName(object):
                         chainProp['mergingPreserveL2EFOrder'] = m_preserveL2EFOrder
 
                         mergingInfoFilled = True
-                    else: logDict.error("Something went wrong here....topoStartFrom has already been filled!")                  
+                    else: 
+                        logDict.error("Something went wrong here....topoStartFrom has already been filled!")                  
 
-                elif (type(chainInfo[i]) is bool):
-                    if tsfInfoFilled == False: 
+                elif typeOfChainInfo is bool:
+                    if tsfInfoFilled is False: 
                         chainProp['topoStartFrom'] = chainInfo[i]
                         tsfInfoFilled = True
-                    else: logDict.error("Something went wrong here....topoStartFrom has already been filled!")                  
-                else: logDict.error('Input format not recognised for chainInfo[%s]', chainInfo[i])
+                    else: 
+                        logDict.error("Something went wrong here....topoStartFrom has already been filled!")                  
+                else: 
+                    logDict.error('Input format not recognised for chainInfo[%s]', chainInfo[i])
                 
         # setting the L1 item
         if (chainProp['L1item']== ''): 
@@ -145,9 +149,6 @@ class DictFromChainName(object):
 
         from SignatureDicts import getBasePattern
         pattern = getBasePattern()
-        mdicts=[]
-        multichainindex=[]
-        signatureNames = []
 
         allMultis = []
         for cpart in cNameParts:
@@ -165,9 +166,6 @@ class DictFromChainName(object):
 
         from SignatureDicts import getBasePattern
         pattern = getBasePattern()
-        mdicts=[]
-        multichainindex=[]
-        signatureNames = []
         trigType = []
         thresholdToPass = 0
 
@@ -192,7 +190,6 @@ class DictFromChainName(object):
         are defined in SliceDicts
         The naming ocnvention is defined inthis document http://
         """
-        chainName_orig = chainName
 
         # ---- dictionary with all chain properties ----
         from SignatureDicts import ChainDictTemplate
@@ -209,7 +206,10 @@ class DictFromChainName(object):
            
         # ---- identify the topo algorithm and add to genchainDict -----
         from SignatureDicts import AllowedTopos
-        topo = '';topos=[];toposIndexed={}; topoindex = -5
+        topo = ''
+        topos=[]
+        toposIndexed={} 
+        topoindex = -5
         for cindex, cpart in enumerate(cparts):
             if  cpart in AllowedTopos:
                 logDict.debug('" %s" is in this part of the name %s -> topo alg', AllowedTopos, cpart)
@@ -241,24 +241,17 @@ class DictFromChainName(object):
 
         # ---- obtain dictionary parts for signature defining patterns ----
         from SignatureDicts import getSignatureNameFromToken, AllowedCosmicChainIdentifiers, \
-            AllowedCalibChainIdentifiers, AllowedStreamingChainIdentifiers, \
-            AllowedMonitorChainIdentifiers, AllowedBeamspotChainIdentifiers, AllowedEBChainIdentifiers
-            #, AllowedMatchingKeywords
+            AllowedCalibChainIdentifiers, AllowedMonitorChainIdentifiers, AllowedBeamspotChainIdentifiers
 
         logDict.debug("cparts: %s", cparts)
         for cpart in cparts:
 
             logDict.debug("Looping over cpart: %s", cpart)
             m = pattern.match(cpart)
-            #if 'mu4antidr05' in str(cpart): continue
             if m: 
                 logDict.debug("Pattern found in this string: %s", cpart)
                 m_groupdict = m.groupdict()
                 # Check whether the extra contains a special keyword
-                skip=False
-#                for keyword in AllowedMatchingKeywords :
-#                    if keyword in m_groupdict['extra']: skip=True
-#                if skip: continue
                 
                 multiChainIndices = [i for i in range(len(chainName)) if ( chainName.startswith(cpart, i) ) ]
                 logDict.debug("MultiChainIndices: %s", multiChainIndices)
@@ -266,13 +259,10 @@ class DictFromChainName(object):
                     # this check is necessary for the bjet chains, example: j45_bloose_3j45
                     # j45 would be found in [0, 13], and 3j45 in [12]
                     # so need to make sure the multiplicities are considered here!
-                    if (theMultiChainIndex != 0) & (chainName[theMultiChainIndex-1] != '_'): continue
-                    skip=False
-#                    for keyword in AllowedMatchingKeywords :
-#                        if chainName[theMultiChainIndex:len(chainName)].startswith(cpart+keyword): skip=True
-#                    if skip: continue
-                    
-                    if not theMultiChainIndex in multichainindex:
+                    if (theMultiChainIndex != 0) & (chainName[theMultiChainIndex-1] != '_'): 
+                        continue
+
+                    if theMultiChainIndex not in multichainindex:
                         multichainindex.append(theMultiChainIndex)
 
                 logDict.debug("ChainName: %s", chainName)
@@ -284,7 +274,8 @@ class DictFromChainName(object):
                 m_groupdict['signature'] = sName
                 logDict.debug('groupdictionary m_groupdict: %s', m_groupdict)
                 sigToken = getSignatureNameFromToken(cpart)
-                if sigToken not in signatureNames: signatureNames.append(sigToken)
+                if sigToken not in signatureNames: 
+                    signatureNames.append(sigToken)
                 mdicts.append(m_groupdict)
 
                     
@@ -292,7 +283,8 @@ class DictFromChainName(object):
                 multichainindex.append(chainName.index(cpart)) 
                 m_groupdict = {'signature': 'Streaming', 'threshold': '', 'multiplicity': '', 
                                 'trigType': 'streamer', 'extra': ''}
-                if 'Streaming' not in signatureNames: signatureNames.append('Streaming')
+                if 'Streaming' not in signatureNames: 
+                    signatureNames.append('Streaming')
                 mdicts.append(m_groupdict)
                 break # stop loop here so mb doesn't get picked up from min bias slice as it's streaming info
 
@@ -301,7 +293,8 @@ class DictFromChainName(object):
                 multichainindex.append(chainName.index(cpart)) 
                 m_groupdict = {'signature': 'MinBias', 'threshold': '', 'multiplicity': '', 
                                'trigType': 'mb', 'extra': ''}
-                if 'MinBias' not in signatureNames:  signatureNames.append('MinBias')
+                if 'MinBias' not in signatureNames:  
+                    signatureNames.append('MinBias')
                 mdicts.append(m_groupdict)
 
             elif cpart=='hi':
@@ -309,7 +302,8 @@ class DictFromChainName(object):
                 multichainindex.append(chainName.index(cpart))
                 m_groupdict = {'signature': 'HeavyIon', 'threshold': '', 'multiplicity': '',
                                'trigType': 'mb', 'extra': ''}
-                if 'HeavyIon' not in signatureNames:  signatureNames.append('HeavyIon')
+                if 'HeavyIon' not in signatureNames:  
+                    signatureNames.append('HeavyIon')
                 mdicts.append(m_groupdict)
 
             elif cpart in AllowedCosmicChainIdentifiers:
@@ -317,7 +311,8 @@ class DictFromChainName(object):
                 multichainindex.append(chainName.index(cpart)) 
                 m_groupdict = {'signature': 'Cosmic', 'threshold': '', 'multiplicity': '', 
                                 'trigType': 'cosmic', 'extra': ''}
-                if 'Cosmic' not in signatureNames: signatureNames.append('Cosmic')
+                if 'Cosmic' not in signatureNames: 
+                    signatureNames.append('Cosmic')
                 logDict.debug('%s',signatureNames)
                 mdicts.append(m_groupdict)
                 
@@ -326,7 +321,8 @@ class DictFromChainName(object):
                 multichainindex.append(chainName.index(cpart)) 
                 m_groupdict = {'signature': 'Calibration', 'threshold': '', 'multiplicity': '', 
                                'trigType': 'calib', 'extra': ''}
-                if 'Calibration' not in signatureNames:  signatureNames.append('Calibration')
+                if 'Calibration' not in signatureNames:  
+                    signatureNames.append('Calibration')
                 logDict.debug('%s',signatureNames)
                 mdicts.append(m_groupdict)
 
@@ -335,7 +331,8 @@ class DictFromChainName(object):
                 multichainindex.append(chainName.index(cpart)) 
                 m_groupdict = {'signature': 'Monitoring', 'threshold': '', 'multiplicity': '', 
                                 'trigType': 'calib', 'extra': ''}
-                if 'Monitoring' not in signatureNames:  signatureNames.append('Monitoring')
+                if 'Monitoring' not in signatureNames:  
+                    signatureNames.append('Monitoring')
                 logDict.debug('%s',signatureNames)
                 mdicts.append(m_groupdict)
 
@@ -344,7 +341,8 @@ class DictFromChainName(object):
                 multichainindex.append(chainName.index(cpart)) 
                 m_groupdict = {'signature': 'Beamspot', 'threshold': '', 'multiplicity': '', 
                                 'trigType': 'beamspot', 'extra': ''}
-                if 'Beamspot' not in signatureNames:  signatureNames.append('Beamspot')
+                if 'Beamspot' not in signatureNames:  
+                    signatureNames.append('Beamspot')
                 logDict.debug('%s',signatureNames)
                 mdicts.append(m_groupdict)
 
@@ -353,7 +351,8 @@ class DictFromChainName(object):
                 multichainindex.append(chainName.index(cpart)) 
                 m_groupdict = {'signature': 'EnhancedBias', 'threshold': '', 'multiplicity': '', 
                                'trigType': 'eb', 'extra': ''}
-                if 'EnhancedBias' not in signatureNames:  signatureNames.append('EnhancedBias')
+                if 'EnhancedBias' not in signatureNames:  
+                    signatureNames.append('EnhancedBias')
                 mdicts.append(m_groupdict)
 
            
@@ -361,8 +360,6 @@ class DictFromChainName(object):
         # ---- part depending on the signature it belongs to ----
         # ----  ----
         multichainparts=[]
-
-        remainder = chainName
         multichainindex = sorted(multichainindex, key=int)
         cN = chainName
         for i in reversed(multichainindex):
@@ -385,7 +382,7 @@ class DictFromChainName(object):
             logDict.debug('chainparts %s', chainparts)
 
             # ---- check if L1 item is specified in chain Name ----
-            L1itemFromChainName = ''; L1item = ''; 
+            L1item = '' 
             chainpartsNoL1 = chainparts
             
             #Checking for L1 item for chain part and overall in the name
@@ -413,7 +410,7 @@ class DictFromChainName(object):
                     chainparts = chainparts[:allL1indices[1]]
                     
                 if (allL1items[0] not in L1items_chainParts):
-                    logDict.error("L1 chain part " +L1items_chainParts+" item does not seem to match the one in the chain name "+llL1items[0])
+                    logDict.error("L1 chain part " +L1items_chainParts+" item does not seem to match the one in the chain name "+allL1items[0])
 
 
 
@@ -501,7 +498,6 @@ class DictFromChainName(object):
 
             # ---- check remaining parts for complete machtes in allowedPropertiesAndValues Dict ----
             # ---- unmatched = list of tokens that are not found in the allowed values as a whole ----
-            unmatched = [] 
             parts = filter(None, parts)     #removing empty strings from list
 
             matchedparts = []
@@ -509,7 +505,7 @@ class DictFromChainName(object):
                 origpart = part
                 for prop, allowedValues in allowedSignaturePropertiesAndValues.items():
                     if part in allowedValues:
-                        if type(chainProperties[prop]) == list:
+                        if type(chainProperties[prop]) is list:
                             chainProperties[prop] += [part]
                         else:
                             chainProperties[prop] = part
@@ -520,7 +516,8 @@ class DictFromChainName(object):
             logDict.debug('leftoverparts %s', leftoverparts)
             for pindex, part in enumerate(leftoverparts):
                 for prop, allowedValues in allowedSignaturePropertiesAndValues.items():
-                    if prop in chainProperties.keys():  continue
+                    if prop in chainProperties.keys():  
+                        continue
                     for aV in allowedValues:
                         if (aV in part):
                             if (chainProperties['signature'] in ['Egamma', 'Muon'] )& (prop in ['trkInfo','hypoInfo']):
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py
index e22da47322889acd3b3acda2004afaa49bfb71c9..438400ff5142b1024d973bfec3c6cfeef28123f4 100755
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT.py
@@ -1,33 +1,21 @@
 # Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 
 from TriggerJobOpts.TriggerFlags              import TriggerFlags
-from TriggerJobOpts.MuonSliceFlags            import MuonSliceFlags
-from TriggerJobOpts.EgammaSliceFlags          import EgammaSliceFlags
-from TriggerJobOpts.JetSliceFlags             import JetSliceFlags
-from TriggerJobOpts.CombinedSliceFlags        import CombinedSliceFlags
-from TriggerJobOpts.TestSliceFlags            import TestSliceFlags
-
-
 
 # Configure the scheduler
 from AthenaCommon.AlgScheduler import AlgScheduler
 AlgScheduler.ShowControlFlow( True )
 AlgScheduler.ShowDataFlow( True )
 
-from AthenaCommon.CFElements import parOR, seqAND, stepSeq
-from AthenaCommon.AlgSequence import AlgSequence, AthSequencer
-from AthenaCommon.Constants import VERBOSE,INFO,DEBUG
+from AthenaCommon.Constants import DEBUG
 
 from TriggerMenuMT.HLTMenuConfig.Menu.TriggerConfigHLT  import TriggerConfigHLT
-from TriggerMenuMT.HLTMenuConfig.Menu.HLTCFConfig import *
-from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import *
+from TriggerMenuMT.HLTMenuConfig.Menu.HLTCFConfig import makeHLTTree
+#from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import *
 from TriggerMenuMT.HLTMenuConfig.Menu import DictFromChainName
 from TriggerMenuMT.HLTMenuConfig.Menu.ChainDictTools import splitInterSignatureChainDict
 from TriggerMenuMT.HLTMenuConfig.Menu.MenuPrescaleConfig import MenuPrescaleConfig
 
-from TriggerMenuMT.HLTMenuConfig.Menu.HLTCFConfig import makeHLTTree
-
-import os, traceback, operator, commands, time
 
 from AthenaCommon.Logging import logging
 log = logging.getLogger( 'TriggerMenuMT.HLTMenuConfig.Menu.GenerateMenuMT' )
@@ -62,6 +50,8 @@ class GenerateMenuMT:
         self.triggerConfigHLT = TriggerConfigHLT(TriggerFlags.outputHLTconfigFile())
         self.triggerConfigHLT.menuName = TriggerFlags.triggerMenuSetup()
         log.debug("Working with menu: %s", self.triggerConfigHLT.menuName)
+        log.debug("   and prescales : %s", HLTPrescales)
+        
 
         
     def generateChainConfig(self, chainDicts):
@@ -71,14 +61,14 @@ class GenerateMenuMT:
         if self.doEgammaChains:
             try:
                 import TriggerMenuMT.HLTMenuConfig.Egamma.generateElectronChainDefs                
-            except:
+            except ImportError:
                 log.exception('Problems when importing generateElectronChainDefs, disabling Egamma chains.')
                 self.doEgammaChains = False
 
         if self.doTestChains:
             try:
                 import TriggerMenuMT.HLTMenuConfig.Test.generateTestChainDefs  
-            except:
+            except ImportError:
                 log.exception('Problems when importing generateTestChainDefs, disabling Test chains.')
                 self.doTestChains = False
               
@@ -100,14 +90,14 @@ class GenerateMenuMT:
                 try:
                     log.debug("Try to get chain config")
                     chainConfigs = TriggerMenuMT.HLTMenuConfig.Egamma.generateElectronChainDefs.generateChainConfigs(chainDict)                    
-                except:
+                except RuntimeError:
                     log.exception( 'Problems creating ChainDef for chain\n %s ' % (chainDict['chainName']) ) 
                     continue
 
             elif chainDict["signature"] == "Test" and self.doTestChains:
                 try:
-                    chainDefs = TriggerMenuMT.HLTMenuConfig.Test.generateTestChainDefs.generateChainConfigs(chainDict)
-                except:
+                    chainConfigs = TriggerMenuMT.HLTMenuConfig.Test.generateTestChainDefs.generateChainConfigs(chainDict)
+                except RuntimeError:
                     log.exception('Problems creating ChainDef for chain %s ' % (chainDict['chainName']))
                     continue
 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT_newJO.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT_newJO.py
index bdd64dd97058a9b083d953ee1149bc17022018ba..ad79a5b31416599b0e154ba37e7e9829adc1070c 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT_newJO.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/GenerateMenuMT_newJO.py
@@ -1,12 +1,12 @@
 # Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
 from AthenaCommon.CFElements import seqAND
-from TriggerMenuMT.HLTMenuConfig.Menu.HLTCFConfig import decisionTree_From_Chains, \
-    generateDecisionTreeOld
+
+from TriggerMenuMT.HLTMenuConfig.Menu.HLTCFConfig import generateDecisionTreeOld
 from TriggerMenuMT.HLTMenuConfig.Menu.HLTCFConfig_newJO import generateDecisionTree
 
 from AthenaCommon.Logging import logging
-from AthenaCommon.Constants import VERBOSE,INFO,DEBUG
+from AthenaCommon.Constants import VERBOSE
 _log = logging.getLogger('GenerateMenuMT_newJO')
 _log.setLevel( VERBOSE )
 
@@ -41,10 +41,13 @@ def generateMenu( flags ):
     menuChains = []
     allChainDicts =[]
 
-    chainAccumulators = []
+    menuAcc = ComponentAccumulator()
+    mainSequenceName = 'HLTAllSteps'
+    menuAcc.addSequence( seqAND(mainSequenceName) )
+
 
     for name, cfgFlag in list(flags._flagdict.iteritems()):
-        if not 'Trigger.menu.' in name:
+        if 'Trigger.menu.' not in name:
             continue
         value = flags._get(name)
         if len(value) == 0:
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py
index 32d650c939522aa800dba327c15c557466312cbb..2e39b170ce5674eae0574ccded8ccc47d2b3b491 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig.py
@@ -8,8 +8,7 @@ from TriggerMenuMT.HLTMenuConfig.Menu.HLTCFDot import  stepCF_DataFlow_to_dot, s
 from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponentsNaming import CFNaming
 
 import sys
-import copy
-from AthenaCommon.Constants import VERBOSE,INFO,DEBUG
+from AthenaCommon.Constants import VERBOSE
 log = logging.getLogger('HLTCFConfig')
 log.setLevel( VERBOSE )
 
@@ -32,7 +31,8 @@ def createStepRecoNode(name, seq_list, dump=False):
     for seq in seq_list:        
         stepCF += createCFTree(seq)
     
-    if dump: dumpSequence (stepCF, indent=0)        
+    if dump: 
+        dumpSequence (stepCF, indent=0)        
     return stepCF
 
 
@@ -46,7 +46,8 @@ def createStepFilterNode(name, seq_list, dump=False):
         log.info("Add  %s to filter node %s", filterAlg.name(), name)
         stepCF += filterAlg
     
-    if dump: dumpSequence (stepCF, indent=0)        
+    if dump: 
+        dumpSequence (stepCF, indent=0)        
     return stepCF
 
 
@@ -138,12 +139,11 @@ def makeHLTTree(HLTChains, triggerConfigHLT = None):
     hltTop +=  steps
     
     # make CF tree
-
     finalDecisions = decisionTree_From_Chains(steps, allChainConfigs, allChainDicts)
-    EnabledChainNames = [c.name for c in allChainConfigs]
-    
+        
     flatDecisions=[]
-    for step in finalDecisions: flatDecisions.extend (step)
+    for step in finalDecisions: 
+        flatDecisions.extend (step)
     summary= makeSummary("TriggerSummaryFinal", flatDecisions)
     hltTop += summary
 
@@ -184,7 +184,6 @@ def matrixDisplay( allSeq ):
                 return sname.ljust( longestName ) + __nextSteps( index + 1, nextStepName )
         return ""
             
-    from pprint import pprint
     log.debug("" )
     log.debug("chains^ vs steps ->")
     log.debug( "="*90 )    
@@ -204,7 +203,7 @@ def decisionTree_From_Chains(HLTNode, chains, allDicts):
 
     log.debug("Run decisionTree_From_Chains on %s", HLTNode.name())
 
-    from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import CFSequence, RoRSequenceFilterNode, ComboMaker
+    from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import CFSequence
     HLTNodeName= HLTNode.name()
 
     # find nsteps
@@ -463,8 +462,10 @@ def buildFilter(filter_name,  filter_input):
     """
     from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import  RoRSequenceFilterNode       
     sfilter = RoRSequenceFilterNode(name=filter_name)
-    for i in filter_input: sfilter.addInput(i)
-    for i in filter_input: sfilter.addOutput(CFNaming.filterOutName(filter_name, i))
+    for i in filter_input: 
+        sfilter.addInput(i)
+    for i in filter_input: 
+        sfilter.addOutput(CFNaming.filterOutName(filter_name, i))
 
     log.debug("Added inputs to filter: %s", sfilter.getInputList())
     log.debug("Added outputs to filter: %s", sfilter.getOutputList())
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig_newJO.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig_newJO.py
index 707c700706c080c4aad8d9514fd625358d7ca8bc..a074748583d68226d94c0a1504fe7484caa11342 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig_newJO.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFConfig_newJO.py
@@ -1,12 +1,8 @@
 # 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.MenuComponents import CFSequence
 from TriggerMenuMT.HLTMenuConfig.Menu.HLTCFConfig import buildFilter, makeSummary
-from AthenaCommon.CFElements import parOR, seqAND, seqOR, findOwningSequence
+from AthenaCommon.CFElements import parOR, seqAND
 from AthenaCommon.Logging import logging
 from AthenaCommon.Constants import VERBOSE
 
@@ -34,8 +30,6 @@ def connectStepToFilter(chainStep, filterNode):
 def generateDecisionTree(chains, allChainDicts):
     from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
     from collections import defaultdict
-    from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import CFSequence
-    from AthenaCommon.CFElements import findOwningSequence
 
     acc = ComponentAccumulator()
     mainSequenceName = 'HLTAllSteps'
@@ -51,8 +45,6 @@ def generateDecisionTree(chains, allChainDicts):
             chainName = chainStep.name.split('_')[0]
             chainStepsMatrix[stepNumber][chainName].append(chain)
 
-    allSequences = []
-
     ## Matrix with steps lists generated. Creating filters for each cell
     for nstep in chainStepsMatrix:
         stepDecisions = []
@@ -114,4 +106,4 @@ def generateDecisionTree(chains, allChainDicts):
         summary = makeSummary('TriggerSummary{}'.format(stepName), stepDecisions)
         acc.addSequence(summary, parentName = mainSequenceName)
 
-    return acc
\ No newline at end of file
+    return acc
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFDot.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFDot.py
index 1393617f6af55497f6a517dc07565e3df0869f39..5768accf1bd251657db63a6b8a98c751cb69fde1 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFDot.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/HLTCFDot.py
@@ -1,16 +1,18 @@
 ###### Here some graphical methods to produce dot files from Decision Handling
  # to visualize: dot -T pdf Step1.dot > Step1.pdf
  
-from ViewAlgsTest.connectAlgorithmsIO import connectAlgorithmsIO, graph_generator
 from AthenaCommon.AlgSequence import AthSequencer
 from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import isHypoBase, isInputMakerBase, isFilterAlg
 import itertools
 
 def algColor(alg):
     """ Set given color to Alg type"""
-    if isHypoBase(alg):       return "darkorchid1"
-    if isInputMakerBase(alg): return "cyan3"
-    if isFilterAlg(alg):      return "chartreuse3"
+    if isHypoBase(alg):      
+        return "darkorchid1"
+    if isInputMakerBase(alg): 
+        return "cyan3"
+    if isFilterAlg(alg):      
+        return "chartreuse3"
     return "cadetblue1"
 
 def stepCF_ControlFlow_to_dot(stepCF):
@@ -40,8 +42,11 @@ def stepCF_ControlFlow_to_dot(stepCF):
         return False
 
     def _seqColor(seq):
-        if _parOR(seq): return "red"
-        if _seqAND(seq): return "blue"
+        if _parOR(seq): 
+            return "red"
+        if _seqAND(seq): 
+            return "blue"
+
         return "black"
 
    
@@ -105,7 +110,7 @@ def all_DataFlow_to_dot(name, step_list):
                 for menuseq in cfseq.step.sequences:
                     cfseq_algs.append(menuseq.maker)
                     cfseq_algs.append(menuseq.sequence )
-                    if menuseq.reuse==False:
+                    if menuseq.reuse is False:
                         file.write("    %s[fillcolor=%s]\n"%(menuseq.maker.Alg.name(), algColor(menuseq.maker.Alg)))
                         file.write("    %s[fillcolor=%s]\n"%(menuseq.sequence.Alg.name(), algColor(menuseq.sequence.Alg)))
                         menuseq.reuse=True
@@ -166,7 +171,7 @@ def stepCF_DataFlow_to_dot(name, cfseq_list):
             for menuseq in cfseq.step.sequences:
                 cfseq_algs.append(menuseq.maker)
                 cfseq_algs.append(menuseq.sequence )
-                if menuseq.reuse==False:
+                if menuseq.reuse is False:
                     file.write("    %s[fillcolor=%s]\n"%(menuseq.maker.Alg.name(), algColor(menuseq.maker.Alg)))
                     file.write("    %s[fillcolor=%s]\n"%(menuseq.sequence.Alg.name(), algColor(menuseq.sequence.Alg)))
                     menuseq.reuse=True
@@ -236,12 +241,12 @@ def getValuesProperties(node):
     
     for alg in algs:        
         for k, cval in alg.getValuedProperties().items():
-            if type(cval) == type(list()):  
+            if type(cval) is list:  
                 for val in cval:
-                    if type(val) == type(''):
+                    if val is '': # CAT type(val) is None ??
                         if val not in Excluded:
                             values.append(val)            
-            elif type(cval) == type(''):
+            elif cval is '': # CAT type(val) is None ??
                 if cval not in Excluded:
                     values.append(cval)
             else:
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
index 92e5492d02c9c8f4d2424409fa49f29bd9f0f527..d8333ba5259020536f665a6caef20017ee07e1ba 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py
@@ -8,7 +8,7 @@ def setupMenu():
     from AthenaCommon.Logging                 import logging
     log = logging.getLogger( 'TriggerMenuMT.HLTMenuConfig.Menu.LS2_v1.py' )
 
-    from TriggerMenuMT.LVL1MenuConfig.TriggerConfigLVL1 import TriggerConfigLVL1 as tcl1
+    #from TriggerMenuMT.LVL1MenuConfig.TriggerConfigLVL1 import TriggerConfigLVL1 as tcl1
     #if tcl1.current:
     #    log.info("L1 items: %s " % tcl1.current.menu.items.itemNames())
     #else:
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 9aebb97a11d6fbb78fb575dd02d54199fd5f6920..1a16de80f5d8a7354fdd7320246d30c0fb2e7d52 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1_newJO.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1_newJO.py
@@ -10,9 +10,6 @@ def setupMenu(flags):
     Assign chains for LS2_v1 to menu flags
     """
 
-    from AthenaCommon.Logging import logging
-    log = logging.getLogger( 'TriggerMenuMT.HLTMenuConfig.Menu.LS2_v1_newJO.py' )
-
     #---------------------------------------------------------------------
     # INPUT FORMAT FOR CHAINS:
     # ['chainName', [L1 items for chainParts], [stream], [groups], EBstep],
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuComponents.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuComponents.py
index aa253f8944d0809f507e425821174e2a8364c492..9230ddb23139ac3ee311a476a3630dd569d0e544 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuComponents.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuComponents.py
@@ -2,7 +2,7 @@
 
 import sys, re, copy
 from AthenaCommon.Logging import logging
-from AthenaCommon.Constants import VERBOSE,INFO,DEBUG
+from AthenaCommon.Constants import VERBOSE,DEBUG
 log = logging.getLogger('MenuComponents')
 log.setLevel( VERBOSE )
 logLevel=DEBUG
@@ -49,21 +49,19 @@ class AlgNode(Node):
 
     def setPar(self, prop, name):
         cval = self.Alg.getProperties()[prop]
-        try:
-            if type(cval) == type(list()):
-                cval.append(name)
-                return setattr(self.Alg, prop, cval)
-            else:
-                return setattr(self.Alg, prop, name)
-        except:
-            pass
+        if type(cval) is list:
+            cval.append(name)
+            return setattr(self.Alg, prop, cval)
+        else: 
+            return setattr(self.Alg, prop, name)
+
 
     def getPar(self, prop):
-        try:
+        if hasattr(self.Alg, prop):
             return getattr(self.Alg, prop)
-        except:
+        else:
             return self.Alg.getDefaultProperty(prop)
-        raise "Error in reading property " + prop + " from " + self.Alg
+
 
     def addOutput(self, name):
         outputs = self.readOutputList()
@@ -82,7 +80,7 @@ class AlgNode(Node):
         cval = self.getPar(self.outputProp)
         if cval == '':
             return outputs
-        if type(cval) == type(list()):
+        if type(cval) is list:
             outputs.extend(cval)
         else:
             outputs.append(cval)
@@ -105,7 +103,7 @@ class AlgNode(Node):
         cval = self.getPar(self.inputProp)
         if cval =='':
             return inputs
-        if type(cval) == type(list()):
+        if type(cval) is list:
             inputs.extend(cval)
         else:
             inputs.append(cval)
@@ -123,7 +121,7 @@ class HypoToolConf():
         self.conf=''
 
     def setConf( self, chainDict):
-        if type(chainDict) != type({}):
+        if type(chainDict) is not dict:
             raise RuntimeError("Configuring hypo with %s, not good anymore, use chainDict" % str(chainDict) )
         self.chainDict = chainDict
 
@@ -224,7 +222,7 @@ class ComboMaker(AlgNode):
             print "MEOW multiplicity ", allMultis[i]
             cval = self.Alg.getProperties()[self.prop]  # check necessary to see if chain was added already?
             print "MEOW cval ", cval
-            if type(cval) == type(dict()):
+            if type(cval) is dict:
                 ##cval[chain] = allMultis
                 if chain in cval.keys():
                     cval[chain].append(allMultis[i])
@@ -262,7 +260,6 @@ def isFilterAlg(alg):
 class MenuSequence():
     """ Class to group reco sequences with the Hypo"""
     def __init__(self, Sequence, Maker,  Hypo, HypoToolGen, CA=None ):
-        from AthenaCommon.AlgSequence import AthSequencer
         self.name = CFNaming.menuSequenceName(Hypo.name())
         self.sequence     = Node( Alg=Sequence)
         self.maker        = InputMakerNode( Alg = Maker )
@@ -345,10 +342,13 @@ class Chain:
         for seed in vseeds:
             split=re.findall(r"(\d+)?([A-Z]+\d+)", seed)
             mult,single = split[0]
-            if not mult: mult=1
-            else: mult=int(mult)
+            if not mult: 
+                mult=1
+            else: 
+                mult=int(mult)
 #            print mult,single
-            for m in range(0,mult): self.vseeds.append(single)
+            for m in range(0,mult): 
+                self.vseeds.append(single)
 
         # group_seed is used to se tthe seed type (EM, MU,JET), removing the actual threshold
         # in practice it is the L1Decoder Decision output
@@ -380,7 +380,7 @@ class Chain:
 
     def decodeHypoToolConfs(self, allChainDicts):
         """ This is extrapolating the hypotool configuration from the (combined) chain name"""
-        #from TriggerMenuMT.HLTMenuConfig.Menu.TriggerConfigHLT import getConfFromChainName
+        import copy
         from TriggerMenuMT.HLTMenuConfig.Menu.TriggerConfigHLT import getChainDictFromChainName
         chainDict = getChainDictFromChainName(self.name, allChainDicts)
 
@@ -391,9 +391,8 @@ class Chain:
                 sys.exit("ERROR, in chain configuration")
 
             for seq, chainDictPart in zip(step.sequences, chainDict['chainParts']):
-                if seq.ca != None: # The CA merging took care of everything
+                if seq.ca is not None: # The CA merging took care of everything
                     continue
-                import copy
                 onePartChainDict = copy.deepcopy( chainDict )
                 onePartChainDict['chainParts'] = [ chainDictPart ]
 
@@ -437,7 +436,8 @@ class CFSequence():
             nseq+=1
 
 
-        if self.step.isCombo: self.connectCombo()
+        if self.step.isCombo: 
+            self.connectCombo()
 
     def connectCombo(self):
         # reset sequence output, they will b ereplaced by new combo outputs
@@ -569,7 +569,6 @@ class RecoFragmentsPool:
         The flags are not part of unique identifier as creation of new reco fragments should not be caused by difference in the unrelated flags.
         TODO, if that code survives migration to New JO we need to handle the case when the creator is an inner function
         """
-        from AthenaCommon.Logging import logging
         requestHash = hash( ( creator, tuple(kwargs.keys()), tuple(kwargs.values()) ) )
         if requestHash not in cls.fragments:
             recoFragment = creator( flags, **kwargs )
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuPrescaleConfig.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuPrescaleConfig.py
index 8b8f1a28d9e53f5b35f92fa6cb5abd696a132962..93cb0aa70d6db8db9a384f4cc9d407265bbbb48e 100755
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuPrescaleConfig.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuPrescaleConfig.py
@@ -13,9 +13,12 @@ def MenuPrescaleConfig(triggerConfigHLT):
     
     menu_name = TriggerFlags.triggerMenuSetup()
     ## Do some aliasing here
-    if menu_name == 'Physics_default': menu_name = 'LS2_v1'
-    elif menu_name == 'MC_loose_default': menu_name = 'LS2_v1'
-    elif menu_name == 'MC_tight_default': menu_name = 'LS2_v1'
+    if menu_name == 'Physics_default': 
+        menu_name = 'LS2_v1'
+    elif menu_name == 'MC_loose_default': 
+        menu_name = 'LS2_v1'
+    elif menu_name == 'MC_tight_default': 
+        menu_name = 'LS2_v1'
 
     log.info( 'Menu name: '+ menu_name)
 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuUtil.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuUtil.py
index c469180047dd54f3d68f59fcde8174ecf8f30373..7e0df8b7747d1e7ecabf4490f0318666c09ada23 100755
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuUtil.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/MenuUtil.py
@@ -18,7 +18,8 @@ def getStreamTagForRerunChains(triggerPythonConfig, HLTPrescale):
         n = len(prescales)
         hltchain = None
         for ch in triggerPythonConfig.allChains[item]:
-            if ch.level == 'HLT': hltchain = ch
+            if ch.level == 'HLT': 
+                hltchain = ch
             if n > 3  and hltchain:
                 if hltchain.prescale != "0":
                     log.warning("chain "+ hltchain.chain_name + " in rerun mode with special strema tag does not have the correct HLT PS [=0] ")
@@ -45,7 +46,8 @@ def applyHLTPrescale(triggerPythonConfig, HLTPrescale):
         n = len(prescales)
         hltchain = None
         for ch in triggerPythonConfig.allChains[item]:
-            if ch.level == 'HLT': hltchain = ch
+            if ch.level == 'HLT': 
+                hltchain = ch
         if n > 0  and hltchain:
             hltchain.prescale = str(prescales[0])
         if n > 1  and hltchain:
@@ -104,12 +106,8 @@ def checkTriggerGroupAssignment(triggerPythonConfig):
             for group in GroupItems:
                 if group in chain.groups:
                     GroupAssigned=True
-            if not GroupAssigned and CheckGroups:
+            if GroupAssigned is False and CheckGroups is True:
                 log.warning( "IN CHAIN: GROUP (primary, supporting, ... etc) undefined for chain: " + str(chain.chain_name) + ".")
-                #log.warning( "IN CHAIN: GROUP undefined for chain: " + str(chain.chain_name) + ". The chain will be excluded from the menu!")
-                #This part will become active soon
-                #if chain in triggerPythonConfig.theL2HLTChains : triggerPythonConfig.theL2HLTChains.remove(chain)
-                #if chain in triggerPythonConfig.theEFHLTChains: triggerPythonConfig.theEFHLTChains.remove(chain)
 
 #def checkStreamConsistency(triggerPythonConfig,streamConfig):
 def checkStreamConsistency(triggerPythonConfig):
@@ -118,52 +116,10 @@ def checkStreamConsistency(triggerPythonConfig):
     """
     menu_name = TriggerFlags.triggerMenuSetup()
     log.info( "Menu: " + menu_name)
-    CheckGroups=False
 
     from TriggerMenu.menu.StreamInfo       import getAllStreams
 
     allStreams = getAllStreams()
-#    allStreams=['UPC',
-#                'TRTMonitoring',
-#                'WarmStart',      
-#                'ZeroBias',       
-#                'CosmicCalo',     
-#                'ZeroBiasOverlay',
-#                'CosmicMuons',
-#                'CosmicCalo',
-#                'IDCosmic',
-#                'IDMonitoring',
-#                'IDTracks',
-#                'Muon_Calibration',
-#                'Standby',   
-#                'Background',
-#                'MinBias',
-#                'MinBiasOverlay',
-#                'ALFA',
-#                'Bphysics',
-#                'physics',
-#                'express',
-#                'Tile',
-#                'L1Muon',
-#                'L1MinBias',
-#                'EnhancedBias',
-#                'LArCells',
-#                'LArCellsEmpty',
-#                'DISCARD',
-#                'EFCostMonitoring',
-#                'HLTPassthrough',
-#                'beamspot',
-#                'PixelBeam',
-#                'PixelNoise',
-#                'VdM',
-#                'L2CostMonitoring',
-#                'SCTNoise',
-#                'ALFACalib',
-#                'L1Calo',     
-#                'L1CaloCalib',     
-#                ]
-
-    #allStreams.extend(streamConfig)
 
     ##Check that all the streams associated to the chains exists
     ##Chech that there is no duplication of ROB_ID for the ds streams used in a specific menu
@@ -225,7 +181,8 @@ def allSignatures():
         TriggerFlags.CombinedSlice,
         )
     for a in slices:
-        if a.signatures.statusOn: sigs += a.signatures()
+        if a.signatures.statusOn: 
+            sigs += a.signatures()
     return sigs
 
 
@@ -234,11 +191,11 @@ def findL1TT(chain, triggerPythonConfig):
     if chain.level == 'EF':
         l2_chain_name = chain.lower_chain_name
         l2_chain = triggerPythonConfig.getHLTChain(l2_chain_name)
-    if l2_chain == None:
+    if l2_chain is None:
         return -2
     l1_item_name = l2_chain.lower_chain_name
     l1_item = triggerPythonConfig.getLvl1Item(l1_item_name)
-    if l1_item==None:
+    if l1_item is None:
         return -1
     return l1_item.trigger_type
 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
index 1637d01b074e227ec7f257757f585c39b9223b8e..1901479088dad8e19e8f0fcfc53cc999f6e932dd 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py
@@ -848,10 +848,9 @@ def getSignatureInformation(signature):
 #==========================================================            
 def getBasePattern():
     import re
-    import itertools
     allTrigTypes = SliceIDDict.values()
     possibleTT = '|'.join(allTrigTypes)
-    pattern = re.compile("(?P<multiplicity>\d*)(?P<trigType>(%s))(?P<threshold>\d+)(?P<extra>\w*)" % (possibleTT))
+    pattern = re.compile("(?P<multiplicity>\d*)(?P<trigType>(%s))(?P<threshold>\d+)(?P<extra>\w*)" % (possibleTT)) # noqa: W605
     return pattern
 
 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/TriggerConfigHLT.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/TriggerConfigHLT.py
index cbf15205d8b00dded9df69a0708b54a915057da7..5a448e44818d2e9fd4a47face62a7b48099892fc 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/TriggerConfigHLT.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/TriggerConfigHLT.py
@@ -39,7 +39,7 @@ class TriggerConfigHLT:
 
     def registerHLTChain(self, chainName, chainConfig):
         """ Adds chain to the set of self.allChains which are registered for further use """
-        if logical_name in self.allChains:
+        if chainName in self.allChains:
             self.allChains[chainName].append( chainConfig )
         else:
             self.allChains[chainName] = [ chainConfig ]
@@ -89,7 +89,7 @@ def getConfFromChainName(chainName, allChainDicts = None):
                     chainPartNames.append('HLT_'+cPName)
                     
     if len(chainPartNames) == 0:
-        log.error("MenuChains.getConfFromChainName: Wrong chain name given: found %s",name)
+        log.error("MenuChains.getConfFromChainName: Wrong chain name given: found %s", chainName)
         sys.exit("ERROR, in getConfFromChainName: Wrong chain configuration") 
         return [chainName]
     else:
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonDef.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonDef.py
index b89ae7a140e1c6296d3a3975a9b87228a2b170a1..6dac01b934bcde82418c2d15cb810913a31a371a 100755
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonDef.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonDef.py
@@ -5,49 +5,52 @@
 # SliceDef file for muon chains/signatures
 #
 #########################################################################
-from AthenaCommon import CfgGetter
 from AthenaCommon.Logging import logging
 logging.getLogger().info("Importing %s",__name__)
 
 log = logging.getLogger("TriggerMenuMT.HLTMenuConfig.Muon.MuonDef")
 
-from TriggerMenuMT.HLTMenuConfig.Menu.HltConfig import *
-
-
-############################### Class/function to configure muon chains ##############################
-class Chain_mu(L2EFChainDef):
-
-  def __init__(self, chainDict):
-    self.chainName       = chainDict['chainName']
-    self.chainL1Item     = chainDict['L1item']
-    self.chainPart       = chainDict['chainParts']
-    self.chainPartL1Item = self.chainPart['L1item']
-    self.mult            = int(self.chainPart['multiplicity'])
-    self.chainPartName   = self.chainPart['chainPartName']
-    self.chainPartNameNoMult = self.chainPartName[1:] if self.mult > 1 else self.chainPartName
-    self.L2InputTE = self.chainPartL1Item or self.chainL1Item
-    if self.L2InputTE:      # cut of L1_, _EMPTY,..., & multiplicity
-      self.L2InputTE = self.L2InputTE.replace("L1_","")
-      self.L2InputTE = self.L2InputTE.split("_")[0]
-      self.L2InputTE = self.L2InputTE[1:] if self.L2InputTE[0].isdigit() else self.L2InputTE
-    
-    # --- call corresponding functions to set up chains ---
-    if        not self.chainPart['extra'] \
-          and not self.chainPart['FSinfo'] \
-          and not self.chainPart['hypoInfo'] \
-          and not self.chainPart['reccalibInfo'] :
-      self.setup_muXX()      
-    else:
-      log.error('Chain %s could not be assembled' % (self.chainPartName))
-      return False
-
-
-
-############################### DEFINE GROUPS OF CHAIN CONFIGURATIONS HERE ##############################
-  def setup_muXX(self):
-
-    log.info('Function to setup muXX chains to be implemented')
-    
-#################################################################################################
+from TriggerMenuMT.HLTMenuConfig.Menu.ChainConfigurationBase import ChainConfigurationBase
+
+
+############################################# 
+###  Class/function to configure muon chains 
+#############################################
+
+class MuonChainConfiguration(ChainConfigurationBase):
+
+    def __init__(self, chainDict):
+        ChainConfigurationBase.__init__(self,chainDict)
+        
+    # ----------------------
+    # Assemble the chain depending on information from chainName
+    # ----------------------
+    def assembleChain(self):                            
+        myStepNames = []
+        chainSteps = []
+        log.debug("Assembling chain for " + self.chainName)
+        # --------------------
+        # define here the names of the steps and obtain the chainStep configuration 
+        # --------------------
+        if        not self.chainPart['extra'] \
+              and not self.chainPart['FSinfo'] :
+          
+          myStepNames += ["Step1_etcut"]
+          myStepNames += ["Step2_etcut"]            
+          for step in myStepNames:
+            log.debug("Assembling steps for chain %s", self.chainName)
+            #chainSteps += [self.getMuonSteps(step)]
+
+        else:
+            raise RuntimeError("Chain configuration unknown for chain: " + self.chainName )
+            
+        myChain = self.buildChain(chainSteps)
+        return myChain
+        
+
+
+
+
+
 
 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/generateMuonChainDefs.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/generateMuonChainDefs.py
index 7a0a4d7636159526704117d7d20805884ffcd63a..73cccc23dbf2a1cc6c833084e91c52d874adbc90 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/generateMuonChainDefs.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/generateMuonChainDefs.py
@@ -1,19 +1,16 @@
-# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
+# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 
 ###########################################################################
 # SliceDef file for Muon chains
 ###########################################################################
-__author__  = 'C. Bernius'
-__doc__="Definition of muon chains for AthenaMT" 
 
 from AthenaCommon.Logging import logging
+log = logging.getLogger( 'TriggerMenuMT.HLTMenuConfig.Muon.generateChainConfigs' )
 logging.getLogger().info("Importing %s",__name__)
 
-from TriggerMenuMT.HLTMenuConfig.Menu.ChainDictTools import *
+from TriggerMenuMT.HLTMenuConfig.Menu.ChainDictTools import splitChainDict
+from TriggerMenuMT.HLTMenuConfig.Muon.MuonDef import MuonChainConfiguration as MuonChainConfiguration
 
-from TrigUpgradeTest.TrigUpgradeTestConf import HLTTest__TestRecoAlg
-from TrigUpgradeTest.TrigUpgradeTestConf import HLTTest__TestHypoAlg
-from TrigUpgradeTest.TrigUpgradeTestConf import HLTTest__TestHypoTool
 
 
 def generateChainDefs(chainDict):
@@ -21,27 +18,24 @@ def generateChainDefs(chainDict):
     listOfChainDicts = splitChainDict(chainDict)
     listOfChainDefs=[]
 
-    #define the list of keywords from Signature dicts to base the grouping on
-    groupCategories = []
+    for subChainDict in listOfChainDicts:
+        
+        Muon = MuonChainConfiguration(subChainDict).assembleChain() 
 
-    for chainDict in listOfChainDicts:
-        chainName = chainDict['chainName']
-        chainL1Item = chainDict['L1item']
-        chainPart = chainDict['chainParts']
-        chainPartL1Item = self.chainPart['L1item']
-        chainthreshhold = chainPart['threshold']
+        listOfChainDefs += [Muon]
+        log.debug('length of chaindefs %s', len(listOfChainDefs) )
         
-        nsteps = 2
-        allChainSteps=[]
-        for step in nsteps:
-            stepname="Step"+str(step)+"_"+chainName
-            
-            cstep=ChainStep(stepname, [SequenceHypoTool(muStep(str(step), chainL1Item), stepHypoTool(step, chainthreshold))])
-            allChainSteps.append(cstep)
 
-        MuonChainDef = Chain(chainName,chainL1Item,ChainSteps=allChainSteps)
+    if len(listOfChainDefs)>1:
+        log.warning("Implement case for multi-electron chain!!") 
+        theChainDef = listOfChainDefs[0] #needs to be implemented properly
+    else:
+        theChainDef = listOfChainDefs[0]
+
+    log.debug("theChainDef.name: %s" , theChainDef.name)
+    log.debug("theChainDef.seed: %s" , theChainDef.seed)
+    log.debug("theChainDef.ChainSteps: %s" , theChainDef.steps)
 
-        listOfChainDefs += MuonChainDef
+    return theChainDef
 
 
-    return listOfChainDefs
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Photon/generatePhoton.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Photon/generatePhoton.py
index cabf075efbe00f6c3a6f3154c2fbf2f41401b78c..d3e60818b8323548c00dde3c2aa9f21e6bb4e0f0 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Photon/generatePhoton.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Photon/generatePhoton.py
@@ -7,8 +7,6 @@ from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import MenuSequence, \
 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
 
 from TrigEgammaHypo.TrigL2CaloHypoTool import TrigL2CaloHypoToolFromDict
-from TrigEgammaHypo.TrigEgammaHypoConf import TrigL2CaloHypoAlgMT
-from TrigEgammaHypo.TrigEgammaHypoConf import TrigL2PhotonHypoAlgMT
 from TrigEgammaHypo.TrigL2PhotonHypoTool import TrigL2PhotonHypoToolFromDict
 
 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Test/TestDef.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Test/TestDef.py
index 87a21994502ba18585b0322b1c45da093ac31405..8b02f8d6e2a36a96d09c0295dd4d69952c904f21 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Test/TestDef.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Test/TestDef.py
@@ -6,8 +6,6 @@ log = logging.getLogger("TriggerMenuMT.HLTMenuConfig.Test.TestDef")
 
 
 from TriggerMenuMT.HLTMenuConfig.Menu.ChainConfigurationBase import ChainConfigurationBase
-from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import Chain, ChainStep, RecoFragmentsPool
-from TriggerMenuMT.HLTMenuConfig.Menu.TriggerConfigHLT import TriggerConfigHLT
 
 
 #----------------------------------------------------------------
@@ -22,7 +20,6 @@ class TestChainConfiguration(ChainConfigurationBase):
     # Assemble the chain depending on information from chainName
     # ----------------------
     def assembleChain(self):                            
-        myStepNames = []
         chainSteps = []
         log.debug("Assembling chain for " + self.chainName)
         # --------------------
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Test/generateTestChainDefs.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Test/generateTestChainDefs.py
index 13291d6bc74e90868e7dc81e4b5824f7f1503e7e..27e84a98a55c85676f84827ad75cc099157f7638 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Test/generateTestChainDefs.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Test/generateTestChainDefs.py
@@ -1,6 +1,5 @@
 # Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 
-from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import Chain
 from TriggerMenuMT.HLTMenuConfig.Menu.ChainDictTools import splitChainDict
 from TriggerMenuMT.HLTMenuConfig.Test.TestDef import TestChainConfiguration as TestChainConfiguration